Rider helmet detection and license plate recognition method and system based on YOLOv10s and PP-OCRv4

By introducing the CoordAtt attention module in the YOLOv10s model and using the PP-OCRv4 model, combining YOLOv10s and PP-OCRv4, cyclist helmet detection and license plate recognition are realized, solving the problems of long inference time and insufficient license plate recognition in the existing technology. Provides efficient and accurate traffic supervision support.

CN119251776APending Publication Date: 2025-01-03XIAMEN UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411141131.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The prior art relies on NMS algorithms in cyclist helmet detection, resulting in an increase in inference time and calculation overhead, and only detects the helmet wearing situation, fails to realize license plate recognition, and cannot provide more comprehensive supervision and record support from the transportation department.

Method used

Using the cyclist helmet detection and license plate recognition method based on YOLOv10s and PP-OCRv4, the CoordAtt attention module is added to the YOLOv10s model and the license plate recognition is combined with the PP-OCRv4 model to realize helmet wear detection and license plate number output, reducing inference time and Calculate overhead.

Benefits of technology

It realizes high-precision and real-time cyclist helmet wear detection and license plate recognition, can quickly identify and record violation information, help the transportation department formulate effective management and punishment measures, and reduces the cost and time of manual inspections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251776A_ABST
    Figure CN119251776A_ABST
Patent Text Reader

Abstract

The invention discloses a rider helmet detection and license plate recognition method and system based on YOLOv10s and PP-OCRv4, and the method comprises the following steps: S1, collecting a rider image of a riding two-wheeled motor vehicle, and constructing a rider image data set; s2, a CoordAtt attention module is added to a YOLOv10s model, a YOLOv10sCA model is constructed, the rider image data set is used for training the YOLOv10sCA model, and whether the rider image wears a helmet or not and whether the rider image wears a license plate area of the corresponding two-wheeled motor vehicle or not are recognized; s3, inputting a to-be-detected rider image into the trained YOLOv10sCA model, and detecting and storing a two-wheeled motor vehicle license plate area corresponding to the rider image without wearing the helmet; and S4, based on a pre-trained PP-OCRv4 model, identifying the detected license plate area of the two-wheeled motor vehicle, and outputting a license plate number. By using the rider helmet detection and license plate recognition method provided by the invention, the helmet wearing condition of the rider can be detected in real time, the license plate information can be recognized, and help can be provided for investigation and recording of a traffic department.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of target recognition, and in particular to a method and system for detecting a cyclist's helmet and recognizing a license plate based on YOLOv10s and PP-OCRv4. Background Art

[0002] In my country, electric vehicles or motorcycles are a major means of transportation, but traffic accidents involving these vehicles also occur frequently. The present invention refers to electric vehicles and motorcycles as motorized two-wheeled vehicles. Wearing a helmet can greatly reduce the risk of head injuries and mortality of motorized two-wheeled vehicle drivers in traffic accidents. It is expected that the public's awareness of the importance of wearing a helmet when riding a motorized two-wheeled vehicle will be improved through various media and community activities. However, publicity and education have not increased the cost of violations, and some drivers still do not consciously wear helmets. Transportation departments in various places set up checkpoints, and traffic police punish riders who do not wear helmets through verbal education or fines. Although this manual inspection method is very effective, it is time-consuming and labor-intensive. The target detection algorithm can automatically detect the helmet wearing of riders around the clock and continuously to ensure that violations can be discovered and handled in a timely manner.

[0003] The YOLO series of target detection algorithms have efficient real-time processing capabilities, not only with fast detection speed but also high accuracy. Currently, researchers have achieved certain results in the task of detecting cyclist helmets using YOLOv5 and YOLOv8, but they only detect the wearing of cyclists' helmets and rely on the NMS (non-maximum suppression) algorithm, which increases the inference time and computing overhead. Summary of the invention

[0004] The existing method only detects the wearing of helmets by cyclists. The present invention proposes a method for detecting cyclist helmets and recognizing license plates based on YOLOv10s and PP-OCRv4, and further proposes license plate recognition to help the supervision and record keeping of traffic departments. Compared with the method using YOLOv5 and YOLOv8, the inference time and computational overhead are less.

