Training method of license plate positioning recognition model and related device

By adjusting the parameters of the license plate positioning and recognition model, the problem of low efficiency of license plate positioning and recognition is solved, rapid and accurate positioning and recognition is achieved, the efficiency and accuracy of license plate positioning and recognition are improved, and license plate desensitization processing ensures data security.

CN118570783APending Publication Date: 2024-08-30SAIC MOTOR

Patent Information

Application Number
CN202310183630.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In the existing technology, the efficiency of positioning and identifying license plates in image data is low, resulting in complicated license plate positioning and recognition steps, which affects data processing efficiency.

Method used

By obtaining license plate sample images and real license plate position data, input the initial license plate positioning and recognition model, use the predicted license plate position data and real license plate position data to adjust model parameters, optimize the license plate positioning and recognition model, and achieve fast and accurate positioning and recognition.

Benefits of technology

The training results in a license plate positioning and recognition model that can quickly and accurately locate and recognize license plates, improves the efficiency and accuracy of license plate positioning and recognition, and ensures license plate desensitization processing for data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570783A
    Figure CN118570783A
Patent Text Reader

Abstract

The invention provides a license plate positioning recognition model training method and a related device, and the method comprises the steps: obtaining a license plate sample image and corresponding real license plate position data, the license plate sample image being a sample image including a license plate, and the real license plate position data being used for identifying the real position of the license plate included in the corresponding license plate sample image; inputting the license plate sample image into the initial license plate positioning recognition model to obtain corresponding predicted license plate position data; and according to the predicted license plate position data, the real license plate position data and a preset loss function, adjusting model parameters of the initial license plate positioning recognition model to obtain a license plate positioning recognition model which is used for performing license plate positioning recognition processing on the vehicle picture including the license plate. Through the method, the license plate positioning and recognition model capable of quickly and accurately positioning and recognizing the license plate in the image can be obtained through training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to a training method and related device for a license plate positioning and recognition model. Background Art

[0002] With the rapid development of science and technology, the automotive field is gradually transitioning from low-level assisted driving to high-level autonomous driving. In order to enable autonomous driving to cope with complex and changeable road conditions and driving scenarios, it is necessary to collect and analyze vehicle image data accordingly, so as to improve vehicle development, optimize user experience, and provide personalized services. At this time, since vehicle image data often includes license plates with personal information, for data security reasons, the vehicle image data needs to be desensitized before the corresponding analysis and processing can be carried out. Among them, how to accurately locate and identify the license plate of vehicle image data is crucial to license plate desensitization.

[0003] The related technology mainly realizes license plate positioning and recognition of vehicle image data by segmenting and recognizing license plate characters. Specifically, after preprocessing the vehicle image data, the license plate can be preliminarily located, and then the license plate characters are segmented, and the license plate is recognized by recognizing the segmented license plate characters.

[0004] Although the segmentation and recognition of license plate characters can realize accurate positioning and recognition of license plates, the steps of segmentation and recognition of license plates are relatively complicated, which leads to low positioning and recognition efficiency. In view of this, how to train a license plate positioning and recognition model that can quickly locate and recognize license plates is an urgent problem to be solved. Summary of the invention

[0005] The embodiments of the present application provide a method and related device for training a license plate location and recognition model, which can be trained to obtain a license plate location and recognition model that can quickly locate and recognize license plates.

[0006] In view of this, a first aspect of an embodiment of the present application provides a method for training a license plate location recognition model, comprising:

[0007] Acquire a license plate sample image and corresponding real license plate position data, the license plate sample image is a sample image including a license plate, and the real license plate position data is used to identify the real position of the license plate included in the corresponding license plate sample image;

[0008] Input the license plate sample image into the initial license plate positioning and recognition model to obtain the corresponding predicted license plate position data;

[0009] According to the predicted license plate position data, the actual license plate position data and the preset loss function, the model parameters of the initial license plate positioning and recognition model are adjusted to obtain the license plate positioning and recognition model. The license plate positioning and recognition model is used to perform license plate positioning and recognition processing on the vehicle image including the license plate.

