License plate color recognition method based on target detection and classification algorithm

By combining the improved YOLOv5 model and AlexNet network, using object detection and classification algorithms, the problem of insufficient robustness and limited generalization ability of license plate color recognition technology in complex lighting and background is solved, and efficient and accurate license plate color is achieved. Identification reduces the false detection rate and improves the adaptability and accuracy of identification.

CN119295826APending Publication Date: 2025-01-10北京中科通量科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411418720.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing license plate color recognition technology is not robust enough in complex lighting and backgrounds. It relies on a large amount of labeled data, consumes a lot of computing resources, has limited generalization ability, high error detection rate, and has new scenarios and license plate recognition ability. Difference.

Method used

Using a method based on object detection and classification algorithm, combined with the improved YOLOv5 model and AlexNet network, through the strategy of feature extraction and weighted summing, the impact of lighting is reduced, the generalization ability of model, the error detection rate is reduced, and the recognition accuracy is improved.

Benefits of technology

In many scenarios, the accuracy and robustness of license plate color recognition is significantly improved, the error detection rate is reduced, the adaptability and flexibility of the model is enhanced, the model design is simplified, and the practicality and operability of the recognition is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295826A_ABST
    Figure CN119295826A_ABST
Patent Text Reader

Abstract

The invention discloses a license plate color recognition method based on a target detection and classification algorithm, and the method comprises the steps: S1, inputting an obtained image into an improved YOLOv5 model for reasoning, outputting a license plate color detection result, and cutting a license plate image from an original image; s2, inputting a license plate image cut from the original image into an AlexNet network for reasoning to obtain a license plate color classification result; and S3, allocating different weight parameters to the license plate color detection result obtained in the step S1 and the license plate color classification result obtained in the step S2, and carrying out weighted summation on the two results to obtain a final license plate recognition result, so that efficient and accurate recognition under various environmental conditions is realized, and the robustness is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a license plate color recognition technology, and in particular to a license plate color recognition method based on a target detection and classification algorithm. Background Art

[0002] License plate color recognition technology is a key link in intelligent transportation systems (ITS), which is closely related to technical fields such as image processing, computer vision, pattern recognition and machine learning. With the development of technology, especially the breakthrough in deep learning, license plate recognition technology has made significant progress in accuracy, robustness and real-time performance, and is widely used in traffic monitoring, parking management, electronic toll collection and vehicle tracking.

[0003] In the process of development in the field of technology, license plate recognition technology has evolved from traditional image processing algorithms to modern deep learning methods. Early systems mainly used color segmentation, edge detection and other technologies for license plate location and character segmentation. Over time, machine learning algorithms, such as support vector machines (SVM) and decision trees, were introduced to improve the accuracy of recognition. Key technologies include image preprocessing, license plate location, character segmentation and recognition, and color recognition. Image preprocessing technology improves image quality through grayscale, noise removal and contrast enhancement. License plate location technology uses color space analysis, edge detection and deep learning target detection algorithms to quickly and accurately locate license plates. Character segmentation technology achieves accurate character segmentation through methods such as projection analysis and threshold segmentation. Character recognition technology uses algorithms such as SVM and CNN to improve recognition accuracy. Color recognition technology uses HSV color space analysis and fuzzy logic to improve recognition capabilities. However, existing technologies still have limitations, such as the lack of robustness of traditional algorithms under complex lighting and backgrounds, machine learning algorithms rely on a large amount of labeled data, and deep learning methods consume large computing resources and have limited generalization capabilities for small samples.

