A training method of a parking space detection model

By separating the detection of vertical and horizontal parking spaces in the parking space detection model and using SlotIouloss to adjust the parameters, the accuracy and computational complexity issues of existing parking space detection algorithms are resolved, achieving more efficient and accurate parking space detection.

CN116935355BActive Publication Date: 2026-03-31ZHEJIANG SMART INTELLIGENCE TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-27
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing parking space detection algorithms suffer from low detection accuracy, high computational complexity, and poor scene adaptability, especially under conditions such as worn parking lines, insufficient lighting, and special scenarios.

Method used

A parking space detection model training method is adopted. By acquiring parking space sample images, image features are extracted to predict the heat map of parking space corners, parking space parameters and categories. Vertical and horizontal parking spaces are detected separately. SlotIouloss is used to calculate the intersection-union ratio to adjust the model parameters, reduce the mutual influence of features and improve detection accuracy.

Benefits of technology

It improves the accuracy and computational efficiency of parking space detection, enhances adaptability in different scenarios, reduces false detections and missed detections, and supports the detection of any parking space type.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116935355B_ABST
    Figure CN116935355B_ABST
Patent Text Reader

Abstract

The application provides a parking space detection model training method and relates to the vehicle parking technology field. In the training of the initial model, the heat map of the parking space corner point in the parking space sample picture, the parameters of the parking space, the category of the parking space, and the parameters of the four corner points of the vertical parking space or the horizontal parking space are extracted, the initial model is trained according to the above parameters and the real parking space data, which is equivalent to decoupling the features of the vertical parking space and the horizontal parking space, that is, the detection is carried out separately, prevents the difference between the horizontal parking space and the vertical parking space from causing the key point order to jump, causes the training to be unable to converge, improves the accuracy of the initial model training, and improves the accuracy of the parking space detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle parking technology, and in particular to a training method for a parking space detection model. Background Technology

[0002] Currently, mainstream parking space detection algorithms can be divided into the following two main categories based on their technical solutions.

[0003] The first approach is based on parking line segmentation. The first step distinguishes the parking lines from the background, using common techniques such as traditional image thresholding and deep neural network learning. The second step uses algorithms like the Hough transform to fit the segmented parking lines into a line function. The third step utilizes the intersection principle of parking lines to obtain the corner information of the parking spaces. This approach has the advantage of high accuracy in parking space detection, but it has several drawbacks: 1. Parking cameras often have poor image quality, and insufficient lighting in garage scenes, along with wear and tear on the parking lines, leads to poor segmentation results and less than ideal detection outcomes; 2. Post-processing computation is high, as the Hough transform process requires histogram statistics and multiple iterations, which is difficult to optimize and time-consuming; 3. It requires manually introducing a large number of parameters for rule-based constraints, which may not be effective in specific scenarios, necessitating adaptive optimization and making subsequent algorithm maintenance difficult.

[0004] The second type of solution is based on parking space corner detection, which has two main approaches:

[0005] The first approach involves locating parking space corners using detection algorithms. Common algorithms include traditional image detection algorithms and deep learning detection schemes. The second step is to use the positional information between parking space corners to define rules and determine whether two corners belong to the same parking space. This method has the following drawbacks: 1. Parking space corners are small targets, making detection difficult and prone to missed detections and false positives; 2. The parking space corner matching logic is complex and requires setting numerous parameters, potentially necessitating optimization for specific scenarios; 3. It only detects two corners and cannot detect angled parking spaces.

[0006] The second approach is to adopt a cascaded approach. The first step is to use Network 1 to regress the target bounding box of the parking space and the heatmap of all corner points. The second step is to compare the coordinates of the parking space bounding box information and the corner point heatmap and bind the parking space and corner point information. The third step is to use Network 2 to classify the corner points and determine the corner point type. These methods have the following drawbacks: 1. There are dependencies between steps; missed detections and false detections in the previous step will affect the next step. 2. The mapping between the target box and the heatmap requires certain logical processing, which is computationally complex and prone to problems in special scenarios. 3. During the turning process, the parking space attribute can be regarded as either a perpendicular parking space or a horizontal parking space. During the training of the deep learning model, it is necessary to clarify the logical order of the key points. The different categories of horizontal and perpendicular parking spaces will affect the logical order of their key points, making it impossible to determine the two corner points of the parking space corresponding to the parking space entrance. 4. During the training of Network 1, since the parking spaces are adjacent, the matching of anchor points and labels mostly uses the overlap of the target box as the matching standard. When the parking space has an angle, it is easy to encounter the problem of mismatch, which leads to the training failing to converge for this situation, and ultimately resulting in detection failure or false detection. Summary of the Invention

