Page Header

การรู้จำลายมือเขียนภาษาไทยด้วยการเรียนรู้เชิงลึก
Thai Handwriting Recognition Using Deep Learning

Sompong Valuvanathorn, Teerasak Sangsuwan, Nadh Ditcharoen

Abstract


การทำงานในองค์กรส่วนใหญ่มีความเกี่ยวข้องกับเอกสารที่ถูกสร้างขึ้นเป็นจำนวนมากอยู่เสมอ หนึ่งในเอกสารที่สร้างได้ง่ายและรวดเร็ว คือ เอกสารที่เขียนด้วยลายมือ แต่เอกสารลักษณะนี้โดยทั่วไปไม่ได้เป็นไฟล์ดิจิทัล ดังนั้นจึงมีข้อจำกัดในการทำระบบค้นคืนข้อมูล และงานวิจัยในเรื่องการรู้จำลายมือเขียนภาษาไทยส่วนใหญ่จะทดสอบกับพยัญชนะเพียง 44 อักขระ แต่ในความเป็นจริงตัวอักษรที่พบบนเอกสารนั้นมีรูปแบบที่แตกต่างกัน ซึ่งมีความแตกต่างกันถึง 4 ระดับ ดังนั้นจึงยากที่จะทำให้เครื่องคอมพิวเตอร์สามารถแยกแยะตัวอักษรแต่ละตัวได้อย่างถูกต้อง งานวิจัยนี้จึงได้นำเสนอการรู้จำลายมือเขียนภาษาไทยด้วยการเรียนรู้เชิงลึก โดยทดสอบกับภาพลายมือชื่อจังหวัดทั้ง 77 จังหวัด จากภาพลายมือที่มีรูปแบบการเขียนที่แตกต่างกัน 70 ตัวอย่าง ข้อมูลสำหรับการฝึกฝนและทดสอบถูกแบ่งด้วยอัตราส่วน 90 : 10 โดยพัฒนาโมเดลในการรู้จำด้วยโครงข่ายประสาทเทียมแบบสังวัตนาการร่วมกับโครงข่ายประสาทเทียมแบบวนซ้ำ LSTM แบบสองทิศทางโดยใช้ CTC Loss Function และยังเพิ่มความถูกต้องของผลลัพธ์ที่ได้โดยการประมวลผลด้วย Word Beam Search ที่การฝึกฝนจำนวน 1,000 รอบ ผลการวิจัยพบว่า โมเดลสามารถให้ค่าความถูกต้องสูงสุดเมื่อใช้ภาพความเข้มเทาเป็นข้อมูลนำเข้า ร่วมกับการคงอัตราส่วนของข้อความในภาพ โดยค่าความถูกต้องระดับคำเท่ากับ 94.99% ค่าความถูกต้องระดับอักษรที่ปรากฏในคำเท่ากับ 95.92% และเมื่อนำไปผ่านกระบวนการทำ Post-Processing ด้วย Word Beam Search ได้ค่าความถูกต้องระดับคำสูงสุดเท่ากับ 98.14% (เพิ่มขึ้น 3.15%) และในระดับอักษรสูงสุดเท่ากับ 98.40% (เพิ่มขึ้น 2.48%)

Working in most organizations often involves a large number of documents being created. One of the quickest and easiest documents to create is a handwritten document. However, these documents are generally not digitized files. Therefore, there are some disadvantages regarding the data retrieval system. Most research on handwritten recognition for the Thai language only tested 44 characters of the alphabet. However, the characters found on the documents contained different forms which consisted of 4 different levels. Therefore, it is difficult for a computer to segment each character correctly. This research proposed a Thai handwriting recognition system using deep learning by testing 77 handwritten images of provincial names in 70 different writing style samples. The data were divided into training and testing sets with the ratio of 90 : 10. The recognition model was developed by using the convolutional neural network with the 2-way LSTM recurrent neural network and CTC loss function. The accuracy of the results increased with post-processing by Word Beam Search for 1,000 epochs of training. The results showed that the highest accuracy was achieved when using the grayscale image as an input together with keeping the aspect ratio of the text. The accuracy was 94.99% in the word level and 95.92% in the character level. After the post-processing with the Word Beam Search, it was found that the highest accuracy in the word level was 98.14% (increased by 3.15%) and 98.40% (increased 2.48%) in the character level.