[0004] The fuzzy-based license plate color recognition algorithm is a method that uses fuzzy logic to handle license plate color recognition tasks. This algorithm is particularly suitable for dealing with colors that are difficult to distinguish in traditional color spaces, or color recognition problems in complex environments such as changing lighting conditions and license plate color degradation. The core principle of the fuzzy-based license plate color recognition algorithm is to use fuzzy logic to deal with uncertainty and ambiguity in color recognition, which is usually achieved through the following steps: 1) Color space conversion: First, convert the license plate image from the RGB color space to the HSV (hue, saturation and value) color space, because the HSV color space is more intuitive and robust for color representation; 2) Color feature extraction: In the HSV color space, extract the color features of the license plate, which usually involves analyzing the hue (H) component because it is the most critical in color recognition; 3) Fuzzy set mapping: Map the hue component of the HSV space to the fuzzy set according to different membership functions. The membership function defines the relationship between the color value and the fuzzy set (such as red, blue, yellow, etc.). ); 4) Fuzzy rule definition: define fuzzy rules to describe the relationship between different color features and license plate color categories, which are based on experience and expert knowledge; 5) Fuzzy reasoning: use fuzzy logic to reason and classify the license plate color according to the defined fuzzy rules and extracted color features; 6) Color recognition: identify the color of the license plate through the results of fuzzy reasoning, which usually involves determining the color category with the highest membership; 7) Learning algorithm optimization: in order to adapt to different environments and license plate types, use learning algorithms to optimize the parameters of the fuzzy logic controller to improve the accuracy and adaptability of recognition; 8) Post-processing: may include some post-processing steps, such as color consistency check, to further improve the accuracy of recognition.

[0005] The fuzzy-based license plate color recognition algorithm shows high robustness in the problem of license plate color recognition and can handle the uncertainty and ambiguity in license plate color recognition. However, this method relies on experience to adjust parameters, the algorithm is complex, and the performance varies greatly in different lighting environments. When faced with new scenes or license plates that have never been seen, the generalization ability is very poor. Specifically, there are the following shortcomings: 1) Parameter adjustment depends on experience: The performance of the fuzzy logic system depends to a large extent on the definition of membership functions and fuzzy rules, and usually requires professional knowledge and experience to adjust; 2) Sensitive to lighting: Although the HSV color space is more robust to lighting changes, color recognition is difficult to detect under extreme lighting conditions. The accuracy may still be affected; 3) Color similarity problem: For license plates with similar color features, such as blue and black, it may be difficult to distinguish, resulting in recognition errors; 4) Limitations of learning algorithms: Although learning algorithms can optimize system parameters, they may require a large amount of training data and may have difficulty adapting to new colors or lighting conditions that have not been seen; 5) System generalization ability: Fuzzy logic systems may perform well in specific application scenarios, but generalization to other scenarios may require re-adjustment of parameters; 6) Dependence on specific implementations: Different implementation methods (such as the selection of membership functions, the definition of fuzzy rules, etc.) may lead to significant differences in performance. Therefore, the fuzzy-based license plate color recognition algorithm only realizes license plate color recognition based on the color distribution of different license plates. It is greatly affected by lighting, has insufficient generalization ability in different scenarios, and is difficult to debug.

[0006] The lightweight vehicle license plate color recognition method based on attention mechanism optimization is an advanced intelligent transportation technology that achieves efficient and accurate license plate color recognition through a series of carefully designed steps. The method first obtains and preprocesses images from vehicle driving data, and then uses a specific network structure, including CBS module, C3 module, SlimAM module, Upsample module and Concat module, to perform feature extraction and color recognition. Among them, the introduction of SiLU activation function and parameter-free attention mechanism SlimAM module not only optimizes the model performance and avoids performance loss during training, but also improves the recognition ability of license plate color features. In addition, the generation of anchor boxes is optimized by k-means algorithm, which further improves the training efficiency and convergence speed of the model. For example, a license plate color recognition method with publication number CN117392658A has the following specific implementation steps: 1) Acquire vehicle image: Capture vehicle image from vehicle driving data and mark the position of the license plate in the image; 2) Set label of annotation box: Set corresponding color label for the annotation box of the license plate position according to the actual color of the license plate; 3) Image resolution processing: Perform uniform resolution processing on vehicle images to form a standardized image data set suitable for model training and recognition; 4) Build network structure: Build a lightweight vehicle license plate color recognition network structure, which may include multiple optimization modules, such as CBS module, C3 module, SlimAM module, Upsample module and Concat module; 5) Model training: Use the training data set with labeled color labels to train the network model to generate a license plate color recognition model; 6) Model inference: Input the vehicle image to be recognized into the trained model, and the model outputs the license plate color through forward propagation calculation; 7) Output result: The model finally outputs the recognized license plate color to complete the color recognition task.

