Model Pipeline - Feature extraction approach
This pipeline shows how we use a pre-trained model to extract important features from images. These features help a smaller model learn faster and better for a new task.
This pipeline shows how we use a pre-trained model to extract important features from images. These features help a smaller model learn faster and better for a new task.
Loss
2.0 |****
1.5 |***
1.0 |**
0.5 |*
0.0 +----
1 2 3 4 5 Epochs| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 1.85 | 0.45 | Model starts learning with moderate loss and accuracy |
| 2 | 1.20 | 0.65 | Loss decreases and accuracy improves as model learns features |
| 3 | 0.85 | 0.75 | Training continues with better performance |
| 4 | 0.65 | 0.82 | Model converges with lower loss and higher accuracy |
| 5 | 0.50 | 0.87 | Final epoch shows good accuracy and stable loss |
trainable = False on the base model freezes its weights.base_model.trainable = False. Others are invalid syntax or do not freeze layers.features?
base_model = tf.keras.applications.MobileNetV2(input_shape=(128,128,3), include_top=False) base_model.trainable = False inputs = tf.keras.Input(shape=(128,128,3)) features = base_model(inputs) print(features.shape)
base_model = tf.keras.applications.ResNet50(weights='imagenet', include_top=False) base_model.trainable = False inputs = tf.keras.Input(shape=(224,224,3)) x = base_model(inputs) x = tf.keras.layers.Dense(10)(x) model = tf.keras.Model(inputs, x)
Pass the test and this pattern moves unknown