[0005] According to one aspect of the present invention, a method for detecting a cyclist's helmet and recognizing a license plate based on YOLOv10s and PP-OCRv4 is proposed. The method comprises:

[0006] S1: Collect images of riders riding motorized two-wheelers and construct a rider image dataset;

[0007] S2: By adding the CoordAtt attention module to the YOLOv10s model, a YOLOv10s_CA model is constructed, and the YOLOv10s_CA model is trained using the rider image dataset to identify whether the rider image is wearing a helmet and the corresponding motorized two-wheeled vehicle license plate area;

[0008] S3: Input the image of the cyclist to be detected into the trained YOLOv10s_CA model, detect and save the motor vehicle license plate area corresponding to the image of the cyclist not wearing a helmet;

[0009] S4: Based on the pre-trained PP-OCRv4 model, the detected license plate area of ​​the motor two-wheeled vehicle is recognized and the license plate number is output.

[0010] Preferably, S2 specifically includes, constructing the YOLOv10s_CA model by adding a CoordAtt attention module between the C2fCIB_add module and the SPPF module of the YOLOv10s model. By introducing the CoordAtt attention module to focus on position information, the channel attention mechanism of YOLOv10s is improved, and the feature expression ability of the model is enhanced.

[0011] Preferably, the category labels of the rider image dataset include motorized two-wheeled vehicle, with helmet, without helmet and license plate.

[0012] Preferably, the PP-OCRv4 model includes a character detection model, a text direction classification model, and a character recognition model. By further identifying the license plate of a motorized two-wheeled vehicle without a helmet through OCR (optical character recognition), law enforcement agencies can record violation information and impose penalties on the owner, such as fines or warnings. At the same time, the identified license plate information can be archived to form a violation database for subsequent management and analysis. This helps to focus on monitoring and managing vehicles and personnel who have violated the rules many times.

[0013] Further preferably, S4 specifically includes:

[0014] S401, the character detection model detects the character area of ​​the motor two-wheeled vehicle license plate area and cuts out the license plate information area;

[0015] S402, the text direction classification model corrects the detected license plate information area;

[0016] S403, the character recognition model recognizes the license plate information according to the corrected license plate information area and outputs the license plate number.

[0017] According to one aspect of the present invention, a cyclist helmet detection and license plate recognition system based on YOLOv10s and PP-OCRv4 is proposed, comprising the following modules:

[0018] Image acquisition module: collects images of riders riding motorized two-wheelers and constructs a rider image dataset;

[0019] Target recognition model training module: by adding the CoordAtt attention module to the YOLOv10s model, a YOLOv10s_CA model is constructed, and the YOLOv10s_CA model is trained using the rider image dataset to identify whether the rider image is wearing a helmet and the corresponding motorized two-wheeled vehicle license plate area;

[0020] Target recognition model detection module: Input the image of the cyclist to be detected into the trained YOLOv10s_CA model, detect and save the motor vehicle license plate area corresponding to the image of the cyclist not wearing a helmet;

[0021] License plate information detection module: Based on the pre-trained PP-OCRv4 model, the detected motor vehicle license plate area is identified and the license plate number is output.

[0022] According to one aspect of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method according to any one of the first aspects is implemented.

[0023] According to one aspect of the present invention, a computing system is provided, comprising a processor and a memory, wherein the processor is configured to execute the method as described in any one of the first aspects.

[0024] The present invention is beneficial in that:

[0025] (1) The YOLOv10s_CA model improved based on YOLOv10s has the characteristics of high precision and high real-time performance. It can quickly identify and locate the helmet wearing status of the cyclist.

[0026] (2) The PP-OCRv4 model is used specifically to extract license plate information from the license plates detected by the YOLOv10s_CA model to ensure that the information of illegal vehicles is identified and recorded in a timely and accurate manner.

[0027] (3) The present invention combines YOLOv10s_CA and PP-OCRv4 to achieve millisecond-level prediction. The collaborative work of the two can achieve comprehensive traffic monitoring, not only to detect and determine in real time whether the rider is wearing a helmet, but also to quickly identify the license plate information of the motorized two-wheeled vehicle. The present invention can help the transportation department formulate more effective management and punishment measures. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and are used together with the description to explain the principles of the present invention. It will be easy to recognize other embodiments and many expected advantages of the embodiments because they become better understood by reference to the following detailed description. The elements of the accompanying drawings are not necessarily to scale with each other. The same reference numerals refer to corresponding similar parts.

