This project presents an image classification pipeline using a convolutional neural network (CNN) based on EfficientNetB4 architecture. The model is designed to handle a custom image dataset, leveraging advanced data augmentation and regularization techniques to enhance performance and prevent overfitting.
- Base Model: EfficientNetB4 (pre-trained on ImageNet)
- Top Layers: Custom classification head
- Regularization: L1, L2 weight penalties
- Augmentation: Random flip, rotation, zoom
- Training Strategy:
- EarlyStopping to avoid overfitting
- ModelCheckpoint to save the best model
- Structure:
/train
/class_1
image1.jpg
image2.jpg
/class_2
...
/test
/class_1
...
/class_2
...
- Images are automatically loaded and labeled from directory structure using TensorFlow's
ImageDataGenerator
.
- Python 3.x
- TensorFlow 2.x
- NumPy, Pandas, Matplotlib, Seaborn
- scikit-learn
The model's performance is assessed using:
- Confusion Matrix
- Classification Report (Precision, Recall, F1-score)
- Accuracy metrics over training epochs
- Loss and Accuracy plots
- Confusion matrix heatmap
- Example predictions
-
Clone this repository:
git clone https://github.com/your-username/your-repo-name.git cd your-repo-name
-
Install the required packages:
pip install -r requirements.txt
-
Place your dataset inside the
train
andtest
directories. -
Run the notebook:
jupyter notebook CNN_Model.ipynb
- Make sure the dataset is well-organized as described.
- You can easily swap EfficientNetB4 with other architectures using Keras Applications.
For questions or suggestions, feel free to open an issue or contact the maintainer.
Author: Farshad Tofighi (farshad257)
License: MIT Email: farshadtfgh@gamil.com