License plate recognition method and device based on few-sample training

By using few-sample training and data enhancement technology in license plate recognition, extracting features and setting up multiple recognition branch models, the problem of inaccurate recognition of incomplete or multiple license plates in the existing technology is solved, and high accuracy under harsh conditions is achieved. and robust license plate recognition.

CN118587694APending Publication Date: 2024-09-03HUITE INTELLIGENT TECH (NANJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410633043.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

Existing license plate recognition technology has low accuracy when dealing with incomplete or fake license plates, does not support multiple license plate recognition, and requires high training data, making it difficult to adapt to bad weather and high-angle scenes.

Method used

Adopt a license plate recognition method based on few-sample training, extract features through a convolutional neural network, set up license plate number, type and authenticity recognition branch models, and use data enhancement technology to train a highly robust algorithm model that can identify multiple license plates and Return accurate results.

Benefits of technology

It has high robustness and accuracy under various lighting and angle scenarios, can effectively identify multiple license plates, and train an efficient algorithm model with a small number of samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118587694A
    Figure CN118587694A
Patent Text Reader

Abstract

The invention relates to the field of character recognition, and discloses a license plate recognition method and device based on few-sample training, and the key point of the technical scheme is that the method comprises the following steps: S1, setting annotation data for license plate pictures in a database; s2, extracting features of license plate pictures in a database through a trunk model of a convolutional neural network; s3, after the features of the license plate pictures in the training database are obtained, the license plate number recognition branch model, the license plate type recognition branch model and the license plate authenticity recognition branch model are sequentially trained; and S4, deploying the trunk model, the license plate number identification branch model, the license plate type identification branch model and the license plate authenticity identification branch model of the trained convolutional neural network to a target computer, and inputting a to-be-detected license plate image into the target computer to obtain an identification result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of character recognition, and more specifically, to a vehicle license plate recognition method and device based on few-sample training. Background Art

[0002] The traditional license plate recognition algorithm first locates the license plate position, crops the license plate image, and determines the license plate number by comparing the features of the license plate number. This method has poor robustness and has a low accuracy rate for license plates at large angles and in bad weather. With the development of deep learning, convolutional neural network methods are now basically used for license plate recognition, and the recognition accuracy has been greatly improved. However, the current methods still cannot handle license plate images including incomplete or fake license plates well, and each training requires a large amount of labeled data, and some types of license plates are difficult to collect.

[0003] The most popular method in the prior art is to use the CRNN method recorded in "An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition" for license plate recognition. Subsequent related documents "Gated recurrent convolution neural network for OCR", "Focusing attention: Towards accurate text recognition in natural images", "Show, attend and read: A simple and strong baseline for irregular text recognition" and "Decoupled attention network for text recognition" have made some improvements to the CRNN method. However, the project that can be directly used for license plate recognition and has received a lot of attention is the CCPD method mentioned in "Towards End-to-End License Plate Detection and Recognition: A Large Dataset and Baseline", which uses a convolutional neural network to implement an end-to-end license plate recognition solution.

[0004] The CRNN method is a common method for optical character recognition (OCR) that can directly convert images into text sequences. However, the CRNN method cannot recognize incomplete license plates or images that are not license plates. It generally outputs unexpected results and requires a high amount of training data. The CCPD method can perform end-to-end license plate recognition, but can only output one license plate result. If there are multiple license plates in a picture, the CCPD method cannot recognize them. Summary of the invention

[0005] The purpose of the present invention is to provide a license plate recognition method and device based on few-sample training, which can recognize multiple license plates in a picture and return correct results; this scheme is highly robust and has a high license plate recognition accuracy in various lighting and angle scenes; through data enhancement technology, a small number of license plate samples can be used to train a highly robust algorithm model.

[0006] The above technical objectives of the present invention are achieved through the following technical solutions: A license plate recognition method based on few-sample training comprises the following steps:

[0007] S1. Setting annotation data for license plate images in the database;

[0008] S2, extract the features of the license plate images in the database through the backbone model of the convolutional neural network;

[0009] S3, after acquiring the features of the license plate images in the training database, sequentially train the license plate number recognition branch model, the license plate type recognition branch model, and the license plate authenticity recognition branch model;

[0010] S4. Deploy the trained convolutional neural network backbone model, license plate number recognition branch model, license plate type recognition branch model, and license plate authenticity recognition branch model to the target computer, and input the license plate image to be tested into the target computer to obtain the recognition result.

[0011] As a preferred technical solution of the present invention, the annotation data includes license plate number character data, license plate type data, and license plate authenticity data corresponding to the license plate image.

[0012] As a preferred technical solution of the present invention, the database includes a training set and a test set; the license plate images and annotation data in the training set are used to train the license plate number recognition branch model, the license plate type recognition branch model, and the license plate authenticity recognition branch model; after the training is completed, the license plate images and annotation data in the test set are used to test the license plate number recognition branch model, the license plate type recognition branch model, and the license plate authenticity recognition branch model; after the test passes, the license plate number recognition branch model, the license plate type recognition branch model, and the license plate authenticity recognition branch model are frozen.

[0013] As a preferred technical solution of the present invention, the backbone model includes a deep convolutional neural network ResNet18, which is used to extract features from license plate images.

[0014] As a preferred technical solution of the present invention, S3 includes the following sub-steps:

[0015] S3.1. Use data enhancement to augment the license plate image data in the training database, train the license plate number recognition branch model with the augmented license plate image data, and freeze the main model and the license plate number recognition branch model after the training is completed;

[0016] S3.2. After the trunk model and the license plate number recognition branch model are frozen, the license plate type recognition branch model is trained. After the training is completed, the license plate type recognition branch model is frozen.

[0017] S3.3. After the license plate type recognition branch model is frozen, the license plate authenticity recognition branch model is trained, and after the training is completed, the license plate authenticity recognition branch model is frozen.

[0018] As a preferred technical solution of the present invention, the data enhancement for the license plate image data in S3.1 includes: randomly changing the positions of the license plate characters and obtaining corresponding license plate annotation data.

[0019] As a preferred technical solution of the present invention, a multi-label classification algorithm is provided in the license plate number recognition branch model in S3.1, each character of the license plate is set as a category, and all license plate characters are recognized.

[0020] As a preferred technical solution of the present invention, in S3.3, a binary classification algorithm is set in the license plate authenticity recognition branch model, cross entropy is used as the objective function, and the stochastic gradient descent algorithm is used as the optimization strategy, so that the license plate authenticity recognition branch model gradually approaches the license plate authenticity data. After the license plate authenticity recognition branch model is trained, the authenticity of the license plate is obtained based on the output prediction result.

[0021] As a preferred technical solution of the present invention, before the license plate recognition, the position of the license plate image in the original picture is determined by a license plate image detection algorithm, and the license plate image is cropped.

[0022] A license plate recognition device based on few-sample training comprises: a processor and a memory, wherein the memory stores a computer program executable by the processor, and the processor implements the above method when executing the computer program.

[0023] In summary, the present invention has the following beneficial effects: It can identify multiple license plates in a single picture and return the correct results; it has strong robustness and high license plate recognition accuracy in various lighting and angle scenarios; through data augmentation technology, a highly robust algorithm model can be trained using a small number of license plate samples. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 is the overall architecture diagram of license plate recognition;

[0025] Figure 2 is the actual captured license plate picture;

[0026] Figure 3 is generated by using the data augmentation algorithm from Figure 2 the generated license plate picture;

[0027] Figure 4 is the picture of the model recognition result. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0028] The present invention will be further described in detail below with reference to the accompanying drawings.

