Designing the architecture of a neural nerwork application for handwriting recognition
Artsybashev I.A., Efimenko K.N.
Donetsk National Technical University (Donetsk)
Intriduction
In the modern world, printed text is one of the main sources of information and knowledge. However, it is not always possible or convenient to work with printed documents in their original form. To convert printed or handwritten text into a digital format, special detection and recognition technologies (Optical Character Recognition, OCR) must be used. These technologies allow for the automatic identification of boundaries and content of text blocks in an image, and convert text images into a machine-readable format. Thus, OCR technologies facilitate the storage, search, editing, and analysis of handwritten text [1-2].
However, existing OCR technologies have a number of limitations and drawbacks. Firstly, they often cannot correctly process low-quality images containing noise, distortion, or uneven lighting. Secondly, they are not always adapted to different languages, fonts, and handwriting styles. Thirdly, they do not consider the context and semantics of the text, which may lead to errors or ambiguity in recognition [2].
The purpose of this paper is to review the design of the architecture of a neural network application for handwriting recognition. The design includes a neural network model, a use case diagram, a component diagram, and a class diagram. Handwriting recognition is a non-invasive identification system that performs recognition faster than other systems, as several text areas can be analyzed simultaneously.
Neural Network Architecture Model
In Figure 1, the first element is an image of handwritten text uploaded to the network, with a width and height of 300 pixels, making the total number of pixels 90,000. The second element is the convolutional layer, from which the name of this neural network architecture originates. The first convolutional layer consists of 32 maps of size 300 х 300, equal to the image size. Each convolutional layer map has a synaptic kernel size of 3 х 3.
Following the convolutional layer is the third element of the model — a subsampling layer consisting of 64 maps, each half the size: 150 х 150.
The convolutional and subsampling layers alternate. The second convolutional layer has 64 maps of 150 х 150 with a kernel size of 4 х 3. This is followed by the second subsampling layer with 128 maps sized 75 х 75. The model also includes a third layer: the convolutional layer has 128 maps of 75 х 75 with a kernel size of 3 х 3, and the subsampling layer has 256 maps sized 37 х 37.
After the final subsampling layer comes a fully connected layer consisting of the first layer of 512 neurons connected to the output layer, which has 74 neurons representing printed characters.
Image 1 – Neural network model
Use-case diagram
At the next stage, the functionality of the developed application is designed. The available functionality is shown using a UML use case diagram, presented in Figure 2 [3].
From this diagram, we see that in order to train the model, the user first needs to collect training data, then normalize it, and based on this data — train the neural network. After training, the user can view the training progress, evaluate performance, and save the neural network weights.
For testing, the user needs to collect test data, normalize it, and load the weights of the trained neural network. Based on this, the user can test the network and view the testing performance.
Additionally, the user can launch the neural network program, upload an image, and recognize printed text from it, or trigger the training or testing modules.
Component diagram
The component diagram (Figure 3) provides a visualization of the program system’s source code structure, specifications of the executable version, and ensures code reusability [4].
From the diagram, we observe that the code structure is interconnected: the developer must first train the neural network using a pre-prepared dataset, then test it and display the results, release the program, and deliver it to the client. The user, in turn, uploads an image, starts the recognition process, and receives the result from the neural network.
Class diagram
A class diagram is a structural UML modeling diagram that demonstrates the overall structure and hierarchy of the system’s classes, their interactions, attributes (fields), methods, interfaces, and relationships. Figure 4 shows the class diagram for the developed product [5].
Image 2 – UML use-case diagram
Image 3 – UML component diagram
The user must have a training image database and a testing image database. Available operations include: training, uploading an image, and recognition. The user can also interact with the Image and Weights classes.
The Image class includes attributes such as size and format. The Weights class includes convolution weights, pooling weights, and fully connected layer weights.
The Training class includes: images, class labels, and weights. It also has operations like convolution, error matrix computation, weight update, image loading, and weight export. This class interacts with the Image Loader, Image, and Weights classes.
The Recognition class includes: image and weights. Its operations are convolution, recognition, and weight loading. It also interacts with Image Loader, Image, and Weights.
The Image Loader class includes: image and image name as attributes, and an operation to load the image. It interacts with the Image class.
Image 4 – UML class diagram
Conclusion
This paper reviewed aspects of designing the architecture of a neural network application for handwriting recognition. The design was presented through the following models:
- neural network model;
- use case diagram;
- component diagram;
- class diagram.
Based on the conducted work, the goal stated in this paper (reviewing the designed architecture of the handwriting recognition application) has been achieved.
The results obtained are planned to be transferred from the design stage to practical implementation to create a neural network application for handwriting recognition.
Literature
- Гренандер, У. Лекции по теории образов (Том 2. Анализ образов) / У. Гренандер. – Москва: [не указано], 2016. – 342 c.
- Гренандер, У. Лекции по теории образов (Том 3. Регулярные структуры) / У. Гренандер. – Москва: [не указано], 2012. – 432 c.
- Дударев, В. А. Методы распознавания образов в компьютерном конструировании неорганических соединений / В.А. Дударев. – Москва: Синергия, 2014. – 325 c.
- Елисеева, И. И. Группировка, корреляция, распознавание образов (статистические методы классификации и измерения связей) / И.И. Елисеева, В.О. Рукавишников. – Москва: РГГУ, 2014. – 144 c.
- Емельянов, С.В. Информационные технологии и вычислительные системы. Вычислительные системы. Компьютерная графика. Распознавание образов / Математическое моделирование / С.В. Емельянов. – Москва: Мир, 2015. – 662 c.