This Project is based on Kaggle's Competition : Flower classification on TPU
Images are provided in TFRecord format, a container format frequently used in Tensorflow to group data files for optimal training performace. Each file contains the id, label and image.
- 12753 training images
- 3712 validation images
- 7382 unlabeled test images
Data is provided for resolutions:
- (512 X 512 X 3)
- (331 X 331 X 3)
- (224 X 224 X 3)
- (192 X 192 X 3)
Refer to Kaggle Notebook : here for the approach and implementation.
Model | Score |
---|---|
MobilenetV2 | 0.93745 |
DenseNet201 | 0.96971 |
EfficientNetB7 | 0.95150 |
(0.62)*DenseNet201 + (1-0.62)*EfficientNetB7 | 0.97058 |
-
Input Data Pipeline:
- tf.data pipeline with data augmentation
- Added additional data
- Data Augmentation done are:
- Spatial level Transforms:
- Random flip left right, Random flip up down, Random crop
- Pixel level Transforms :
- Random Saturation, Random Contrast, Adjust Gamma, Random Brightness
- Miscellaneous :
- Transform Rotation, Transform Shift, Transform Shear, Transform Zoom
- Spatial level Transforms:
-
Model
- BaseModel with input image size of 224 X 224 and Added GlobalAveragePooling layer
- Transfer learning over several models out which DenseNet201 performed best
- Ensemble Learning with 2 or more models
- used DenseNet201 and EfficientnetB7 :
- instead of one network, we train two and then combine their probability distributions.
- used DenseNet201 and EfficientnetB7 :
-
Training parameters
- Hyper-parameters : Image Size, Batch Size, Epochs, Learning rate, Types and Amount of Augmentation
- used learning rate scheduling, for more stable training.
- optimizer = Adam
- loss function = sparse_categorical_crossentropy
- metrics = sparse_categorical_accuracy
marigold | rose | sunflower | dahlia |
---|---|---|---|
- Converted trained model to TFLite Format
- Did setup for Android App in Android studio
- apk files are present here