[0007] One objective of this invention is to provide a training method for a parking space detection model, thereby addressing the technical problem of low accuracy in parking space detection in the prior art.

[0008] Another objective of this invention is to further improve the accuracy of parking space detection.

[0009] According to the purpose of this invention, a method for training a parking space detection model is provided, comprising the following steps:

[0010] Obtain parking space sample images, which are labeled with real parking space data;

[0011] The parking space sample image is input into the pre-established initial model;

[0012] Extract image features from the parking space sample images to predict the heatmap of parking space corners, parking space parameters, parking space category, and parameters of the four corners of vertical or horizontal parking spaces based on the image features.

[0013] The parameters of the initial model are adjusted based on the heatmap of the parking space corners in the predicted parking space sample image, the parameters of the parking space, the category of the parking space, the parameters of the four corners of the vertical or horizontal parking space, and the real parking space data, in order to train the initial model.

[0014] Optionally, the step of adjusting the parameters of the initial model based on the predicted heatmap of parking space corners in the parking space sample image, parking space parameters, parking space category, parameters of the four corners of vertical or horizontal parking spaces, and the actual parking space data to train the initial model specifically includes the following steps:

[0015] The predicted heatmap of the parking space corner point is compared with the heatmap of the parking space corner point in the actual parking space data; the predicted parameters of the parking space are compared with the parameters of the parking space in the actual parking space data; the predicted category of the parking space is compared with the type of the parking space in the actual parking space data; and the predicted parameters of the four corner points of the vertical or horizontal parking space are compared with the parameters of the four corner points of the vertical or horizontal parking space in the actual parking space data, so as to obtain the first comparison result, the second comparison result, the third comparison result and the fourth comparison result respectively.

[0016] Based on the first comparison result, the second comparison result, the third comparison result, and the fourth comparison result, determine whether to stop training the initial model.

[0017] Optionally, the step of determining whether to stop training the initial model based on the first comparison result, the second comparison result, the third comparison result, and the fourth comparison result specifically includes the following steps:

[0018] The first comparison result, the second comparison result, the third comparison result, and the fourth comparison result are multiplied by their respective weighting coefficients and then summed to obtain the predicted value.

[0019] The predicted value is compared with a preset threshold.

[0020] If the predicted value is less than or equal to the preset threshold, then training the initial model is stopped.

[0021] Optionally, in the step of extracting image features from the parking space sample image to predict the heatmap of the parking space corner points, the parameters of the parking space, the category of the parking space, and the parameters of the four corner points of a vertical or horizontal parking space based on the image features, the parameters of the parking space include the width of the parking space frame, the height of the parking space frame, and the x-coordinate and y-coordinate of the center point of the parking space.

[0022] Optionally, in the step of extracting image features from the parking space sample image to predict the heatmap of parking space corner points, parking space parameters, parking space category, and parameters of the four corner points of a vertical or horizontal parking space based on the image features, the parking space category includes vertical parking space with a car, vertical parking space without a car, horizontal parking space with a car, and horizontal parking space without a car; the parameters of the four corner points of the vertical or horizontal parking space include the horizontal and vertical coordinates of the four corner points of the vertical or horizontal parking space.

[0023] Optionally, the step of extracting image features from the parking space sample image to predict the heatmap of parking space corners, parking space parameters, parking space category, and parameters of the four corners of a vertical or horizontal parking space based on the image features specifically includes the following steps:

[0024] Extract the first image features from the parking space sample image to predict the heat map of the parking space corner points in the parking space sample image based on the first image features;

[0025] Extract the second image features from the parking space sample image and fuse them with the first image features to predict the parameters and category of the parking space based on the fused first image features and second image features.

[0026] Based on the predicted parking space category, the parameters of the four corner points of a vertical or horizontal parking space are selectively predicted.

[0027] Optionally, the step of selectively predicting the parameters of the four corner points of a perpendicular or horizontal parking space based on the predicted category of the parking space includes the following steps:

[0028] The intersection-union ratio is calculated based on the predicted parameters of the parking space, the predicted parameters of the four corner points of the vertical or horizontal parking space, and the actual parking space data, and the intersection-union ratio is used as the second comparison result.