[0010] A second aspect of an embodiment of the present application provides a training device for a license plate location recognition model, comprising:

[0011] An acquisition unit, used to acquire a license plate sample image and corresponding real license plate position data, the license plate sample image is a sample image including a license plate, and the real license plate position data is used to identify the real position of the license plate included in the corresponding license plate sample image;

[0012] A determination unit, used to input the license plate sample image into the initial license plate positioning and recognition model to obtain corresponding predicted license plate position data;

[0013] The adjustment unit is used to adjust the model parameters of the initial license plate positioning and recognition model according to the predicted license plate position data, the real license plate position data and the preset loss function to obtain the license plate positioning and recognition model. The license plate positioning and recognition model is used to perform license plate positioning and recognition processing on the vehicle picture including the license plate.

[0014] A third aspect of an embodiment of the present application provides an electronic device, including:

[0015] A memory for storing executable instructions;

[0016] The processor is used to implement the training method of the license plate positioning and recognition model provided in the embodiment of the present application when executing the executable instructions stored in the memory.

[0017] A fourth aspect of an embodiment of the present application provides a computer-readable medium storing executable instructions for implementing the training method of the license plate positioning and recognition model provided in an embodiment of the present application when executed by a processor.

[0018] The embodiment of the present application provides a training method and related device for a license plate location recognition model, the method comprising: obtaining a license plate sample image and corresponding real license plate position data, the license plate sample image is a sample image including a license plate, and the real license plate position data is used to identify the real position of the license plate included in the corresponding license plate sample image; inputting the license plate sample image into an initial license plate location recognition model to obtain corresponding predicted license plate position data; adjusting the model parameters of the initial license plate location recognition model according to the predicted license plate position data, the real license plate position data and a pre-set loss function to obtain a license plate location recognition model, the license plate location recognition model is used to perform license plate location recognition processing on a vehicle picture including a license plate. Through the above method, a license plate location recognition model that can quickly and accurately locate and recognize the license plate in an image can be trained. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0020] Figure 1 A flowchart of a method for training a license plate location recognition model provided in an embodiment of the present application;

[0021] Figure 2 A structural diagram of a license plate positioning and recognition model provided in an embodiment of the present application;

[0022] Figure 3 A schematic diagram of the parameter composition of a target prediction license plate prediction frame provided in an embodiment of the present application;

[0023] Figure 4 A schematic diagram of a training device for a license plate location and recognition model provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0025] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] When analyzing and processing vehicle image data, since vehicle image data often includes license plates containing personal information, for data security reasons, the vehicle image data needs to be desensitized before corresponding analysis and processing can be performed. Among them, how to accurately locate and identify the license plate of the vehicle image data is crucial to license plate desensitization.

[0027] In the related art, the license plate positioning and recognition is mainly realized by segmenting and recognizing the license plate characters. Specifically, after preprocessing the vehicle image data, the license plate can be initially positioned, and then the license plate characters are segmented, and the license plate recognition is realized by recognizing the segmented license plate characters. Although the segmentation and recognition of the license plate characters can realize the accurate positioning and recognition of the license plate, the steps of segmenting and recognizing the license plate are relatively complicated, which leads to low positioning and recognition efficiency.

[0028] In view of this, the present application provides a method and related device for training a license plate positioning and recognition model, which can train a license plate positioning and recognition model that can quickly locate and recognize license plates.

[0029] The following is an explanation of a method for training a license plate location recognition model of the present application through a method embodiment. Figure 1 As shown, Figure 1 A flowchart of a method for training a license plate location recognition model provided in an embodiment of the present application, the method comprising:

[0030] S101. Acquire a license plate sample image and corresponding real license plate position data, wherein the license plate sample image is a sample image including a license plate, and the real license plate position data is used to identify the real position of the license plate included in the corresponding license plate sample image.

