completed Jan 2021 - May 2022

Background and Ruled Line Noise Removal for Sri Lankan NIC Recognition Systems

#Computer Vision #Image Denoising #OCR #Generative Adversarial Networks #Autoencoders #Fuzzy Logic
Background and Ruled Line Noise Removal for Sri Lankan NIC Recognition Systems

Overview

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.

Motivation & Objectives

Noisy, low-quality NIC images undermine OCR-based digitisation, and conventional image processing filters cannot recover the overlapping and corrupted characters found in small, densely noisy cards. The research question was how to improve the quality of NIC images taken with handheld devices by adopting high-performance background and ruled line noise removal. The objectives were:

High-Performance Denoising Models – To develop models that can remove dense background noise from NIC images by integrating fuzzy logic filtering with machine learning denoisers.

Model Evaluation – To evaluate the developed models and identify the better approach for background noise removal.

Ruled Line Removal – To develop a method that effectively removes ruled line noise as a step prior to background noise removal.

Impact & Results

Performance

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.

Key Contributions

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.

Real-world Impact

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.

Gallery

Project poster: Background and Ruled Line Noise Removal for SL NIC Recognition System

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

Overall architecture: ruled line removal, fuzzy filtering, binarisation and GAN/autoencoder denoising

Resources

Project Team

C

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

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

N.G.S. Anjana

Undergraduate Researcher

Contributed to the development and evaluation of the background and ruled line noise removal pipeline for NIC images.