- Introduction
- Dataset
- Data Preprocessing
- Model Architecture
- Results
- Evaluation Metrics
- Conclusion
- Contributing
- License
This project aims to develop a machine learning model capable of classifying handwritten characters from images. Using a Convolutional Neural Network (CNN), the model is trained to accurately detect and classify individual characters, which can be utilized in various applications such as digitizing handwritten notes or automating form processing.
The dataset consists of images divided into three categories: training, validation, and testing. Each category contains subfolders labeled with the character the images represent. The dataset is structured as follows:
- Train Folder: 60% of the total images, used for training the model.
- Validation Folder: 20% of the total images, used for tuning the model's hyperparameters and preventing overfitting.
- Test Folder: 20% of the total images, used to evaluate the model's performance on unseen data.
The dataset used in this project includes images of handwritten characters, divided into several classes representing different letters of the alphabet. Below is a sample from the dataset:
| Character | Sample Image |
|---|---|
| A | ![]() |
| B | ![]() |
| C | ![]() |
Preprocessing steps include:
- Resizing all images to a standard size of 32x32 pixels to ensure uniformity.
- Converting images to grayscale to reduce complexity.
- Normalizing pixel values to the range [0, 1] for faster convergence during training.
The chosen model is a CNN with the following layers:
- Convolutional layers to extract features from the images.
- MaxPooling layers to reduce spatial dimensions.
- Dropout layers to prevent overfitting.
- A Flatten layer to convert the 2D feature maps into a 1D feature vector.
- Dense layers for classification.
The model was selected due to its proven effectiveness in image recognition tasks, particularly in recognizing patterns in visual input.
The latest training session yielded the following results:
- Final training accuracy: 96%
- Final validation accuracy: 95%
- Test accuracy on unseen data: 93.8%
After training, the model was evaluated on the test dataset. Here are the results:
- Accuracy: 94.6%,
- Precision: 94.7%,
- Recall: 94.6%,
- F1-Score: 94.5%
These metrics indicate the model's performance, and effectiveness in recognizing handwritten characters with high reliability, highlighting its strengths and areas for improvement.
Throughout the training process, we monitored the model's accuracy on both the training and validation datasets. The following graph illustrates the model's performance over epochs:
As observed, the model's validation accuracy closely follows its training accuracy, indicating good generalization to unseen data.
The confusion matrix below provides insight into the model's performance across all character classes, highlighting its strengths and areas where improvement is needed.
The CNN model demonstrates promising capabilities in recognizing handwritten characters, with potential applications in automated data entry and digital archiving. Future work will focus on refining the model by exploring more sophisticated architectures and training techniques to further improve accuracy and reliability.
Contributions to this project are welcome! To contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Please ensure your code adheres to the project's coding standards and includes appropriate tests.
This project is licensed under the MIT License - see the LICENSE.md file for details.