[0031] Specifically, in order to be able to train the subsequent initial license plate positioning and recognition model, it is necessary to obtain license plate sample images and the corresponding real license plate position data, wherein the license plate sample image is a sample image whose image content includes the license plate, and its data can be derived from images including the license plate captured by drones or cameras in real traffic scenes. In order to improve the diversity of license plate sample images, the acquired license plate sample images can be images including the license plate captured under different weather environments, different viewing angles, different lighting conditions, etc.; the real license plate position data is used to identify the real position of the license plate included in the corresponding license plate sample image. The real position can be manually marked or automatically marked by an algorithm, as long as it can accurately reflect the real position of the license plate included in the license plate sample image.

[0032] In some embodiments, the real license plate position data includes the coordinates of the center point of the real license plate rectangular frame, the width of the real license plate rectangular frame, and the height of the real license plate rectangular frame.

[0033] Specifically, the real license plate position data may be the coordinate data corresponding to the real license plate rectangular frame, and the coordinate data may include the X coordinate and Y coordinate of the center point of the real license plate rectangular frame, and the width W and height H of the real license plate rectangular frame, wherein the real license plate data may be stored in txt format.

[0034] In some embodiments, before inputting the license plate sample image into the initial license plate positioning and recognition model, the method further includes performing data enhancement processing on the license plate sample image.

[0035] Specifically, the license plate sample images input into the initial license plate positioning and recognition model can be pre-processed with data enhancement, mainly including random rotation, scaling, cropping, median filtering, Laplace sharpening and other means. Among them, the random rotation, scaling and cropping of the license plate image samples can model the target perspective tilt, different distances, and occluded license plate data in real traffic scenes, thereby increasing the diversity of image samples and improving the number of training samples. It is a means of data augmentation; the median filtering process can remove certain noise and relatively completely retain the detailed features of the samples, which can highlight the license plate feature information to a certain extent and improve the quality of the license plate image samples; the Laplace sharpening process can highlight the edge contour of the image, especially for blurred images caused by car shaking or violent movement, which can improve the quality of the license plate image samples.

[0036] S102: Input the license plate sample image into the initial license plate positioning and recognition model to obtain corresponding predicted license plate position data.

[0037] Specifically, the initial license plate positioning and recognition model is a preliminary constructed model. For example, the YOLOv3 model can be used as the initial license plate positioning and recognition model. In order to obtain the positioning and recognition ability of the initial license plate positioning and recognition model and train and optimize the initial license plate positioning and recognition model in subsequent steps, the license plate sample image can be input into the initial license plate positioning and recognition model to obtain the corresponding predicted license plate position data.

[0038] In some embodiments, the predicted license plate position data includes the coordinates of the center point of the predicted license plate rectangular box, the predicted width of the license plate rectangular box, the predicted height of the license plate rectangular box and the predicted confidence, wherein the predicted confidence is used to indicate the degree of confidence that there is indeed a license plate within the predicted license plate rectangular box and the degree of confidence that the predicted license plate rectangular box includes all features of the license plate.

[0039] Specifically, the predicted license plate position data may be coordinate data corresponding to the predicted license plate rectangular box, and the coordinate data may include the coordinates of the center point of the predicted license plate rectangular box, the width and height of the predicted license plate rectangular box, and the predicted confidence. The predicted confidence is used to indicate the degree of confidence that the predicted license plate rectangular box does contain a license plate and the degree of confidence that the predicted license plate rectangular box includes all features of the license plate. For example, when the predicted confidence value is 1, it indicates that the degree of confidence that the predicted license plate rectangular box does contain a license plate and includes all features of the license plate is 100%; when the predicted confidence value is 0, it indicates that the degree of confidence that the predicted license plate rectangular box does contain a license plate and includes all features of the license plate is 0.

[0040] S103. According to the predicted license plate position data, the actual license plate position data and a preset loss function, the model parameters of the initial license plate positioning and recognition model are adjusted to obtain a license plate positioning and recognition model. The license plate positioning and recognition model is used to perform license plate positioning and recognition processing on a vehicle image including a license plate.

