A vehicle component matching method, storage medium and device based on deep learning
The deep learning method is used to train the model to predict vehicle component positions, and the weight map is used for matching, which solves the problems of low vehicle component matching efficiency and poor robustness in the existing technology, and achieves efficient and robust component matching in various scenarios. .
Patent Information
- Application Number
- CN202111567942.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-12-21
AI Technical Summary
The existing technology has low efficiency and poor robustness in vehicle component matching. It is prone to misidentification and pairing errors, especially in crowded vehicle scenarios. It also requires manual empirical parameter setting and is not adaptable.
Through the deep learning method, the deep convolutional neural network model is trained, a point regression branch is added to predict the position information of vehicle components, and component matching is performed based on the predicted center point. The weight map is used to calculate the matching score, and the component matching is automatically completed to avoid manual work. Logical intervention.
It achieves robustness and efficiency in vehicle component matching in various scenarios, is fast and adaptable, avoids dependence on manual empirical parameters, and improves recognition accuracy.
Smart Images

Figure CN114494743B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image processing technology and deep learning technology, and in particular to a vehicle component matching method, storage medium and device based on deep learning. Background Art
[0002] Deep learning is an important branch of artificial intelligence, and image recognition is an important application field of modern artificial intelligence. Among them, image recognition technology based on deep convolutional neural network currently occupies half of the field of artificial intelligence, here referred to as CNN (Convolutional Neural Network).
[0003] In practical applications, when it is necessary to judge the various states of a vehicle, it is often necessary to use various components of the vehicle such as the license plate, front, rear, windows, roof, and lights to comprehensively judge the vehicle's information, such as the license plate number, driving direction, occlusion, lighting conditions, etc.; therefore, it is necessary to be able to extract information from various components of the vehicle. To meet this requirement, there are several different schools of traditional conventional practices.
[0004] The first traditional method is that the detector only detects the location box of the car, and cuts out the corresponding patch of the entire car area from the original image based on the box, and sends the patch to the trained classification / recognition model to further extract the location information of the required components; the main disadvantage of this method is that the recognition model needs to be run again for each car in the image, which is too inefficient and completely unusable in scenarios with high speed requirements / dense vehicles; and this approach may also cause the recognition model to mistakenly identify the information of other cars for the current car in crowded situations because the cut-out car patch carries the information of other nearby cars; and for small components such as license plates and lights, especially when the license plate needs to further identify its content, it is generally necessary to run a special recognition model again, and this part of the calculation cannot be saved.
[0005] The second traditional method is that after the detector detects the car, it also detects the boxes of the remaining required car components. After processing, these boxes are paired according to the manually written logic to obtain the pairing / clustering information of the car box + the remaining component boxes of the body. When further information of certain components needs to be identified later, such as the license plate number or the lighting information of the headlights, the area corresponding to the component box in the car is cut out and sent to a special recognition model to run the results. Compared with the first method, this method omits the step of extracting the positions of the various components of the car, which greatly speeds up the process. It is very practical in terms of speed, but the disadvantages are also obvious. The component pairing logic written based on manual experience is not robust, and it is easy to cause pairing errors due to congestion, vehicle type changes, posture changes, incompleteness, and misdetection and missed detection by the detector. In addition, too many empirical parameters need to be set manually, which is not adaptable and troublesome.
[0006] The third traditional method is that while the detector detects the car, the model also predicts the location and presence of each component corresponding to each car box. This method also saves a lot of recognition time in the first method, and overcomes the defects of the second method's weak robustness and high human experience requirements. However, the disadvantage is that the component information predicted by this method is not good, because the detector detects objects of different sizes involving different receptive fields and feature map granularity, making it difficult for a relatively large object - the car to simultaneously predict the accurate location information of much smaller components in the car, such as license plates and lights. This forced prediction may even reduce the effectiveness of the detector in detecting the car itself. Summary of the invention
[0007] The purpose of the present invention is to overcome the defects of the prior art and provide a vehicle component matching method based on deep learning, which can robustly handle the matching problem of vehicle components, can adapt to various scenarios when the training data set is reasonably collected, and does not require manual experience to write post-processing logic.
[0008] The object of the present invention is achieved through the following technical solutions:
[0009] A vehicle component matching method based on deep learning, the vehicle component matching method comprising:
[0010] S1: Image collection and image annotation steps, complete the position annotation of the vehicle box and the component box on the vehicle, and complete the corresponding vehicle ID annotation for each vehicle box and component box on the vehicle to form an annotation label;
[0011] S2: label processing step, making corresponding detection labels based on the label labels in step S1, so that the corresponding vehicle box and component box can be found based on the vehicle ID through the detection label information; then the center point coordinate setting of the vehicle box is completed to form additional position information;
[0012] S3: Model training step, inputting images, annotation labels, detection labels and additional information into the detection network model built by the deep convolutional neural network for model training. In addition to the classification and box branches, a point regression branch is added to the model to predict additional location information;
[0013] S4: Detection step. After the model training is completed, for the image to be processed, the detector is used to detect the position of the car box and each component box in the image. For each box, an additional position information is predicted, that is, the center point of the vehicle is predicted.
[0014] S5: Car body component matching step,
[0015] S51: sorting the boxes from large to small according to the classification scores, and for each box in the order, selecting the remaining components of the vehicle body according to the additional position information corresponding to the box, and completing the matching of the components; or
[0016] S52: Calculate the distance D1 between each predicted center point of each car box and each component box, or calculate the relative distance D2 relative to the size of the car box based on the calculated distance D1, so as to obtain a calculation score S based on D1 or D2, wherein the calculation score S is smaller when the distance D1 or D2 is larger, and S is 0 when the distance D1 or D2 is greater than a preset value;
[0017] According to the classification scores of the car box and the component box, the calculated score S is multiplied to obtain the pairwise connection score S1.
[0018] Each connection score S1 that is not 0 forms a weight graph, and the component matching of each vehicle is completed based on the numerical value relationship in the weight graph.
[0019] According to a preferred embodiment, in step S1, each vehicle box and on-vehicle component box is labeled with a corresponding vehicle ID, so that each vehicle and on-vehicle component has the same ID.
[0020] According to a preferred embodiment, in step S2, the coordinates of the center point of the vehicle box are expressed as xy, which is additional position information.
[0021] According to a preferred embodiment, in step S4, the detector needs to use fpn.
[0022] According to a preferred embodiment, in step S4, each box is predicted to have an additional position information xy representing the center point of the vehicle.
[0023] According to a preferred embodiment, when selecting the remaining components of the vehicle body in step S51, the closer the center point of the vehicle predicted based on the component box is to the center point predicted based on the vehicle box, the higher the matching degree of the component is. Among all the candidate components, the components are selected to match the vehicle based on the maximum number of each component corresponding to each vehicle.
[0024] According to a preferred embodiment, when the distance between the center point of the vehicle predicted based on the component box and the center point predicted based on the vehicle box is greater than a certain threshold relative to the size of the vehicle box, the component is not selected.
[0025] According to a preferred embodiment, the vehicle component matching method includes: S6: when the matching of the components on the vehicle is completed, using the matching results to perform subsequent operations.
[0026] On the other hand, the present invention also discloses:
[0027] A processing device for an external storage medium, the device comprising:
[0028] The processor is used to implement the steps of the vehicle component matching method as described above when executing the computer program.
[0029] On the other hand, the present invention also discloses:
[0030] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the vehicle component matching method as described above are implemented.
[0031] The aforementioned main scheme of the present invention and its further options can be freely combined to form multiple schemes, all of which are schemes that can be adopted and claimed for protection by the present invention. After understanding the scheme of the present invention, those skilled in the art can understand that there are multiple combinations based on the prior art and common knowledge, all of which are technical schemes to be protected by the present invention, and they are not exhaustively listed here.
[0032] Beneficial effects of the present invention: The vehicle component matching method based on deep learning of the present invention directly uses the detection model to make each box predict an additional specified point, and finally clusters the boxes according to the points predicted by the boxes to directly obtain the matching results of the vehicle components. It can overcome the defects of several different traditional methods, use the model to directly predict the relationship information between the vehicle and the vehicle components, adapt to various scenarios, be robust, have good effects, and be fast. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0034] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0035] It should be noted that in order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are clearly and completely described below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments.
[0036] Embodiment 1:
[0037] refer to Figure 1As shown, the present invention discloses a vehicle component matching method based on deep learning, and the vehicle component matching method includes:
[0038] Step S1: image collection and image annotation steps, completing the position annotation of the vehicle box and the component box on the vehicle, and completing the corresponding vehicle ID annotation for each vehicle box and the component box on the vehicle to form an annotation label.
[0039] By marking each car box and on-vehicle component box with the corresponding car ID, each car and on-vehicle component has the same ID.
[0040] Specifically, collect pictures of each scene to be processed, and manually annotate the car instance-level labels: the location of the car and the required category of components, and the ID of the car corresponding to each box, so that each car and the component in the car have the same ID. It is required that each car annotated with a component box should also be annotated with at least a car box.
[0041] Step S2: label processing step, making corresponding detection labels based on the label labels in step S1, so that the corresponding vehicle box and component box can be found based on the vehicle ID through the detection label information; then the center point coordinate setting of the vehicle box is completed to form additional position information;
[0042] Specifically, the original manual labels are post-processed. First, the detection label information is annotated according to the labels. Then, for the id corresponding to each box (car box or component box), the car box corresponding to the id can be found, and then the center point coordinates of the car box are set to the box as additional position information (two numbers xy are used to represent the center point coordinates, and the coordinate representation is consistent with the coordinate representation of the box).
[0043] Step S3: Model training step, input the picture, annotation label, detection label and additional information into the detection network model built by the deep convolutional neural network for model training. In addition to the classification and box branches, a point regression branch is added to the model to predict additional location information.
[0044] Specifically, the images and labels are sent to the detection network built by the deep convolutional neural network for training, and a point regression branch is added in addition to the classification and box branches to predict additional information xy, that is, to predict the center point of the vehicle.
[0045] Step S4: Detection step. After the model training is completed, for the image to be processed, the detector is used to detect the position of the car box and each component box in the image. Each box outputs an additional position information. Each box has an additional output x and y, which represent the predicted position of the center point of the vehicle.
[0046] Preferably, since the small object box also needs to predict the point positions related to the large object, the detector needs to use FPN.
[0047] Step S5: Car body component matching step. Specifically including:
[0048] Step S51: Sort the boxes from large to small according to the classification score. For each box in the order, select the remaining components of the vehicle body according to the additional position information corresponding to the box, and complete the matching of the components. The classification score is a confidence score.
[0049] When selecting the remaining components of the vehicle body in step S51, the closer the center point of the vehicle predicted by the component box is to the center point predicted by the vehicle box, the higher the matching degree between the component box and the corresponding vehicle box. Among all the candidate components, according to the maximum number of each component per vehicle, enough components are selected to successfully match the vehicle. When the distance between the center point of the vehicle predicted by the component box and the center point predicted by the vehicle box is greater than a certain threshold relative to the size of the vehicle box, the component is not selected.
[0050] Alternatively, step S52 is adopted to complete component matching.
[0051] Step S52: Calculate the distance D1 between each predicted center point of each car box and each component box, or calculate the relative distance D2 relative to the size of the car box based on the calculated distance D1, so as to obtain a calculation score S based on D1 or D2. The calculation score S is smaller when the distance D1 or D2 is larger, and S is 0 when the distance D1 or D2 is greater than a preset value.
[0052] The purpose of calculating the relative distance D2 is that when some cars are larger in size, there may be a larger distance D1 between the center prediction point based on the car box and the center prediction point based on the component box. However, a larger D1 does not necessarily mean that the component box does not belong to or cannot be matched to the corresponding car box. For example, by normalizing the distance D1 based on a specific car size, the relative distance D2 may be very small, which can also indicate that the component box should be matched to the corresponding car box.
[0053] The calculated score S is multiplied according to the classification scores of the vehicle box and the component box to obtain the pairwise connection scores S1. The connection scores S1 that are not 0 form a weight graph, and the component matching of each vehicle is completed based on the numerical relationship in the weight graph (or various strategies can be used to find the optimal solution or suboptimal solution of the graph to obtain the final component matching strategy).
[0054] It should be noted that the final solution of S5 is the same as the manual strategy that may be used in method 2 in the background introduction, but the biggest difference is that the initial matching score is not calculated by the manual strategy, but is directly and simply obtained from the results of the model, and the subsequent solutions based on the matching score can be shared by both parties.
[0055] Preferably, the vehicle component matching method comprises: S6: when the matching of the components on the vehicle is completed, using the matching results to perform subsequent operations.
[0056] In the above manner, the deep learning-based vehicle component matching method of the present invention directly uses the detection model to make each box additionally predict a specified point, and finally clusters the boxes according to the points predicted by the boxes to directly obtain the matching results of the vehicle components.
[0057] The vehicle component matching method based on deep learning of the present invention can overcome the defects of several different traditional methods, use the model to directly predict the relationship information between the vehicle and the vehicle components, adapt to various scenarios, be robust, have good effects and high speed.
[0058] Example 2
[0059] The present invention also discloses: a processing device of an external storage medium, the device comprising: a processor, which is used to implement the steps of the vehicle component matching method as described in Example 1 when executing a computer program.
[0060] Example 3
[0061] The present invention also discloses: a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the vehicle component matching method as described in Example 1 are implemented.
[0062] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A vehicle component matching method based on deep learning, characterized in that: The vehicle component matching method comprises: S1: Image collection and image annotation steps, complete the position annotation of the vehicle box and the component box on the vehicle, and complete the corresponding vehicle ID annotation for each vehicle box and component box on the vehicle to form an annotation label; S2: label processing step, making corresponding detection labels based on the label labels in step S1, so that the corresponding vehicle box and component box can be found based on the vehicle ID through the detection label information; then the center point coordinate setting of the vehicle box is completed to form additional position information; S3: Model training step, inputting images, annotation labels, detection labels and additional information into the detection network model built by the deep convolutional neural network for model training. In addition to the classification and box branches, a point regression branch is added to the model to predict additional location information; S4: Detection step. After the model training is completed, for the image to be processed, the detector is used to detect the position of the car box and each component box in the image. For each box, an additional position information is predicted, that is, the center point of the vehicle is predicted. S5: Car body component matching step, S51: sorting the boxes from large to small according to the classification scores, and for each box in the order, selecting the remaining components of the vehicle body according to the additional position information corresponding to the box, and completing the matching of the components; or S52: Calculate the distance D1 between each predicted center point of each car box and each component box, or calculate the relative distance D2 relative to the size of the car box based on the calculated distance D1, so as to obtain a calculation score S based on D1 or D2, wherein the calculation score S is smaller when the distance D1 or D2 is larger, and S is 0 when the distance D1 or D2 is greater than a preset value; According to the classification scores of the car box and the component box, the calculated score S is multiplied to obtain the pairwise connection score S1. Each connection score S1 that is not 0 forms a weight graph, and the component matching of each vehicle is completed based on the numerical value relationship in the weight graph.
2. The vehicle component matching method according to claim 1, characterized in that: In step S1, each car box and on-vehicle component box is labeled with a corresponding car ID, so that each car and on-vehicle component has the same ID.
3. The vehicle component matching method according to claim 1, characterized in that: In step S2, the center point coordinates of the car box are expressed as xy, which is the additional position information.
4. The vehicle component matching method according to claim 1, characterized in that: In step S4, the detector needs to use fpn.
5. The vehicle component matching method according to claim 3, characterized in that: In step S4, each box is predicted with an additional location information xy, representing the center point of the vehicle.
6. The vehicle component matching method according to claim 5, characterized in that: When selecting the remaining components of the vehicle body in step S51, the closer the center point of the vehicle predicted based on the component box is to the center point predicted based on the vehicle box, the higher the matching degree of the component. Among all the candidate components, the components are selected to match the vehicle based on the maximum number of each component corresponding to each vehicle.
7. The vehicle component matching method according to claim 6, characterized in that: When the distance between the center point of the vehicle predicted by the component box and the center point predicted by the car box is greater than a certain threshold relative to the size of the car box, the component is not selected.
8. The vehicle component matching method according to claim 1, characterized in that: The vehicle component matching method comprises: S6: when the matching of the components on the vehicle is completed, using the matching results to perform subsequent operations.
9. A processing device for an external storage medium, characterized in that: The device comprises: A processor, configured to implement the steps of the vehicle component matching method as claimed in any one of claims 1 to 8 when executing a computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the vehicle component matching method according to any one of claims 1 to 8 are implemented.
