Accurately reading handwritten digits is crucial for operations such as processing patient IDs, prescription numbers, laboratory test results, and diagnostic forms. Handwritten digit recognition is a fundamental problem in computer vision with many applications in the healthcare industry. Such numerical data transcription errors may result in misdiagnosis, delays, or inappropriate treatment. Artificial Intelligence (AI) can automate this procedure, greatly reducing human error, increasing operational efficiency, and facilitating quicker, more dependable healthcare workflows.
This study explores the use of two machine learning models for handwritten digit recognition: Visual Geometry Group 16-layer network (VGG16) and Multi-Layer Perceptron (MLP). The Modified National Institute of Standards and Technology (MNIST) dataset, a commonly used benchmark in image classification research, was used for training and testing the frameworks in this study. The MNIST dataset comprises a total of 70,000 grayscale images of handwritten digits ranging from 0 to 9, each measuring 28×28 pixels. Ten thousand of these were utilized for testing, and sixty thousand for training. The pictures are based on a wide variety of handwriting styles, which reflects the variation found in real-world situations like medical documents.
Prior to training, the dataset underwent preprocessing, including normalization to a [0,1] pixel value range to improve training stability and performance. For the MLP model, the images were flattened into one-dimensional vectors, while for VGG16, the images were resized and converted to match the model’s expected three-channel input format.
Both models were trained and evaluated using key classification metrics: accuracy, precision, recall, and F1-score. The MLP achieved a test accuracy of 98.2%, outperforming the VGG16 model, which achieved 96.9%. Although VGG16 is a deep convolutional architecture with strong feature extraction capabilities, it required significantly more computational resources, leading to longer training and inference times. In contrast, the MLP demonstrated not only superior accuracy but also higher efficiency, making it a more practical choice for deployment in resource-constrained environments such as small clinics or embedded healthcare systems.
Given these results, the MLP model was selected for deployment. A web-based Minimum Viable Product (MVP) was developed to demonstrate the model’s real-world usability. The front end was built using Next. JavaScript (Next.js) and Tailwind Cascading Style Sheets (CSS), ensuring a responsive and visually appealing user interface. The back end consisted of a lightweight Flask Application Programming Interface (API) responsible for receiving input data from the client, performing inference using the trained MLP model, and returning predictions. Users can draw digits directly in the browser and receive instant classification results, allowing for intuitive, hands-on interaction with the AI system.
The MVP, hosted at https://digit-ai-tau.vercel.app/, illustrates the potential of AI-based handwritten digits recognition to automate healthcare processes, reduce manual workloads, and enhance patient data handling accuracy. Future work will explore integrating the system with real-world healthcare management platforms, expanding it to recognize multi-character handwritten entries, and optimizing it for deployment on low-power edge devices, enabling usage in remote or under-resourced healthcare facilities.