[0029] Optionally, the step of calculating the intersection-union ratio based on the predicted parameters of the parking space, the predicted parameters of the four corner points of the vertical or horizontal parking space, and the actual parking space data, and using the intersection-union ratio as the second comparison result, specifically includes the following steps:

[0030] The two corner points at the entrance of the predicted parking space are determined based on the parameters of the four corner points of the predicted vertical or horizontal parking space.

[0031] The parameters of the center point of the entrance of the parking space are determined based on the parameters of the two corner points of the predicted entrance.

[0032] The scaling factor is calculated based on the predicted parameters of the center point of the entrance of the parking space and the parameters of the center point of the entrance of the parking space in the actual parking space data.

[0033] The intersection-merger ratio is calculated based on the proportionality coefficient, the predicted parameters of the parking spaces, and the actual parking space data.

[0034] Optionally, the intersection-union ratio is calculated according to formula (1):

[0035]

[0036] Wherein, Slotiouloss represents the intersection-union ratio, area1 represents the intersection area between the predicted parking space and the actual parking space, area2 represents the merged area between the predicted parking space and the actual parking space, and A represents the ratio coefficient.

[0037] Alternatively, the scaling factor can be calculated according to the following formula (2):

[0038] A = 1 - |P1 - P2| * B (Formula (2));

[0039] Wherein, P1 represents the parameter of the center point of the entrance of the predicted parking space, P2 represents the parameter of the center point of the entrance of the parking space in the actual parking space data, B represents the preset parameter, 0 < B < 1; when A is greater than or equal to the preset value, A = A, when A is less than the preset value, A = the preset value, the preset value is greater than zero and less than 1.

[0040] This invention extracts heatmaps of parking space corner points, parking space parameters, parking space categories, and parameters of the four corner points of perpendicular or horizontal parking spaces from parking space sample images during initial model training. Based on these parameters and real parking space data, the initial model is trained, which is equivalent to decoupling the features of perpendicular and horizontal parking spaces, that is, detecting them separately. This prevents the difference in predicted categories between horizontal and perpendicular parking spaces from causing a jump in the order of key points, which could lead to training failure. This improves the accuracy of the initial model training, thereby improving the accuracy of parking space detection.

[0041] Furthermore, this invention first extracts first image features from parking space sample images to predict the heatmap of parking space corner points in the parking space sample images based on the first image features; then, it extracts second image features from the parking space sample images and fuses them with the first image features to predict the parameters and category of the parking space based on the fused first and second image features; subsequently, it selectively predicts the parameters of the four corner points of vertical or horizontal parking spaces based on the predicted parking space category. The above technical solution incorporates the parking space corner point heatmap into the parking space features, improving the accuracy of corner point detection, thereby further enhancing the accuracy of parking space detection.

[0042] The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments of the invention in conjunction with the accompanying drawings. Attached Figure Description

[0043] The following sections will describe some specific embodiments of the invention in detail by way of example and not limitation, with reference to the accompanying drawings. The same reference numerals in the drawings denote the same or similar parts or portions. Those skilled in the art should understand that these drawings are not necessarily drawn to scale. In the drawings:

[0044] Figure 1 This is a schematic flowchart of a training method for a parking space detection model according to an embodiment of the present invention;

[0045] Figure 2 This is a schematic flowchart of a training method for a parking space detection model according to another embodiment of the present invention;

[0046] Figure 3 This is a schematic diagram of a parking space according to the present invention;

[0047] Figure 4 This is a schematic comparison diagram of actual parking space data and predicted parking space data according to the present invention;

[0048] Figure 5 This is the network model diagram of the initial model according to the present invention. Detailed Implementation

[0049] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0050] Figure 1 This is a schematic flowchart illustrating a training method for a parking space detection model according to an embodiment of the present invention. Figure 1 As shown, the training method for the parking space detection model includes the following steps:

[0051] Step S100: Obtain parking space sample images, which are labeled with real parking space data;

[0052] Step S200: Input the parking space sample image into the pre-established initial model;

[0053] Step S300: Extract image features from parking space sample images to predict the heatmap of parking space corners, parking space parameters, parking space category, and parameters of the four corners of vertical or horizontal parking spaces based on the image features.

