This project aims to create models for binary and multi-class image classification using various deep learning architectures in TensorFlow/Keras.
The project includes two classifications:
- Binary Image Classification: Distinguishes between fruits and vegetables.
- Multi-class Classification: Identifies different types of flowers.
Both tasks involve several deep learning models, including:
- Custom model
- VGG16 model
- MobileNetV3Large model
- EfficientNetB0 model
- Xception model
- Clone the repository:
bash git clone https://your-repo-url.git cd your-repo-name
-
Make sure the required libraries are installed: bash pip install tensorflow pandas matplotlib scikit-learn imbalanced-learn tqdm albumentations
-
Download and prepare the necessary data: Place your images in the directories specified in the code (train_set, val_set, test_set).
- Python 3
- TensorFlow
- Keras
- Pandas
- Matplotlib
- OpenCV (for augmentation)
Data Preparation: The data was split into training, validation, and test sets. Data Augmentation: Augmentation methods (flipping, resizing, contrast adjustment) were applied to improve model quality. Model Building: Each model was built and trained using the appropriate architectures. Model Evaluation: Models were evaluated on the test dataset, and results were collected.
- Article on model inference times: Habr
- GitHub discussion on inference time: ultralytics/ultralytics Issue #11238
- Article on model performance (EfficientNet): Keras
Binary Classification
The dataset was collected independently and contains images of fruits and vegetables. Below are the sources from which the images were obtained:
- Pineapple Supply Co (CC0 License)
- Freestocks.org
- Foodiesfeed.com
- Viktor Hanacek на picjumbo
- Kaboompics.com
- Gratisography
- Barnimages
- Negative Space
- tbridge на Visualhunt
Multi-Class Classification
For multi-class classification, I used the 102 Category Flower Dataset, created by Maria-Elena Nilsback and Andrew Zisserman. The dataset consists of 102 flower categories, each containing between 40 and 258 images of flowers commonly found in the United Kingdom.
- The dataset features a wide scale, pose, and lighting variations, making it suitable for robust image classification tasks.
- Each class is stored in separate folders and includes a variety of images, providing diversity and complexity for the classification model
If you use this dataset in your research or projects, please cite the following publication:
Nilsback, M-E., & Zisserman, A. (2008). Automated flower classification over a large number of classes. In Proceedings of the Indian Conference on Computer Vision, Graphics and Image Processing.
The dataset is available for use under the terms outlined on the Oxford VGG website. Ensure to check the specific usage guidelines provided there.
You can access the dataset through this link.
This project is licensed under the MIT License - see the LICENSE file for details.