Certificate number identification system based on efficient ultra-lightweight convolutional attention network
By using an efficient and ultra-lightweight convolutional attention network, combined with a lightweight backbone network and attention mechanism, the computational complexity and storage resource occupation problems of ID number recognition on embedded devices are solved, achieving efficient and accurate ID number recognition.
Patent Information
- Application Number
- CN202510773327.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-09-12
AI Technical Summary
Existing OCR systems have difficulty in efficiently recognizing ID numbers on embedded devices. They have problems with high computational complexity and large storage resource usage, and the recognition accuracy of traditional lightweight models is insufficient.
It adopts an efficient and ultra-lightweight convolutional attention network, including an ID number detection module, an identification feature extraction module, and an identification sequence transcription module. It uses a lightweight backbone network MobileNetV3, a residual FPN structure, a dense simplified convolutional attention module, and a dual dimensionality reduction block, combined with an attention mechanism for feature extraction and sequence transcription.
While ensuring recognition accuracy, it significantly reduces the number of model parameters and computing resource consumption, meets the deployment requirements of embedded devices, and achieves fast and accurate document number recognition.
Smart Images

Figure CN120635932A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an ID number recognition system based on an efficient and ultra-lightweight convolutional attention network. Background Art
[0002] In the digital information age, with the widespread adoption of various internet applications and government and enterprise business systems, the importance of intelligent identity authentication models is becoming increasingly prominent. Whether verifying identity for online services or handling offline transactions, accurate and efficient entry and recognition of user identity information is required. Traditionally, this information has been manually entered, a time-consuming and labor-intensive process prone to errors and subsequent complications. Therefore, designing a method that can quickly and accurately identify key information from ID images, thereby reducing the burden of manual entry and improving recognition efficiency, has become a hot topic in character recognition research.
[0003] In recent years, optical character recognition (OCR) has made significant progress in document recognition and has become widely used in embedded devices such as barcode scanners and scanners. Through image processing and pattern recognition algorithms, OCR technology can convert text information on document images into a computer-processable text format, greatly improving the efficiency of information entry. However, due to the limited computing and storage resources of embedded devices, traditional OCR systems are often difficult to deploy directly on these devices. To meet the needs of embedded devices, researchers have been forced to adopt lightweight models to replace state-of-the-art methods. However, how to reduce model complexity and memory usage while maintaining recognition accuracy remains a challenge in current research. Summary of the Invention
[0004] The present invention provides an ID number recognition system based on an efficient and ultra-lightweight convolutional attention network to solve the above technical problems.
[0005] To solve the above technical problems, the present invention provides an ID number recognition system based on an efficient and ultra-lightweight convolutional attention network, which includes an ID number detection module, a recognition feature extraction module and a recognition sequence transcription module.
[0006] The ID number detection module sequentially includes a backbone network, a neck network, a prediction head, and a differentiable binarization module. The ID image is input into the backbone network to output a feature map. The neck network generates a multi-scale feature map. The spliced multi-scale feature map is input into the prediction head to obtain a probability map and a threshold map. The probability map and threshold map are generated into an approximate binary map by the differentiable binarization module, and the detection result is output.
[0007] The recognition feature extraction module includes an initial module, a dense simplified convolutional attention module, and a dual dimensionality reduction block. The initial module includes a convolution layer and an average pooling layer. The dense simplified convolutional attention module is divided into three groups, each group containing a number of dense simplified convolutional attention modules. The dual dimensionality reduction block is used to reduce the number of channels and spatially downsample the feature map.
[0008] The recognition sequence transcription module includes a circulation layer and a transcription layer. The circulation layer is used to perform time series modeling on the feature sequence extracted by the recognition feature extraction module, and the transcription layer is used to map the input features to a specific output space.
[0009] Preferably, the document number detection module adopts a text detection network DBNet.
[0010] Preferably, the backbone network adopts a lightweight backbone network MobileNetV3, and the neck network replaces the convolutional layer in the FPN structure of DBNet with an RSEConv layer with a residual channel attention structure through a residual FPN structure.
[0011] Preferably, the convolution kernel size of the convolution layer of the initial module is 3×3.
[0012] Preferably, the number of dense simplified convolutional attention modules in the three groups of dense simplified convolutional attention modules is 1, 3, and 6 respectively; each dense simplified convolutional attention module introduces a direct connection from the current layer to all subsequent layers.
[0013] Preferably, the dense simplified convolution attention module includes an efficient bottleneck convolution block and a simplified channel attention module, and the efficient bottleneck convolution block sequentially uses 1×1 convolution and 3×3 convolution to reduce the dimension of the input channel.
[0014] Preferably, the simplified channel attention module first performs a global average pooling operation, then passes the obtained global features of each channel through two 1×1 two-dimensional convolutional layers, and then applies a Sigmoid activation function to the output of the second convolutional layer, normalizing the weight of each channel to the [0,1] interval to obtain the attention weight Z of each channel; the obtained attention weight Z is applied to the input feature Figure X Each channel is weighted.
[0015] Preferably, the calculation formula of the global average pooling operation is:
[0016]
[0017] Where, C is the number of channels, H and W are the height and width of the feature map respectively. c = 0, 1, ..., C-1, h is the index in the height direction, ranging from 0 to H-1, and w is the index in the width direction, ranging from 0 to W-1.
[0018] Preferably, the dual dimensionality reduction block includes a 1×1 convolutional layer and a 2×2 average pooling layer.
[0019] Preferably, the recurrent layer includes a dropout layer and two linear layers; and the transcription layer adopts a connection temporal classification algorithm.
[0020] Compared with the existing technology, the ID number recognition system based on the efficient and ultra-lightweight convolutional attention network provided by the present invention has the following advantages:
[0021] 1. This paper adopts an efficient and innovative encoder-decoder architecture. The encoder adopts a lightweight architecture and recognition feature extraction module with attention mechanism, which includes dense simplified convolution attention module and dual dimensionality reduction block, so as to capture information of different scales in feature maps and achieve lightweight.
[0022] 2. The present invention can effectively reduce the number of model parameters while ensuring high performance of the feature extraction process, and fully meets the standards of lightweight models and the requirements of deployment-level models. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is a flowchart of a document number recognition system based on an efficient and ultra-lightweight convolutional attention network in a specific embodiment of the present invention;
[0024] Figure 2 This is a diagram of the FPN structure of the neck network in a specific embodiment of the present invention;
[0025] Figure 3 A network structure diagram of an identification feature extraction module in a specific embodiment of the present invention;
[0026] Figure 4 This is a network structure diagram of a densely simplified convolutional attention module in a specific embodiment of the present invention;
[0027] Figure 5 This is a network structure diagram of an efficient bottleneck convolution block in a specific embodiment of the present invention;
[0028] Figure 6 This is a simplified network structure diagram of the channel attention module in a specific embodiment of the present invention;
[0029] Figure 7 This is a network structure diagram of a double dimensionality reduction block in a specific embodiment of the present invention;
[0030] Figure 8A network structure diagram of a sequence transcription module for identifying a sequence in a specific embodiment of the present invention;
[0031] Figure 9 This is a flowchart of deploying a specific embodiment of the present invention on the RK3588S2 development board;
[0032] Figure 10 This is a diagram of the reasoning steps of a specific embodiment of the present invention on the RK3588S2 development board;
[0033] Figure 11 These are some examples from the BDCI dataset;
[0034] Figure 12 Some examples of the SUST dataset;
[0035] Figure 13 A schematic diagram of a method for calculating the number of errors in document number recognition errors;
[0036] Figure 14 This is a schematic diagram of the recognition effect after a specific embodiment of the present invention is deployed on the RK3588S2 platform. DETAILED DESCRIPTION
[0037] In order to describe the technical solution of the above invention in more detail, specific embodiments are listed below to demonstrate the technical effects; it should be emphasized that these embodiments are used to illustrate the present invention and are not used to limit the scope of the present invention.
[0038] The document number recognition system based on the Efficient Ultra Lightweight Convolutional Attention Network (EULCAN) provided by the present invention is as follows: Figure 1 As shown, it includes a document number detection module, a recognition feature extraction module and a recognition sequence transcription module, wherein:
[0039] The ID number detection module includes a backbone network, a neck network, a prediction head and a differentiable binarization module in sequence. The ID image is input into the backbone network to output a feature map {C1, C2, C3, C4}. The multi-scale feature map {P2, P3, P4} is obtained through the neck network. The spliced multi-scale feature map is input into the prediction head to obtain a probability map and a threshold map. The probability map and threshold map are generated into an approximate binary map through the differentiable binarization module, and the detection result is output.
[0040] The recognition feature extraction module includes an initial module (Stem), a dense simplified convolutional attention module (DSCAM) and a dual dimensionality reduction block (DDRB). The initial module includes a convolution layer and an average pooling layer; the dense simplified convolutional attention module is divided into three groups, each group containing a number of dense simplified convolutional attention modules; the dual dimensionality reduction block is used to reduce the number of channels and spatially downsample the feature map.
[0041] The recognition sequence transcription module includes a circulation layer and a transcription layer. The circulation layer is used to perform time series modeling on the feature sequence extracted by the recognition feature extraction module, and the transcription layer is used to map the input features to a specific output space.
[0042] The present invention adopts an efficient and innovative encoding-decoding architecture. The encoder adopts a lightweight architecture and recognition feature extraction module with attention mechanism, which includes a dense simplified convolution attention module and a double dimensionality reduction block, enabling the system to capture information of different scales in the feature map and achieve lightweight.
[0043] In some embodiments, please refer to Figure 1 The overall process of the system provided by the present invention is as follows: first, the detection image (document image) is input into the backbone network MoblieNetV3 to obtain the feature map {C1, C2, C3, C4}. The obtained feature map is passed through the RES-FPN feature pyramid and upsampled to obtain the multi-scale feature map {P2, P3, P4}, which are upsampled to 1 / 4 of the original image for splicing. The spliced multi-scale feature map is input into the prediction head to obtain the probability map and threshold map. DB calculation is performed based on the probability map and threshold map to generate an approximate binary map, and the detection result is finally output; then the detected image is input into the recognition feature extraction module for feature extraction, and the output feature map is input into the recognition sequence transcription module; the recognition sequence transcription module outputs the recognition result.
[0044] In some embodiments, the ID number detection module can utilize a lightweight and improved text detection network, DBNet, for detection. Traditional text detection methods typically utilize binarization as a post-processing step, separate from network training. However, the DBNet employed in this application integrates the binarization process into network training, enabling the network to adaptively learn a more appropriate binarization threshold, thereby improving detection accuracy. This detection network primarily consists of a backbone network, a neck network, and a differentiable binarization module.
[0045] The backbone network can use the lightweight backbone network MobileNetV3. The neck network uses a residual FPN structure to replace the convolutional layer in the FPN of DBNet with the RSEConv layer with a residual channel attention structure. Figure 2 As shown in Figure 2, RSEConv consists of two parts: SEblock and residual structure, which improve the representation capability of feature maps and further enhance text detection performance. The differentiable binarization module performs pixel-by-pixel comparisons between the probability map and the threshold map to achieve binarization and output the inference results during the inference phase.
[0046] In some embodiments, the recognition feature extraction module of the EULCAN network proposed in this application is as follows: Figure 3As shown, it is used to extract key information from the input image and finally represent it as a vector of fixed length.
[0047] For the initial module in the recognition feature extraction module, in the document character recognition scenario, the characters in the image present various characteristics, such as uneven length and width, and may also be blurred and worn. This poses a great challenge to the convolutional neural network (CNN) that undertakes the feature extraction task, so the selection of the initial convolution layer is particularly important. This application uses a 3×3 convolution layer as the initial detailed feature extraction module. At the same time, batch normalization, activation operation, and pooling operation are added after the convolution operation. Assume that the size of the input image is
[0048] P i =AvgPool(ReLU(BN(Conv(X,K i )))) (1)
[0049] in, K i is the convolution kernel, Conv represents the convolution operation, BN represents the batch normalization operation, ReLU represents the ReLU function in the activation operation, and AvgPool represents the average pooling operation.
[0050] In order to solve the problems of insufficient feature extraction, weak response of key features and large overall network computation in the existing recognition network in the document number recognition task, this application designs a dense simplified convolutional attention module (DSCAM) to improve the feature extraction performance of the entire network. This block combines DenseNet, efficient bottleneck convolution block (EBCB) and simplified channel attention module (SCAB). Figure 3 As shown, the network has three groups of DSCAMs, each group contains a different number of DSCAM modules, in this embodiment, 1, 3, and 6 respectively.
[0051] Take the second set of DSCAM as an example, Figure 4 To further improve the information flow between layers, a direct connection from the current layer to all subsequent layers is introduced between each DSCAM. The input of the first layer is the concatenation of the feature maps of all previous layers, and the number of feature maps in each layer is x1, x2, ..., x l-1 , then the number of input feature maps of layer l can be expressed as:
[0052] x l =H l ([x1,x2,…,x l-1 ]) (2)
[0053] Among them, [x1,x2,…,x l-1] means connecting the feature maps of the previous l-1 layers in the channel dimension, H l () is the nonlinear transformation function of the lth layer, which is composed of BN, ReLU and Conv.
[0054] In some embodiments, the EBCB structure is as follows Figure 5 As shown in the figure, its core design concept is to balance computational complexity and feature expression capabilities, thereby significantly reducing computing resource consumption while ensuring model performance. This module sequentially uses 1×1 convolution and 3×3 convolution to reduce the dimensionality of the input channels. First, 1×1 convolution is used to reduce the dimensionality of the input channels. Compared to directly using 3×3 convolution to process the channels, this can effectively reduce the amount of computation and the number of parameters. Furthermore, 1×1 convolution is essentially a linear combination of channels, which does not increase model complexity.
[0055] In some embodiments, the structure of SCAB is as follows Figure 6 As shown in the figure, the attention mechanism is an important technology that simulates the human attention process. It enables the model to focus on key parts of the input image and dynamically adjust the weights of the input image features, thereby improving the model's performance and generalization ability. SCAB is a convolution-based channel attention mechanism. Its core idea is to allow the model to automatically learn the importance of each channel. By weighting the channels of the input feature map, it enhances the feature expression of important channels, allowing the model to pay more attention to the more important feature information in the input data.
[0056] Specifically, the SCAB attention mechanism first operates through an AdaptiveAvgPool (AAP) to Figure X Perform a global average pooling operation to aggregate the spatial information of each channel into a scalar, thereby obtaining the global features of each channel. The features can be expressed by the AAP formula:
[0057]
[0058] Where, C is the number of channels, H and W are the height and width of the feature map respectively. c = 0, 1, ..., C-1, h is the index in the height direction, ranging from 0 to H-1, and w is the index in the width direction, ranging from 0 to W-1.
[0059] The global features of each channel obtained above are then passed through two 1×1 two-dimensional convolutional layers, which implement specific feature transformations. Channels are first compressed to achieve linear combinations, and then restored to their original dimensions to complete the low-dimensional to high-dimensional mapping, thereby extracting channel correlation information and preserving spatial features. A sigmoid activation function is then applied to the output of the second convolutional layer, normalizing the weights of each channel to the range [0, 1] to obtain the attention weight Z for each channel. This improves the model's selectivity and expressiveness of features. The formula is:
[0060] Z = Sigmoid(Conv(ReLU(Conv(Y (c,0,0) ,K i )))) (4)
[0061] where Y (c,0,0) is the output of the adaptive average pooling layer, K i is the convolution kernel size, Conv represents the convolution operation, BN represents the batch normalization operation, ReLU and Sigmoid represent the activation function. Finally, the obtained attention weight Z is applied to the input feature Figure X Each channel is weighted. The formula is as follows:
[0062]
[0063] Wherein, c = 1, ..., C, i = 1, ..., H, j = 1, ..., W. The above operation realizes adaptive adjustment of features.
[0064] In order to avoid the excessive amount of computation caused by the increasing number of channels in the previous set of DSCAM, this application uses a dual dimensionality reduction block (DDRB) to reduce the network dimension. The structure of DDRB is as follows Figure 7 As shown in the figure, it consists of a 1×1 convolutional layer and a 2×2 average pooling layer. The 1×1 convolutional layer initially adjusts the number of feature channels, achieving channel dimensionality reduction; the subsequent 2×2 average pooling layer further spatially downsamples the feature maps. Through this combination, DDRB effectively reduces the network's computational complexity and parameter count. While reducing the model burden, it also achieves a certain degree of feature selection and compression, extracting more representative and important features, facilitating the entry of feature channels into the next DSCAM. The formula is as follows:
[0065] DDRB(x)=AvgPool(Conv(ReLU(BN(x)))) (6)
[0066] In the text recognition algorithm, the image feature map output by the recognition feature extraction module is converted into a representation suitable for sequence modeling, mapping the two-dimensional image features into a one-dimensional feature sequence. The resulting feature sequence is then transcribed into the final text sequence.
[0067] like Figure 1 As shown in FIG, the recognition sequence transcription module is divided into two parts: a circulation layer and a transcription layer. Figure 8 As shown in the figure, the recurrent layer is responsible for temporal modeling of the feature sequence extracted by the convolutional layer. In this way, the recurrent layer can effectively capture the contextual information in the sequence, thereby more accurately predicting the category of each character and laying the foundation for subsequent processing. In the EULCAN network, the recurrent layer consists of a dropout layer and two linear layers, primarily used to map input features to a specific output space. To significantly reduce the computational complexity and parameter count of the recurrent layer, an FC layer is used to process the output features of the recognition feature extraction module. First, Dropout is used to prevent overfitting. The FC layer performs feature transformation and dimensionality adjustment, expanding the features output by the recognition feature extraction module to make them more suitable for subsequent classification prediction tasks.
[0068] After the feature sequence obtained in the circulation layer, it enters the transcription layer. The transcription layer uses the CTC algorithm. This technology introduces blank characters, which effectively solves the problem of the network obtaining the predicted label sequence Y=y1,y2,…,y t The problem of misalignment with the actual image labels. When performing dictionary-free transcription, the CTC algorithm usually relies on the optimal path strategy. The core of this strategy is to find a string path with the highest probability and output the corresponding sequence of this path as the optimal sequence. The calculation formula is as follows:
[0069]
[0070] Where p(a|Y) is the probability of any possible output path a, The output label at time t is a t When the label sequence a with the maximum probability is found, repeated characters and blank characters are removed by mapping β, and the recognition label L is finally obtained. * .
[0071] To comprehensively evaluate the system's feasibility and performance in real-world engineering scenarios, this application deployed the model on an embedded hardware platform for experimental verification. The embedded device used for model deployment, the RK3588S2, is a chip developed by Rockchip Microelectronics specifically for AI terminal inference. This device integrates a quad-core Cortex-A76 plus a quad-core Cortex-A55, an octa-core CPU, a powerful Arm high-performance GPU, and a built-in NPU neural network processor with 6T computing power. It can be used for lightweight AI applications.
[0072] First, the document number dataset is constructed on the PC side, and the network models of the document number detection module and the recognition feature extraction module are trained and optimized, and the trained models are ported to the embedded device. The model framework required for deployment is RKNN (Rockchip Neural Network). The experiment converts the PyTorch model trained on the PC side into the ONNX model format, and then uses the RKNN tool chain provided by Rockchip to further convert the ONNX model into an RKNN model that can be deployed on the Rockchip platform. The model is deployed and applied by writing inference code. The model deployment process on the RK3588S2 development board is as follows: Figure 9 As shown, after the model deployment is completed, Figure 10 The inference steps of the model on the RK3588S2 development board are shown.
[0073] In order to verify the performance of the model on document images, this application uses two document image datasets for testing and verification, including a public document dataset BDCI and a self-collected document dataset SUST.
[0074] This application first conducts an experimental analysis of the system's parameters and structure; then compares the performance of the proposed system with other recognition methods to verify the accuracy and lightweightness of this application in the document data set. The experimental environment configuration of this application is shown in Table 1:
[0075] Table 1 Experimental environment configuration
[0076] name Configuration information operating system Ubuntu 20.04 Development language Python 3.9.0 frame Pytorch2.2.1+Cuda11.8 CPU Intel 5th generation 12400f GPU RTX4060Ti Memory 8GB
[0077] The BDCI dataset, based on images from the 2019 China Computer Federation Big Data & Computing Intelligence Contest (CCF BDCI), consists of 10,000 ID card photos, annotated using PaddleLabel, a semi-automatic annotation tool within PaddleOCR. The 10,000 ID card images were divided into training, validation, and test sets with a ratio of 8:1:1. Figure 11 It is an instance of the BDCI dataset.
[0078] The SUST dataset consists of ID images collected in real-world scenarios. It includes 30 ID images taken with a barcode scanner, 48 ID images taken with a handheld mobile device, and 141 ID photocopies taken with a handheld mobile device. These images were annotated using PaddleLabel, PaddleOCR's semi-automatic annotation tool. The images for each capture method were divided into training, validation, and test sets in a 6.5:1:2.5 ratio. Figure 12 An example of the SUST dataset is shown, where (a) is a photo of a real ID card taken with a barcode scanner, (b) is a photo of a real ID card taken with a mobile phone, and (c) is a photo of a copy of the ID card taken with a mobile phone.
[0079] This application uses sequence-level accuracy, model parameter count, and recognition time as evaluation metrics. Recognition accuracy measures the model's ability to correctly identify character sequences in each image. If the predicted sequence is completely consistent with the label sequence, the recognition is considered correct; otherwise, it is considered an error, and the accuracy is calculated based on this. Recognition accuracy is defined as follows:
[0080]
[0081] Among them, W represents the set of all given text line images, and Wr represents the set of correctly recognized text line images.
[0082] In addition, this application proposes a new evaluation metric, error counts, for evaluating the performance of ID number recognition systems. In ID number recognition, both incorrectly recognized characters and unrecognized characters in the recognition results are considered a single error count unit. This metric is applicable to scenarios where the ID number to be recognized is of a fixed and unique length. A lower error count indicates a higher accuracy of the ID number recognition system.
[0083] The number of errors is calculated by adding the number of character recognition errors and the number of unrecognized characters for each ID number to obtain the number of errors for that number. The calculation formula is as follows:
[0084]
[0085] There are n ID numbers to be recognized. For the i-th ID number (i=1, 2, ..., n), the number of character recognition errors is a. i , the number of unrecognized characters b i If there are more or less recognized bits, then the bits from that bit to the last bit are all considered errors. Figure 13As shown in the figure, the number of errors in the first number is 3, the number of errors in the second number is 7, and the number of errors in the third number is 2. In the DBCI dataset, this metric counts the average number of errors per 100 images, while in the SUST dataset, this metric counts the number of errors in the entire test set.
[0086] Based on the characteristics of text lines on ID cards, the model designed in this application uses an input image size of 32 in height and a variable width. If the input image height is greater or less than 32, the image height is first resized to 32, and then the scaling factor is calculated and applied to the image width.
[0087] The model proposed in this application is trained with a batch size of 8 and an epoch of 1000. The learning rate used in training is 1×10 -2 The Adam optimizer is used to validate the model at the end of each training cycle.
[0088] Since the convolutional layer of the first module (the initial module) of the encoder is primarily responsible for extracting contour information from the image, enabling the model to better judge the shape and structure of characters, the size of the convolution kernel of the first convolutional layer plays a crucial role. We evaluated the model performance using the SUST dataset by varying the size of the first convolution kernel.
[0089] Table 2 Results of different convolution kernel sizes on the SUST dataset
[0090] Convolution kernel size Accuracy % Parameter quantity / Mb Recognition time (ms) Number of errors 3×3 95.3 2.8 25 13 5×5 89.3 5.2 36 35 7×7 87.6 9.2 53 42
[0091] Note: Bold indicates the best results
[0092] As shown in Table 2, gradually increasing the kernel size to 5×5 and 7×7 leads to a decrease in model performance. This is attributed to the sensitivity of the receptive field in character recognition. Excessively large receptive fields introduce redundant contextual information, leading to semantic redundancy. To mitigate the impact of contextual information on character recognition, a 3×3 convolution kernel is used in the Stem of ECLAN's recognition feature extraction module.
[0093] In addition, the output of each DSCAM group is concatenated with the output of all previous layers in the channel dimension and SCAB is used to enhance the feature expression capability. To verify the impact of the number of DSCAMs in each group on the performance and parameter efficiency of the model, the model performance is evaluated using the SUST dataset by varying the number of DSCAMs in each group.
[0094] Table 3 Results of different numbers of DSCAMs on the SUST dataset
[0095] Number of DSCAMs Accuracy / % Parameter quantity / Mb Recognition time / ms Number of errors 1,1,3 86.1 1.9 20 29 2,2,2 87.5 2.4 24 27 1,3,6 95.3 2.8 25 13 2,4,6 90.3 3.9 31 54 6,6,6 92.7 6.3 38 71
[0096] Note: Bold indicates the best performance, and underlined indicates the second best performance.
[0097] As shown in Table 3, the combination of 1, 3, and 6 achieves the highest recognition accuracy of 95.3%, significantly higher than other combinations, demonstrating the effectiveness of this specific combination of layers in improving recognition accuracy. The accuracy of other combinations is significantly lower than that of 1, 3, and 6. Furthermore, as the number of DSCAs increases, the number of parameters and recognition time increase. The combination of 1, 1, and 3 has the lowest number of parameters, at only 1.9M, 0.8M less than the combination of 1, 3, and 6. However, the accuracy is 9.2% lower, and the number of character errors more than doubles.
[0098] Therefore, the more layers there are, the better the model effect is. A reasonable distribution of layers is crucial to improving model performance. Therefore, this embodiment selects 1, 3, and 6 combinations as the structure of the recognition feature extraction module in DSCAM to achieve optimal performance.
[0099] The following discusses the structural composition of DSCAM in EULCAN and measures the impact of different modules on this application.
[0100] Method 1: Select the Densenet121 model structure without adding the SCAB attention module.
[0101] Method 2: Select 1, 3, or 6 EBCB module structures without adding the SCAB attention module.
[0102] Method 3 (EULCAN proposed in this application): Select 1, 3, 6EBCB module structures and add SCAB attention module.
[0103] As shown in Table 4, the total number of parameters in the Method 1 model is as high as 30.8M, while the number of parameters in the Method 2 model, which uses 1, 3, or 6 EBCB modules, and the EULCAN model has been significantly reduced to 2.8M. This clearly demonstrates the significant effectiveness of lightweight design in reducing model complexity and lowering storage and computational costs, laying the foundation for the efficient deployment of subsequent models.
[0104] As shown in Table 4, on the BDCI dataset, Method 1 achieved an accuracy of only 86%, an average recognition time of 103ms, and 17 errors. Method 2, leveraging its lightweight architecture, significantly reduced the average recognition time to 16ms, but its accuracy decreased by 8.1% and the number of errors increased to 58. Further incorporating the SCA attention module, Method 3 achieved an improvement in accuracy to 97.1%, maintaining an average recognition time of 13ms. Furthermore, the number of errors decreased to 5, reflecting the improved accuracy. This demonstrates the crucial role of the SCAB module in enhancing feature learning and improving the model's discriminative power without increasing inference time. In real-world datasets, the introduction of the lightweight architecture and SCAB attention module also yielded significant improvements in parameter count, accuracy, recognition time, and error count.
[0105] Table 4 Results of different structures on different datasets
[0106]
[0107]
[0108] Note: Bold indicates the best results
[0109] In order to demonstrate the performance of different attention mechanisms on this network, this application selected several common attention mechanisms and compared them with the attention mechanism used in this application on the SUST dataset. The compared attention mechanisms are as follows:
[0110] (1)A 2 : A dual attention mechanism of channel attention and spatial attention is introduced. Channel attention focuses on the importance of image features in the channel dimension; spatial attention focuses on the relationship between image features in the spatial dimension.
[0111] (2) CBAM: A convolutional attention module. It adds a spatial attention mechanism while retaining the original channel attention mechanism. It optimizes the network from both channel and spatial perspectives, improving the model's feature extraction performance from both channel and spatial perspectives.
[0112] (3) GAM: This attention mechanism adopts a sequential channel-spatial attention mechanism and redesigns the CBAM submodule, which can amplify global interaction features while reducing information diffusion.
[0113] (4) SE: A new architectural unit, the Squeeze-and-Excitation module, which explicitly models the interdependencies between convolutional feature channels to improve the network’s representation capabilities. The module includes global information embedding, adaptive recalibration, and reweighting of feature maps, aiming to allow the network to dynamically adjust channel weights.
[0114] (5) ECA: This attention mechanism avoids the complex dimensionality reduction and dimensionality increase process and captures the dependencies between channels through one-dimensional convolution, thus achieving high efficiency and lightweight characteristics.
[0115] (6) Coordinate: A coordinate attention method that incorporates location information into channel attention, enhancing the performance of the model in tasks such as classification, object detection, and semantic segmentation, and improving the expressive power of lightweight models.
[0116] Table 5 Recognition results of different attention mechanisms in the SUTS dataset
[0117]
[0118]
[0119] Note: Bold indicates the best performance, and underlined indicates the second best performance.
[0120] As shown in Table 5, the attention mechanism SCAB used in this application performed the best among all the compared attention mechanisms, with an accuracy of 95.3%. Although its parameter count is similar to that of CBAM, SE, and EAC, all at 2.8M, SCAB's accuracy is 4.1% higher than the second-best performing SE model, a significant advantage. At the same time, SCA's recognition time is only 25ms, ensuring high accuracy while also achieving impressive recognition speed. Coordinate, which has the second-fastest recognition time, not only has an accuracy 7.6% lower than SCAB, but also has twice the number of errors.
[0121] Overall, SCAB has obvious advantages in accuracy and number of errors, and also performs well in parameter quantity and recognition time, showing strong comprehensive performance.
[0122] To further demonstrate the superior performance of the recognition model proposed in this application, we conducted a detailed comparison of the proposed system with various classic algorithms on the BDCI and SUST datasets. This comparison included the industrial-grade OCR engine Pytesseract, based on the CRNN algorithm; the lightweight recognition models PaddleOCRV3 and MobileNetV3; and the Transformer-based OCR models TrOCR and OmniParser. Since MobileNetV3 performs only recognition, we used our ID number detection module for detection, followed by MobileNetV3 for recognition.
[0123] Each method was trained, validated, and tested using the same data split ratio on both datasets. All methods were implemented using the PyTorch framework, with 1000 iterations and a learning rate of 0.01.
[0124] (1) Comparative experiment on BDCI dataset
[0125] Table 6 shows the comparison results of the model presented in this application with other models on the BDCI dataset. While OmniParser performs quite well in terms of recognition accuracy and error count, it comes with high resource requirements, with a model parameter count of 438.2M, making it unsuitable for deployment on embedded platforms. In comparison, EULCAN, presented in this application, is 1.6% lower than OmniParser in recognition accuracy and only has two fewer errors, but its model parameter count and recognition time are significantly lower than OmniParser, meeting the requirements for a lightweight and deployable model. Furthermore, our model outperforms the second-best performing TrOCR and the worst-performing model, Pytesseract, by 1.5% and 14.3%, respectively, demonstrating that our model performs relatively well in terms of text recognition rate. In terms of parameter count, only the MobileNetV3 model approaches the parameter count of our network model, but its accuracy is 11.7% lower and its error count is over tenfold higher. Compared to another lightweight network, PaddleOCRv3, our model uses 73.83% fewer parameters. The text model takes an average of only 13ms to process a single image. This feature makes this application model the best in terms of memory usage and inference performance.
[0126] Table 6 Results of different methods on the BDCI dataset
[0127]
[0128] Note: Bold indicates the best performance, and underlined indicates the second best performance.
[0129] (2) Comparative experiments on the SUST dataset
[0130] As shown in Table 7, the comparison results of the model of this application and other models on the SUST dataset are presented. Although TrOCR and OmniParser performed outstandingly in recognition accuracy, reaching 96.3% and 98.2%, the parameters of these two models are as high as 62M and 438.2M, and the recognition time is relatively long, at 380ms and 550ms, which brings extremely high resource requirements. In comparison, EULCAN is 2.9% lower than OmniParser in recognition accuracy, but the model parameters are only 2.8M, and the recognition time is only 25ms, which is much lower than OmniParser, meeting the requirements of lightweight and deployment-level models. In addition, the model of this application is only 1.0% lower than the second-best performing TrOCR model in accuracy, and the number of errors is close. Therefore, it can be seen that the model of this application is relatively outstanding in terms of text recognition rate.
[0131] In terms of parameter count, only the MobileNetV3 model approaches EULCAN, but its accuracy is 24.4% lower. Compared to another lightweight network, PaddleOCRV3, EULCAN not only achieves 10.6% higher accuracy but also reduces the number of errors by 75.5%. EULCAN processes a single image in an average of just 25ms, demonstrating its unique advantages in real-world scenarios with stringent memory and inference speed requirements, making it a preferred choice for scenarios where speed is paramount.
[0132] Table 7 Results of different methods on the SUST dataset
[0133]
[0134] Note: Bold indicates the best performance, and underlined indicates the second best performance.
[0135] The trained model is deployed to the RK3588S2 platform and tested in real time. In embedded devices, the EULCAN algorithm still performs well, with a recognition speed of about 15ms and the same recognition effect as on the server side, meeting the requirements for real-time document number recognition algorithm deployment on embedded devices. The comparative experimental results of several models that can be deployed on embedded devices are shown in Table 8. The recognition effect of the EULCAN model deployed on the RK3588S2 platform is shown in Table 8. Figure 14 shown.
[0136] Table 8 Recognition time of different models on RK3588S2
[0137]
[0138] Note: Bold indicates the best results
[0139] Below, we present a comprehensive analysis and comparison of the recognition results of different algorithms, as shown in Table 9. The results are accompanied by ID images captured using three methods: a barcode scanner image, a mobile phone photo of a genuine ID card, and a mobile phone photo of a photocopied ID card. In all three scenarios, EULCAN performed the best, while the other methods all exhibited varying numbers of errors. Among all algorithms, MobileNetV3 and Pytesseract performed the weakest, with Pytesseract exhibiting a higher number of missed and false detections. It can be seen that the blurry character "3" was recognized as "5," and "0" and "1" were easily missed. Furthermore, certain characters, such as "5," "1," and "X," are susceptible to misrecognition due to blur. In the third image, every model exhibited a false detection. EULCAN and other models also misrecognized characters when they were severely worn.
[0140] In summary, compared with other recognition models, the EULCAN proposed in this application shows significant advantages in prediction accuracy and recognition speed, and also performs better in recognizing more ambiguous characters.
[0141] Table 9 compares the visualization results of document number recognition of different methods and EULCAN in different situations
[0142]
[0143] In summary, the ID number recognition system based on an efficient and ultra-lightweight convolutional attention network (EULCAN) proposed in this paper is suitable for ID text recognition. It employs a highly efficient and innovative encoder-decoder architecture. The encoder utilizes a lightweight architecture and a feature extraction network (DSCAN) with an attention mechanism, and a DDRB dual dimensionality reduction module, which are key factors in capturing information at different scales in the feature map and achieving lightweight performance.
[0144] Experimental verification shows that EULCAN reduces the number of parameters by 28% compared to the deployment-level model Mobilev3. This fully meets the requirements for deployment on embedded devices. Validation on two ID card datasets demonstrated that the model achieved recognition accuracy exceeding 95.3%, with only 2.8M parameters and a minimum recognition time of 13ms, outperforming other recognition methods. EULCAN effectively reduces the number of model parameters while maintaining high extraction network performance, fully meeting the standards for lightweight models and the requirements for deployment-level models. This application also deploys the detection and recognition models on embedded devices, achieving an average runtime of approximately 11ms in these devices, meeting the requirements for real-time recognition.
[0145] Obviously, those skilled in the art may make various changes and modifications to the invention without departing from the spirit and scope of the invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. An ID number recognition system based on an efficient and ultra-lightweight convolutional attention network, characterized by: It includes the ID number detection module, the recognition feature extraction module and the recognition sequence transcription module. The ID number detection module sequentially includes a backbone network, a neck network, a prediction head, and a differentiable binarization module. The ID image is input into the backbone network to output a feature map. The neck network generates a multi-scale feature map. The spliced multi-scale feature map is input into the prediction head to obtain a probability map and a threshold map. The probability map and threshold map are generated into an approximate binary map by the differentiable binarization module, and the detection result is output. The recognition feature extraction module includes an initial module, a dense simplified convolutional attention module, and a dual dimensionality reduction block. The initial module includes a convolution layer and an average pooling layer. The dense simplified convolutional attention module is divided into three groups, each group containing a number of dense simplified convolutional attention modules. The dual dimensionality reduction block is used to reduce the number of channels and spatially downsample the feature map. The recognition sequence transcription module includes a circulation layer and a transcription layer. The circulation layer is used to perform time series modeling on the feature sequence extracted by the recognition feature extraction module, and the transcription layer is used to map the input features to a specific output space.
2. The ID number recognition system based on the efficient ultra-lightweight convolutional attention network according to claim 1 is characterized in that: The document number detection module adopts the text detection network DBNet.
3. The ID number recognition system based on the efficient ultra-lightweight convolutional attention network according to claim 2 is characterized in that: The backbone network adopts the lightweight backbone network MobileNetV3, and the neck network uses the residual FPN structure to replace the convolutional layer in the FPN structure of DBNet with the RSEConv layer with a residual channel attention structure.
4. The ID number recognition system based on an efficient and ultra-lightweight convolutional attention network according to claim 1, characterized in that: The convolution kernel size of the convolution layer of the initial module is 3×3.
5. The ID number recognition system based on an efficient and ultra-lightweight convolutional attention network according to claim 1, characterized in that: The number of dense simplified convolutional attention modules in the three groups of dense simplified convolutional attention modules is 1, 3, and 6 respectively; each dense simplified convolutional attention module introduces a direct connection from the current layer to all subsequent layers.
6. The ID number recognition system based on an efficient ultra-lightweight convolutional attention network according to claim 5, characterized in that: The dense simplified convolution attention module includes an efficient bottleneck convolution block and a simplified channel attention module. The efficient bottleneck convolution block sequentially uses 1×1 convolution and 3×3 convolution to reduce the dimension of the input channel.
7. The ID number recognition system based on an efficient ultra-lightweight convolutional attention network according to claim 6, characterized in that: The simplified channel attention module first performs a global average pooling operation, then passes the obtained global features of each channel through two 1×1 two-dimensional convolutional layers, and then applies a Sigmoid activation function to the output of the second convolutional layer to normalize the weight of each channel to the [0,1] interval to obtain the attention weight Z of each channel; the obtained attention weight Z is applied to the input feature map X to weight each channel.
8. The ID number recognition system based on the efficient ultra-lightweight convolutional attention network according to claim 7 is characterized in that: The calculation formula of the global average pooling operation is: Where, C is the number of channels, H and W are the height and width of the feature map respectively; c = 0, 1, ..., C-1, h is the index in the height direction, ranging from 0 to H-1, and w is the index in the width direction, ranging from 0 to W-1.
9. The ID number recognition system based on an efficient ultra-lightweight convolutional attention network according to claim 1, characterized in that: The dual dimensionality reduction block consists of a 1×1 convolutional layer and a 2×2 average pooling layer.
10. The ID number recognition system based on an efficient ultra-lightweight convolutional attention network according to claim 1, characterized in that: The recurrent layer includes a dropout layer and two linear layers; the transcription layer adopts a connection temporal classification algorithm.