[0029] Figure 1 A schematic diagram of a method for detecting a cyclist's helmet and recognizing a license plate based on YOLOv10s and PP-OCRv4 proposed in the present invention;

[0030] Figure 2 This is a structural diagram of the YOLOv10s_CA model proposed in the present invention;

[0031] Figure 3 It is the detection result of the YOLOv10s_CA model proposed in the present invention;

[0032] Figure 4 The present invention uses PP-OCRv4 to recognize the license plate detected by YOLOv10s_CA;

[0033] Figure 5 It is the detection and recognition result of the combination of YOLOv10s_CA and PP-OCRv4 of the present invention;

[0034] Figure 6 A schematic diagram of the structure of a system for cyclist helmet detection and license plate recognition based on YOLOv10s and PP-OCRv4 proposed in the present invention;

[0035] Figure 7 A schematic diagram of the computer system structure of an electronic device suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION

[0036] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0037] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0038] Figure 1A method for detecting a cyclist's helmet and recognizing a license plate based on YOLOv10s and PP-OCRv4 is provided according to the present invention, the method comprising:

[0039] S1: Collect images of riders riding motorized two-wheelers and construct a rider image dataset;

[0040] S2: By adding the CoordAtt attention module to the YOLOv10s model, a YOLOv10s_CA model is constructed, and the YOLOv10s_CA model is trained using the rider image dataset to identify whether the rider image is wearing a helmet and the corresponding motorized two-wheeled vehicle license plate area;

[0041] S3: Input the image of the cyclist to be detected into the trained YOLOv10s_CA model, detect and save the motor vehicle license plate area corresponding to the image of the cyclist not wearing a helmet;

[0042] S4: Based on the pre-trained PP-OCRv4 model, the detected license plate area of ​​the motor two-wheeled vehicle is recognized and the license plate number is output.

[0043] In one embodiment, the cyclist image dataset is modified based on the public TWHD dataset for helmet detection, and license plate detection is added to the original TWHD dataset, and the wrong labels of the original TWHD dataset are further corrected. The annotation tool used is Labelimg. The newly annotated dataset is called TWHD-LP, with a total of 5448 pictures, most of which are from pictures taken at multiple intersections, and there are four category labels: motorized two-wheeled vehicles, with helmets, without helmets, and license plates. The improvements of TWHD-LP to TWHD include: marking the license plate detection frame for motorized two-wheeled vehicles in riding state, and not marking motorized two-wheeled vehicles in non-riding state, such as vehicles parked on the roadside; TWHD contains some erroneous detection frames, such as pedestrians are marked, and motorized two-wheeled vehicles completely blocked by four-wheeled vehicles are also marked (this type of erroneous annotation may be due to automatic annotation of the trained model), etc. TWHD-LP further corrects the above errors; TWHD-LP further marks the detection targets to be marked that are omitted in TWHD, such as motorized two-wheeled vehicles riding far away on the road.

[0044] When training the YOLOv10s_CA model, the cyclist image dataset TWHD-LP is divided into training set, validation set and test set in a ratio of 7:1:2. The training set is only used to train the model parameters so that the model can understand the relationship between the input data and the output target, so that it can make accurate predictions on new data. The validation set is only used to regularly evaluate the performance of the model on the validation set during the training process to prevent overfitting and select the best model and parameter settings. The test set is only used for the trained model to ensure that the model can perform well on unseen data to verify the actual application effect of the model. The training samples of the dataset are input into the target detection model YOLOv10s_CA, and the model parameters are updated by back propagation. Its loss function is the loss function of the original YOLOv10.