[0054] Step S400: Adjust the parameters of the initial model based on the heat map of the parking space corner points in the predicted parking space sample image, the parameters of the parking space, the category of the parking space, the parameters of the four corner points of the vertical or horizontal parking space, and the real parking space data, in order to train the initial model.

[0055] This embodiment is equivalent to decoupling the features of vertical and horizontal parking spaces, that is, detecting them separately. This prevents the difference in the predicted categories of horizontal and vertical parking spaces from causing a jump in the order of key points, which could lead to the training failing to converge. This improves the accuracy of the initial model training and thus improves the accuracy of parking space detection.

[0056] This embodiment is an end-to-end detection algorithm that does not require the introduction of additional parameters for rule limitation and has better scene adaptability than other methods. It uses the surround view stitched image as the parking space sample image of the initial model and directly outputs the parameters of the parking space and the coordinates of the four corner points of the parking space.

[0057] In step S300, the parameters of the four corner points of the vertical parking space or the horizontal parking space refer to the parameters of the four corner points of the vertical parking space or the four corner points of the horizontal parking space. The prediction of the four corner points of the two types of parking spaces has different logical order relationships. This embodiment predicts the vertical parking space and the horizontal parking space separately, and different logics can be used to predict the four corner points, which can be more targeted and improve the accuracy of the initial model training, so that the initial model can accurately predict different types of parking spaces.

[0058] Figure 2 This is a schematic flowchart illustrating a training method for a parking space detection model according to another embodiment of the present invention. Figure 2 As shown, step S400 specifically includes the following steps:

[0059] Step S410: Compare the predicted parking space corner point heatmap with the actual parking space corner point heatmap, compare the predicted parking space parameters with the actual parking space parameters, compare the predicted parking space category with the actual parking space type, and compare the predicted vertical or horizontal parking space four corner point parameters with the actual parking space four corner point parameters to obtain the first comparison result, the second comparison result, the third comparison result, and the fourth comparison result respectively.

[0060] Step S420: Determine whether to stop training the initial model based on the first comparison result, the second comparison result, the third comparison result, and the fourth comparison result.

[0061] In this embodiment, step S420 specifically includes the following steps:

[0062] Step S421: Multiply the first alignment result, the second alignment result, the third alignment result, and the fourth alignment result by their respective weighting coefficients and then sum them to obtain the predicted value.

[0063] Step S422: Compare the predicted value with the preset threshold;

[0064] Step S423: If the predicted value is less than or equal to a preset threshold, then stop training the initial model.

[0065] This embodiment decouples parking space data, reducing the feature representation between parking space parameters, parking space categories, and the parameters of the four corner points of vertical or horizontal parking spaces, thus reducing mutual influence and improving prediction accuracy. Furthermore, this embodiment compares each decoupled feature with real parking space data, multiplies them by their respective weights, and sums them to obtain a predicted value. This predicted value is then compared with a preset threshold, allowing for more precise adjustment of the initial model parameters. Here, four weight coefficients are required: a first weight coefficient, a second weight coefficient, a third weight coefficient, and a fourth weight coefficient. The first weight coefficient corresponds to the first comparison result, the second weight coefficient to the second comparison result, the third weight coefficient to the third comparison result, and the fourth weight coefficient to the fourth comparison result. In this embodiment, the first weight coefficient is less than the second weight coefficient, the second weight coefficient is less than the third weight coefficient, and the third weight coefficient is equal to the fourth weight coefficient. In other embodiments, the first, second, third, and fourth weight coefficients can be set according to specific design requirements. The preset threshold is also set according to specific design requirements.

[0066] Figure 3 This is a schematic diagram of a parking space according to the present invention. Figure 3 As shown, in step S300, the parameters of the parking space include the frame width W, the frame height H, and the x and y coordinates of the center point O of the parking space. Figure 3 As shown, points A, B, C, and D represent the four corner points of the parking space. If the parking space is a perpendicular parking space, then the side A and B is the entrance end of the parking space; if the parking space is a horizontal parking space, then the side B and C is the entrance end of the parking space.

[0067] In step S300, the parking space categories include perpendicular parking spaces with cars, perpendicular parking spaces without cars, horizontal parking spaces with cars, and horizontal parking spaces without cars; the parameters of the four corner points of a perpendicular or horizontal parking space include the x-coordinate and y-coordinate of the four corner points. Here, parking space identification will only be performed when perpendicular parking spaces without cars and horizontal parking spaces without cars are identified.

[0068] In this embodiment, step S300 specifically includes the following steps:

