Long Dang
commited on
Update result
Browse files- README.md +40 -3
- classification_report_image.png +0 -0
- confusion_matrix.png +0 -0
- model.png +0 -0
- test_result.png +0 -0
- training_history.png +0 -0
README.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MNIST Pattern Recognition with Convolutional Neural Network (CNN)
|
| 2 |
+
|
| 3 |
+
This project implements a Convolutional Neural Network (CNN) for recognizing handwritten digits from the MNIST dataset. The model is built using TensorFlow and Keras, and it supports both single-GPU and multi-GPU training. The project includes training, testing, and a user-friendly GUI for inference.
|
| 4 |
+
|
| 5 |
+
## Features
|
| 6 |
+
- **Customizable CNN Architecture**: Includes convolutional, pooling, normalization, and dense layers.
|
| 7 |
+
- **Multi-GPU Support**: Leverages TensorFlow's `MirroredStrategy` for distributed training.
|
| 8 |
+
- **Training Visualization**: Generates plots for training/validation accuracy and loss.
|
| 9 |
+
- **Evaluation Metrics**: Outputs confusion matrix, classification report, and precision/recall/F1 scores.
|
| 10 |
+
- **Interactive GUI**: Built with Streamlit for real-time image recognition.
|
| 11 |
+
- **Docker Support**: Easily deployable using Docker.
|
| 12 |
+
|
| 13 |
+
## Model Architecture
|
| 14 |
+
 <br>
|
| 15 |
+
The CNN model consists of:
|
| 16 |
+
1. Two convolutional layers with ReLU activation and max-pooling.
|
| 17 |
+
2. Layer normalization for improved convergence.
|
| 18 |
+
3. Fully connected dense layers with dropout for regularization.
|
| 19 |
+
4. Softmax output layer for classification into 10 digit classes.
|
| 20 |
+
|
| 21 |
+
## Training
|
| 22 |
+
The model is trained on the MNIST dataset, which contains 60,000 training images and 10,000 test images of handwritten digits (28x28 grayscale). The training process includes:
|
| 23 |
+
- Data normalization to scale pixel values to the range [0, 1].
|
| 24 |
+
- Categorical cross-entropy loss and accuracy as the evaluation metric.
|
| 25 |
+
- Model checkpointing to save the best-performing model based on validation accuracy.
|
| 26 |
+
|
| 27 |
+
## Final result
|
| 28 |
+
**Training history**
|
| 29 |
+
 <br>
|
| 30 |
+
|
| 31 |
+
**Confusion matrix**
|
| 32 |
+
 <br>
|
| 33 |
+
|
| 34 |
+
**Classification report**
|
| 35 |
+
 <br>
|
| 36 |
+
|
| 37 |
+
**Test result**
|
| 38 |
+
 <br>
|
| 39 |
+
|
| 40 |
+
Full code at [Github](https://github.com/longdnk/Pattern-Recognition/tree/main/MNIST)
|
classification_report_image.png
ADDED
|
confusion_matrix.png
ADDED
|
model.png
ADDED
|
test_result.png
ADDED
|
training_history.png
ADDED
|