Abstract
The Know Your Customer (KYC) and Anti Money Laundering (AML) are worldwide practices to online customer identification based on personal identification documents, similarity and liveness checking, and proof of address. To answer the basic regulation question: are you whom you say you are? The customer needs to upload valid identification documents (ID). This task imposes some computational challenges since these documents are diverse, may present different and complex backgrounds, some occlusion, partial rotation, poor quality, or damage. Advanced text and document segmentation algorithms were used to process the ID images. In this context, we investigated a method based on U-Net to detect the document edges and text regions in ID images. Besides the promising results on image segmentation, the U-Net based approach is computationally expensive for a real application, since the image segmentation is a customer device task. We propose a model optimization based on Octave Convolutions to qualify the method to situations where storage, processing, and time resources are limited, such as in mobile and robotic applications. We conducted the evaluation experiments in two new datasets CDPhotoDataset and DTDDataset, which are composed of real ID images of Brazilian documents. Our results showed that the proposed models are efficient to document segmentation tasks and portable.
Introduction
In the world of online banking and security, "Know Your Customer" (KYC) and "Anti-Money Laundering" (AML) regulations require users to upload photos of their IDs. However, these photos are often messy—taken in poor lighting, at odd angles, or against cluttered backgrounds. To extract text or verify a face, the system first needs to "segment" the document—essentially drawing a precise digital border around the ID or the text blocks. While Deep Learning models like U-Net are excellent at this, they are computationally "heavy," requiring significant memory and processing power, which often leads to laggy performance or crashes on mobile phones and embedded devices.
The researchers developed OctHU-PageScan (also referred to as FOCNN), a lightweight version of the popular U-Net architecture that uses "Octave Convolutions" to segment document images. By splitting image data into high and low spatial frequencies, the model achieves a massive 93.5% reduction in parameters and runs up to 75% faster than a standard U-Net, making it ideal for real-time ID scanning on mobile devices.
Methods: Octave Convolutions
The core innovation is the transition from standard convolutions to Octave Convolutions (OctConv). In a typical CNN, all feature maps are treated equally. However, image data contains inherent redundancy that can be exploited by separating frequency components.
- Low-frequency components: These capture the overall structure and smooth shapes of the image.
- High-frequency components: These capture fine details and sharp edges.
Octave Convolutions process these frequencies separately. The low-frequency maps are stored and processed at a lower resolution, which drastically reduces the number of required calculations. The authors integrated this "plug-and-play" unit into a U-Net-style encoder-decoder architecture. The model takes a 512x512 grayscale image as input and outputs a binary mask where the document or text regions are highlighted in white against a black background.
Datasets
The researchers introduced two new datasets specifically focused on Brazilian identification documents:
- CDPhotoDataset: 20,000 images of IDs (like driver's licenses) placed in various real-world environments with complex backgrounds, different lighting, and perspective distortions.
- DTDDataset: 10,000 images specifically labeled for text region detection (masks that cover the actual text blocks rather than the whole document).
These datasets are significant because they move away from "perfect" scans and toward the "noisy" photos actually taken by users on smartphones.
Key Results
The comparison between the standard U-Net and the proposed OctHU-PageScan is striking:
- Speedup: Inference time dropped by 75.13% on the CDPhotoDataset (from ~0.09s to ~0.02s per image).
- Model Size: The pre-trained model size was slashed from 118.3 MB to 7.7 MB.
- Parameters: Trainable parameters dropped from over 30 million to just 1.96 million (a 93.5% reduction).
- Accuracy: On the CDPhotoDataset, the Jaccard Similarity Coefficient (JCS) score only dropped from 0.99 to 0.94, maintaining high usability despite the massive compression.
While the model showed a numerical drop in precision, the qualitative results remained strong. Visually, the masks were still accurate enough for downstream tasks like OCR (Optical Character Recognition), proving that a slight loss in mathematical precision is a worthy trade-off for a 10x smaller model.
Conclusion
The OctHU-PageScan model is slightly less precise at defining sharp edges compared to the full U-Net, likely because the low-frequency processing loses some fine-grained spatial information. This can be mitigated by using a "low-cost polygon approximation algorithm" as a post-processing step to "snap" the edges into place. Future research will explore even more aggressive optimization techniques, such as Quantization and Knowledge Distillation.
Summary updated