ShapeNet

A machine learning-powered shape recognition system

ShapeNet Demo

Project Overview

ShapeNet is a machine learning project that recognizes hand-drawn shapes in real-time using a web interface. The system allows users to draw shapes on an HTML canvas, and the trained neural network predicts which shape was drawn with remarkable accuracy.

The current model can recognize five different shapes: circles, squares, triangles, hexagons, and octagons. The application provides real-time feedback as users draw, showing not only the predicted shape but also a confidence score and probability distribution across all possible shape classifications.

Technical Implementation

Key Features

Real-time shape recognition as you draw on the canvas
Multi-class neural network classification trained on shape dataset
Visual probability distribution showing confidence across all shape categories
Optimized for quick response with minimal latency
Responsive canvas drawing interface with immediate feedback
Clean, modern UI with GitHub-inspired dark theme

Implementation Details

The frontend utilizes HTML5 Canvas for drawing and JavaScript to capture user input. When a user completes a drawing, the canvas image is converted to base64 and sent to the backend Flask server. The server preprocesses the image by resizing it to 28x28 pixels, normalizing pixel values, and inverting colors to match the training data format.

The TensorFlow/Keras model processes this standardized input and returns prediction probabilities for each shape class. The application then displays these results in an intuitive interface with animated probability bars, making it easy to understand the model's confidence level for each possible shape.

Technologies Used

TensorFlow/Keras Flask HTML5 Canvas JavaScript Python NumPy PIL/Pillow CSS3

Future Enhancements

Expand model to recognize additional shape types
Implement progressive learning to improve accuracy over time
Add a training mode where users can contribute labeled examples
Optimize model size for faster mobile performance
Create an export feature to save and share drawings with predictions

Explore the Code

View on GitHub