[0007] The above method can provide high-precision color quantization while reducing the consumption of computing resources, solve the problems of cumbersome data collection and large inference resource usage in the existing technology, and significantly improve the accuracy and practicality of license plate color recognition. However, this technology can only recognize blue and green license plates, and has not been tested for license plates of other colors. It has the following problems: 1) Generalization ability: It has only been verified on blue and green license plates, and its generalization ability for license plates of other colors may be limited; 2) False detection: The exclusion mechanism for non-license plate images is not perfect, resulting in a high false recognition rate; 3) Limitations of the attention mechanism: The attention mechanism may need to be carefully designed to ensure that it can effectively highlight important color features: 4) Environmental adaptability: The robustness of the model needs to be further enhanced for environmental factors such as different lighting conditions, occlusion or license plate damage. Therefore, this method's ability to recognize complex and diverse license plate colors needs to be improved, and the attention mechanism also has certain limitations. Summary of the invention

[0008] The purpose of the present invention is to provide a license plate color recognition method based on target detection and classification algorithm, so as to reduce the influence of changes in the environment such as lighting on the model, enhance the generalization ability of the model and reduce the false detection rate of the model, so as to still have a high accuracy rate in multiple scenes, making it competitive in the field of license plate color recognition. The technical problems to be solved by the present invention include:

[0009] 1) Light sensitivity: Traditional machine learning methods mainly reason about the color space of license plates. When the lighting environment is very different, the model's recognition results of license plate color will also be very different. The present invention trains the improved YOLOv5 model using data from multiple lighting environments, so that the improved model can realize license plate color recognition in multiple scenarios.

[0010] 2) Problems of relying on specific implementation methods: Current license plate color recognition technologies often rely on specific methods to improve their recognition effects. For example, methods based on fuzzy logic require careful definition of membership functions and fuzzy rules, while methods based on deep learning may rely on complex network structures and fine-tuning of attention mechanisms. Although these technologies perform well under controlled conditions, their application effects in unknown or complex environments may be reduced. In contrast, the present invention adopts an innovative combination strategy, combining the improved YOLOv5 target detection model and the AlexNet network for license plate color classification, which significantly enhances the robustness of the model in diverse environments.

[0011] 3) The problem of insufficient generalization ability: The primary goal of the present invention is to overcome the limitations of the existing technology in generalization ability. Faced with the shortcomings of traditional machine learning strategies and fuzzy logic-based algorithms in identifying license plate colors in new scenarios, as well as the limited generalization of deep learning models when faced with distribution inconsistencies with training data, the present invention proposes an innovative solution. By utilizing the inherent shape stability and size consistency of license plates, the accuracy of target detection algorithms and the efficiency of classification models are cleverly combined. Through the strategy of detection before classification, the model's adaptability to different environments and conditions is significantly improved.

[0012] 4) High false detection rate: Another core pursuit of the present invention is to significantly reduce the high false detection rate problem that is prevalent in the prior art. In multi-scale and complex scenarios, existing recognition technologies often encounter high false detection rates, mainly because they directly perform color recognition based on the license plate detected by the model. Once an error occurs in the license plate detection, the accuracy of color recognition is out of the question. The false detections of these methods usually come from two aspects: misidentification of license plates and misjudgment of license plate colors. In order to effectively meet this challenge, the present invention adopts an innovative dual recognition strategy. First, the license plate detection process is optimized by an improved YOLOv5 model, thereby reducing the false detection rate. Secondly, even in the case of errors in license plate detection, the introduced AlexNet model can perform secondary fine recognition of suspicious targets to further screen and correct possible false detections. This two-stage recognition process not only improves the overall accuracy of the system, but also greatly reduces the overall false detection rate in the license plate color recognition process, demonstrating the significant advantages of the present invention in improving recognition accuracy and reliability.

[0013] To achieve the above object, the present invention provides a license plate color recognition method based on target detection and classification algorithm, which comprises:

[0014] Step S1: input the acquired image into the improved YOLOv5 model for inference, wherein: the model first adjusts the input image size, and then extracts features from the image by using CSPNet as the backbone; then the model uses the feature pyramid network and PANet of its Neck network part to enhance features at multiple scales to improve the small target detection performance; then the model defines multiple anchor boxes for each feature point, and predicts the classification and positioning of each anchor box, and optimizes the accuracy of model prediction through a composite loss function, wherein the composite loss function includes classification loss, confidence loss and positioning loss; finally, a non-maximum suppression algorithm is applied to remove low-confidence prediction boxes, and overlapping prediction boxes are merged, and the license plate color detection result is output and the license plate image is cropped from the original image;

[0015] Step S2: The license plate image cropped from the original image is input into the AlexNet network for inference, wherein: the AlexNet network first extracts features from the image through five convolutional layers and ReLU activation functions, and each convolutional layer is followed by a maximum pooling layer to reduce the spatial dimension of the features; the extracted features are then deeply analyzed through several fully connected layers, and the ReLU activation function introduces nonlinearity in the fully connected layers; finally, the network output is converted into a category probability distribution through an output layer activated by softmax to obtain the license plate color classification result;

[0016] Step S3: assigning different weight parameters to the license plate color detection result obtained in step S1 and the license plate color classification result obtained in step S2, respectively, and performing weighted summation on the two results to obtain the final license plate recognition result.

[0017] In one embodiment of the present invention, the improved YOLOv5 model uses the SIoU loss function as the positioning loss function.

[0018] In one embodiment of the present invention, the SIoU loss function L SIoU The specific definition is:

[0019]

[0020] In the formula, Δ is the distance loss, that is, the Euclidean distance between the center of the real box and the center of the predicted box; Ω is the shape loss, that is, the width loss and height loss of the real box and the predicted box; IoU represents the intersection over union ratio of the real box and the predicted box.

[0021] In one embodiment of the present invention, the distance loss Δ is defined as:

[0022]

[0023] in, and γ=2-Λ,

[0024] in, and They represent the coordinate values ​​of the center point of the real frame in the X direction and the Y direction respectively. and They represent the coordinate values ​​of the center point of the prediction box in the X direction and the Y direction respectively, C w and C h They represent the width and height of the minimum bounding box respectively, and Λ represents the angle loss between the real box and the predicted box.

[0025] In one embodiment of the present invention, the shape loss Ω is defined as:

[0026]

[0027] Among them, θ is a parameter that controls the degree of attention to shape loss.

[0028] In one embodiment of the present invention, the intersection over union (IoU) of the real frame and the predicted frame is defined as:

[0029]

[0030] Among them, B represents the prediction box, B gt For the real frame.

[0031] In one embodiment of the present invention, a category of non-license plate images is added to the classification algorithm of the AlexNet network, and the non-license plate category is used to filter false detections in the target detection algorithm.

[0032] In one embodiment of the present invention, the specific manner of weighting the two results in step 3 is:

[0033] OutPut=ω1*O o +ω2*O c

[0034] Among them, ω1 and ω2 are weight parameters, O o is the license plate color detection result obtained in step S1, O c is the license plate color classification result obtained in step S2;

[0035] Among them, the weight parameters are obtained through automatic learning during the training process of each model. The automatic learning definition of the weight parameters is as follows:

[0036]

[0037] Among them, ω i is the current weight, η is the learning rate, is the loss function with respect to weight ω i The partial derivative of .

[0038] In one embodiment of the present invention, the model training data includes data collected under various lighting environments such as sunny days, cloudy days, and nights, and the data is preprocessed by image enhancement techniques such as rotation, flipping, random brightness, and random contrast.

[0039] Compared with the prior art, the license plate color recognition method based on target detection and classification algorithm provided by the present invention realizes efficient and accurate recognition under various environmental conditions by combining the improved YOLOv5 model and AlexNet network, and provides an effective solution to the limitations of the prior art, such as insufficient generalization ability, high false detection rate, and poor adaptability to complex environments. By introducing adaptive weight parameters and advanced loss functions, not only the accuracy and robustness of license plate detection are improved, but also the flexibility and intelligence of the model fusion strategy are enhanced. The method provided by the present invention not only promotes the development of intelligent transportation systems, but also provides new ideas and tools for technological progress in related fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present invention 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 It is a flowchart of an embodiment of the present invention. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] The key technologies of the present invention include the improvement of YOLOv5 and the integration method of the recognition results of YOLOv5 and AlexNet, so as to cooperate with each other in license plate color recognition to achieve better performance and generalization ability. Figure 1 FIG. 1 is a flow chart of an embodiment of the present invention. Figure 1 As shown, this embodiment provides a license plate color recognition method based on a target detection and classification algorithm, which includes:

[0044] Step S1: input the acquired image into the improved YOLOv5 model for inference, wherein: the model first adjusts the input image size, and then extracts features from the image by using CSPNet (Cross Stage Partial Network) as the backbone; then the model uses the feature pyramid network and PANet (Path Aggregation Network, a neural network for target detection) of its Neck network (intermediate feature extraction network in the YOLOv5 model) to enhance features at multiple scales to improve small target detection performance; then the model defines multiple anchor boxes for each feature point, and predicts the classification and positioning of each anchor box, and optimizes the accuracy of model prediction through a composite loss function, which includes classification loss, confidence loss and positioning loss; finally, a non-maximum suppression algorithm is applied to remove low-confidence prediction boxes, and overlapping prediction boxes are merged, and the license plate color detection result is output and the license plate image is cropped from the original image;

[0045] Since the detection of the license plate will affect the final recognition result of the entire model, in order to improve the detection effect of the license plate, the improved YOLOv5 model adopted in this embodiment uses the SIoU loss function as the positioning loss function, aiming to further improve the accuracy and robustness of license plate detection. The working principle of the model can be found in the conventional YOLOv5 model, which will not be elaborated here.

[0046] In this embodiment, the improved YOLOv5 model uses the SIoU loss function as the positioning loss function. The SIoU loss function L SIoU The specific definition is:

[0047]

[0048] In the formula, Δ is the distance loss, that is, the Euclidean distance between the center of the real box and the center of the predicted box; Ω is the shape loss, that is, the width loss and height loss of the real box and the predicted box; IoU represents the intersection over union ratio of the real box and the predicted box.

[0049] In this embodiment, the distance loss Δ is defined as:

[0050]

[0051] in, and γ=2-Λ,

[0052] in, and They represent the coordinate values ​​of the center point of the real frame in the X direction and the Y direction respectively. and They represent the coordinate values ​​of the center point of the prediction box in the X direction and the Y direction respectively, C w and C h They represent the width and height of the minimum bounding box respectively, and Λ represents the angle loss between the real box and the predicted box.

[0053] In this embodiment, the shape loss Ω is defined as:

[0054]

[0055] Among them, θ is a parameter that controls the degree of attention to shape loss. In order to avoid paying too much attention to shape loss and reducing the movement of the prediction box, its value range can be calculated by genetic algorithms, etc., usually [2, 6].

[0056] In this embodiment, the intersection over union (IoU) of the real box and the predicted box is defined as:

[0057]

[0058] Among them, B represents the prediction box, Bgt For the real frame.

[0059] The object detection algorithm of the YOLOv5 model, with its deep network structure, is able to deeply explore and extract the complex and subtle features of the license plate, while the relatively shallow classification network focuses on capturing the basic and salient features of the license plate.

[0060] Step S2: The license plate image cropped from the original image is input into the AlexNet network for inference, wherein: the AlexNet network first extracts features from the image through five convolutional layers and ReLU activation functions, and each convolutional layer is followed by a maximum pooling layer to reduce the spatial dimension of the features. Due to the AlexNet's unique local response normalization layer, the generalization ability of the model can be further enhanced and overfitting can be reduced; the extracted features are then deeply analyzed through several fully connected layers, and the ReLU activation function introduces nonlinearity in the fully connected layers; finally, the network output is converted into a category probability distribution through an output layer activated by softmax to obtain the license plate color classification result; the AlexNet network can make predictions based on the category with the highest probability, thereby completing the classification of the input image;

[0061] In this embodiment, the category of non-license plate images is added to the classification algorithm of the AlexNet network to further filter the false detections in the target detection algorithm of YOLOv5, which can significantly reduce the false detection rate of the model and improve the robustness of the model.

