journal article·2025-04-29Open access

Automated Redaction of Personally Identifiable Information on Drug Labels Using Optical Character Recognition and Large Language Models for Compliance with Thailand’s Personal Data Protection Act

Parinya Thetbanthad, Benjaporn Sathanarugsawait, Prasong Praneetpolgrang

Applied Sciences· Volume 15· Issue 9

Abstract

The rapid proliferation of artificial intelligence (AI) across various industries presents both opportunities and challenges, particularly concerning personal data privacy. With the enforcement of regulations like Thailand’s Personal Data Protection Act (PDPA), organizations face increasing pressure to protect sensitive information found in diverse data sources, including product and shipping labels. These labels, often processed by AI systems for logistics and inventory management, frequently contain Personally Identifiable Information (PII). This paper introduces a novel AI-driven system for automated PII redaction on label images, specifically designed to facilitate PDPA compliance. Our system employs a two-stage pipeline: (1) text extraction using a combination of EasyOCR and Tesseract OCR engines, maximizing recall for both Thai and English text; and (2) intelligent redaction using a pre-trained large language model (LLM), Qwen (Qwen/Qwen2.5-72B-Instruct-AWQ), prompted to identify and classify text segments as PII or non-PII based on simplified PDPA guidelines. Identified PII is then automatically redacted via black masking. We evaluated our system on a dataset of 100 drug label images, achieving a redaction precision of 92.5%, a recall of 83.2%, and an F1-score of 87.6%, with an over-redaction rate of 3.1%. These results demonstrate the system’s effectiveness in accurately redacting PII while preserving the utility of non-sensitive label information. This research contributes a practical, scalable solution for automated PDPA compliance in AI-driven label processing, mitigating privacy risks and promoting responsible AI adoption.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Artificial Intelligence in Law · Imbalanced Data Classification Techniques · Vehicle License Plate Recognition

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

School of Information Technology, Sripatum University, Bangkok 10900, Thailand

References (25)

Show source-provided references
1. Russell, S.J., and Norvig, P. (2016). Artificial Intelligence: A Modern Approach, Pearson. [3rd ed.].
2. Voigt, P., and von dem Bussche, A. (2017). The EU General Data Protection Regulation (GDPR): A Practical Guide, Springer International Publishing.10.1007/978-3-319-57959-7 ↗
3. European Union Regulations on Algorithmic Decision-Making and a “Right to Explanation”
4. Ministry of Digital Economy and Society (2025, February 14). Personal Data Protection Act B.E. 2562, Available online: https://mdes.go.th/law/detail/3577-Personal-Data-Protection-Act-B-E--2562--2019-.
5. Greenleaf, G. Global Data Privacy Laws 2019: 132 National Laws & Many Bills, Privacy Laws & Business International Report.
6. Gartner Inc (2025, April 11). Gartner Forecasts Worldwide Government IT Spending to Grow 8% in 2023. Available online: https://www.gartner.com/en/newsroom/press-releases/2023-05-24-gartner-forecasts-worldwide-government-it-spending-to-grow-8-percent-in-2023.
7. De-identification for Privacy Protection in Multimedia Content: A Survey10.1016/j.image.2016.05.020 ↗
8. Yang, A., Yang, B., Zhang, B., Hui, B., Zheng, B., Yu, B., Li, C., Liu, D., Huang, F., and Wei, H. (2024). Qwen2.5 Technical Report. Version 1. arXiv.
9. Jaided AI (2025, April 11). EasyOCR. Available online: https://github.com/JaidedAI/EasyOCR.
10. Smith, R. (2007, January 23–26). An Overview of the Tesseract OCR Engine. Proceedings of the Ninth International Conference on Document Analysis and Recognition (ICDAR 2007), Curitiba, Brazil.10.1109/ICDAR.2007.4376991 ↗
11. Lison, P., Pilán, I., Sánchez, D., Batet, M., and ∅vrelid, L. (2021, January 1–6). Anonymisation Models for Text Data: State of the Art, Challenges and Future Directions. Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), Online.10.18653/v1/2021.acl-long.323 ↗
12. Adaptive Dewarping of Severely Warped Camera-Captured Document Images Based on Document Map Generation10.1007/s10032-022-00425-4 ↗
13. Improving Robustness of License Plates Automatic Recognition in Natural Scenes10.1109/TITS.2022.3151475 ↗
14. Nohlen, H., Bakogianni, I., Grammatikaki, E., Ciriolo, E., Pantazi, M., Dias, J., Salesse, F., Moz Christofoletti, M., Wollgast, J., and Bruns, H. (2022). Front-of-Pack Nutrition Labelling Schemes: An Update of the Evidence, Publications Office of the European Union. JRC Technical Report JRC130125.
15. Chamchong, R., Saisangchan, U., and Pawara, P. (2021, January 12–16). Thai Handwritten Recognition on BEST2019 Datasets Using Deep Learning. Proceedings of the International Conference on Multi-Disciplinary Trends in Artificial Intelligence, Pattaya, Thailand.10.1007/978-3-030-80253-0_14 ↗
16. Privacy Preservation through Facial De-identification with Simultaneous Emotion Preservation10.1007/s11760-020-01819-9 ↗
17. K-anonymity: A model for protecting privacy10.1142/S0218488502001648 ↗
18. Iterative local search for preserving data privacy10.1007/s10489-024-05909-w ↗
19. The Algorithmic Foundations of Differential Privacy10.1561/0400000042 ↗
20. Ranzato, M., Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J.W. (2021, January 6–14). Deep Learning with Label Differential Privacy. Proceedings of the Advances in Neural Information Processing Systems 34 (NeurIPS 2021), Online.
21. Bonta, R. (2025, April 11). California Consumer Privacy Act (CCPA). State of California Department of Justice, Office of the Attorney General, Available online: https://oag.ca.gov/privacy/ccpa.
22. Artificial Intelligence and the Value of Transparency10.1007/s00146-020-01066-z ↗
23. Chalkidis, I., Fergadiotis, M., Malakasiotis, P., Aletras, N., and Androutsopoulos, I. (2020, January 16–20). LEGAL-BERT: The Muppets Straight Out of Law School. Proceedings of the Findings of the Association for Computational Linguistics: EMNLP, Online.10.18653/v1/2020.findings-emnlp.261 ↗
24. BerriAI (2025, April 11). LiteLLM. Available online: https://github.com/BerriAI/litellm.
25. OpenCV Team (2025, April 11). Open Source Computer Vision Library. Available online: https://opencv.org.