[0069] Step S310: Extract the first image features from the parking space sample image to predict the heat map of the parking space corner points in the parking space sample image based on the first image features.

[0070] Step S320: Extract the second image features from the parking space sample images and fuse them with the first image features to predict the parameters and category of the parking space based on the fused first and second image features.

[0071] Step S330: Selectively predict the parameters of the four corner points of the vertical or horizontal parking space based on the predicted parking space category.

[0072] This embodiment incorporates the parking space corner heatmap into the parking space features, improving the accuracy of corner detection and thus further enhancing the accuracy of parking space detection.

[0073] The following steps are included after step S330:

[0074] Step 1: Calculate the intersection-union ratio (IUGR) based on the predicted parking space parameters, the parameters of the four corner points of the predicted perpendicular or horizontal parking spaces, and the actual parking space data. Use the IUGR as the second comparison result. In other words, this embodiment compares the parking space parameters with the parameters of the actual parking spaces in the data by calculating the IUGR.

[0075] In this embodiment, step one specifically includes the following steps:

[0076] Step 2: Determine the two corner points at the entrance of the predicted parking space based on the parameters of the four corner points of the predicted vertical or horizontal parking space;

[0077] Step 3: Determine the parameters of the center point of the predicted parking space's entrance based on the parameters of the two corner points of the predicted parking space's entrance.

[0078] Step 4: Calculate the scaling factor based on the parameters of the center point of the predicted parking space entrance and the parameters of the center point of the actual parking space entrance in the data.

[0079] Step 5: Calculate the intersection-merge ratio based on the proportional coefficient, the predicted parking space parameters, and the actual parking space data.

[0080] Traditional IOUloss can lead to anchor point and label matching failures. This embodiment designs SlotIouloss, which uses the ratio of the difference between the center point of the entrance in the real parking space data and the center point of the predicted parking space entrance as a weighting coefficient for the overlap, thereby further enhancing the accuracy of parking space entrance detection.

[0081] Figure 4This is a schematic comparison diagram of actual parking space data and predicted parking space data according to the present invention. For example... Figure 4 As shown, in this embodiment, the intersection-union ratio is calculated according to formula (1):

[0082]

[0083] Where Slotiouloss represents the intersection-union ratio, area1 represents the intersection area between the predicted parking space and the actual parking space, area2 represents the merged area between the predicted parking space and the actual parking space, and A represents the scaling factor. Here, area1 refers to... Figure 4 The area where the two dashed boxes intersect, area2 refers to Figure 4 The area where the two dashed boxes meet.

[0084] In this embodiment, the scaling factor is calculated according to the following formula (2):

[0085] A = 1 - |P1 - P2| * B (Formula (2));

[0086] Where P1 represents the parameters of the predicted center point of the parking space entrance, P2 represents the parameters of the center point of the parking space entrance in the actual parking space data, and B represents a preset parameter, 0 < B < 1, where B is the reciprocal of the pixel length of the center point of the parking space entrance in the parking space sample image. Here, P1 represents the x-coordinate and y-coordinate of the predicted center point of the parking space entrance, respectively... and Where A1x and B1x represent the x-coordinates of A1 and B1, respectively, and A1y and B1y represent the y-coordinates of A1 and B1, respectively. A1 and B1 are the two corner points of the predicted parking space entrance. P2 represents the x-coordinate and y-coordinate of the center point of the actual parking space entrance. and Where A2x and B2x represent the x-coordinates of A2 and B2 respectively, A2y and B2y represent the y-coordinates of A2 and B2 respectively, and A2 and B2 are the two corner points of the predicted parking space entrance.

[0087] In formula (2), when A is greater than or equal to the preset value, A = A; when A is less than the preset value, A = the preset value. The preset value is greater than zero and less than 1. In this embodiment, the preset value is 0.3, meaning that A will not be less than 0.3, but will only be greater than 0.3. In other embodiments, the preset value can also be set according to specific design requirements.

[0088] After the initial model training is completed, when actually predicting parking spaces, the initial model is input with a surround view stitched image taken at the same time stamp by four fisheye cameras in front, behind, left and right of the vehicle. After being analyzed by the deep learning network of the initial model, the coordinates of the four parking space corner points are output.

