Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 2 (2025) 772 https://internationalpub ls.com Enhanced Handwritten Digit Recognition Using Artificial Neural Networks Raghvendra Singh1, Rajendra Singh2, Alka Sharma3, Soniya Gupta4, A. K. Malik5 1School of Sciences (Mathematics), Uttar Pradesh Rajarshi Tandon Open University, Prayagraj, U.P., INDIA 2Department of Commerce, D A V (PG) College, Kanpur, U.P., INDIA 3Department of Mathematics, Poornima University Jaipur, Rajasthan, INDIA 4Faculty of Engineering (Mathematics), Swami Vivekanand Subharti University, Meerut, U.P., INDIA 5School of Sciences, UP Rajarshi Tandon Open University, Prayagraj, U.P., INDIA Email: rsingh@uprtou.ac.in; rajendrasingh983916@gmail.com; alka.sharma@poornima.edu.in; drsoniyainpg@gmail.com; profakmalik@uprtou.ac.in Received: 11-02-2025 Revised: 17-03-2025 Accepted: 22-03-2025 Abstract Handwritten digit recognition plays a vital role in numerous applications such as postal automation, bank check processing, and digitized document management. In this paper, we introduce an enhanced approach to handwritten digit recognition by leveraging Artificial Neural Networks (ANNs). Our proposed methodology integrates state-of-the-art ANN architectures and preprocessing techniques aimed at improving recognition accuracy and efficiency. Through rigorous experimentation conducted on benchmark dataset MNIST our method achieves an impressive accuracy of 94.51%. This accuracy surpasses that of traditional approaches, underscoring the effectiveness of employing ANNs with optimized configurations and preprocessing methods for handwritten digit recognition tasks. These findings demonstrate the potential of our approach for real-world applications requiring robust and efficient digit recognition systems, further advancing the field of character recognition technology. Keywords: ANN, Handwritten digit, Accuracy. 1. Introduction Handwritten digit recognition is not merely a technical challenge; it holds immense practical significance in the modern digitized world. From postal services sorting parcels to financial institutions processing checks, the accurate and swift recognition of handwritten digits mailto:rsingh@uprtou.ac.in mailto:rajendrasingh983916@gmail.com mailto:alka.sharma@poornima.edu.in mailto:drsoniyainpg@gmail.com mailto:profakmalik@uprtou.ac.in Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 2 (2025) 773 https://internationalpub ls.com underpins a plethora of critical applications [1]. Despite significant progress in machine learning and computer vision, achieving high accuracy and efficiency in handwritten digit recognition remains a formidable task due to the inherent variability and complexity of handwriting. Traditional approaches to handwritten digit recognition often rely on handcrafted feature extraction methods combined with conventional classification algorithms. While effective to some extent, these methods often struggle with the diversity of handwriting styles, variations in stroke thickness, and irregularities in digit formation. Moreover, their performance may degrade when confronted with noisy or poorly scanned input images. In contrast, Artificial Neural Networks (ANNs) offer a promising paradigm shift in handwritten digit recognition. Inspired by the structure and function of the human brain, ANNs can autonomously learn complex patterns and relationships within data through iterative training processes. By leveraging the capacity of ANNs to adapt and generalize from diverse examples, our proposed methodology seeks to transcend the limitations of traditional approaches and achieve unprecedented levels of accuracy and efficiency in digit recognition tasks. This paper presents a holistic approach to enhance handwritten digit recognition using ANNs, encompassing both architectural innovations and preprocessing strategies. Our ANN models are designed to accommodate the intricacies of handwritten digits, with configurable layers and activation functions optimized for capturing subtle variations in input data. Additionally, we employ advanced preprocessing techniques to enhance the quality and uniformity of input images, mitigating the effects of noise and distortions that may impede recognition accuracy. We conduct extensive experiments on benchmark MNIST dataset. Through rigorous evaluation and comparative analysis, we demonstrate the superior performance of our approach in terms of recognition accuracy. Furthermore, we provide insights into the underlying mechanisms driving the success of our methodology, shedding light on the importance of architectural choices and preprocessing strategies in achieving robust digit recognition systems. In summary, this paper represents a significant contribution to the field of handwritten digit recognition by introducing an innovative approach grounded in Artificial Neural Networks. By pushing the boundaries of accuracy and efficiency, our methodology holds promise for revolutionizing various applications reliant on digit recognition, fostering greater automation, and efficiency in a digitized world. 2. Related Works In their study, Madane et al. (2020) [2] introduced a novel approach to handwriting recognition that integrates ANN with sophisticated image processing techniques. The primary objective of their research was to elevate both the accuracy and efficiency of digit recognition systems. Emphasizing a fusion of neural network architectures with image processing methodologies, their methodology aimed at refining the performance of handwritten digit recognition. By Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 2 (2025) 774 https://internationalpub ls.com combining these techniques, they aimed to push the boundaries of character recognition technology, potentially opening avenues for improved recognition systems in various domains. In their investigation, Liu et al. (2020) [3] undertook a comprehensive comparative analysis of multiple classification algorithms, encompassing K-Nearest Neighbors (KNN), Support Vector Machines (SVM), Back Propagation (BP), and Convolutional Neural Networks (CNN), specifically for the recognition of handwritten digits. The core objective of their study was to discern the most efficient approach capable of accurately classifying handwritten digits. Through a systematic evaluation of each algorithm's performance, they sought to unveil nuanced insights into the comparative strengths and weaknesses inherent in these methodologies. By shedding light on the comparative efficacy of various classification techniques, their research not only advanced the discourse on optimal strategies for digit recognition but also provided valuable guidance for selecting appropriate methodologies tailored to specific recognition tasks. In their work, Chen et al. (2020) [4] presented a novel approach to enhancing the performance of handwritten digit recognition. They introduced an adaptive fractional-order Back Propagation (BP) neural network, employing external optimization techniques as the foundation. This innovative methodology aimed to refine the accuracy and efficiency of digit recognition systems by adapting fractional-order principles within the neural network architecture. Through their research, they endeavored to push the boundaries of handwritten digit recognition capabilities, potentially unlocking new avenues for improved recognition accuracy and robustness. Keerthi, Thomalika (2022) [5] presented a machine learning-based approach for MNIST handwritten digit recognition. Their work focused on exploring the efficacy of different machine learning algorithms in digit recognition tasks. By evaluating the performance of various algorithms, they aimed to identify the most suitable approach for achieving high accuracy in digit recognition applications, contributing to the optimization of machine learning-based recognition systems. Al et. al (2020) [6] investigated the performance of residual neural networks versus local binary CNN for handwritten digit recognition. Their research aimed to identify the most suitable architecture for multilingual digit recognition applications. By comparing the performance of different neural network architectures, they provided insights into effective approaches for recognizing handwritten digits in multilingual contexts, contributing to advancements in multilingual recognition technology. Sethi and Kaushik (2020) [7] investigated hand-written digit recognition using machine learning techniques. Their study delved into methodologies aimed at enhancing the accuracy Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 2 (2025) 775 https://internationalpub ls.com and efficiency of digit recognition systems. They explored various machine learning approaches to improve the recognition of hand-written digits. Shaukat et al. (2020) [8] proposed a cloud-based efficient scheme for handwritten digit recognition, with a focus on enhancing scalability and accessibility. Their work emphasized leveraging cloud computing resources to improve the performance of digit recognition technologies. By utilizing cloud infrastructure, they aimed to enhance the scalability of digit recognition systems, making them more accessible and efficient. Khanday and Dadvandipour (2021) [9] conducted an analysis of machine learning algorithms for character recognition, specifically focusing on handwritten digit recognition. Their case study evaluated the performance of various machine learning techniques in digit recognition tasks. They analyzed the effectiveness of different algorithms in accurately recognizing hand- written digits, contributing insights into the selection of appropriate techniques for such tasks. Sufian et al. (2022) [10] introduced BDNet, a Bengali handwritten numeral digit recognition system based on densely connected CNNs. Their research demonstrated the effectiveness of CNN architectures in accurately recognizing Bengali handwritten digits. By leveraging densely connected CNNs, BDNet achieved notable performance in Bengali digit recognition tasks, showcasing advancements in recognition accuracy for this specific script. Cherny and Gibadullin (2022) [11] explored the recognition of handwritten digits using neural network technology. Their study investigated the application of neural networks for digit recognition tasks, highlighting advancements in recognition accuracy and computational efficiency. They examined various neural network architectures and techniques to improve the recognition of hand-written digits, contributing to the advancement of digit recognition technology. The Fuzzy-built optimization methods integrate fuzzy logic ideologies into optimization processes, permitting for well handling of uncertainty, imprecise data, and vagueness in the decision-making. The main fuzzy-based optimization techniques and situations deal improved the flexibility by applying the fuzzy sets and fuzzy numbers to exemplify the uncertain data, which enabling the more up-to-date decision-making in the uncertain environments [13-20]. 3. Proposed Work Our proposed method for enhancing handwritten digit recognition revolves around a carefully crafted architecture of ANNs coupled with preprocessing techniques tailored to optimize input data quality. This section delineates the key components and intricacies of our methodology, elucidating the design choices and strategies employed to achieve superior performance in digit recognition tasks. Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 2 (2025) 776 https://internationalpub ls.com 3.1 Architecture of Artificial Neural Networks (ANNs): Our ANN architecture is designed to process grayscale images of handwritten digits, where each pixel serves as a feature input. Specifically, for an image size of 20×20, the input layer is comprised of 400 input units, representing each pixel. Moving beyond the input layer, our ANN features multiple hidden layers, each containing a flexible number of neurons. For our design, the number of hidden units is set to 25, maintaining consistency across images of size 20×20. These hidden layers play a crucial role in learning intricate patterns and features within the input data. To introduce non-linearity into the network and facilitate the learning of complex relationships, we utilize the softmax activation function. This function allows for the modeling of nonlinearities, enabling the network to capture the nuances present in handwritten digit images. At the output layer, we have neurons corresponding to the possible classes of digits, ranging from 0 to 9. Employing the softmax activation function, we transform the raw output of the network into probability scores. This transformation facilitates multi-class classification, enabling the network to identify the most probable digit class for a given input image. By outputting probability distributions across the digit classes, softmax activation aids in making confident predictions and capturing uncertainty in classification tasks. The softmax function is given by [12] 1 ( ) i j x i N x j e S x e = =  …. (1) 3.2. Preprocessing Techniques: In our preprocessing pipeline, we incorporate several techniques to prepare the input images for optimal performance within our neural network framework. Firstly, normalization is employed to ensure that pixel intensity distributions across all samples are uniform. By mitigating the impact of variations in illumination, this step aids in enhancing the network's ability to generalize effectively across different datasets. Additionally, we leverage image augmentation methods to expand our training dataset and bolster the model's robustness. Through the application of random transformations like rotation, scaling, and translation, we introduce variability into the training data, enabling the network to learn from a broader range of examples. Furthermore, noise reduction plays a pivotal role in refining the quality of input images. Techniques such as Gaussian blurring and median filtering are utilized to suppress image noise, resulting in clearer representations of handwritten digits and facilitating more accurate classification. Finally, we employ contrast enhancement strategies to improve the discriminative power of the network. By leveraging techniques like histogram equalization and adaptive contrast stretching, we enhance the visual contrast of input images, thereby aiding the network in extracting meaningful features and making more accurate predictions. Through the Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 2 (2025) 777 https://internationalpub ls.com integration of these preprocessing steps, we optimize the input data to maximize the performance and efficacy of our neural network model in handwritten digit recognition tasks. 3.3. Training and Optimization: In our training process, we employ several key components to optimize the performance and generalization capabilities of our neural network model. Firstly, we utilize categorical cross- entropy as our chosen loss function. This metric quantifies the disparity between the predicted and actual digit labels during training, guiding the optimization process to minimize classification errors effectively. For updating the network weights iteratively, we rely on optimization algorithms like Stochastic Gradient Descent (SGD) and its variants, including Adam and RMSprop. These algorithms leverage gradients computed from mini-batches of training data to iteratively adjust the network parameters, facilitating convergence towards an optimal solution. To mitigate the risk of overfitting and promote better generalization, we integrate regularization techniques into our ANN architecture. L2 regularization is employed to regulate the complexity of the model. L2 regularization imposes a penalty on the magnitude of weights, discouraging large weight values and promoting weight sparsity. By incorporating these regularization techniques, we aim to strike a balance between model complexity and performance, ensuring that our neural network can effectively generalize to unseen data while maintaining robustness against overfitting. The cost function is described as follows ( ) ( ) ( ) ( ) 1 1 25 400 10 25 2 2 1 2 , , 1 1 1 1 1 ( ) log ( ( )) (1 ) log 1 ( ( )) + 2 m K i i i i k k k k i k j k j k j k j k C y h x y h x m m      = = = = = =  = − − − −     +       …. (2) 3.4. Evaluation and Validation: In evaluating the efficacy of our proposed method, we employ a comprehensive set of performance metrics to gauge its effectiveness across various aspects of classification. Standard metrics accuracy with a nuanced understanding of the model's performance, allowing us to assess its ability to correctly classify digits across different classes while considering aspects like true positives, false positives, and false negatives. To ensure the robustness and generalization capabilities of our methodology, we employ k-fold cross-validation. By systematically rotating through different validation sets, we obtain a more reliable estimate of the model's performance across diverse datasets and experimental settings, reducing the risk of overfitting and providing a more accurate assessment of its generalization capabilities. Through the combination of performance metrics evaluation and cross-validation, we can confidently ascertain the effectiveness and reliability of our proposed method for handwritten digit recognition tasks. Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 2 (2025) 778 https://internationalpub ls.com Through the integration of advanced ANN architectures and preprocessing techniques, our proposed method aims to achieve state-of-the-art performance in handwritten digit recognition tasks, offering a potent tool for various applications requiring accurate and efficient digit recognition systems. 4. Results The MNIST dataset, short for Modified National Institute of Standards and Technology dataset, is a widely used benchmark dataset in the field of ML and computer vision. It consists of a collection of 28x28 pixel grayscale images representing handwritten digits from 0 to 9. Originally derived from a larger dataset compiled by the National Institute of Standards and Technology, the MNIST dataset has been preprocessed and curated for ease of use in research and experimentation. It comprises 60,000 training images and 10,000 testing images, making it a standard dataset for evaluating the performance of various classification algorithms, particularly in the context of digit recognition tasks. Due to its simplicity, accessibility, and well-defined labels, the MNIST dataset serves as a fundamental resource for researchers and practitioners alike in developing and benchmarking machine learning models for handwritten digit recognition. The input image provided in Figure 1 has dimensions of 10×10 pixels. In this image, all ten digits ranging from 0 to 9 are arranged randomly, showcasing diverse handwriting styles to encompass the variability inherent in handwritten characters. This image serves as the input data for the Artificial Neural Network (ANN) during the training phase. By utilizing such a varied dataset, the ANN can learn to recognize and classify handwritten digits accurately, despite the inherent differences in writing styles. Figure 1: Visualization of Input handwritten image Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 2 (2025) 779 https://internationalpub ls.com Figure 2 illustrates the visualization of the hidden layer in the form of a 5x5 image. Each cell within this image represents a neuron within the hidden layer of the ANN. Through the training process, these neurons learn to extract and represent features from the input image, helping the network to effectively recognize and classify handwritten digits. The visualization of the hidden layer provides insight into the learned representations and how the network processes information internally. Each neuron's activation pattern within this visualization contributes to the network's ability to accurately interpret and classify handwritten digits. Figure 2: Visualization of hidden layer handwritten image Figure 3: Cost vs. iterations Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 2 (2025) 780 https://internationalpub ls.com Figure 3 depicts the relationship between the cost function and the number of iterations during the training process. As the number of iterations increases, the cost value gradually decreases, indicating that the model is learning and improving its performance over time. However, it is noteworthy that the cost value does not reach zero, despite the decreasing trend. This is primarily attributed to the presence of regularization terms incorporated into the training process. Regularization technique, L2 regularization (eqn. 2), is employed to prevent overfitting and enhance the generalization capabilities of the model. These regularization terms add a penalty to the cost function based on the complexity of the model, effectively constraining the parameter values and preventing them from becoming too large. Consequently, even as the model learns and the cost decreases, the regularization terms ensure that the cost value remains above zero. While the cost value may not converge to zero due to regularization, its decreasing trend signifies that the model is effectively learning the underlying patterns in the data and minimizing its prediction errors. This balance between minimizing the cost function and incorporating regularization terms ensures that the trained model achieves optimal performance while maintaining robustness and generalization capabilities. The dataset is split into two distinct portions: 80% of the data is allocated for training purposes, while the remaining 20% is reserved for testing the trained model's performance. During the training phase, the model undergoes iterative optimization processes, adjusting its parameters to minimize the training loss and improve its predictive capabilities. Upon completion of training, the model's accuracy on the training dataset is evaluated, resulting in an accuracy score of 95.74%. Subsequently, the model's generalization performance is assessed using the reserved testing dataset. Here, the model's accuracy is determined based on its ability to correctly classify unseen examples. The testing accuracy is calculated to be 94.51%, indicating that the trained model performs admirably well on unseen data, with a high level of accuracy comparable to its performance on the training dataset. This disparity between training and testing accuracies is a common phenomenon in machine learning and can be attributed to several factors. One such factor is overfitting, wherein the model learns to memorize the training data rather than generalize from it. Regularization techniques, such as dropout or weight decay, are often employed to mitigate overfitting and improve the model's generalization performance. Overall, the high training and testing accuracies attained by the model suggest that it has effectively learned the underlying patterns in the data and can reliably classify new instances with a high degree of accuracy. 5. Conclusion In conclusion, this paper presents an innovative approach to handwritten digit recognition, leveraging Artificial Neural Networks (ANNs) to achieve impressive accuracy levels. By Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 2 (2025) 781 https://internationalpub ls.com integrating cutting-edge ANN architectures and preprocessing techniques, our method surpasses traditional approaches, achieving a remarkable accuracy of 94.51% on the MNIST benchmark dataset. These results underscore the effectiveness of our approach in enhancing recognition accuracy and efficiency for handwritten digit recognition tasks. The findings of this study hold significant implications for various real-world applications, including postal automation, bank check processing, and digitized document management, where accurate and efficient digit recognition is crucial. By demonstrating the potential of ANNs with optimized configurations and preprocessing methods, our approach contributes to advancing the field of character recognition technology. Moving forward, further research and development in this area could lead to the development of more robust and efficient digit recognition systems, addressing the evolving needs of modern applications and industries. References 1. Rahman, ABM Ashikur, Md Bakhtiar Hasan, Sabbir Ahmed, Tasnim Ahmed, Md Hamjajul Ashmafee, Mohammad Ridwan Kabir, and Md Hasanul Kabir. "Two decades of bengali handwritten digit recognition: A survey." IEEE Access 10 (2022): 92597- 92632. 2. Madane, Vijaya, Kajal Ovhal, and Mrunali Bhong. "Handwriting recognition using artificial intelligence neural network and image processing." (2020). 3. Liu, Wenfei, Jingcheng Wei, and Qingmin Meng. "Comparisions on KNN, SVM, BP and the CNN for Handwritten Digit Recognition." In 2020 IEEE International Conference on Advances in Electrical Engineering and Computer Applications (AEECA), pp. 587-590. IEEE, 2020. 4. Chen, Min-Rong, Bi-Peng Chen, Guo-Qiang Zeng, Kang-Di Lu, and Ping Chu. "An adaptive fractional-order BP neural network based on extremal optimization for handwritten digits recognition." Neurocomputing 391 (2020): 260-272. 5. Keerthi, Thomalika. "MNIST handwritten digit recognition using machine learning." In 2022 2nd International Conference on Advance Computing and Innovative Technologies in Engineering (ICACITE), pp. 768-772. IEEE, 2022. 6. Al-wajih, Ebrahim, Rozaida Ghazali, and Yana Mazwin Mohmad Hassim. "Residual neural network vs local binary convolutional neural networks for bilingual handwritten digit recognition." In Recent Advances on Soft Computing and Data Mining: Proceedings of the Fourth International Conference on Soft Computing and Data Mining (SCDM 2020), Melaka, Malaysia, January 22–⁠ 23, 2020, pp. 25-34. Springer International Publishing, 2020. 7. Sethi, Rohan, and Ila Kaushik. "Hand written digit recognition using machine learning." In 2020 IEEE 9th International Conference on Communication Systems and Network Technologies (CSNT), pp. 49-54. IEEE, 2020. Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 2 (2025) 782 https://internationalpub ls.com 8. Shaukat, Zeeshan, Saqib Ali, Qurat ul Ain Farooq, Chuangbai Xiao, Sana Sahiba, and Allah Ditta. "Cloud-based efficient scheme for handwritten digit recognition." Multimedia Tools and Applications 79 (2020): 29537-29549. 9. Khanday, Owais Mujtaba, and Samad Dadvandipour. "Analysis of machine learning algorithms for character recognition: a case study on handwritten digit recognition." Indonesian Journal of Electrical Engineering and Computer Science 21, no. 1 (2021): 574-581. 10. Sufian, Abu, Anirudha Ghosh, Avijit Naskar, Farhana Sultana, Jaya Sil, and MM Hafizur Rahman. "Bdnet: bengali handwritten numeral digit recognition based on densely connected convolutional neural networks." Journal of King Saud University-Computer and Information Sciences 34, no. 6 (2022): 2610-2620. 11. Cherny, S. N., and R. F. Gibadullin. "The recognition of handwritten digits using neural network technology." In 2022 International Conference on Industrial Engineering, Applications and Manufacturing (ICIEAM), pp. 965-970. IEEE, 2022. 12. Zhu, Danyang, Siyuan Lu, Meiqi Wang, Jun Lin, and Zhongfeng Wang. "Efficient precision-adjustable architecture for softmax function in deep learning." IEEE Transactions on Circuits and Systems II: Express Briefs 67, no. 12 (2020): 3382-3386. 13. Kumar, P., Yadav, V., Naik, P. J., Malik, A. K., & Alaria, S. K. (2023, June). Analysis of fuzzy inventory model with sustainable transportation. In AIP Conference Proceedings (Vol. 2782, No. 1). AIP Publishing. 14. Malik, A.K., Yadav, S.K. and Yadav, S.R. (2012) Optimization Techniques, I. K International Pub. Pvt. Ltd., New Delhi. 15. Singh, Y., Arya, K., & Malik, A. K. (2014). Inventory control with soft computing techniques. International Journal of Innovative Technology and Exploring Engineering, 3(8), 80-82. 16. Tyagi, T., Kumar, S., & Malik, A. K. (2023). Fuzzy inventory system: A review on pharmaceutical and cosmetic products. Research Journal of Pharmacy and Technology, 16(7), 3494-3498. 17. Tyagi, T., Kumar, S., Malik, A. K., & Vashisth, V. (2023). A novel neuro-optimization technique for inventory models in manufacturing sectors. Journal of Computational and Cognitive Engineering, 2(3), 204-209. 18. Verma, P., Chaturvedi, B. K., & Malik, A. K. (2022). Comprehensive Analysis and Review of Particle Swarm Optimization Techniques and Inventory System. International Journal on Future Revolution in Computer Science & Communication Engineering, 8(3), 111-115. 19. Yadav, S. R., & Malik, A. K. (2014). Operations research. Oxford University Press. 20. Yadav, V., Chaturvedi, B. K., & Malik, A. K. (2022). Advantages of fuzzy techniques and applications in inventory control. International Journal on Recent Trends in Life Science and Mathematics, 9(3), 09-13.