[0041] Specifically, the loss function can be used to analyze the difference between the predicted license plate position data and the real license plate position data. The smaller the loss function value, the smaller the difference between the predicted license plate position data and the real license plate position data. Therefore, the model parameters of the initial license plate location recognition model can be adjusted according to the pre-set loss function until a license plate location recognition model with the best performance is obtained. For example, when the initial license plate location recognition model is a YOLOv3 model, it is iteratively trained and optimized to obtain a license plate location recognition model such as Figure 2 As shown, Figure 2 A structural diagram of a license plate positioning and recognition model provided in an embodiment of the present application includes a convolution layer, an upsampling layer, a fusion layer and a target detection layer. The input license plate sample image will be forward propagated as follows: Figure 2 The convolution, upsampling, tensor addition, and tensor concatenation calculations are shown, and then backpropagation is performed based on the derivatives of the loss function with respect to the model parameters to continuously adjust the model parameters until the optimal performance of the model is achieved.

[0042] In some embodiments, the loss function includes a rectangular box center coordinate loss function, a rectangular box width and height loss function, and a confidence loss function;

[0043] The rectangular box center coordinate loss function is as follows:

[0044]

[0045] The rectangular box width and height loss function is as follows:

[0046]

[0047] The confidence loss function is as follows:

[0048]

[0049] Among them, Loss (x,y) Represents the loss function value of the center coordinate of the rectangular box, Loss (w,h) Represents the value of the rectangular box width and height loss function, P represents the number of grid cells in the license plate sample image, and I represents the number of predicted license plate rectangular boxes generated by each grid cell. For example, when I is 3, it means that each grid cell can generate three predicted license plate rectangular boxes. Indicates whether the ith predicted license plate rectangle corresponding to the pth grid cell predicts a license plate. If the predicted license plate rectangle predicts a license plate, the value can be 1; if it does not predict a license plate, the value can be 0. p ,h p is the width and height of the real license plate rectangle. To predict the width and height of the license plate rectangle, x p ,y p is the center point coordinate of the real license plate rectangle. To predict the coordinates of the center point of the license plate rectangle, Loss (objectness) represents the confidence loss function value, is the ratio of the intersection and union of the predicted license plate rectangle and the real license plate rectangle, with a value range of [0,1]. is the prediction confidence, N is the number of positive and negative samples, the positive sample refers to the predicted license plate rectangular frame with the largest ratio of intersection and union with the real license plate rectangular frame, and the negative sample refers to the predicted license plate rectangular frame with the ratio of intersection and union with the real license plate rectangular frame less than 0.5.

[0050] Specifically, the loss function can be used to analyze the degree of overlap between the predicted license plate rectangular frame and the real license plate rectangular frame. The loss function in this application includes a rectangle center coordinate loss function, a rectangle frame width and height loss function, and a confidence loss function. Among them, the rectangle center coordinate loss function can analyze the difference between the center point coordinates of all predicted license plate rectangular frames generated by all grid cells of the license plate sample image and the center point coordinates of the real license plate rectangular frame; the rectangle width and height loss function can analyze the difference between the width and height of all predicted license plate rectangular frames generated by all grid cells of the license plate sample image and the width and height of the real license plate rectangular frame; in the confidence loss function, is the predicted value c iThe prediction confidence calculated by the sigmoid function indicates whether there is a license plate in the predicted license plate rectangular box. The positive sample refers to the predicted license plate rectangular box with the largest ratio of intersection and union with the real license plate rectangular box, and the negative sample refers to the predicted license plate rectangular box with the ratio of intersection and union with the real license plate rectangular box less than 0.5. Among them, the positive sample not only contributes to the training and learning of confidence, but also has a positive contribution to positioning learning, while the negative sample only contributes to the training and learning of confidence.

[0051] The above-mentioned rectangle center coordinate loss function, rectangle frame width and height loss function and confidence loss function can constitute the loss function of the present application. The model parameters of the initial license plate positioning and recognition model can be adjusted through the loss function to obtain a license plate positioning and recognition model with optimal performance.

