Table of Contents
This repository offers source code for the research part of the Bird Classification project where I use various model architectures, including:
- InceptionV3;
- MobileNetV1 and MobileNetV2;
- YOLOv8.
-
The orginal paper of Inception (C. Szegedy et al., 2015).
-
The application documentation of InceptionV3 using TensorFlow v2.14.0.
-
The orginal paper of MobileNet (Howard, A.G. et al., 2017).
-
The application documentation of MobileNet using TensorFlow v2.14.0.
-
The orginal paper of You Only Look Once YOLO architecture (Redmon, J. et al., 2016).
-
The application documentation of YOLOv8 by Ultralytics.
- Pytorch
- TensorFlow
- numpy
- pandas
- Docker
- AWS EC2
- AWS S3
This project utilizes a bird species dataset provided by Gerry, available on Kaggle. For detailed information, visit birds 525 species- image classification .
The diagram provided above outlines the core structure of this project. The training of the model was carried out on AWS EC2, utilizing data stored in an S3 bucket. Following is the example of a brief outline of the code setups for experimenting with different configurations of MobileNetV1 and YOLOv8.
- MobileNetV1 - test20 configuration
# ________________ CONFIG THE BASE MODELS ________________ #
learning_rate = 0.001
epochs = 50
patience = 15
factor = 0.6
# _______ MOBILENET test20: RE-TRAIN ALL LAYERS WITH DATA AUGMENTATION _______ #
model_base = tf.keras.applications.mobilenet.MobileNet(
include_top=False, weights="imagenet"
)
model_base.trainable = True
...
# add callbacks mechanism to the model fitting
callbacks = [
...
]
# refit model and record metrics
history = model_0.fit(
train_data,
epochs=epochs,
steps_per_epoch=len(train_data),
validation_data=val_data,
validation_steps=int(0.25 * len(val_data)),
verbose=1,
callbacks=callbacks,
)
- YOLOv8 - test1 configuration
# custom configuration
epochs = 50
patience = 15
batch = 16
image_size = 224
device = 0
workers = 2
pretrained = False
optimizer = "auto"
verbose = True
lr0 = 0.01
weight_decay = 0.0005
dropout = 0.0
model = YOLOv8(
test_name=test_name,
model_yaml=model_yaml,
model_pt=model_pt,
data=data,
project=project,
...
)
# _ TRAIN _ #
model.train()
# _ EVALUATING ON TEST DATA _ #
predictions, test_accuracy = make_evaluation_on_testdata(
path_to_chosen_model, path_to_testdata, path_to_json
)
This project involved numerous experiments, but only the most significant results are highlighted here.
MobileNet - test 20
YOLOv8 test0
- YOLOv8 accuracy on test data: 98.5%
The results of this project is pretty decent when compared to similar efforts addressing the task of classifying bird species using the birds 525 species- image classification dataset . The highest accuracy achieved so far is approximately 98% on the test dataset (e.g., Vo, H.-T., et al. 2023)
I'm excited to share this repository! Please feel free to explore its functionalities. Thank you for this far. Have a wonderful day ahead!
Best, Hoang Ng
C. Szegedy et al., 2015. "Going deeper with convolutions," 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Boston, MA, USA, 2015, pp. 1-9, doi: 10.1109/CVPR.2015.7298594.
Howard, A.G. et al., 2017. MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications. CoRR, abs/1704.04861. Available at: http://arxiv.org/abs/1704.04861.
Redmon, J. et al., 2016. You Only Look Once: Unified, Real-Time Object Detection. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). pp. 779–788.
Vo, H.-T., et al. (2023). "Bird Detection and Species Classification: Using YOLOv5 and Deep Transfer Learning Models." International Journal of Advanced Computer Science and Applications 14.