
Machine Learning | Multi-Class Classification
The goal of this project is to classify images of military aircraft into one of 80 distinct classes using deep learning. The system leverages state-of-the-art Convolutional Neural Network (CNN) architecturesβincluding EfficientNetB3, ResNet50, MobileNetV2, InceptionV3, and InceptionResNetV2βto achieve high accuracy. Using transfer learning, these models are adapted from pre-trained ImageNet weights to the specific domain of military aircraft recognition. The project utilizes the "Military Aircraft Detection Dataset" from Kaggle, comprising over 33,000 images. The solution is implemented using TensorFlow and Keras, featuring a custom data pipeline and modular model definitions to support both frozen feature extraction and full fine-tuning.
The system follows a standard deep learning pipeline architecture:
BatchNormalization for stability.Dense layer (256 units, ReLU activation, L2 regularization).Dropout (0.2) for regularization.Output Dense layer (80 units, Softmax activation).models.py:
The core factory module containing definitions for all model architectures. It functions as a flexible builder that can instantiate models in either "frozen" (feature extraction only) or "trainable" (fine-tuning) modes. It includes definitions for:
customCNN: A baseline CNN built from scratch.efficientNetB3_80, resnet50_80, mobilenetV2_80, etc.dataGenerator.py (AircraftDataGenerator):
A custom class inheriting from keras.utils.Sequence. It handles efficient, batched data loading from the disk, ensuring the system can train on large datasets without memory exhaustion. It manages shuffling, resizing, and on-the-fly preprocessing.classification.py:
The main driver script. It handles:
reformatDataset).results.py:
A dedicated module for visualizing training metrics. It contains hardcoded results from experiments to reproduce performance graphs (Accuracy/Loss vs Global Epochs) using Matplotlib.models.py), data handling (dataGenerator.py), and execution logic (classification.py). This allows for easy swapping of base models (e.g., switching from ResNet to MobileNet requires changing just one function call) without rewriting the training loop.AircraftDataGenerator streams batches on demand. This fits the "Load-Process-Train" pattern, essential for deep learning on consumer hardware.Source: Military Aircraft Detection Dataset (Kaggle)
| Model | Train Acc | Test Acc | Batch Size | Notes |
|---|---|---|---|---|
| EfficientNetB3 | 95% | 88% | 16 | Best performance |
| ResNet50 | 80% | 72% | 16 | |
| MobileNetV2 | 83% | 65% | 16 | Fastest but lowest accuracy |
military-aircraft-classification/
βββ images/ # Reformatted and structured dataset
β βββ 33,872 .jpg images # Images
βββ savedModels/ # Saved model weights and architectures
β βββ various saved models
βββ results/ # Accuracy/Loss plots
β βββ batchSize16_frozen_training_accuracy_loss.png
β βββ batchSize32_frozen_training_accuracy_loss.png
β βββ batchSize_vs_frozen_test_accuracy_loss_.png
βββ labels.txt # Class label mappings
βββ README.md # Project overview and documentation
βββ classification.py # Main script, contains training, evaluation, data generator, and architecture definitions
βββ results.py # Results script, used to visualize the results
βββ requirements.txt # Python dependencies