[0045] In the present invention, the target detection model used is improved based on YOLOv10. Unlike previous models such as YOLOv5, YOLOv10 no longer uses the NMS algorithm. NMS in the post-processing process of the YOLO algorithm hinders the end-to-end deployment and generates additional reasoning overhead. YOLO's reliance on NMS stems from the "one-to-many" label allocation during training. A direct way to get rid of NMS is to use "one-to-one" label allocation during training, that is, each detection target is only assigned one anchor frame instead of multiple. However, "one-to-one" matching leads to weak supervision, which reduces the accuracy of the model and slows down the convergence. YOLOv10 uses a consistent dual allocation strategy for training the YOLO model without NMS. Specifically, during the training process, YOLOv10 uses two detection heads, one is a "one-to-one" head, and the other is a "one-to-many" head, and the two heads are optimized together with the model backbone. During the reasoning process, YOLOv10 abandons the "one-to-many" head and only uses the "one-to-one" head for detection. YOLOv10 introduces a consistent matching metric to evaluate the consistency level between predictions and instances, proving that the consistent matching metrics of the "one-to-many" and "one-to-one" heads trained by the above strategy are similar. YOLOv10 thus achieves the effect of the "one-to-many" head by using only the "one-to-one" head, and gets rid of the NMS algorithm brought by the "one-to-many" head.

[0046] In a specific embodiment, it also includes preprocessing operations on the image, including random scaling, mosaic enhancement, color space adjustment, etc., in order to prevent the model from overfitting.

[0047] Mosaic augmentation works by randomly selecting four different images, scaling them, and stitching them into a large image. The labels of each object in the new image are then adjusted accordingly to fit the position of the object in the new image. Color space adjustment involves randomly adjusting the hue, saturation, and brightness of the image. This augmentation technique is particularly important when dealing with variable weather conditions. For example, different scenes such as sunny and cloudy days will have a certain impact on the detection effect of the object detection model on cyclists. Through color space adjustment, the model can better cope with different lighting conditions and color changes. These adjustments can simulate a variety of complex visual environments, making the model more robust and adaptable in practical applications. Introducing these changes during training helps the model ignore irrelevant differences in color and focus on the shape and texture features of the target, thereby improving the accuracy and reliability of detection.

[0048] The final training sample resolution is resized to 640x640.

[0049] The training data of the improved YOLOv10s_CA process is as follows Figure 2 First, the preprocessed image is passed through the backbone to extract rich features, then the neck further fuses and enhances the features, and finally the head outputs the category and bounding box information of the target.

[0050] In the structure of YOLOv10s_CA, other modules are the parts included in the original YOLOv10s. Compared with YOLOv10s, the YOLOv10s_CA in the present invention adds a CoordAtt attention module in the middle of the C2fCIB_add module and the SPPF module of the original backbone. CoordAtt, i.e. Coordinate Attention, encodes spatial information by averaging pooling in the horizontal and vertical directions, and then transforms the spatial information, and finally fuses the spatial information by weighting it on the channel, introducing an attention mechanism for position information, which improves the traditional channel attention mechanism and enhances the feature expression ability of the model.

[0051] Figure 3 The detection results of the improved YOLOv10s_CA model are shown in Table 1.

[0052] Table 1

[0053]

[0054] Among them, mAP is the abbreviation of mean Average Precision, which represents the average precision over multiple categories. mAP50 represents the mAP value under the loU threshold of 50%. mAP50-95 represents the mAP value within the loU threshold range of 50-95%, and then takes the average. R is the abbreviation of Recall, which evaluates the proportion of all true positive samples that the model can find. P is the abbreviation of Precision, which evaluates the proportion of positive samples predicted correctly by the model.

[0055] In a specific embodiment, after the image to be detected is input into the trained YOLOv10s_CA model, YOLOv10s_CA outputs the detection frame and target category, and saves the detected target in a separate folder. Specifically, not only the detected target frame should be drawn on each image, but each target should also be cropped out and stored according to the target category. The image of the license plate area of ​​the motor vehicle detected as not wearing a helmet is detected by the PP-OCRv4 model.

[0056] PP-OCRv4 is an open source OCR system from Baidu, which includes a character detection model, a text direction classification model, and a character recognition model.

[0057] In a specific embodiment, considering that in actual deployment, situations such as mud obscuring the license plate information or other factors may have an adverse effect on the model, a license plate recognition dataset is created and various models of PP-OCRv4 are pre-trained to improve the performance of the model in complex environments.

