This project demonstrates the use of a neural network to identify handwritten digits from the MNIST dataset. The neural network is trained on a large set of handwritten digits and learns to classify each digit (0-9) based on the pixel values of the images.
- Data preprocessing and normalization
- Neural network model creation using Keras
- Model training and evaluation
- Prediction on new handwritten digit images
- Visualization of training results and predictions
- Python 3.x
- TensorFlow 2.x
- Keras
- NumPy
- Matplotlib
- Jupyter Notebook (optional for interactive use)
- Clone the repository:
git clone https://github.com/yourusername/handwritten-digits-identification.git cd handwritten-digits-identification
- Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
- Install the required packages:
pip install -r requirements.txt
- The MNIST dataset is automatically downloaded using Keras. The dataset consists of 60,000 training images and 10,000 test images of 28x28 pixels.
- Preprocess the data:
- Normalize the pixel values to the range [0, 1].
- Reshape the data to fit the model input.
- Define the neural network architecture using Keras Sequential API.
- Compile the model with an appropriate optimizer, loss function, and metrics.
- Train the model on the training data and validate on the test data.
- Use the trained model to make predictions on new images.
- Evaluate the model's performance using accuracy and other metrics.
- Plot the training and validation accuracy/loss over epochs.
- Display sample predictions with the actual labels.
Contributions are welcome! Please fork this repository and submit a pull request for any enhancements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.