[0062] Step S3: assigning different weight parameters to the license plate color detection result obtained in step S1 and the license plate color classification result obtained in step S2, respectively, and performing weighted summation on the two results to obtain the final license plate recognition result.

[0063] In this embodiment, the specific method of weighting the two results (the results obtained by the target detection algorithm and the classification algorithm) in step 3 is:

[0064] OutPut=ω1-O o +ω2*O c Among them, ω1 and ω2 are weight parameters, O o is the license plate color detection result obtained in step S1 (i.e., the output result of the target detection algorithm), O c is the license plate color classification result obtained in step S2 (i.e., the output result of the classification algorithm);

[0065] Among them, the weight parameters are obtained through automatic learning during the training process of each model. The automatic learning definition of the weight parameters is as follows:

[0066]

[0067] Among them, ω i is the current weight, η is the learning rate, is the loss function with respect to weight ω i The partial derivative of .

[0068] In this embodiment, the model training data includes data collected under various lighting environments such as sunny days, cloudy days, and nights, and the data is preprocessed by image enhancement techniques such as rotation, flipping, random brightness, and random contrast. That is, in the data collection stage, data under various lighting environments such as sunny days, cloudy days, and nights are collected; in the data preprocessing stage, image enhancement techniques such as rotation, flipping, random brightness, and random contrast are used, so that the model of the present invention can realize license plate color recognition in multiple scenes, solving the problem of light sensitivity in the prior art.

[0069] This embodiment cleverly assigns differentiated weight parameters to the outputs of the YOLOv5 model and the AlexNet network. By weighted summing the outputs of the two models, it is possible to combine their respective advantages and intelligently integrate information to obtain a more accurate and reliable final output result. This fusion strategy not only improves the accuracy of license plate color recognition, but also enhances the robustness of the model to changing environments.

[0070] The license plate color recognition method based on target detection and classification algorithm provided by the present invention effectively solves the problems of insufficient generalization ability of the model in the field of license plate color detection, sensitivity to light and high false detection rate, and shows strong market potential. It is expected to bring certain improvements to the license plate recognition technology in the field of intelligent transportation and improve the efficiency and accuracy of the system in actual deployment, including:

[0071] 1) Reduced illumination sensitivity: Compared with traditional methods that are often limited to specific scenarios and sensitive to changes in the illumination environment, the present invention uses a relatively complete data set for training, which effectively reduces the adverse effects of illumination conditions on model performance, and the resulting model exhibits strong robustness in most scenarios;

[0072] 2) Reduced model design difficulty: Compared with traditional methods that rely on fuzzy logic and attention mechanisms, the present invention cleverly combines the dual advantages of target detection algorithm and classification algorithm, simplifying the complexity of model design. This integration strategy not only improves the overall performance of the model, but also reduces the technical threshold for achieving high-precision license plate color recognition, making the present invention more practical and operational in the field of license plate recognition;

[0073] 3) Improve the generalization ability of the model: Given that the shape of the license plate has high consistency and does not change much in different scenarios, this paper makes full use of the powerful ability of YOLOv5 in object detection to accurately extract the license plate area, and then further uses the classification network to carefully identify the license plate color. This strategy not only improves the adaptability of the model to various environments, but also significantly enhances the generalization ability of the model, ensuring stable recognition performance in a variety of actual scenarios.

[0074] 4) Reduce false detection rate: The present invention adopts the advanced SIoU (Scaled Intersection over Union) loss function to enhance the detection accuracy of the YOLOv5 model for license plates and optimize the detection effect. In addition, for the recognition results of license plate color, a weighted summation fusion strategy is adopted, combining the detection accuracy of YOLOv5 and the classification ability of AlexNet. This comprehensive method effectively integrates the advantages of the two models, significantly reduces the possibility of false detection, and improves the accuracy and reliability of license plate color recognition.

[0075] Those skilled in the art can understand that the accompanying drawings are only schematic diagrams of an embodiment, and the modules or processes in the accompanying drawings are not necessarily required to implement the present invention.

[0076] Those skilled in the art can understand that the modules in the device in the embodiment can be distributed in the device in the embodiment according to the description of the embodiment, or can be changed accordingly and located in one or more devices different from the embodiment. The modules in the above embodiment can be combined into one module, or can be further divided into multiple sub-modules.