[0052] In some embodiments, after obtaining the license plate location recognition model, the license plate location recognition model can be used to recognize and desensitize the license plate position of the license plate image to be desensitized, including:

[0053] Acquire a target license plate image to be desensitized, where the target license plate image to be desensitized is an image including the license plate to be desensitized;

[0054] According to the target desensitized license plate image, the license plate positioning recognition model is used to perform license plate positioning recognition processing to obtain the target predicted license plate position data;

[0055] Based on the target predicted license plate position data, the license plate to be desensitized in the target license plate image to be desensitized is desensitized.

[0056] Specifically, in order to ensure data security, first, obtain the target license plate image to be desensitized, wherein the target license plate image to be desensitized can be constructed into a 4-dimensional Blob for model input and set the scaling ratio of the image channel values. Blob is a (Width, Height, Channel, Number) quadruple, Width represents the image width, Height represents the image height, Channel represents the number of image channels, and Number represents the number of images.

[0057] Then, the target license plate image to be desensitized is input into the license plate location recognition model, the license plate position of the target license plate image to be desensitized is recognized, and the target predicted license plate position data is output. The target predicted license plate position data can be used to identify the position data of the target license plate prediction frame. The license plate location recognition model will have multiple prediction outputs during the prediction process of extracting image feature information, and each prediction will generate multiple target license plate prediction frames for each grid, such as Figure 3 As shown, Figure 3 A schematic diagram of the parameter composition of a target prediction license plate prediction frame provided in an embodiment of the present application, Figure 3Three target license plate prediction frames are generated for each grid in the , and each target license plate prediction frame includes 4+1 target prediction parameters. The target prediction parameters include the target center point coordinates and target width and height data of the target license plate prediction frame, as well as the target prediction confidence corresponding to the target license plate prediction frame. The target center point coordinates and target width and height data can accurately represent the position and size of the target license plate prediction frame. The target prediction confidence can accurately represent the confidence level that there is indeed a license plate to be desensitized in the target license plate prediction frame and the confidence level that the target license plate prediction frame includes all features of the license plate to be desensitized. Among them, the license plate positioning and recognition model will use the non-maximum suppression algorithm to suppress redundant target license plate prediction frames.

[0058] Finally, based on the target predicted license plate position data, the license plate to be desensitized in the target license plate image to be desensitized can be accurately represented and desensitized, so that the license plate that can reflect personal information can be protected during the subsequent data analysis of the target license plate image to be desensitized.

[0059] In some embodiments, when the license plate location recognition model includes multiple target detection layers of different scales, in terms of performing license plate location recognition processing on the target to-be-desensitized license plate image through the license plate location recognition model to obtain target predicted license plate position data, the method includes:

[0060] According to the target license plate image to be desensitized, multiple target detection layers in the license plate positioning and recognition model are used to perform positioning and recognition at different scales to obtain multiple predicted license plate position data;

[0061] The non-maximum suppression algorithm is used to suppress multiple predicted license plate position data to obtain the target predicted license plate position data.

[0062] Specifically, since the scale of the license plate in the desensitized license plate image actually obtained is not fixed, for example, when the camera is close to the vehicle, the scale of the license plate in the desensitized license plate image obtained by the camera is larger, the license plate positioning and recognition model can include multiple target detection layers of different scales, and the positioning and recognition of different scales are performed through the multiple target detection layers in the license plate positioning and recognition model, such as Figure 2 As shown in the figure, when the target license plate image to be desensitized is input into the license plate positioning and recognition model with multiple target detection layers, it can be Figure 2 The 82nd, 94th, and 106th layers in the image are used for positioning and recognition at different scales.

[0063] After obtaining multiple predicted license plate position data, a non-maximum suppression algorithm can be used to suppress the multiple predicted license plate position data, eliminate non-optimal predicted license plate position data, and obtain target predicted license plate position data.

[0064] In some embodiments, desensitizing the license plate to be desensitized in the target license plate image to be desensitized based on the target predicted license plate position data includes:

[0065] Based on the target predicted license plate position data, determine the target desensitized area in the target desensitized license plate image;