[0089] Figure 5 This is the network model diagram of the initial model according to the present invention. For example... Figure 5 As shown, network model design generally includes four parts: backbone, neck, head, and loss. The backbone and neck typically employ classic architectures. The backbone can be designed using network structures such as ResNet, VGG, and MobileNet to extract features at different scales. The neck can be designed using FPN, Bi-FPN, PA-Net, etc., to enhance feature information at various scales.

[0090] In this embodiment, the head part is divided into two branches. Branch one extracts feature1 to predict the point heatmap of the parking space corners. The point heatmap is used to calculate loss1, which can be calculated using Euclidean distance. Branch two first extracts feature2. Feature2 and feature1 are fused to obtain enhanced features containing parking space key point information. These enhanced features are used to predict four results: bbox(Ox, Oy, w, h, corresponding to the x-coordinate of the center point, y-coordinate of the center point, width of the parking space, and height of the parking space, respectively), classification(id, corresponding to the category of the parking space), slot1keypoints(Ax Ay Bx By Cx Cy Dx Dy, corresponding to the coordinate information of the four corner points of the vertical parking space, respectively), and slot2keypoints(Ax Ay Bx By Cx Cy Dx Dy, corresponding to the coordinate information of the four corner points of the horizontal parking space, respectively).

[0091] In this embodiment, the main difference in the loss calculation lies in the calculation of loss2. Loss1, loss3, loss4, and loss5 are calculated by directly comparing whether the two sets of values ​​are equal, thus using Euclidean distance. The difference between this embodiment and existing methods lies in the design of the head and loss mechanism, which will be described in detail below.

[0092] The first difference is that in this embodiment, the head part is divided into two branches. The first branch predicts the heatmap of the parking space corner point, and the heatmap is embedded as a feature into the second branch feature to strengthen the second branch feature.

[0093] The second difference is that the feature representations of bounding boxes, classification, and keypoints are decoupled, reducing their mutual influence.

[0094] The third difference is that the corner points of vertical and horizontal parking spaces are predicted using slot1 keypoints and slot2 keypoints respectively, to avoid problems with keypoint regression caused by incorrect prediction of the categories of horizontal and vertical parking spaces.

[0095] The fourth difference is that loss2 is calculated using SlotIouloss.

[0096] This embodiment supports the detection of any parking space type, and supports the detection of special parking space types or special scenario vehicle models. By labeling the category of the parking space, the x-coordinate of the center point of the parking space, the y-coordinate of the center point of the parking space, the width of the parking space frame, the height of the parking space frame, and the x-coordinate and y-coordinate of the four corner points in the real parking space data, it can be understood that the above data is used as labels. The parking space sample images and labels are used as input parameters to the initial model for iterative training, and the iteration conditions are set. That is, if the inference result of the parking space sample image in the initial model and the label error are within a certain range, the training ends and the network model parameters are saved.

[0097] Therefore, those skilled in the art should recognize that although numerous exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications conforming to the principles of the present invention can be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Thus, the scope of the present invention should be understood and construed as covering all such other variations or modifications.

Claims

1. A training method for a parking space detection model, characterized in that, The method comprises the following steps: obtaining a parking space sample picture, wherein the parking space sample picture is labeled with real parking space data; inputting the parking space sample picture into a pre-established initial model; extracting picture features in the parking space sample picture to predict a heat map of a parking space corner point, parameters of the parking space, a category of the parking space, and parameters of four corner points of a vertical parking space or a horizontal parking space in the parking space sample picture according to the picture features; adjusting parameters of the initial model according to the predicted heat map of the parking space corner point, the parameters of the parking space, the category of the parking space, and the parameters of the four corner points of the vertical parking space or the horizontal parking space in the parking space sample picture and the real parking space data to train the initial model; wherein the step of extracting the picture features in the parking space sample picture to predict the heat map of the parking space corner point, the parameters of the parking space, the category of the parking space, and the parameters of the four corner points of the vertical parking space or the horizontal parking space in the parking space sample picture according to the picture features comprises the following steps: extracting first picture features in the parking space sample picture to predict a heat map of a parking space corner point in the parking space sample picture according to the first picture features; extracting second picture features in the parking space sample picture and fusing the first picture features to predict the parameters of the parking space and the category of the parking space according to the fused first picture features and the second picture features; selectively predicting the parameters of the four corner points of the vertical parking space or the horizontal parking space according to the predicted category of the parking space.