Keywords



[1] S. Bag and G. Harit, “A survey on optical character recognition for bangla and devanagari scripts,” Sadhana, pp. 133–168, 2013.

[2] O. Phaophanat, “Handwritten Thai character recognition using deformable wavelet descriptor,” M.E. thesis, Department of Electrical Engineering, Faculty of Engineering, King Mongkut’s University of Technology Thonburi, Bangkok, 2001 (in Thai).

[3] S. Iamsa-at and P. Horata, “Handwritten character recognition using histograms of oriented gradient features in deep learning of artificial neural network,” in Proceedings of 3rd International Conference on IT Convergence and Security, 2013, pp. 1–5.

[4] R. Khadijah and A. Nurhadiyatna, “Deep learning for handwritten javanese character recognition,” in Proceedings of 1st International Conference on Informatics and Computational Sciences, 2017, pp. 59–64.

[5] U. Pal, R. K. Roy, and F. Kimura, “Handwritten street name recognition for indian postal automation,” in Proceedings of International Conference on Document Analysis and Recognition, 2011, pp. 483–487.

[6] J. L. Mitrpanont and Y. Imprasert, “Thai handwritten character recognition using heuristic rules hybrid with neural network,” in Proceedings of 8th International Joint Conference on Computer Science and Software Engineering, 2011, pp. 160–165.

[7] Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner, “Gradient-based learning applied to document recognition,” in Proceedings of the IEEE, vol. 86, no. 11, 1998, pp. 2278–2324.

[8] S. Rathor, (2018, June 3). Simple RNN vs GRU vs LSTM: Difference lies in More Flexible control. [Online]. Available: https://medium. com/@saurabh.rathor092/simple-rnn-vs-gru-vslstm- difference-lies-in-more-flexible-control- 5f33e07b1e57

[9] R. C. Staudemeyer and E. R. Morris, Understanding LSMT – a tutorial into Long Short-Term Memory Recurrent Neural Networks. Thuringia, Germany: Schmalkalden University of Applied Sciences, 2019.

[10] B. Shi, X. Bai, and C. Yao, An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Science Text Recognition, New York, USA: Cornell University, 2015.

[11] NECTEC. (2019, March 20). 68PersonsBmp. [Online]. Available: https://thailang.nectec. or.th/best/best2019-hand writtenrecognitiontrainingset

[12] MathWorks. (2019, January 1). Rgb2Gray. [Online]. Available: https://www.mathworks. com/help/matlab/ ref/rgb2gray.htm

[13] OpenCV. (2019, January 1). Image Thresholding. [Online]. Available: https://docs.opencv.org/ master/d7/ d4d/tutorial_py_thresholding.html

[14] J. Canny, “A Computational Approach to Edge Detection,” in IEEE Transactions on Pattern Analysis and Machine Intelligence, Massachusetts, 1986, pp. 679–698.

[15] NECTEC. (2019, March 20). WD200-1, WD200- 2, WD200-3 and WD200-4. [Online]. Available: https://thailang. nectec.or.th/best/best2019- handwrittenrecognition-trainingset

[16] Z. Xu, X. Liu, and N. Ji, “Fog removal from color images using contrast limited adaptive histogram equalization,” in Proceeding of CISP2009, 2009, pp. 1–5.

[17] K. Simonyan and A. Zisserman, Very Deep Convolutional Networks for Large-Scale Image Recognition. Oxford, England: University of Oxford, 2015.

[18] T. Sangsuwan and S. Valuvanathoorn, “Thai handwritten character recognition using character line level grouping and keeping aspect ratio with convolutional neural network,” in Proceedings of NCCIT2019, 2019, pp. 383– 388 (in Thai).

Full Text: PDF

DOI: 10.14416/j.kmutnb.2024.03.003

ISSN: 2985-2145