[0066] Perform mosaic masking on the target area to be desensitized.

[0067] Specifically, the target desensitized area in the target license plate image can be determined based on the target predicted license plate position data. For example, the target predicted license plate position data can be converted into the starting point x1, y1 and the ending point x2, y2 of the target desensitized area, wherein the color and pixel thickness of the rectangular box corresponding to the target desensitized area can also be set, and mosaic masking processing can be performed on the target desensitized area to achieve the purpose of data desensitization.

[0068] In summary, the embodiment of the present application provides a method for training a license plate location recognition model and a related device, the method comprising: obtaining a sample license plate image and corresponding real license plate position data, the sample license plate image is a sample image including a license plate, and the real license plate position data is used to identify the real position of the license plate included in the corresponding sample license plate image; inputting the sample license plate image into the initial license plate location recognition model to obtain the corresponding predicted license plate position data; adjusting the model parameters of the initial license plate location recognition model according to the predicted license plate position data, the real license plate position data and a pre-set loss function to obtain a license plate location recognition model, the license plate location recognition model is used to perform license plate location recognition processing on a vehicle picture including a license plate. Through the above method, a license plate location recognition model that can quickly and accurately locate and recognize the license plate in the image can be trained.

[0069] The obtained license plate location and recognition model can quickly and accurately locate and recognize the license plate area in the desensitized license plate image in an end-to-end manner, improve the efficiency of license plate location and recognition, and ensure the accuracy of license plate location and recognition.

[0070] The following is an explanation of a training device for a license plate location recognition model provided by the present application through a device embodiment. Figure 4 As shown, Figure 4 A schematic diagram of a training device for a license plate location recognition model provided in an embodiment of the present application, the device comprising:

[0071] An acquisition unit, used to acquire a license plate sample image and corresponding real license plate position data, the license plate sample image is a sample image including a license plate, and the real license plate position data is used to identify the real position of the license plate included in the corresponding license plate sample image;

[0072] A determination unit, used to input the license plate sample image into the initial license plate positioning and recognition model to obtain corresponding predicted license plate position data;

[0073] The adjustment unit is used to adjust the model parameters of the initial license plate positioning and recognition model according to the predicted license plate position data, the real license plate position data and the preset loss function to obtain the license plate positioning and recognition model. The license plate positioning and recognition model is used to perform license plate positioning and recognition processing on the vehicle picture including the license plate.

[0074] In some embodiments, the real license plate position data includes the coordinates of the center point of the real license plate rectangular frame, the width of the real license plate rectangular frame, and the height of the real license plate rectangular frame;

[0075] Correspondingly, the predicted license plate position data includes the coordinates of the center point of the predicted license plate rectangular box, the predicted width of the license plate rectangular box, the predicted height of the license plate rectangular box and the predicted confidence, wherein the predicted confidence is used to indicate the degree of confidence that there is indeed a license plate within the predicted license plate rectangular box and the degree of confidence that the predicted license plate rectangular box includes all features of the license plate.

[0076] In some embodiments, the loss function includes a rectangular box center coordinate loss function, a rectangular box width and height loss function, and a confidence loss function;

[0077] The rectangular box center coordinate loss function is as follows:

[0078]

[0079] The rectangular box width and height loss function is as follows:

[0080]

[0081] The confidence loss function is as follows:

[0082]

[0083] Among them, Loss (x,y) Represents the loss function value of the center coordinate of the rectangular box, Loss (w,h) Represents the value of the rectangular box width and height loss function, P represents the number of grid cells of the license plate sample image, and I represents the number of predicted license plate rectangular boxes generated by each grid cell. Indicates whether the i-th predicted license plate rectangle corresponding to the p-th grid cell predicts a license plate, w p ,h p is the width and height of the real license plate rectangle. To predict the width and height of the license plate rectangle, x p ,y p is the center point coordinate of the real license plate rectangle. To predict the coordinates of the center point of the license plate rectangle, Loss (objectness) represents the confidence loss function value, is the ratio of the intersection and union of the predicted license plate rectangle and the real license plate rectangle, with a value range of [0,1]. is the prediction confidence, N is the number of positive and negative samples, the positive sample refers to the predicted license plate rectangular frame with the largest ratio of intersection and union with the real license plate rectangular frame, and the negative sample refers to the predicted license plate rectangular frame with the ratio of intersection and union with the real license plate rectangular frame less than 0.5.