2. The training method of claim 1, wherein, The step of adjusting the parameters of the initial model according to the predicted heat map of the parking space corner point, the parameters of the parking space, the category of the parking space, and the parameters of the four corner points of the vertical parking space or the horizontal parking space in the parking space sample picture and the real parking space data to train the initial model comprises the following steps: comparing the predicted heat map of the parking space corner point with a heat map of a parking space corner point in the real parking space data, comparing the predicted parameters of the parking space with parameters of a parking space in the real parking space data, comparing the predicted category of the parking space with a type of a parking space in the real parking space data, and comparing the predicted parameters of the four corner points of the vertical parking space or the horizontal parking space with parameters of four corner points of a vertical parking space or a horizontal parking space in the real parking space data to obtain a first comparison result, a second comparison result, a third comparison result, and a fourth comparison result, respectively; judging whether to stop training the initial model according to the first comparison result, the second comparison result, the third comparison result, and the fourth comparison result.

3. The training method of claim 2, wherein, The step of judging whether to stop training the initial model according to the first comparison result, the second comparison result, the third comparison result, and the fourth comparison result comprises the following steps: multiplying the first comparison result, the second comparison result, the third comparison result, and the fourth comparison result by corresponding weight coefficients and then adding them to obtain a prediction value; comparing the prediction value with a preset threshold value; if the prediction value is less than or equal to the preset threshold value, stopping training the initial model.

4. The training method of claim 3, wherein, In the step of extracting picture features in the parking space sample pictures to predict a heat map of a parking space corner point, parameters of a parking space, a category of a parking space, parameters of four corner points of a vertical parking space or a horizontal parking space in the parking space sample pictures according to the picture features, the parameters of the parking space include a frame width of the parking space, a frame height of the parking space, and horizontal and vertical coordinates of a center point of the parking space.

5. The training method of claim 4, wherein, In the step of extracting picture features in the parking space sample pictures to predict a heat map of a parking space corner point, parameters of a parking space, a category of a parking space, parameters of four corner points of a vertical parking space or a horizontal parking space in the parking space sample pictures according to the picture features, the category of the parking space includes a vertical parking space with a vehicle, a vertical parking space without a vehicle, a horizontal parking space with a vehicle, and a horizontal parking space without a vehicle; and the parameters of the four corner points of the vertical parking space or the horizontal parking space include horizontal and vertical coordinates of the four corner points of the vertical parking space or the horizontal parking space.

6. The training method of claim 3, wherein, The step of selectively predicting the parameters of the four corner points of the vertical parking space or the horizontal parking space according to the predicted category of the parking space further includes the following steps: The step of calculating an intersection over union value according to the predicted parameters of the parking space, the predicted parameters of the four corner points of the vertical parking space or the horizontal parking space, and the real parking space data, and taking the intersection over union value as the second comparison result.

7. The training method of claim 6, wherein, The step of calculating an intersection over union value according to the predicted parameters of the parking space, the predicted parameters of the four corner points of the vertical parking space or the horizontal parking space, and the real parking space data, and taking the intersection over union value as the second comparison result specifically includes the following steps: determining two corner points of an entrance end of the predicted parking space according to the predicted parameters of the four corner points of the vertical parking space or the horizontal parking space; determining parameters of a center point of the entrance end of the predicted parking space according to the parameters of the two corner points of the entrance end of the predicted parking space; calculating a proportional coefficient according to the parameters of the center point of the entrance end of the predicted parking space and parameters of a center point of an entrance end of a parking space in the real parking space data; calculating the intersection over union value according to the proportional coefficient, the predicted parameters of the parking space, and the real parking space data.

8. The training method of claim 7, wherein, The intersection over union value is calculated according to formula (1): Equation (1); wherein Slotiouloss represents the intersection over union value, represents the intersection area of the predicted parking space and the real parking space, represents the union area of the predicted parking space and the real parking space, A represents the proportionality coefficient.

9. The training method of claim 8, wherein, The proportional coefficient is calculated according to formula (2): A = 1 - |P1 - P2| * B formula (2); wherein P1 represents the parameters of the center point of the entrance end of the predicted parking space, P2 represents the parameters of the center point of the entrance end of the parking space in the real parking space data, B represents a preset parameter, 0 < B < 1; when A is greater than or equal to a preset value, A = A; when A is less than the preset value, A = the preset value, the preset value is greater than zero and less than 1.

Citation Information

Patent Citations

  • Parking space detection and model training method and device, vehicle, equipment and storage medium

    CN111178295A