Handwritten Digit Classification Using CNN, MLP, and LeNet Architectures: A Comparative Study of CPU and GPU Performance

https://colab.research.google.com/drive/1QibOywveHtaOjxldRCEg8ztrVwnM1nMc?usp=sharingHere’s a structured and professional **Title**, **Abstract**, and **Project Overview** tailored for your project comparing CNN, MLP, and LeNet models on custom MNIST digit images, including CPU vs GPU training benchmarks and real-time predictions:—### **Project Title****Performance Benchmarking of CNN, MLP, and LeNet Models for Handwritten Digit Classification on CPU and GPU using Custom MNIST Dataset**—### **Abstract**This project presents a comparative study of three deep learning architectures—Convolutional Neural Network (CNN), Multilayer Perceptron (MLP), and LeNet—for the task of handwritten digit classification using a custom MNIST image dataset. The primary objective is to benchmark the training performance and classification accuracy of each model on both CPU and GPU environments. Each model is trained using custom-labeled digit images and evaluated for accuracy on unseen test data. Training time is recorded to highlight computational efficiency. Furthermore, the models are tested in real-time on user-uploaded images to demonstrate prediction speed and reliability. This study provides insights into the trade-offs between model complexity, training time, prediction latency, and classification performance, serving as a reference for deploying efficient digit recognition systems in constrained environments.—### **Project Overview**#### **1. Introduction**Handwritten digit recognition is a foundational task in computer vision, widely used in postal mail sorting, bank cheque verification, and digital form processing. This project investigates three neural network architectures—CNN, MLP, and LeNet—for recognizing handwritten digits using a custom dataset derived from the MNIST format. The goal is to benchmark their training time and accuracy on both CPU and GPU setups and evaluate their efficiency in real-time inference.#### **2. Objectives*** To train and evaluate CNN, MLP, and LeNet models on a custom MNIST dataset.* To compare training performance on CPU vs GPU.* To assess and visualize model training time and classification accuracy.* To implement real-time prediction on user-uploaded digit images.#### **3. Dataset**A custom dataset of 20 grayscale digit images (2 per digit from 0 to 9) was uploaded to Google Drive. Each image is:* Labeled by its filename (e.g., `3_01.png`),* Preprocessed to 28×28 grayscale format,* Normalized and reshaped for model input.#### **4. Models Used*** **CNN (Custom)**: A compact 3-layer CNN with ReLU activation and max pooling.* **MLP**: A 3-layer fully connected network with 512 and 256 neurons in hidden layers.* **LeNet**: A classic convolutional architecture adapted for the MNIST format.#### **5. System Setup*** Code developed in **Google Colab**,* **TensorFlow 2.x** used for model creation,* CPU and GPU training performed using TensorFlow’s `tf.device` API.#### **6. Methodology*** **Preprocessing**: Grayscale conversion, resizing, inversion, normalization.* **Training**: All models trained for 30 epochs with batch size 2.* **Benchmarking**: Training time recorded for each model on both CPU and GPU.* **Evaluation**: Accuracy assessed on a test split.* **Visualization**: Bar charts created to compare training time and accuracy.* **Prediction**: Uploaded digit images are classified by all three models with prediction time tracked.#### **7. Results*** **Training Time Comparison**: GPU training significantly outperforms CPU across all models.* **Accuracy Comparison**: CNN and LeNet yield higher accuracy compared to MLP, with LeNet being the most accurate on custom images.* **Prediction Latency**: Real-time predictions completed in under 0.05 seconds for each model, with CNN being the fastest.#### **8. Visualizations*** Bar chart showing training time for each model on CPU vs GPU.* Accuracy bar chart comparing CNN, MLP, and LeNet.* Real-time prediction display with matplotlib for each uploaded image.#### **9. Conclusion**The CNN and LeNet architectures demonstrate superior performance over MLP for handwritten digit classification. GPU usage results in significantly reduced training times, making it preferable for large-scale or time-sensitive applications. Among all models, LeNet offers the best accuracy on the custom MNIST images, making it an optimal choice for deployment in digit recognition systems.#### **10. Future Work*** Expand dataset with more handwritten samples per digit.* Integrate model pruning or quantization for edge deployment.* Explore advanced models like ResNet or MobileNet for further improvements.—Would you like help turning this into a formatted report (Word/PDF or LaTeX)?

Ace Your Assignments! 🏆 - Hire a Professional Essay Writer Now!

Why Choose Our Essay Writing Service?

  • ✅ Original writing: Our expert writers will write each paper from scratch, ensuring complete originality, zero plagiarism and AI free content.
  • ✅ Expert Writers: Our seasoned professionals are ready to deliver top-quality papers tailored to your needs.
  • ✅ Guaranteed Good Grades: Impress your professors with outstanding work.
  • ✅ Fast Turnaround: Need it urgently? We've got you covered!
  • ✅ 100% Confidentiality: Customer privacy is our number one priority. Your identity is anonymous to our writers.
🎓 Why wait? Let us help you succeed! Our Writers are waiting..

Get started

Starts at $9 /page

How our paper writing service works

It's very simple!

  • Fill out the order form

    Complete the order form by providing as much information as possible, and then click the submit button.

  • Choose writer

    Select your preferred writer for the project, or let us assign the best writer for you.

  • Add funds

    Allocate funds to your wallet. You can release these funds to the writer incrementally, after each section is completed and meets your expected quality.

  • Ready

    Download the finished work. Review the paper and request free edits if needed. Optionally, rate the writer and leave a review.