Unlimited scene license plate detection method based on feature fusion and weight mapping
By adopting the method of feature fusion and weight mapping in license plate detection, the distinction between adjacent features of the license plate is enhanced, which solves the problem of low plate detection accuracy in complex scenes, achieves efficient license plate correction and recognition, and improves detection accuracy and reduced computational cost.
Patent Information
- Application Number
- CN202410822870.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-10-29
AI Technical Summary
Existing license plate detection technology is difficult to show robustness in complex scenarios (such as tilt, distortion, rotation, etc.), resulting in low detection accuracy. There is an aliasing effect in the feature fusion process, which affects the recognition accuracy.
Using a method based on feature fusion and weight mapping, features are extracted through ResNet-50 and BiFPN, combined with the feature preprocessing module and weight mapping module to enhance the distinction between adjacent features of the license plate, using bar pooling and weight mapping Reduce the aliasing effect and improve the accuracy of license plate detection.
The accuracy of license plate detection is significantly improved in complex scenarios, from 94.7% to 98.9%, and the sensitivity of the detection model to license plate numbers is increased, reducing the amount of calculation.
Smart Images

Figure CN118865347A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of license plate detection, and in particular to an unrestricted scene license plate detection method based on feature fusion and weight mapping, which realizes license plate detection by enhancing the distinctiveness between adjacent features of a license plate. Background Art
[0002] With the development of artificial intelligence and deep learning technology, the technologies involved in smart transportation have experienced explosive growth. As an important part of smart transportation, license plate recognition has received more and more attention. However, problems such as complex road conditions, license plate occlusion, and blur caused by mud and dirt affect the improvement of license plate detection accuracy. In particular, it is difficult to show strong robustness when facing complex scenes such as license plate distortion and rotation. The detection accuracy is often low, which is far from meeting application requirements.
[0003] In the early research on license plate detection, machine learning methods were mostly used, and license plates were manually annotated to obtain the data set required for training. In recent years, with the development of artificial intelligence technology, target detection algorithms such as Yolo-V3, DBNet, and CountNet have been applied to license plate detection. Existing license plate recognition technology is mainly used in specific environments, such as toll parking entrances and exits, highway ETC channels, etc. Under this condition of a fixed detection perspective and detection area, the accuracy of license plate recognition technology can be very high, but the recognition effect is poor in complex scenarios.
[0004] Existing license plate detection methods are generally divided into two types when dealing with license plates in complex scenes: (1) Regression-based detection methods. This method first uses a pre-detection frame to locate the approximate position of the license plate, and then uses a regression algorithm to gradually obtain a more accurate license plate detection frame. However, this method will introduce a large amount of background information when detecting tilted or deformed license plates, resulting in inaccurate subsequent license plate recognition and positioning. (2) Segmentation-based methods. This method uses the generated binary image and a differentiable threshold to judge the foreground and background of the license plate, and performs pixel-by-pixel segmentation to obtain the license plate detection frame. In the above two types of methods, in the license plate detection process, on the one hand, the existing license plate detection algorithm does not make improvements based on the shape characteristics of the license plate when processing the license plate features, resulting in a decrease in sensitivity to the license plate number; on the other hand, there will be more feature fusion processes in the convolutional neural network learning process, resulting in an aliasing effect on the fused license plate features, resulting in a decrease in the accuracy of license plate recognition.
[0005] It can be seen that for unconstrained scenarios, the existing license plate detection technology has the technical problem of low detection accuracy, and more effective methods are urgently needed for feature enhancement. Summary of the invention
[0006] In order to overcome the shortcomings of the above-mentioned prior art, the present invention provides a license plate detection method for unrestricted scenes based on feature fusion and weight mapping, which enhances the distinctiveness between adjacent features of a license plate, and is used to solve license plate detection problems in complex scenes such as the misalignment of deep features of tilted license plates and distorted license plates. It can be used in license plate detection and recognition tasks in unrestricted scenes, and can efficiently realize license plate detection correction.
[0007] To achieve the above object, the present invention adopts the following technical solution:
[0008] A method for detecting license plates in unrestricted scenes based on feature fusion and weight mapping comprises the following steps:
[0009] S1. Dataset construction: Collect images containing regular, tilted, and distorted license plates from traffic monitoring and side parking lots to construct a license plate dataset, mark the location of the license plates, and divide the dataset into training set, validation set, and test set;
[0010] S2. Deep convolution feature extraction and processing: ResNet-50 is used as the backbone network for feature extraction. The license plate image is input into the backbone network for feature extraction. Feature maps of different sizes are generated through five-layer convolution operations. The generated feature maps are aligned to the same dimension. The extracted features are processed through the weighted bidirectional feature pyramid network (BiFPN) to generate feature maps of different sizes.
[0011] S3, feature preprocessing: using a feature preprocessing module to preprocess the feature map obtained in step S2 to generate a new fused feature map for the shape of the license plate number;
[0012] S4, weight mapping: weight mapping is performed on the new fusion feature map obtained in step S3 through a weight mapping module;
[0013] S5, license plate detection: performing differentiable binarization processing on the result of step S4 to generate a binary image, using a scale-by-scale expansion algorithm to distinguish the license plate area, and obtaining a license plate detection result;
[0014] S6. Train the network structure to obtain the trained model parameters: Use ResNet-50 as the backbone network for training, and save the optimal model parameters after training.
[0015] As a further technical solution of the present invention, the specific process of step S3 is:
[0016] S31, introduce high semantic features in the feature pyramid to strengthen the license plate information of the feature map, increase the weight of each license plate information, use the feature preprocessing module with long strip pooling to process the feature map I1, obtain the spatial distance of the license plate information and the structural properties of the feature difference, let the feature map be a three-dimensional tensor x, in the strip pooling, the merged spatial range is H×1 and 1×W, strip pooling averages all feature values in a row or column, and the output feature after horizontal strip pooling is expressed as: The output after vertical strip pooling is expressed as
[0017] S32. Let x∈R C×H×W is the input tensor, where C represents the number of channels, and after 1×1 convolution, the dimension is increased to obtain two outputs and Then multiply it with the feature map I1 to get the new fusion feature I2: Where Scale() represents element-wise multiplication, and σ is the sigmoid function.
[0018] As a further technical solution of the present invention, the specific process of step S4 is: the new fusion feature map I2 is subjected to strip pooling in both horizontal and vertical directions to aggregate two different spatial information. Similar to step S3, the output feature after horizontal global pooling is expressed as The output after vertical global pooling is expressed as After a 1×1×C convolution, the two different spatial information are forwarded to the FC layer respectively, and the two information features are fused by pixel-by-pixel addition. Finally, the output feature vector is merged using the sigmoid function to obtain a binary image. The process is expressed as: CA(I2)=σ(fc1(stripPool(I2))+fc2(stripPool(I2))), R i =CA(I2)×C i , where CA(I2) is the channel weight, i is the pyramid level index, and C i Represents each layer of feature map generated by the feature pyramid.
[0019] As a further technical solution of the present invention, the specific process of step S6 is: using ResNet-50 as the backbone network, after enhancing the training data, two training processes are adopted, first using the training images to train the detector for 600 iterations, and then fine-tuning the model on each benchmark data set for 1200 iterations, training all models with a batch size of 16 on 4 NVIDIA TeslaV100GPUs, using the SGD optimizer in all training processes, with a momentum of 0.9, and adopting a poly learning rate strategy based on DBNet, where the learning rate of each iteration is equal to the initial learning rate multiplied by When the initial learning rate is set to 0.007, the momentum is 0.9, and max_iter represents the maximum number of iterations, whose value depends on the maximum iteration cycle.
[0020] As a further technical solution of the present invention, the training data enhancement includes: random rotation with an angle range of [-10°, 10], random image flipping and random image cropping, adjusting the size of the training image to 640×640, and using a single thread to test the model with a batch size of 1 on a single NVIDIA 1080Ti GPU.
[0021] Compared with the prior art, the present invention has the following beneficial effects:
[0022] The invention introduces global pooling to process the license plate feature map, makes adjustments to the shape characteristics of the license plate number, and proposes a feature preprocessing module by utilizing the characteristic that strip pooling has high sensitivity to block targets. By combining feature fusion, strip pooling is utilized to process the license plate features in the process of fusion of high semantic features and low semantic features, so that interference information can be removed to the maximum extent and the license plate features can be retained, so as to prepare in advance for the next step of enhancing the distinctiveness between license plate features. Secondly, a weight mapping module suitable for license plate detection is proposed, which can map weights to license plate features, enhance the distinctiveness between license plate features, and improve the ability of the detection model to distinguish between adjacent license plate numbers. The module generates corresponding weights by different fusion features, combines with feature pyramids, multiplies the generated weights with the features of each layer of the pyramid, and then fuses them. The fused feature map is used for subsequent semantic segmentation detection, thereby improving the ability of the detection network to distinguish adjacent license plate numbers, and further improving the accuracy of license plate detection. In the CCPD license plate detection rotation (Rotate) data set, the accuracy is improved from 94.7% to 98.9%, while increasing the amount of calculation very little. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 The present invention provides a flow chart of the license plate detection method.
[0024] Figure 2 This is a structural block diagram of the weight mapping module described in the present invention.
[0025] Figure 3 This is a structural block diagram of the feature preprocessing module described in the present invention. DETAILED DESCRIPTION
[0026] The present invention will be further described below by way of embodiments in conjunction with the accompanying drawings, but the scope of the present invention is not limited in any way.
[0027] Example:
[0028] like Figure 1As shown, this embodiment provides a method for detecting license plates in unrestricted scenes based on feature fusion and weight mapping. Figure 3 The feature preprocessing module and Figure 2 The weight mapping module shown in the figure makes changes to the shape characteristics of the license plate number, which is more suitable for the license plate detection task. It also uses the uniqueness of the license plate corresponding to the weight mapping to alleviate the aliasing effect produced in the process of license plate feature fusion, greatly increasing the accuracy of license plate detection. The specific implementation includes the following steps:
[0029] S1. Dataset construction:
[0030] Collect images containing regular, tilted, and distorted license plates in scenes such as traffic monitoring and side parking lots, build a license plate dataset, mark the location of the license plates, and divide the dataset into training set, validation set, and test set.
[0031] S2. Deep convolution feature extraction and processing:
[0032] ResNet-50 is used as the backbone network for feature extraction. The license plate image is input into the backbone network to extract features from the image. Feature maps of different sizes are generated through five-layer convolution operations. The generated feature maps are aligned to the same dimension, and the extracted features are processed through a weighted bidirectional feature pyramid network (BiFPN) to generate feature maps of different sizes {C1, C2, C3, C4, C5} waiting for the next step.
[0033] S3 feature preprocessing module:
[0034] The feature preprocessing module is used to preprocess the feature map obtained in step S2 to generate a new fused feature map for the license plate number shape; specifically:
[0035] S31. First, introduce high semantic features in the feature pyramid to further enrich the license plate information of the feature map I1, increase the weight of each license plate information, and then design a feature preprocessing module suitable for license plate detection based on strip pooling, according to the characteristics of the license plate number shape, such as blocks and long strips. Use a structure with long strip pooling to process the license plate features to obtain the structural properties of the spatial distance and feature differences of the license plate information. Suppose the feature map is a three-dimensional tensor x. In strip pooling, the spatial ranges that need to be merged are (H×1) and (1×W). Unlike two-dimensional average pooling, strip pooling averages all feature values in a row or column. Therefore, the output features after horizontal pooling can be expressed as Similarly, the output after vertical pooling can be expressed as
[0036] S32. Let x∈R C×H×Wis the input tensor, where C represents the number of channels, and then a 1×1 convolution increases the dimension to obtain two outputs and Multiplying with I1, we get the new fusion feature I2, expressed as Where Scale() represents element-wise multiplication, and σ is the sigmoid function.
[0037] After step S3, a corresponding relationship is established between each pixel in I1 and I2, and compared with the global average pooling, the stripe pooling can focus on a longer and narrower position area in the entire feature map, thereby avoiding the establishment of unnecessary connections between two long-distance positions. The subsequent multiplication with the feature map I1 can be regarded as an attention mechanism, but compared with the attention-based module, it not only establishes the relationship between the corresponding positions but also avoids a lot of computational consumption. The improved feature preprocessing module has a lightweight structure and can be easily embedded in the license plate detection network, thereby obtaining rich long-range spatial dependencies and utilizing inter-channel dependency information to complete the preprocessing of the license plate features and generate a feature map with the shape characteristics of the license plate number.
[0038] S4 weight mapping:
[0039] In the previous BiFPN, each merged feature needs to be convolved, and the generated feature pyramid needs to be further fused, resulting in an aliasing effect on the fused license plate features, making the license plate information confusing and complex, making it difficult to effectively complete subsequent positioning and recognition tasks. The feature map I2 generated by the feature preprocessing module incorporates more cross-scale features, making the aliasing effect more serious than the original BiFPN. In order to reduce the negative impact of aliasing, the new fused feature map I2 generated in the previous step is subjected to horizontal and vertical strip pooling to aggregate two different spatial context information. Similar to BiFPN, the output features after horizontal pooling can be expressed as Similarly, the output after vertical pooling can be expressed as After a 1×1×C convolution, the two different spatial information are forwarded to the FC layer respectively, and then the two information features are fused by pixel-by-pixel addition. The output feature vector is merged using the sigmoid function. The process can be expressed as:
[0040] CA(I2)=σ(fc1(stripPool(I2))+fc2(stripPool(I2))),
[0041] R i =CA(I2)×C i ,
[0042] Where CA(I2) is the channel weight, i is the pyramid level index, C i Represents each layer of feature map generated by the feature pyramid.
[0043] This step and step S3 are based on feature fusion and weight mapping to achieve an unrestricted scene license plate detection method that enhances the distinctiveness between adjacent features of the license plate. That is, it can make adjustments based on the shape characteristics of the license plate number to improve the network's sensitivity to long strip numbers, thereby achieving effective segmentation of license plate instances in complex scenes; at the same time, it can alleviate the aliasing effect caused by feature fusion. The use of both enhances the distinctiveness between features, thereby achieving better detection effects.
[0044] S5, license plate detection:
[0045] The result of step S4 is subjected to differentiable binarization to generate a binary image, and the license plate area is distinguished using a scale-by-scale expansion algorithm to obtain a license plate detection result.
[0046] S6. Train the network structure and obtain the trained model parameters:
[0047] For all models, ResNet-50 was used as the backbone network after pre-training, and two training processes were adopted. First, the detector was trained for 600 epochs using the training images, and then the model was fine-tuned for 1200 epochs on each benchmark dataset. All models were trained on 4 NVIDIA Tesla V100 GPUs with a batch size of 16. The SGD optimizer was used in all training processes with a momentum of 0.9. A poly learning rate strategy based on DBNet was used, in which the learning rate of each iteration was equal to the initial learning rate multiplied by When the initial learning rate is set to 0.007, the momentum is 0.9, and max_iter represents the maximum number of iterations, whose value depends on the maximum epoch. During the training process, the training data needs to be enhanced, including: 1) random rotation with an angle range of [-10°, 10]; random flipping of images; random cropping of images. In order to improve training efficiency, the size of the training images is resized to 640×640. During inference, the test images maintain the aspect ratio and adjust the input image size of each benchmark by setting the appropriate height. The model with a batch size of 1 is tested on a single NVIDIA 1080Ti GPU using a single thread.
[0048] This embodiment enhances the distinctiveness of license plate features by using feature preprocessing and weight mapping modules, solves the problem of license plate detection in complex scenarios such as misaligned depth features of tilted or distorted license plates, and can perform license plate detection efficiently and accurately.
[0049] It should be noted that the purpose of publishing the embodiments is to help further understand the present invention, but those skilled in the art can understand that various substitutions and modifications are possible without departing from the spirit and scope of the present invention and the appended claims. Therefore, the present invention should not be limited to the contents disclosed in the embodiments, and the scope of protection claimed by the present invention shall be subject to the scope defined in the claims.
Claims
1. A method for license plate detection in unrestricted scenes based on feature fusion and weight mapping, characterized in that: The following steps are involved: S1. Dataset construction: Collect images containing regular, tilted, and distorted license plates from traffic monitoring and side parking lots to construct a license plate dataset, mark the location of the license plates, and divide the dataset into training set, validation set, and test set; S2, deep convolution feature extraction and processing: ResNet-50 is used as the backbone network for feature extraction. The license plate image is input into the backbone network for feature extraction. Feature maps of different sizes are generated through five-layer convolution operations. The generated feature maps are aligned to the same dimension. The extracted features are processed through a weighted bidirectional feature pyramid network to generate feature maps of different sizes. S3, feature preprocessing: using a feature preprocessing module to preprocess the feature map obtained in step S2 to generate a new fused feature map for the shape of the license plate number; S4, weight mapping: weight mapping is performed on the new fusion feature map obtained in step S3 through a weight mapping module; S5, license plate detection: performing differentiable binarization processing on the result of step S4 to generate a binary image, using a scale-by-scale expansion algorithm to distinguish the license plate area, and obtaining a license plate detection result; S6. Train the network structure to obtain the trained model parameters: Use ResNet-50 as the backbone network for training, and save the optimal model parameters after training.
2. The unrestricted scene license plate detection method based on feature fusion and weight mapping according to claim 1 is characterized in that: The specific process of step S3 is: S31, introduce high semantic features in the feature pyramid to strengthen the license plate information of the feature map, increase the weight of each license plate information, use the feature preprocessing module with long strip pooling to process the feature map I1, obtain the spatial distance of the license plate information and the structural properties of the feature difference, let the feature map be a three-dimensional tensor x, in the strip pooling, the merged spatial range is H×1 and 1×W, strip pooling averages all feature values in a row or column, and the output feature after horizontal strip pooling is expressed as: The output after vertical strip pooling is expressed as S32. Let x∈R C×H×W is the input tensor, where C represents the number of channels, and after 1×1 convolution, the dimension is increased to obtain two outputs and Then multiply it with the feature map I1 to get the new fusion feature I2: Where Scale() represents element-wise multiplication, and σ is the sigmoid function.
3. The unrestricted scene license plate detection method based on feature fusion and weight mapping according to claim 2 is characterized in that: The specific process of step S4 is: the new fused feature map I2 is subjected to strip pooling in both horizontal and vertical directions to aggregate two different spatial information. Similar to step S3, the output feature after horizontal global pooling is expressed as The output after vertical global pooling is expressed as After a 1×1×C convolution, the two different spatial information are forwarded to the FC layer respectively, and the two information features are fused by pixel-by-pixel addition. Finally, the output feature vector is merged using the sigmoid function to obtain a binary image. The process is expressed as: CA(I2)=σ(fc1(stripPool(I2))+fc2(stripPool(I2))), R i =CA(I2)×C i , where CA(I2) is the channel weight, i is the pyramid level index, and C i Represents each layer of feature map generated by the feature pyramid.
4. The unrestricted scene license plate detection method based on feature fusion and weight mapping according to claim 3 is characterized in that: The specific process of step S6 is as follows: ResNet-50 is used as the backbone network. After the training data is enhanced, two training processes are adopted. The detector is first trained for 600 iterations using the training images, and then the model on each benchmark dataset is fine-tuned for 1200 iterations. All models with a batch size of 16 are trained on 4 NVIDIA Tesla V100 GPUs. The SGD optimizer is used in all training processes with a momentum of 0.9 and a poly learning rate strategy based on DBNet, where the learning rate of each iteration is equal to the initial learning rate multiplied by When the initial learning rate is set to 0.007, the momentum is 0.9, and max_iter represents the maximum number of iterations, whose value depends on the maximum iteration cycle.
5. The method for detecting license plates in unrestricted scenes based on feature fusion and weight mapping according to claim 4 is characterized in that: The training data enhancement includes: random rotation with an angle range of [-10°, 10], random image flipping, and random image cropping. The training images are resized to 640×640, and the model with a batch size of 1 is tested on a single NVIDIA 1080Ti GPU using a single thread.