[0029] As Figure 1-4 shown, the present invention provides a license plate recognition method based on few-shot training, including the following steps:

[0030] S1. Set annotation data for the license plate pictures in the database; specifically, the database includes a training set and a test set;

[0031] The annotation data includes license plate number character data, license plate type data, and license plate authenticity data corresponding to the license plate pictures; among them, the license plate number recognition branch model requires the license plate number character data, and the license plate type recognition branch model and the license plate authenticity recognition branch model require picture data, that is, license plate type data and license plate authenticity data, and they are stored in different folders according to different categories.

[0032] As an embodiment of the present invention, the license plate number character data is as follows and is used for training the license plate number recognition branch model:

[0033] Img1.jpg E A 7062Q

[0034] Img2.jpg S A 70834

[0035] Img3.jpg S E 70888 ...

[0037] The license plate type data is as follows and is used for training the license plate type recognition branch model:

[0038] Img1.jpg ordinary blue license plate

[0039] Img2.jpgNew energy license plate

[0040] Img3.jpgPolice car license plate

[0041] Img4.jpgSingle-layer yellow license plate

[0042] Img5.jpgDouble-layer yellow license plate

[0043] Img6.jpg Hong Kong and Macau license plates ...

[0045] The license plate authenticity data is as follows, which is used for license plate authenticity recognition branch model training:

[0046] Img1.jpg is the license plate image

[0047] Img2.jpg is not a license plate image

[0048] Img3.jpg is the license plate image

[0049] Img4.jpg is not a license plate image ...

[0051] S2. Extract features of license plate images in the database through the backbone model of the convolutional neural network; specifically, the backbone model uses the deep convolutional neural network ResNet18 to extract features from license plate images.

[0052] S3, after obtaining the features of the license plate images in the training database, sequentially train the license plate number recognition branch model, the license plate type recognition branch model, and the license plate authenticity recognition branch model, including the following sub-steps:

[0053] S3.1. Use data enhancement to augment the license plate image data in the training database, train the license plate number recognition branch model with the augmented license plate image data, and freeze the main model and the license plate number recognition branch model after the training is completed;

[0054] The license plate image data is enhanced by randomly changing the positions of the license plate characters and obtaining the corresponding license plate annotation data.

[0055] Specifically, a multi-label classification algorithm is set in the license plate number recognition branch model, each character of the license plate is set into a category, and all license plate characters are recognized.

[0056] S3.2. After the trunk model and the license plate number recognition branch model are frozen, the license plate type recognition branch model is trained. After the training is completed, the license plate type recognition branch model is frozen.

[0057] The license plate type recognition branch model is used to identify the color of the license plate, and thus identify the type of license plate, such as ordinary bad license plates, ordinary yellow license plates, new energy license plates, police car license plates, etc.

[0058] S3.3. After the license plate type recognition branch model is frozen, the license plate authenticity recognition branch model is trained, and after the training is completed, the license plate authenticity recognition branch model is frozen.

[0059] Specifically, in S3.3, a binary classification algorithm is set in the branch model of license plate authenticity recognition, that is, the branch of true and false license plates has only two categories: license plate pictures and non-license plate pictures. During the model training process, features are extracted through a convolutional neural network, cross entropy is used as the objective function, and the stochastic gradient descent algorithm is used as the optimization strategy to make the model's prediction results gradually approach the real label of the picture. After the model is trained, the prediction result of each picture is close to the label of the picture. When the model is used to predict pictures, the prediction result of non-license plate pictures is close to the preset vector of fake license plates, and the prediction result of license plate pictures is close to the vector of real license plates, so as to determine whether the picture is a license plate picture.

[0060] In the entire S3 step, the license plate images and annotated data in the training set are used to train the license plate number recognition branch model, the license plate type recognition branch model, and the license plate authenticity recognition branch model. After the training is completed, the license plate images and annotated data in the test set are used to test the license plate number recognition branch model, the license plate type recognition branch model, and the license plate authenticity recognition branch model. Generally, a test accuracy threshold is set, such as the number recognition accuracy, type recognition accuracy, and authenticity recognition accuracy are set to 99%. If any of the recognition accuracy is lower than 99%, it is considered unqualified. The accuracy must be higher than 99% at the same time to determine that the model test is qualified. After the test passes, the license plate number recognition branch model, the license plate type recognition branch model, and the license plate authenticity recognition branch model are frozen.