[0084] In some embodiments, the training device further includes an enhancement unit, which is used to perform data enhancement processing on the license plate sample image.

[0085] In some embodiments, the training device also includes a desensitization unit, which is used to obtain a target license plate image to be desensitized, and the target license plate image to be desensitized is an image including the license plate to be desensitized; according to the target license plate image to be desensitized, a license plate positioning and recognition model is used to perform license plate positioning and recognition processing to obtain target predicted license plate position data; based on the target predicted license plate position data, the license plate to be desensitized in the target license plate image to be desensitized is desensitized.

[0086] In some embodiments, when the license plate positioning and recognition model includes multiple target detection layers of different scales, in terms of performing license plate positioning and recognition processing through the license plate positioning and recognition model according to the target license plate image to be desensitized to obtain target predicted license plate position data, the desensitizing unit is specifically used to: perform positioning and recognition of different scales through multiple target detection layers in the license plate positioning and recognition model according to the target license plate image to be desensitized to obtain multiple predicted license plate position data; suppress multiple predicted license plate position data through a non-maximum suppression algorithm to obtain target predicted license plate position data.

[0087] In some embodiments, in terms of desensitizing the license plate to be desensitized in the target license plate image to be desensitized based on the target predicted license plate position data, the desensitization unit is specifically used to: determine the target desensitized area in the target license plate image to be desensitized based on the target predicted license plate position data; and perform mosaic masking on the target desensitized area.

[0088] It should be noted that the specific working processes of the various modules provided in the above embodiments of the present application can refer to the corresponding implementation methods in the above method embodiments, and will not be repeated here.

[0089] Another embodiment of the present application provides an electronic device, including:

[0090] A memory for storing executable instructions;

[0091] The processor is used to implement the method in the above method embodiment of the embodiment of the present application when executing the executable instructions stored in the memory.

[0092] Another embodiment of the present application provides a computer-readable storage medium storing executable instructions for implementing the method in the above method embodiment of the present application when executed by a processor.

[0093] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0094] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A training method for a license plate location recognition model, characterized in that: include: Acquire a license plate sample image and corresponding real license plate position data, wherein the license plate sample image is a sample image including a license plate, and the real license plate position data is used to identify the real position of the license plate included in the corresponding license plate sample image; Inputting the license plate sample image into the initial license plate positioning and recognition model to obtain corresponding predicted license plate position data; According to the predicted license plate position data, the real license plate position data and a preset loss function, the model parameters of the initial license plate positioning and recognition model are adjusted to obtain a license plate positioning and recognition model, which is used to perform license plate positioning and recognition processing on a vehicle image including a license plate.

2. The method according to claim 1, characterized in that The real license plate position data includes the center point coordinates of the real license plate rectangular frame, the width of the real license plate rectangular frame and the height of the real license plate rectangular frame; Correspondingly, the predicted license plate position data includes the coordinates of the center point of the predicted license plate rectangular box, the predicted width of the license plate rectangular box, the predicted height of the license plate rectangular box and the predicted confidence, wherein the predicted confidence is used to indicate the degree of confidence that there is indeed a license plate within the predicted license plate rectangular box and the degree of confidence that all features of the license plate are included within the predicted license plate rectangular box.