[0058] First, extract useful license plate images from motorized two-wheeled vehicle images. License plate images require that the license plate information can be manually identified. Samples where the license plate information is difficult to identify due to factors such as tilted shooting angles are not considered. Ideally, a large number of license plate image samples under different traffic conditions should be collected, including various lighting conditions, rainy days, foggy days and other common conditions. This can ensure the diversity and representativeness of the samples and provide sufficient and real data for subsequent model training. Secondly, use the annotation tool PPOCRLabel provided by Baidu PaddlePaddle to annotate the license plate samples. The dataset annotated by PPOCRLabel can be directly used for the training of PP-OCRv4 character detection model and character recognition model. PPOCRLabel is similar to Labelimg. It is necessary to select the area where the character information in the license plate is located, and the category label of the detection box is the character information itself. Among them, the position label of the detection box is used to train the character detection model, and the category label of the detection box is used to train the character recognition model. In order to train the text direction classification model, it is necessary to further intercept the image area where each text line in the license plate image is located. The label of each text image is the text angle, and 0 degrees is the text angle under normal reading.

[0059] In a specific embodiment, the license plate detected by YOLOv10s_CA may not be horizontal and may have a certain tilt angle. The license plate information area cropped by the character detection model may not be conducive to the recognition model processing. The text direction classification model can be used to correct the detected license plate information area to ensure that the character recognition model recognizes the license plate information area at a suitable angle, thereby reducing errors caused by incorrect text direction and improving the overall recognition accuracy. Finally, the character recognition model is used to recognize the corrected license plate information area. The recognition effect of PP-OCRv4 on the license plate is shown in the figure. Figure 4 .

[0060] Finally, the license plate result recognized by PP-OCRv4 is plotted on the detection result of YOLOv10s_CA. The license plate information is plotted near the license plate detection frame using the coordinate area of ​​the license plate area detected by YOLOv10s_CA. The result is shown in Figure 5 shown.

[0061] According to one aspect of the present invention, a cyclist helmet detection and license plate recognition system based on YOLOv10s and PP-OCRv4 is proposed, comprising the following modules:

[0062] Image acquisition module 601: collects images of riders riding motorized two-wheeled vehicles and constructs a rider image dataset;

[0063] Target recognition model training module 602: by adding the CoordAtt attention module to the YOLOv10s model, a YOLOv10s_CA model is constructed, and the YOLOv10s_CA model is trained using the rider image dataset to identify whether the rider image is wearing a helmet and the corresponding motorized two-wheeled vehicle license plate area;

[0064] The target recognition model detection module 603: inputs the image of the rider to be detected into the trained YOLOv10s_CA model, detects and saves the motor vehicle license plate area corresponding to the image of the rider not wearing a helmet;

[0065] The license plate information detection module 604 recognizes the detected motor vehicle license plate area based on the pre-trained PP-OCRv4 model and outputs the license plate number.

[0066] The above describes the specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0067] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which performs various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 709 into a random access memory (RAM) 704. In the RAM 704, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, the ROM 703, and the RAM 704 are connected to each other via a bus 705. An input / output (I / O) interface 706 is also connected to the bus 705.

[0068] The following components are connected to the I / O interface 706: an input section 707 including a keyboard, a mouse, etc.; an output section 708 including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 709 including a hard disk, etc.; and a communication section 710 including a network interface card such as a LAN card, a modem, etc. The communication section 710 performs communication processing via a network such as the Internet. A drive 711 is also connected to the I / O interface 706 as needed. A removable medium 712, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 711 as needed so that a computer program read therefrom is installed into the storage section 709 as needed.

[0069] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart is implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program is downloaded and installed from the network through the communication part 710, and / or installed from the removable medium 712. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the method of the present application are executed.

[0070] It should be noted that the computer-readable storage medium of the present application is a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium is, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium is any tangible medium containing or storing a program that is used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium includes a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal takes a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium is any computer-readable storage medium other than a computer-readable storage medium that sends, propagates or transmits a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable storage medium is transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0071] Computer program code for performing the operations of the present application is written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code is executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer is connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or is connected to an external computer (e.g., via the Internet using an Internet service provider).

[0072] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram represents a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the box also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession are actually executed substantially in parallel, and they are sometimes also executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart, are implemented by a dedicated hardware-based system that performs the specified function or operation, or are implemented by a combination of dedicated hardware and computer instructions.