[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A license plate color recognition method based on target detection and classification algorithm, characterized in that: include: Step S1: input the acquired image into the improved YOLOv5 model for inference, wherein: the model first adjusts the input image size, and then extracts features from the image by using CSPNet as the backbone; then the model uses the feature pyramid network and PANet of its Neck network part to enhance features at multiple scales to improve the small target detection performance; then the model defines multiple anchor boxes for each feature point, and predicts the classification and positioning of each anchor box, and optimizes the accuracy of model prediction through a composite loss function, and the composite loss function includes classification loss, confidence loss and positioning loss; finally, a non-maximum suppression algorithm is applied to remove low-confidence prediction boxes, and overlapping prediction boxes are merged, and the license plate color detection result is output and the license plate image is cropped from the original image; Step S2: The license plate image cropped from the original image is input into the AlexNet network for inference, wherein: the AlexNet network first extracts features from the image through five convolutional layers and ReLU activation functions, and each convolutional layer is followed by a maximum pooling layer to reduce the spatial dimension of the features; the extracted features are then deeply analyzed through several fully connected layers, and the ReLU activation function introduces nonlinearity in the fully connected layers; finally, the network output is converted into a category probability distribution through an output layer activated by softmax to obtain the license plate color classification result; Step S3: assigning different weight parameters to the license plate color detection result obtained in step S1 and the license plate color classification result obtained in step S2, respectively, and performing weighted summation on the two results to obtain the final license plate recognition result.

2. The license plate color recognition method based on target detection and classification algorithm according to claim 1 is characterized in that: The improved YOLOv5 model uses the SIoU loss function as the positioning loss function.

3. The license plate color recognition method based on target detection and classification algorithm according to claim 2 is characterized in that: SIoU loss function L SIoU The specific definition is: In the formula, Δ is the distance loss, that is, the Euclidean distance between the center of the real box and the center of the predicted box; Ω is the shape loss, that is, the width loss and height loss of the real box and the predicted box; IoU represents the intersection over union ratio of the real box and the predicted box.

4. The license plate color recognition method based on target detection and classification algorithm according to claim 3 is characterized in that: The distance loss Δ is defined as: in, and γ=2-Λ in, and They represent the coordinate values ​​of the center point of the real frame in the X direction and the Y direction respectively. and They represent the coordinate values ​​of the center point of the prediction box in the X direction and the Y direction respectively, C w and C h They represent the width and height of the minimum bounding box respectively, and Λ represents the angle loss between the real box and the predicted box.

5. The license plate color recognition method based on target detection and classification algorithm according to claim 3 is characterized in that: The shape loss Ω is defined as: Among them, θ is a parameter that controls the degree of attention to shape loss.

6. The license plate color recognition method based on target detection and classification algorithm according to claim 3 is characterized in that: The intersection over union (IoU) of the real box and the predicted box is defined as: Among them, B represents the prediction box, B gt For the real frame.

7. The license plate color recognition method based on target detection and classification algorithm according to claim 1 is characterized in that: Add the category of non-license plate images to the classification algorithm of the AlexNet network.

8. The license plate color recognition method based on target detection and classification algorithm according to claim 1 is characterized in that: The specific method of weighted summing the two results in step 3 is: OutPut=ω1*O o +ω2*O c Among them, ω1 and ω2 are weight parameters, O o is the license plate color detection result obtained in step S1, O c is the license plate color classification result obtained in step S2; Among them, the weight parameters are obtained through automatic learning during the training process of each model. The automatic learning definition of the weight parameters is as follows: Among them, ω i is the current weight, η is the learning rate, is the loss function with respect to weight ω i The partial derivative of .

9. The license plate color recognition method based on target detection and classification algorithm according to claim 8 is characterized in that: The model training data includes data collected under various lighting conditions such as sunny days, cloudy days, and nights, and the data are preprocessed using image enhancement techniques such as rotation, flipping, random brightness, and random contrast.

Citation Information

Patent Citations

  • Light-weight vehicle license plate color recognition method based on attention mechanism optimization

    CN117392658A