This project is an implementation of a Convolutional Neural Network (CNN) for recognizing handwritten digits from the MNIST dataset. The CNN is trained to classify images of handwritten digits into the corresponding digit classes (0-9).
Before running the project, make sure you have the following prerequisites installed:
-
Clone the repository to your local machine:
git clone https://github.com/heib6xinyu/Mnist_Model_with_High_Noise_Level.git
-
Change to the project directory:
cd mnist-cnn
-
Create a Conda environment (optional but recommended):
conda create --name mnist-cnn python=3.8
-
Activate the Conda environment:
conda activate mnist-cnn
-
Install project dependencies:
./compile.sh
To train and evaluate the CNN model on the MNIST dataset, you can run the following command:
python mnist_cnn_model.py
This will train the model, evaluate its accuracy, and save the trained model as mnist_cnn_model.h5
.
python test_model.py
This file creates 10 test data, one with 0 noise, other with 9 level of gaussian noise. Then test the model on the 10 test data.
The project depends on the following Python libraries and packages:
All dependencies are listed in the compile.sh
file and can be installed using Conda.