Fruit Classifier is a machine learning project that leverages deep learning techniques to classify different types of fruits. This project uses a convolutional neural network (CNN) to process images of fruits and predict their category. The dataset includes images of various fruits like apples, bananas, oranges, and more.
- Classify images of fruits into their respective categories.
- Built using deep learning (CNN).
- User-friendly interface for predicting the fruit category from a given image.
To get started with the project, follow the steps below:
-
Clone this repository:
git clone https://github.com/buddhirangana/fruit-classifier.git cd fruit-classifier -
Install the required dependencies:
pip install -r requirements.txt
After installing the dependencies, you can run the project in your local environment:
-
Train the model:
python train.py
-
Once the model is trained, you can test the model using an image:
python predict.py --image path/to/fruit_image.jpg
-
For live predictions, you can use the Flask or Streamlit web interface (if implemented).
The dataset used for this project includes images of fruits categorized into different classes. You can find the dataset here or you can use any similar fruit image dataset for training the model.
data/
├── train/
│ ├── apple/
│ ├── banana/
│ └── ...
└── test/
├── apple/
├── banana/
└── ...This project uses a Convolutional Neural Network (CNN) for fruit classification. The CNN consists of the following layers:
- Convolutional layers to extract features.
- Pooling layers to reduce the dimensions.
- Fully connected layers for final classification.
The model is trained on images of fruits and uses categorical cross-entropy loss for training.
- Python 3.x
- TensorFlow (or PyTorch)
- Keras
- NumPy
- OpenCV (for image pre-processing)
- scikit-learn (for evaluation)
Install the dependencies by running:
pip install -r requirements.txt- Thanks to the contributors of the dataset used for this project.
- Special thanks to the creators of deep learning frameworks like TensorFlow and Keras for providing powerful tools for image classification.
If you have any questions or issues, feel free to open an issue on the GitHub repository