Instructions to use snehadm/CNN with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use snehadm/CNN with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://snehadm/CNN") - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
π§ CIFAR-10 Visual Intelligence
A state-of-the-art Flask-based web application powered by a custom Convolutional Neural Network (CNN). This application provides real-time image classification for the 10 object classes in the CIFAR-10 dataset.
π Features
- High-Accuracy Classification: Optimized CNN architecture for small image recognition.
- Real-time Inference: Quick results with confidence percentage bars.
- Containerized Deployment: Ready-to-use Docker environment.
- Premium UI/UX: Modern dark-mode interface with glassmorphism aesthetics.
- API Endpoint: Accessible
/predictPOST endpoint for programmatic use.
ποΈ Model Architecture
The underlying model is a Lightweight CNN optimized for CPU performance while maintaining high accuracy.
| Layer Type | Configuration | Filters/Units |
|---|---|---|
| Input | Image | 32 x 32 x 3 |
| Augmentation | Flip, Rotation, Zoom | - |
| Conv Block 1 | (Conv2D x 2) + MaxPool + Dropout | 32 filters |
| Conv Block 2 | (Conv2D x 2) + MaxPool + Dropout | 64 filters |
| Conv Block 3 | Conv2D + MaxPool + Dropout | 128 filters |
| Dense Head | Flatten + Dense + BN + Dropout | 128 units |
| Output | Dense (Softmax) | 10 classes |
π Dataset: CIFAR-10
The CIFAR-10 dataset consists of 60,000 32x32 color images in 10 classes, with 6,000 images per class.
Classes:
airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck
π οΈ Installation and Usage
Local Installation
Clone the repository:
git clone https://github.com/your-username/cifar10-app.git cd cifar10-appSet up environment:
python -m venv venv # Windows: .\venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtRun the application:
python app.py
Docker Deployment
docker build -t cifar10-app .
docker run -p 5000:5000 cifar10-app
π¦ Project Structure
βββ app.py # Flask Web Server
βββ train.py # Model Training Logic
βββ predict.py # Command Line Inference
βββ Dockerfile # Container Configuration
βββ .gitignore # Git Exclusion Rules
βββ requirements.txt # Python Dependencies
βββ static/ # CSS, Images, and Uploads
βββ templates/ # HTML Frontend
βββ samples/ # Test Image Collection
β οΈ Troubleshooting
- Dependency Conflict: If
numpyorscipycauses import loops, ensure you have the pinned versions:numpy<2.0andscipy<1.14. - OneDNN Warnings: These are normal for Intel/AMD CPUs and do not affect functionality.
Created with β€οΈ for Visual Intelligence.
- Downloads last month
- -