3. The method according to claim 2, characterized in that The loss function includes a rectangular box center coordinate loss function, a rectangular box width and height loss function, and a confidence loss function; The rectangular frame center coordinate loss function is as follows: The rectangular frame width and height loss function is as follows: The confidence loss function is as follows: Among them, Loss (x,y) Represents the loss function value of the center coordinate of the rectangular box, Loss (w,h) represents the rectangular frame width and height loss function value, P represents the number of grid cells of the license plate sample image, I represents the number of predicted license plate rectangular frames generated by each grid cell, Indicates whether the i-th predicted license plate rectangle corresponding to the p-th grid cell predicts a license plate, w p ,h p is the width and height of the real license plate rectangular frame, is the width and height of the predicted license plate rectangular frame, x p ,y p is the center point coordinate of the real license plate rectangular frame, is the center point coordinate of the predicted license plate rectangle, Loss (objectness) represents the confidence loss function value, is the ratio of the intersection and union of the predicted license plate rectangle and the real license plate rectangle, and its value range is [0,1]. is the prediction confidence, N is the number of positive and negative samples, the positive sample refers to the predicted license plate rectangular frame with the largest ratio of intersection and union with the real license plate rectangular frame, and the negative sample refers to the predicted license plate rectangular frame with the ratio of intersection and union with the real license plate rectangular frame less than 0.

5.

4. The method according to claim 1, characterized in that Before inputting the license plate sample image into the initial license plate positioning and recognition model, the method further includes performing data enhancement processing on the license plate sample image.

5. The method according to claim 1, characterized in that The method further comprises: Acquire a target license plate image to be desensitized, wherein the target license plate image to be desensitized is an image including the license plate to be desensitized; According to the target to-be-desensitized license plate image, license plate positioning and recognition processing is performed through the license plate positioning and recognition model to obtain target predicted license plate position data; Based on the target predicted license plate position data, the license plate to be desensitized in the target license plate image to be desensitized is desensitized.

6. The method according to claim 5, characterized in that When the license plate location recognition model includes a plurality of target detection layers of different scales, the license plate location recognition processing is performed by the license plate location recognition model according to the target to-be-desensitized license plate image to obtain target predicted license plate position data, including: According to the target license plate image to be desensitized, positioning and identifying at different scales are performed through multiple target detection layers in the license plate positioning and recognition model to obtain multiple predicted license plate position data; The plurality of predicted license plate position data are suppressed by a non-maximum suppression algorithm to obtain target predicted license plate position data.

7. The method according to claim 5, characterized in that The desensitizing the license plate to be desensitized in the target license plate image to be desensitized based on the target predicted license plate position data includes: Based on the target predicted license plate position data, determining the target to-be-desensitized area in the target to-be-desensitized license plate image; The target area to be desensitized is subjected to mosaic masking processing.

8. A training device for a license plate location recognition model, characterized in that: include: An acquisition unit, used to acquire a license plate sample image and corresponding real license plate position data, wherein the license plate sample image is a sample image including a license plate, and the real license plate position data is used to identify the real position of the license plate included in the corresponding license plate sample image; A determination unit, used to input the license plate sample image into an initial license plate location recognition model to obtain corresponding predicted license plate position data; An adjustment unit is used to adjust the model parameters of the initial license plate location and recognition model according to the predicted license plate location data, the real license plate location data and a preset loss function to obtain a license plate location and recognition model, wherein the license plate location and recognition model is used to perform license plate location and recognition processing on a vehicle picture including a license plate.

9. An electronic device, characterized in that: include: A memory for storing executable instructions; The processor is used to implement the training method of the license plate positioning and recognition model described in any one of claims 1 to 7 when executing the executable instructions stored in the memory.

10. A computer-readable storage medium, characterized in that: Executable instructions are stored, which are used to implement the training method of the license plate positioning and recognition model described in any one of claims 1 to 7 when executed by a processor.

Citation Information

Patent Citations

  • License plate recognition method and device for complex scenes

    CN110991444A

  • Deep neural network license plate positioning method based on image enhancement in complex environment

    CN111310862A

  • License plate positioning and recognition method and system under unconstrained condition

    CN111444916A

  • License plate recognition detection method and device

    CN114241482A

  • License plate desensitization method and device based on deep learning, equipment and storage medium

    CN114842035A

Cited By

  • Desensitization model training method, image desensitization method and device

    CN118862176A