AI / Computer Vision

Banana Classifier.

An AI-powered web application that classifies bananas as fresh or rotten using a computer vision model and real-time webcam input.

Banana Classifier

Project Information

Project TypeGroup
RoleData training, Dataset Preparation, & Model Development
CategoryAI / Computer Vision
Tools
PythonTensorFlowFlaskNumPy
External Link

Project Details

Overview

Banana Image Classifier is an AI and computer vision project that combines an image classification model with a Flask web application. The system allows users to capture an image of a banana through a webcam and classify it as either fresh or rotten.

Process

The project uses MobileNetV2 with transfer learning to train a binary image classification model for fresh and rotten bananas. The trained model is saved as an H5 file and loaded by the Flask backend when the application starts. The web application handles image requests, processes the captured image using NumPy and PIL, passes the processed input to the TensorFlow model, and returns the classification result to the frontend. The browser interface uses JavaScript and HTML5 Canvas to capture images from the webcam.

Insights

01

The trained MobileNetV2 model achieved a final test accuracy of 97.69% on the banana classification task.

02

Transfer learning was used to build the image classifier while keeping the resulting model lightweight at approximately 9 MB.

03

The Flask backend loads the trained model at application startup and provides the interface between the machine learning model and the web application.

04

The application combines computer vision and web development into an end-to-end workflow, from webcam image capture to fresh or rotten classification.

Next

All Work ↗