[0061] S4. Deploy the trained convolutional neural network backbone model, license plate number recognition branch model, license plate type recognition branch model, and license plate authenticity recognition branch model to the target computer, and input the license plate image to be tested into the target computer to obtain the recognition result.

[0062] As an embodiment of the present invention, before the license plate recognition, the position of the license plate image in the original picture is determined by a license plate image detection algorithm, and the license plate image is cropped.

[0063] Corresponding to the above method, the present invention also provides a license plate recognition device based on few-sample training, including: a processor and a memory, the memory stores a computer program executable by the processor, and the processor implements the above method when executing the computer program.

[0064] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A license plate recognition method based on few-sample training, characterized by: The steps include: S1. Setting annotation data for license plate images in the database; S2, extract the features of the license plate images in the database through the backbone model of the convolutional neural network; S3, after acquiring the features of the license plate images in the training database, sequentially train the license plate number recognition branch model, the license plate type recognition branch model, and the license plate authenticity recognition branch model; S4. Deploy the trained convolutional neural network backbone model, license plate number recognition branch model, license plate type recognition branch model, and license plate authenticity recognition branch model to the target computer, and input the license plate image to be tested into the target computer to obtain the recognition result.

2. According to a license plate recognition method based on few-sample training as described in claim 1, it is characterized in that: the annotation data includes license plate number character data, license plate type data, and license plate authenticity data corresponding to the license plate image.

3. The license plate recognition method based on few-sample training according to claim 2 is characterized by: The database includes a training set and a test set; the license plate images and annotated data in the training set are used to train the license plate number recognition branch model, the license plate type recognition branch model, and the license plate authenticity recognition branch model; after the training is completed, the license plate images and annotated data in the test set are used to test the license plate number recognition branch model, the license plate type recognition branch model, and the license plate authenticity recognition branch model; after the test passes, the license plate number recognition branch model, the license plate type recognition branch model, and the license plate authenticity recognition branch model are frozen.

4. The license plate recognition method based on few-sample training according to claim 3 is characterized by: The backbone model includes a deep convolutional neural network ResNet18, which is used to extract features from license plate images.

5. The license plate recognition method based on few-sample training according to claim 4 is characterized by: S3 includes the following sub-steps: S3.

1. Use data enhancement to augment the license plate image data in the training database, train the license plate number recognition branch model with the augmented license plate image data, and freeze the main model and the license plate number recognition branch model after the training is completed; S3.

2. After the trunk model and the license plate number recognition branch model are frozen, the license plate type recognition branch model is trained. After the training is completed, the license plate type recognition branch model is frozen. S3.

3. After the license plate type recognition branch model is frozen, the license plate authenticity recognition branch model is trained, and after the training is completed, the license plate authenticity recognition branch model is frozen.

6. The license plate recognition method based on few-sample training according to claim 5 is characterized by: The data enhancement for the license plate image data in S3.1 includes: randomly changing the positions of the license plate characters and obtaining the corresponding license plate annotation data.

7. The license plate recognition method based on few-sample training according to claim 6 is characterized by: A multi-label classification algorithm is set in the license plate number recognition branch model in S3.1, which sets each character of the license plate into a category and recognizes all license plate characters.

8. The method for license plate recognition based on few-sample training according to claim 7 is characterized in that: In S3.3, a binary classification algorithm is set in the license plate authenticity recognition branch model, cross entropy is used as the objective function, and the stochastic gradient descent algorithm is used as the optimization strategy, so that the license plate authenticity recognition branch model gradually approaches the license plate authenticity data. After the license plate authenticity recognition branch model is trained, the authenticity of the license plate is obtained based on the output prediction results.

9. The license plate recognition method based on few-sample training according to claim 8 is characterized by: Before license plate recognition, the license plate image detection algorithm is used to determine the position of the license plate image in the original image and crop the license plate image.

10. A license plate recognition device based on few-sample training, characterized by: include: A processor and a memory, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.