[0073] The modules involved in the embodiments of the present application are implemented by software and hardware.

[0074] As another aspect, the present application also provides a computer-readable storage medium, which is included in the electronic device described in the above embodiment; it also exists independently and is not assembled into the electronic device. The above computer-readable storage medium carries one or more programs. When the above one or more programs are executed by the electronic device, the electronic device: S1: collects images of riders riding motorized two-wheeled vehicles and constructs a rider image dataset; S2: constructs a YOLOv10s_CA model by adding a CoordAtt attention module to the YOLOv10s model, and trains the YOLOv10s_CA model using the rider image dataset to identify whether the rider image is wearing a helmet and the corresponding motorized two-wheeled vehicle license plate area; S3: inputs the rider image to be detected into the trained YOLOv10s_CA model, detects and saves the motorized two-wheeled vehicle license plate area corresponding to the rider image not wearing a helmet; S4: identifies the detected motorized two-wheeled vehicle license plate area based on the pre-trained PP-OCRv4 model, and outputs the license plate number. The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.

Claims

1. A method for detecting cyclist helmets and recognizing license plates based on YOLOv10s and PP-OCRv4, characterized in that: The following steps are involved: S1: Collect images of riders riding motorized two-wheelers and construct a rider image dataset; S2: By adding the CoordAtt attention module to the YOLOv10s model, a YOLOv10s_CA model is constructed, and the YOLOv10s_CA model is trained using the rider image dataset to identify whether the rider image is wearing a helmet and the corresponding motorized two-wheeled vehicle license plate area; S3: Input the image of the cyclist to be detected into the trained YOLOv10s_CA model, detect and save the motor vehicle license plate area corresponding to the image of the cyclist not wearing a helmet; S4: Based on the pre-trained PP-OCRv4 model, the detected license plate area of ​​the motor two-wheeled vehicle is recognized and the license plate number is output.

2. The method for detecting a cyclist's helmet and recognizing a license plate based on YOLOv10s and PP-OCRv4 according to claim 1, characterized in that: S2 specifically includes building the YOLOv10s_CA model by adding a CoordAtt attention module between the C2fCIB_add module and the SPPF module of the YOLOv10s model.

3. The method for detecting a cyclist's helmet and recognizing a license plate based on YOLOv10s and PP-OCRv4 according to claim 1, characterized in that: The category labels of the rider image dataset include motorized two-wheeled vehicles, with helmets, without helmets, and license plates.

4. The method for detecting a cyclist's helmet and recognizing a license plate based on YOLOv10s and PP-OCRv4 according to claim 1, characterized in that: The PP-OCRv4 model includes a character detection model, a text direction classification model, and a character recognition model.

5. The method for detecting a cyclist's helmet and recognizing a license plate based on YOLOv10s and PP-OCRv4 according to claim 4, characterized in that: S4 specifically includes: S401, the character detection model detects the character area of ​​the motor two-wheeled vehicle license plate area and cuts out the license plate information area; S402, the text direction classification model corrects the detected license plate information area; S403, the character recognition model recognizes the license plate information according to the corrected license plate information area and outputs the license plate number.

6. A cyclist helmet detection and license plate recognition system based on YOLOv10s and PP-OCRv4, characterized in that: Includes the following modules: Image acquisition module: collects images of riders riding motorized two-wheelers and constructs a rider image dataset; Target recognition model training module: by adding the CoordAtt attention module to the YOLOv10s model, a YOLOv10s_CA model is constructed, and the YOLOv10s_CA model is trained using the rider image dataset to identify whether the rider image is wearing a helmet and the corresponding motorized two-wheeled vehicle license plate area; Target recognition model detection module: Input the image of the cyclist to be detected into the trained YOLOv10s_CA model, detect and save the motor vehicle license plate area corresponding to the image of the cyclist not wearing a helmet; License plate information detection module: Based on the pre-trained PP-OCRv4 model, the detected motor vehicle license plate area is identified and the license plate number is output.

7. A computer readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 5.

8. A computing system comprising a processor and a memory, wherein the processor is configured to execute the method according to any one of claims 1 to 5.

Citation Information

Cited By

  • Rider helmet detection method based on VSC-YOLO

    CN122368929A