Optical Character Recognition (OCR) systems extract information from document images such as national identity cards (NICs) and driving licences. In Sri Lanka, NICs issued before 2014 are handwritten, so most cards still in use are handwritten, and their digital images are typically captured by owners on mobile phones and other handheld devices. These images contain glare, shadows, complex background structures and the horizontal ruled lines printed on the card. Even after standard OCR pre-processing steps such as cropping, glare removal, de-skewing and binarisation, residual background noise and corrupted characters remain, and because NIC images are small the noise density is high, degrading text detection and recognition.
This project develops a multi-step noise removal method tailored to such images. Ruled lines are first removed using adaptive thresholding and morphological erosion and dilation with a horizontal structuring element, after which the extracted lines are subtracted from the image. Background noise is then reduced with a fuzzy logic-based filter followed by binarisation, and finally by a learned denoiser. Two integrated models were developed and compared: Model 1 combines fuzzy filtering with a Conditional Generative Adversarial Network (CGAN), and Model 2 combines fuzzy filtering with a denoising autoencoder, both trained on synthetically corrupted NIC images.
The models were trained and evaluated on 5,000 Sri Lankan NIC images obtained from a company under a data-sharing agreement, using an 80:20 train-test split on Google Colab TPUs, with mean PSNR and RMSE as the primary metrics. The standalone autoencoder achieved a mean PSNR of 23.32 (RMSE 0.07), rising to 24.12 when integrated with the fuzzy filter, a 3.4% improvement. The standalone CGAN achieved 22.29 (RMSE 0.09), while the integrated CGAN and fuzzy filter model reached the highest mean PSNR of 25.36, a 13.8% improvement. The integrated CGAN–fuzzy model was therefore proposed as the high-performance background noise removal method. The ruled line removal stage produced promising results on clean ruled documents, although on real NIC images only some line fragments were detected because the lines are less uniform and affected by glare and blur.
Integrated Fuzzy–CGAN Denoiser
A background noise removal model that combines fuzzy logic-based filtering with a conditional GAN, achieving the best PSNR on NIC images and directly applicable to OCR pre-processing.
Comparative Evaluation of Integrated Models
A systematic comparison of fuzzy filtering integrated with a CGAN versus a denoising autoencoder, using PSNR and RMSE on a real-world NIC dataset.
Ruled Line Noise Removal
A morphology-based technique using adaptive thresholding and horizontal structuring elements to extract and subtract ruled lines from document images before background denoising.
By producing cleaner NIC images, the method improves the input quality for Sri Lankan NIC information extraction systems and can be applied to noise removal in OCR systems more broadly, including for languages such as Sinhala and Tamil where OCR tooling is limited. A paper on the background noise removal method, "High Performance Background Noise Removal Method for OCR Systems", was prepared for the Moratuwa Engineering Research Conference (MERCon) 2022.
Project poster: Background and Ruled Line Noise Removal for SL NIC Recognition System
Overall architecture: ruled line removal, fuzzy filtering, binarisation and GAN/autoencoder denoising
C.C.H.P.E.R. Siriwardena
Undergraduate Researcher
Contributed to the development and evaluation of the background and ruled line noise removal pipeline for NIC images.
T.G.V.S.H. Kumara
Undergraduate Researcher
Contributed to the development and evaluation of the background and ruled line noise removal pipeline for NIC images.
N.G.S. Anjana
Undergraduate Researcher
Contributed to the development and evaluation of the background and ruled line noise removal pipeline for NIC images.