This repository contains code to create an object detection model for fruit images using a dataset from Kaggle. The dataset can be found here.
Before running the code, make sure you have the necessary dependencies installed. You can install them using pip and the provided requirements.txt file:
pip install -r requirements.txtThe dataset is organized into four directories: 'APPLE', 'BANANA', 'MIXED', and 'ORANGE'. Images are preprocessed, then resized, normalized, and categorized.
Model uses Convolutional Neural Network (CNN) with the following architecture:
- Conv2D layer with 64 filters, (3, 3) kernel size, and ReLU activation function.
- MaxPooling2D layer with (3, 3) pool size.
- Conv2D layer with 64 filters, (3, 3) kernel size, and ReLU activation function.
- MaxPooling2D layer with (3, 3) pool size.
- Conv2D layer with 16 filters, (3, 3) kernel size, and ReLU activation function.
- Flatten layer to prepare for dense layers.
- Dense layer with 64 units and ReLU activation function.
- Dense layer with 16 units and softmax activation function.
Data is split into training and validation sets. After training, model accuracy and loss for both training and validation is present on graphs.
To run the code, ensure that you have downloaded the dataset and stored it in appropriate directories. Adjust the path accordingly in the code (PATH). Then, execute the Python script.

