Parking space recognition method and device, vehicle and storage medium

By combining a backbone network, a parking space corner detection network, and a parking space line detection network in the parking space recognition method, and utilizing attention mechanisms and convolution processing, the problems of insufficient accuracy in parking space recognition and success rate of automatic parking are solved, especially in narrow parking space scenarios where it performs excellently.

CN118675140BActive Publication Date: 2026-11-24GUANGZHOU AUTOMOBILE GROUP CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310254812.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-15
Publication Date
2026-11-24
Estimated Expiration
2043-03-15

AI Technical Summary

Technical Problem

Existing parking space recognition methods are insufficient in terms of accuracy and success rate of automatic parking, especially in narrow parking space scenarios.

Method used

By inputting the target image into the backbone network for feature extraction, using the parking space corner detection network for attention mechanism operations and convolution processing, and combining it with the parking space line detection network, the accuracy of parking space corner and parking space line recognition is improved.

Benefits of technology

In complex environments such as missing parking lines, obstructed by obstacles, and dim lighting, the accuracy of parking space recognition is significantly improved, thereby increasing the success rate of automatic parking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118675140B_ABST
    Figure CN118675140B_ABST
Patent Text Reader

Abstract

This application discloses a parking space recognition method, device, vehicle, and readable storage medium. The method includes: acquiring a target image of a target parking space; inputting the target image into a backbone network for feature extraction to obtain a target feature map; inputting the target feature map into a parking space corner detection network for attention mechanism operation to obtain a target spatial attention map; performing convolution processing on the target spatial attention map to obtain a target parking space corner coordinate prediction map; and inputting the target feature map and the target parking space corner coordinate prediction map into a parking space line detection network to obtain a parking space recognition result for the target parking space. This application improves the detection rate of visible parking space corners and the prediction effect of occluded parking space corners, thereby improving the accuracy of parking space recognition and increasing the success rate of automatic parking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of autonomous driving technology, and more specifically, to a parking space recognition method, device, vehicle, and computer-readable storage medium. Background Technology

[0002] With the increasing demand for intelligent transportation, automatic parking is a powerful component in realizing intelligent travel and autonomous driving. In an automatic parking system, once a valid parking space is identified, the system combines the vehicle's position and posture to plan a parking path, and continuously updates the parking space position dynamically based on the perception results during the parking process, thereby achieving automatic parking.

[0003] Currently, parking space corner features can be manually designed to represent parking space corners. By using feature extraction operators and image processing methods, parking space corners and line segments can be obtained. Then, edge detection is performed based on the parking space corners and line segments. Using the geometric features after edge detection, potential parking space boundary lines can be obtained, and finally, the complete parking space can be reconstructed.

[0004] However, this method yields a low accuracy rate for parking spaces, resulting in a low success rate for automatic parking. Summary of the Invention

[0005] This application proposes a parking space identification method, device, vehicle, and computer-readable storage medium to improve the above-mentioned deficiencies.

[0006] In a first aspect, embodiments of this application provide a parking space recognition method, the method comprising: acquiring a captured image of a target parking space; inputting the captured image of the target parking space into a backbone network for feature extraction to obtain a target feature map; inputting the target feature map into a parking space corner detection network for attention mechanism operation to obtain a target spatial attention map; performing convolution processing on the target spatial attention map to obtain a target parking space corner coordinate prediction map; and inputting the target feature map and the target parking space corner coordinate prediction map into a parking space line detection network to obtain a parking space recognition result for the target parking space.

[0007] Secondly, embodiments of this application also provide a parking space recognition device, the device comprising:

[0008] The first acquisition module is used to acquire images of the target parking space.

[0009] The extraction module is used to input the captured image of the target into the backbone network for feature extraction to obtain the target feature map;

[0010] The computation module is used to input the target feature map into the parking space corner detection network for attention mechanism computation to obtain the target space attention map;

[0011] The processing module is used to perform convolution processing on the target space attention map to obtain the predicted coordinate map of the target parking space corner point;

[0012] The output module is used to input the target feature map and the predicted coordinate map of the target parking space corner point into the parking space detection network to obtain the parking space recognition result for the target parking space.

[0013] Thirdly, embodiments of this application also provide a vehicle, characterized in that the vehicle includes: one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to perform the above-described methods.

[0014] Fourthly, embodiments of this application also provide a computer-readable storage medium storing processor-executable program code, which, when executed by the processor, causes the processor to perform the above-described method.

[0015] This application provides a parking space recognition method, device, vehicle, and computer-readable storage medium. The method involves inputting a target image of the target parking space into a backbone network for feature extraction to obtain a target feature map. This target feature map is then input into a parking space corner detection network for attention mechanism computation to obtain a target spatial attention map. Finally, the target spatial attention map is convolved to obtain a predicted coordinate map of the target parking space corner. This ensures that the predicted coordinate map of the target parking space corner, obtained through attention mechanism computation and convolution processing, reflects the information of the true parking space corner even in situations with missing parking lines, obstructed obstacles, or blurred lighting. Finally, the target feature map and the predicted coordinate map of the target parking space corner are input into a parking line detection network to obtain the parking space recognition result. By incorporating features from parking space corner recognition into the parking space recognition result obtained through the parking line detection network, the accuracy of the parking space recognition result is higher, thus improving the success rate of automatic parking.

[0016] Other features and advantages of the embodiments of this application will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the embodiments of this application. The objects and other advantages of the embodiments of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A schematic diagram of a vehicle hardware environment applicable to embodiments of this application is shown.

[0019] Figure 2 A flowchart of a parking space recognition method according to an embodiment of this application is shown.

[0020] Figure 3 A schematic diagram of a parking space corner detection network according to an embodiment of this application is shown.

[0021] Figure 4 A schematic diagram of a parking space corner point is shown in an embodiment of this application.

[0022] Figure 5 It shows Figure 5 A schematic diagram of midpoint A.

[0023] Figure 6 A grid diagram of parking space corner point prediction in an embodiment of this application is shown.

[0024] Figure 7 A flowchart of a parking space identification method according to yet another embodiment of this application is shown.

[0025] Figure 8 A schematic diagram of a backbone network module according to an embodiment of this application is shown.

[0026] Figure 9 A schematic diagram of a backbone network according to an embodiment of this application is shown.

[0027] Figure 10 This illustration shows a schematic diagram of a preprocessing feature map acquisition according to an embodiment of this application.

[0028] Figure 11 This diagram illustrates a method for obtaining target connection results according to an embodiment of this application.

[0029] Figure 12 A flowchart of a parking space identification method according to another embodiment of this application is shown.

[0030] Figure 13 A schematic diagram illustrating the acquisition of parking space recognition results in an embodiment of this application is shown.

[0031] Figure 14 A schematic diagram of a parking space recognition model is shown, which is a parking space recognition method proposed according to an embodiment of this application.

[0032] Figure 15 A structural block diagram of a parking space recognition device according to an embodiment of this application is shown.

[0033] Figure 16A structural block diagram of a computer-readable storage medium provided in an embodiment of this application is shown. Detailed Implementation

[0034] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of them. The components of the embodiments of the present application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without inventive effort are within the scope of protection of the present application.

[0035] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0036] With the increasing demand for intelligent transportation, automatic parking is a powerful component in realizing intelligent travel and autonomous driving. In an automatic parking system, once a valid parking space is identified, the system combines the vehicle's position and posture to plan a parking path, and continuously updates the parking space position dynamically based on the perception results during the parking process, thereby achieving automatic parking.

[0037] Traditional parking space recognition algorithms are limited by the processing accuracy of panoramic surround view systems and the complex environments they face. Parking space recognition has always been an unstable and uncertain part of automatic parking systems. Moreover, with the rapid development of my country's automotive industry and the improvement of people's living standards, the number of cars is constantly increasing. The emergence of narrow parking spaces can increase parking capacity and alleviate parking pressure to some extent, but traditional parking space recognition algorithms face even greater technical challenges in narrow parking space scenarios. Therefore, there is an urgent need for a parking space recognition method to improve the accuracy of parking space recognition, especially the accuracy of narrow parking space recognition, thereby increasing the success rate of automatic parking.

[0038] Currently, existing parking space recognition methods are context-based, two-stage parking space detection approaches. These methods consist of two deep network modules: a parking space context recognizer and a parking space detector. The recognizer identifies the parking environment, including parking space type, angle, and availability; the parking space detector uses multiple type-based fine-tuning detectors with rotating anchor frame detection and rotational non-maximum suppression to pinpoint the exact location of the parking space.

[0039] However, the inventors found in their research that the two-stage parking space detection method based on context had a low accuracy rate, resulting in a low success rate for automatic parking.

[0040] Therefore, to overcome the above-mentioned shortcomings, the inventors proposed a parking space recognition method, device, vehicle, and computer-readable storage medium. The method involves inputting a captured image of the target into a backbone network for feature extraction to obtain a target feature map; then, inputting the target feature map into a parking space corner detection network for attention mechanism computation to obtain a target spatial attention map; convolving the target spatial attention map to obtain a predicted coordinate map of the target parking space corner; finally, inputting the target feature map and the predicted coordinate map of the target parking space corner into a parking space line detection network to obtain the parking space recognition result for the target parking space, thereby improving the accuracy of parking space recognition and increasing the success rate of automatic parking.

[0041] Please see Figure 1 , Figure 1 A schematic diagram of a vehicle hardware environment applicable to an embodiment of this application is shown. The vehicle 100 includes an autonomous driving system 110. The autonomous driving system 110 can have a variety of built-in autonomous driving functions. The autonomous driving system 110 controls the vehicle to drive autonomously according to the built-in autonomous driving functions. The autonomous driving functions may include, for example, automatic lane changing function, automatic overtaking function, and automatic parking function.

[0042] The autonomous driving system 110 may include an on-board data acquisition device 111, one or more (only one is shown in the figure) processors 112 and memory 113.

[0043] The vehicle-mounted acquisition device 111 is used to acquire images of a target parking space while the vehicle is in motion. The vehicle-mounted acquisition device 111 can be, for example, a high-definition camera.

[0044] The processor 112 may be a microcontroller unit (MCU) with a built-in memory 113 containing a program that can execute the contents of the following embodiments, and the processor 112 can execute the program stored in the memory 113.

[0045] The processor 112 may include one or more processors. The processor 112 connects to various parts of the vehicle 100 through various interfaces and lines, and performs various functions of the vehicle 100 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 113, and calling data stored in the memory 113.

[0046] The memory 113 may include random access memory (RAM) or read-only memory (ROM). The memory 113 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 113 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below.

[0047] Please see Figure 2 , Figure 2 This application illustrates a flowchart of a parking space recognition method according to an embodiment of the present application, used for vehicles. The method includes:

[0048] S201. Acquire a target image of the target parking space.

[0049] The target parking space refers to the parking space where the vehicle wishes to park. The target image can be an image of the target parking space captured by a camera, which can be the vehicle's onboard camera or a fisheye lens.

[0050] Parking spaces are categorized by the angle between the vehicle's longitudinal axis and the passageway into parallel, perpendicular, diagonal (i.e., parking at 30°, 45°, or 60° angles to the passageway), or mixed types. Effective representation of a single parking space is fundamental to completing the parking space recognition task.

[0051] like Figure 3 As shown, for all types of parking spaces, without loss of generality, three basic elements describing the parking space structure information are included: parking space corner points, etc. Figure 3 Points A, B, C, and D in the diagram, and the parking space entry line ( Figure 4 The line with an arrow pointing from point A to point B), parking space dividing lines ( Figure 4 (The arrowed lines from point C to point B and from point D to point A).

[0052] Since parking space markings have a certain width, the appropriate definition of the location of the corner points of the parking space is related to the effectiveness of feature learning and the accuracy of subsequent parking. Here, the location of the corner points of the parking space is defined as follows: Figure 6 As shown, Figure 4The intersection of the dashed lines indicates the location of the corner point of the parking space.

[0053] It also stipulates: such as Figure 3 As shown, the direction of the entry line is counterclockwise around the center point of the parking space. The corner points of the parking spaces are also arranged in a certain order. The starting point of the entry line is designated as point A, and the ending point of the entry line is designated as point B.

[0054] Let B be the point, therefore the line entering is... The other two points are designated as points C and D, respectively, in a counter-clockwise direction around the center point of the parking space. Therefore, the set of corner points of the parking space is {A, B, C, D}. The direction of the parking space dividing line is from the parking end point to the entrance.

[0055] The direction of the entry point is The final form of obtaining a parking space is as follows:

[0056] It is worth noting that the starting point of the dividing line may belong to multiple parking spaces that do not share the same dividing line.

[0057] After obtaining the target image of the target parking space, the target image needs to be processed.

[0058] S202. Input the target image into the backbone network for feature extraction to obtain the target feature map.

[0059] A backbone network is any network capable of image feature extraction. A backbone network could be RepVGG, which is an improved version of the VGG network.

[0060] For example, the target feature map extracted by the backbone network can be represented as F∈R H×W×C Where H represents height, W represents width, and C represents the number of backbone network channels.

[0061] S203. Input the target feature map into the parking space corner detection network for attention mechanism operation to obtain the target space attention map.

[0062] The attention mechanism aims to selectively focus on certain relevant things while ignoring others. The attention mechanism can adjust the direction and degree of attention according to the specific task objectives.

[0063] In some implementations, the parking space corner detection network includes a first compression excitation module and a relationship-aware attention module. S203 may include: inputting the target feature map into the first compression excitation module for feature recalibration to obtain a preprocessed feature map, the preprocessed feature map including feature vectors of multiple spatial locations; using the feature vector of each spatial location as a node and the relationship between the feature vectors of any two spatial locations as a connection edge to construct a target undirected node graph; inputting the target undirected node graph into the relationship-aware attention module for multi-head attention mechanism operation to obtain the attention operation result of each node in the target undirected node graph; connecting the attention operation result and feature vector corresponding to each node in the target undirected node graph to obtain the connection result of each node in the target undirected node graph; performing full connection processing on the connection result of each node in the target undirected node graph to obtain the aggregation result of each node in the target undirected node graph; and performing tiling processing on the aggregation result of each node in the target undirected node graph to obtain a target spatial attention map for the target parking space.

[0064] In some implementations, the parking space corner detection network can be as follows: Figure 5 As shown, the network includes two cascaded first compression activation modules (SE modules). Each first compression activation module consists of a squeeze layer and an expand layer connected in sequence. The squeeze layer of each first compression activation module in the parking space corner detection network is a convolutional layer with a 1×1 convolutional kernel, and the expand layer of each first compression activation module in the parking space corner detection network is a convolutional layer combining a 1×1 convolutional kernel and a 3×3 convolutional kernel. A relation-aware attention module (RA module) is then connected to the first compression activation module.

[0065] The compression excitation module, or SE module for short, considers the interdependencies between model channels. Its output preprocessed feature map has a more focused approach than the target feature map, containing more important feature information. An undirected node graph refers to a node graph where the connecting edges have no direction.

[0066] The Relation-Aware Attention (RA) module is built upon a Graph Attention Network (GAN). It utilizes key-value attention mechanisms and dot-product attention models to learn a spatial attention graph of size H×W. For each feature location, it captures global structural information and local appearance information more compactly, stacking various relationships. This means learning attention by combining the pairwise relevance / affinity of all feature locations with the features themselves. Applying the RA module significantly enhances feature representation capabilities, resulting in more discriminative features.

[0067] Multi-head attention refers to independently learning h different mappings to transform queries, keys, and values. These h transformed queries, keys, and values ​​are then pooled in parallel with attention. Finally, the outputs of these h attention pooling are concatenated and transformed through another learnable mapping to produce the final output, which is the aggregated result.

[0068] In this embodiment, the above processing enables the output aggregation result to aggregate the information of adjacent nodes into the information of the current node, enriching the information of the current node and improving the accuracy of parking space corner detection network in identifying parking space corners.

[0069] The target feature map can be represented as F∈R H×W×C After relabeling the target feature map, the preprocessed feature map can be represented as X∈R H×W×C The preprocessed feature map includes a C-dimensional feature vector v i ∈R C The C-dimensional feature vector v at each spatial location i ∈R C As feature nodes, all spatial locations can form an undirected node graph G = (V, E) with N = W × H nodes, where node v e ∈V(e∈{1,...,N}) represents the e-th node, and the connecting edge (v e v g )∈E represents the relationship between nodes e and g.

[0070] For any node i, vi is its corresponding eigenvector, and its neighboring nodes Ni are... The feature set composed of the feature vectors of adjacent nodes is used to find a function Y of the form... The mapping yields the optimal aggregated features, where Θ is a learnable parameter.

[0071] First, the query vector is obtained from the node itself through linear embedding. Simultaneously, the key and value vectors of adjacent nodes are obtained through linear embedding. Then, a multi-head attention mechanism is used to obtain the final aggregated features. For the multi-head attention mechanism, different heads capture features from different representation subspaces. The specific aggregation calculation formula is as follows:

[0072]

[0073]

[0074]

[0075] Among them, z i For the aggregation result, Let K be the result of the attention operation for each node in the target undirected node graph, where K is the number of attention heads, and (·, ·> denote the dot product operator. This indicates a concatenation operation. This indicates a sequential connection from x1 to xk, where xk refers to... The formula after that, It is the k-th attention weight between the center node i and its neighboring node j, obtained by applying softmax to the dot product value. Let represent the parameters used to compute the query vector, key vector, and value vector in the k-th attention head, respectively, with dimensions d. a d a and d v Finally, the output vectors of all K attention heads are concatenated with the input vectors and passed to θ. o A parameterized fully connected layer yields the final output. The meaning of Softmax is that instead of uniquely determining a certain maximum value, it assigns a probability value to each output classification result, representing the likelihood of belonging to each category. The Softmax function can convert the output values ​​of multi-class classification into a probability distribution ranging from [0, 1] to 1.

[0076] The aggregation result of all nodes is obtained through aggregation calculation. Then, all aggregation results are tiled to obtain the target space attention map. Among them, tiling refers to stretching a multidimensional vector into a one-dimensional vector.

[0077] S204. Perform convolution processing on the target space attention map to obtain the target parking space corner coordinate prediction map.

[0078] In some implementations, such as Figure 5 As shown, the target space attention diagram output by the RA module can be viewed. By performing a convolution operation on a convolutional layer that maintains the feature map size but changes the number of channels, the predicted coordinates of the corner points of the target parking space, G∈R, can be obtained. H×W×4 The convolutional layer can be 3×3.

[0079] S205. Input the target feature map and the predicted coordinate map of the corner point of the target parking space into the parking space line detection network to obtain the parking space recognition result for the target parking space.

[0080] After obtaining the target feature map and the predicted coordinate map of the target parking space corner, the target feature map and the predicted coordinate map of the target parking space corner are input into the parking space line detection network. When the parking space line detection network performs parking space recognition, it integrates the parking space corner information obtained by the parking space corner detection network, and finally obtains the parking space recognition result for the target parking space.

[0081] At the same time, it is also very important to train the backbone network, parking space corner detection network, and parking space line detection network to make the network output results more accurate.

[0082] In some implementations, training the backbone network, parking space corner detection network, and parking space line detection network may include: inputting sample captured images into the backbone network for feature extraction to obtain a sample feature map; inputting the sample feature map into the parking space corner detection network for attention mechanism operation to obtain a sample spatial attention map; performing convolution processing on the sample spatial attention map to obtain a sample parking space corner coordinate prediction map; inputting the sample feature map and the sample parking space corner coordinate prediction map into the parking space line detection network to obtain a parking space recognition result for the sample parking space; acquiring the predicted parking space line information, predicted parking space corner information, real parking space line information, and real parking space corner information from the sample parking space recognition result; determining a first loss value based on the predicted parking space corner information and the real parking space corner information; determining a second loss value based on the predicted parking space line information and the real parking space line information; determining a final loss value based on the first loss value and the second loss value; and training the backbone network, parking space corner detection network, and parking space line detection network through a game-theoretic approach based on the final loss value.

[0083] The detailed process of obtaining the parking space identification results of the sample parking spaces can be found in steps S201-S205, which will not be elaborated here.

[0084] Generally speaking, parking space corners are usually far apart and have certain pixel features from the imaging angle. Therefore, the prediction of parking space corners can be regarded as a regression problem. When the coordinates of the corner in the actual parking space fall into a certain grid cell, then that grid cell is responsible for predicting that corner. That is, based on the feature map, the probability that each grid cell contains a parking space corner, the coordinate regression value of each parking space corner, and the occlusion attributes of the parking space corner are directly predicted. Each cell in the network is responsible for predicting at most one parking space corner.

[0085] Given that the sample feature map obtained during the backbone network feature extraction stage is F∈R H×W×C The sample feature map has a size of H×W×C. The process of detecting parking space corner points can be simply represented as: G=f(F), where f is the mapping relationship between F and G, G∈R. H×W×4 This represents the predicted parking space corner information finally output by the parking space corner detection head, taking any grid cell G. ab(1≤a≤W, 1≤b≤H), the values ​​on each channel are concatenated to form a 1×4 vector, used to express the parking space corner point in this grid cell: the first value of the vector represents the probability that the grid contains a vehicle corner point; the second and third values ​​represent the predicted value (Δx) of the offset between the discrete parking space corner point and the coordinates at the upper left of the grid. ab Δy ab )(like Figure 6 As shown in the figure, the filled grid cells are grids containing parking space corner points, and the points in the grid cells are the specific locations of the parking space corner points. The fourth value of the vector represents the occlusion attribute of the parking space corner point (wear occlusion, obstacle occlusion, etc.).

[0086] After obtaining the predicted parking space corner information, the predicted parking space line information can be obtained based on this information. The actual parking space line information and actual parking space corner information can be obtained by the user through manual annotation of the sample environment image. The parking space line information includes the probability that two parking space corners form an entry line, the probability of a dividing line, and the probability that the sample parking space is available for parking. Having obtained the predicted and actual parking space corner information from the sample environment image, a first loss value is determined based on this information. The first loss value L... point Used to characterize the accuracy of the initial model's predictions for parking space corners.

[0087] When a parking space corner falls into a grid cell, that grid cell is considered a valid grid cell, responsible for predicting that corner. However, due to the relatively small number of valid grid cells compared to invalid ones, and the varying difficulty levels of distinguishing parking space corners caused by environmental factors such as occlusion and lighting, an imbalance in the ratio of positive / negative samples to easy / difficult samples occurs during training. To mitigate this issue, Focalloss is used to construct a loss function for grid validity classification. The valid grid cell predicts the coordinates of the parking space corner, i.e., the offset from the top-left corner of the valid grid cell, as well as the occlusion attribute of the corner (0 for unoccluded, 1 for occluded). The corner regression loss is described separately; therefore, the first loss value L... point In other words, the loss value for parking space corner recognition is defined as:

[0088] L point =L cls +L reg ,

[0089]

[0090]

[0091] Where N is the total number of sample environment images, L clsFor classification loss including corner points, α is used to balance the importance of samples from different classes, γ is used to control the weights of easily classified samples by dynamically adjusting the rate of weight reduction of simple samples using the fast scaling property of the power function, and p ij This represents the predicted true value of the classification at (i, j) in the grid diagram. L represents the predicted value at the corresponding location. reg The coordinate regression loss of the corner points is indicated by the indicator function 1. ij Represents coordinates (x) ij y ij The value at () indicates whether the location contains the actual corner point of the parking space. If it does, the value is 1; otherwise, the value is 0. c represents the offset of the corner point output at (i, j) of the predicted mesh graph relative to the top-left corner of the mesh cell. ij This represents the occlusion property of the predicted mesh at (i, j).

[0092] The prediction grid map is a map showing the specific coordinates of the predicted parking space corner points, and it can be a grid map with a fixed size. For example, the prediction grid map can be a 7×7 grid map. A grid cell refers to each small grid in the prediction grid map.

[0093] The predicted parking line information and the actual parking line information of the sample environment image are obtained, and the second loss value is determined based on the predicted parking line information and the actual parking line information.

[0094] Among them, the second loss value L line Used to characterize the accuracy of the initial model's predictions for parking lines.

[0095] Second loss value L line The second loss value L can be obtained by constructing the loss function using cross-entropy. line In other words, the loss value for parking line recognition is defined as:

[0096]

[0097] Among them, l cd ∈R 3 The three dimensions of the (c<B,d<B) vector represent the probability that parking space corner point c and parking space corner point d form an entry line, the probability that they form a dividing line, and the probability that the parking space is available for parking. The superscript ^ indicates the corresponding predicted value, and B refers to the number of grid cells in the row and column of the predicted grid diagram.

[0098] Obtain the first loss value L point and the second loss value L line Then, based on the first loss value and the second loss value, the final loss value is determined.

[0099] The final loss value L is used to characterize the overall prediction accuracy of the backbone network, parking space corner detection network, and parking space line detection network. Therefore, the overall loss value of the model, which is the final loss value L, is defined using the first loss value and the second loss value, as follows:

[0100]

[0101] Where ω1 and ω2 are trainable weight parameters.

[0102] The final loss value is determined, and the backbone network, parking space corner detection network, and parking space line detection network are trained through game theory.

[0103] In this context, game theory considers the predicted and actual behaviors of individuals in a game and studies their optimal strategies. The game here can be a dynamic game, which considers the order in which individuals act, and allows later actors to observe the actions chosen by earlier actors.

[0104] Based on the determined final loss value, the backbone network, parking space corner detection network, and parking space line detection network are trained through game theory, which can achieve rapid convergence and improve the accuracy of detection.

[0105] In this embodiment, the target image of the target parking space is input into the backbone network for feature extraction to obtain a target feature map. This target feature map is then input into the parking space corner detection network for attention mechanism computation to obtain a target spatial attention map. A multi-head attention mechanism is used to enrich the information in the target spatial attention map. Next, the target spatial attention map is convolved to obtain a predicted target parking space corner coordinate map. This ensures that the predicted target parking space corner coordinate map obtained through attention mechanism computation and convolution processing can reflect the true parking space corner information even in situations with missing parking lines, obstructions, or blurred lighting. Finally, the target feature map and the predicted target parking space corner coordinate map are input into the parking line detection network to obtain the parking space recognition result. Incorporating features from parking space corner detection when obtaining the parking space recognition result through the parking line detection network increases the accuracy of the target parking space recognition result, improving the success rate of automatic parking. Furthermore, training the backbone network, parking space corner detection network, and parking line detection network based on a loss function further improves the accuracy of the target parking space recognition result.

[0106] Please see Figure 7 , Figure 7 This paper presents a flowchart of a parking space recognition method according to another embodiment of the present application. The method is for vehicles, and the backbone network includes a backbone network module and a second compression excitation module. The method includes:

[0107] S301. Acquire a target image of the target parking space.

[0108] The description of S301 is the same as that of S201 above, and will not be repeated here.

[0109] S302. Acquire the target image as the image to be extracted; input the image to be extracted into the backbone network module for feature extraction to obtain the target extraction result.

[0110] The backbone network module can be RepVGG, an improved version of VGG. Its main structure consists of stacked CONV-BN and ReLU (rectified linear unit) modules. During training, it uses a multi-branch model structure, while during inference, it uses a single-path model structure. The training and inference models are transformed through structural re-parameterization. RepVGG adopts the concise structure of VGG while incorporating residual networks from ResNet. Figure 8 As shown in (a), the RepVGG Block consists of three parallel branches: (1) 3×3 CONV-BN, (2) 1×1 CONV-BN, and (3) ID-BN, where the ID-BN branch exists only when the number of input channels equals the number of output channels. Here, BN (Batch Normalization) refers to batch normalization.

[0111] The main idea behind RepVGG's decoupled training and inference process is actually to... Figure 8 In (a), the parallel 3×3 convolution kernel with BN, 1×1 convolution kernel, and residual structure are obtained through... Figure 8 The BN absorption operation shown in (b) (converting CONV-BN into a biased CONV) is then converted into a 3×3 convolution kernel. Finally, utilizing the principle that convolution operations with multiple branches but different kernel sizes can be fused into a single convolution operation, it is transformed into... Figure 8 The single-branch structure shown in (c) is as follows, where, Figure 8 In This represents the element-wise addition operator. The principle behind Batch Normalization (BN) is that BN can be incorporated into the preceding convolutions. The specific process is as follows: Given the convolution kernel weights F, the fusion parameters can be formulated as:

[0112]

[0113] Where i represents the i-th channel, and γ, μ, σ, and β represent the scaling factor, mean, variance, and bias of the BN layer.

[0114] Considering that the various features of parking spaces are distributed across different channels (e.g., one channel mainly learns the center feature of parking space markings, while another channel learns the feature of marking intersections; the location of the parking space can be easily determined by combining these two features), to improve the feature extraction capability of the backbone network, a second compression excitation module is introduced on the basis of the RepVGG-AO lightweight network from the RepVGG series, such as... Figure 9 As shown.

[0115] Given an image X to be extracted, the target extraction result U is extracted from X by F. tr To achieve, F tr The specific calculation formula is as follows:

[0116] F tr : X→U, X∈R H′×W′×C′ ,U∈R H×W×C ,

[0117]

[0118] Where X is the image to be extracted, U is the final output matrix of this layer, and H′, W′, C′, H, W, and C are the height, width, and number of channels of X and U, respectively. There is one convolution kernel, and xs is the s-th input.

[0119] S303. Input the target extraction result into the second compression excitation module, perform global average pooling on the target extraction result to obtain the target compression result; perform fully connected processing on the target compression result to obtain the target excitation result; and obtain the target feature map based on the target excitation result and the target extraction result.

[0120] Average pooling refers to dividing an image into a fixed-size network, where the pixel value within a grid is the average of all pixels within that grid.

[0121] like Figure 10 As shown, a second compression excitation module (SE module) is introduced after the backbone network module RepVGG. After obtaining the target extraction result U, a compression (Squeeze) operation is performed, which is manifested in... Figure 10 China F sq At the point (·), Global Average Pooling (GAP) is used, and the calculation formula is as follows:

[0122]

[0123] Where Z represents the target compression result, u c (g, h) represents the value in the g-th row and h-th column of the c-th channel of the input feature.

[0124] After obtaining the target compression result Z, the excitation operation is then performed through the compression excitation attention module, which manifests as follows: Figure 10 S = F ex At (·, W), two fully connected layers are used. The first layer reduces dimensionality, and the second layer restores the original dimensionality. The calculation is as follows:

[0125] S = F ex (Z, W)=σ(W2δ(W) i Z)),

[0126] Where S is the target activation result, δ and σ are the ReLU and sigmoid activation functions respectively, and W1 and W2 are the weight matrices of the two fully connected layers respectively.

[0127] After obtaining the target stimulus result S and the target extraction result U, multiplying S and U results in the following way: Figure 10 China F scale At (·, ·), the weighting operation is completed, and the calculation formula is:

[0128]

[0129] Where X is the output of the SE module, which is the target feature map.

[0130] S304. Input the target feature map into the parking space corner detection network to perform attention mechanism operation to obtain the target space attention map.

[0131] S305. Perform convolution processing on the target space attention map to obtain the target parking space corner coordinate prediction map.

[0132] The descriptions of S304 to S305 are the same as those of S203 to S204 above, and will not be repeated here.

[0133] S306 The parking line detection network includes a first feature encoder, a grid sampling module and a second feature encoder. The parking corner detection network is connected to a parking corner information encoder. The target parking corner coordinate prediction map is input into the parking corner information encoder for linear encoding of position features to obtain the target instance embedding vector.

[0134] Among them, the feature encoder is an instrument that encodes various feature values, which is actually a quantization process. Grid sampling refers to sampling according to a certain regular grid (square, rectangle, or rhombus).

[0135] In some implementations, the graph G∈R can be predicted from the coordinates of the parking space corners. H×W×4 The predicted parking space corner information P∈R is obtained from the middle.B×2 Here, parameter B represents the maximum number of parking space corner points in the frame, and the effective number of parking space corner points is T (T≤B). When T<B, P[:,:]=0 is set. Then, the predicted parking space corner point information P∈R is calculated. B×2 The encoder linearly encodes the positional features of the input parking space corner points to generate target instance embedding vectors.

[0136]

[0137] in, This represents the parameters of the fully connected layer.

[0138] S307. Input the target feature map into the first feature encoder for encoding processing to obtain the encoding result of the target feature map; input the encoding result into the grid sampling module for feature map mapping processing to obtain the target mapping result; add the target instance embedding vector to the target mapping result to obtain the target addition result; perform fully connected processing on the target addition result to obtain the fully connected result; input the fully connected result into the second feature encoder for re-encoding processing to obtain the parking space recognition result of the target parking space.

[0139] After obtaining the target instance embedding vector, it is also necessary to obtain the target mapping result.

[0140] In some implementations, the target feature map is input into a first feature encoder for encoding to obtain the encoded result of the target feature map; the encoded result is then input into a grid sampling module for feature map mapping to obtain the target mapping result. The encoding of the target feature map is performed using a squeeze-and-expand network to generate an encoded result S∈R that can effectively distinguish latent features belonging to the same parking space corner. H×W×C The input S is processed by the grid sampling module to perform feature map mapping, resulting in the target mapping result Q∈R. B×C .

[0141] Obtain the target instance embedding vector V∈R B×2 Mapping result Q∈R with target B×C Next, the target instance embedding vector is added to the target mapping result, and the addition process is as follows: Figure 11 As shown, each rectangular bar represents a vector. Each vector in the target strength embedding vector is added sequentially to each vector in the target mapping result, resulting in... Figure 11 The result shown on the right is the target summation result A∈R. (B×B)×(2×C) .

[0142] After obtaining the target summation result, it is directly sent to the fully connected layer of the multi-layer connection for fully connected processing to obtain the fully connected result, which is the final parking line prediction result.

[0143] The final parking space line prediction result is as follows:

[0144]

[0145] Among them, MFC ω (·) represents a multi-layer fully connected network, and ω represents the parameters of the fully connected network. The spatial sensitivity of the fully connected layer helps to distinguish the relationship between pairwise corner points, and the output dimension is B. 2 The L vector of ×3 represents the relationship between paired corner points, B 2 The first dimension represents the total number of combinations of any two corner points. The three channel values ​​of the second dimension represent the probability of entering the line, the probability of entering the dividing line, and whether the parking space is available for parking.

[0146] After obtaining the fully connected result, it is necessary to input the fully connected result into the second feature encoder for further encoding to obtain the parking space recognition result of the target parking space.

[0147] In this embodiment, the backbone network is improved by introducing a second compression excitation module. The target feature map is obtained through the second compression excitation module, which improves the accuracy of feature extraction. The predicted coordinate map of the target parking space corner is input into the parking space corner information encoder for linear encoding of position features to obtain the target instance embedding vector. At the same time, the target feature map is input into the first feature encoder for encoding processing to obtain the encoding result of the target feature map. The encoding result is input into the grid sampling module for feature map mapping processing to obtain the target mapping result. Then, the target instance embedding vector and the target mapping result are input into the second feature encoder for addition to obtain the target addition result. The target addition result is subjected to fully connected processing to obtain the parking space recognition result of the target parking space, which improves the accuracy of parking space recognition and thus improves the success rate of automatic parking.

[0148] Please see Figure 12 , Figure 12 This paper presents a flowchart of a parking space recognition method according to another embodiment of the present application. The method is for vehicles, and the backbone network includes multiple feature extraction units connected in series. Each feature extraction unit includes a backbone network module and a second compression excitation module. The method includes:

[0149] S401. Acquire a target image of the target parking space.

[0150] The description of S401 is the same as that of S201 above, and will not be repeated here.

[0151] S402. Obtain the first feature extraction unit as the target feature extraction unit, and obtain the target captured image as the image to be extracted; input the image to be extracted into the target feature extraction unit, perform feature extraction on the image to be extracted, and obtain the initial feature map.

[0152] like Figure 10 As shown, a backbone network module RepVGG connected to a second compression excitation module constitutes a feature extraction unit. Each feature extraction unit needs to perform subsequent operations. First, the first feature extraction unit is set as the target feature extraction unit.

[0153] Feature extraction is performed on the image to be extracted using the backbone network module and the second compression excitation module in the target feature extraction unit. The number of iterations of the target extraction unit during the extraction process is variable and can be selected according to requirements. The operations performed in the backbone network module are as shown in step S302, and the operations performed in the compression excitation module are as shown in step S303.

[0154] S403. Obtain the initial feature map as the new image to be extracted, and obtain the next feature extraction unit of the target feature extraction unit as the new target feature extraction unit; return to execute the step of extracting features from the image to be extracted through the target feature extraction unit to obtain the initial feature map, until multiple feature extraction units are traversed and the initial feature map corresponding to the last feature extraction unit is obtained as the target feature map.

[0155] After obtaining a new image to be extracted through the target feature extraction unit, the next feature extraction unit of the target feature extraction unit is used as the new target feature extraction unit for feature extraction. The stride of the convolution in the target feature extraction unit can be the same as or different from the stride of the convolutions in other feature extraction units; the specific stride can be selected according to requirements.

[0156] By traversing multiple feature extraction units (i.e., using multiple feature extraction units as target feature extraction units to extract features from the initial image to be extracted), the initial feature map corresponding to the last feature extraction unit is obtained as the target feature map. The final target feature map contains more information about the initial image to be extracted, thus improving the accuracy of feature extraction.

[0157] S404. Input the target feature map into the parking space corner detection network for attention mechanism operation to obtain the target space attention map.

[0158] S405. Perform convolution processing on the target space attention map to obtain the target parking space corner coordinate prediction map.

[0159] The descriptions of S404 to S405 are the same as those of S203 to S204 above, and will not be repeated here.

[0160] S406. Perform convolution processing on each target space attention map to obtain the target parking space corner coordinate prediction map corresponding to each target space attention map.

[0161] The description of S406 is the same as that of S305 above, and will not be repeated here.

[0162] S407. Input the target feature map and the predicted coordinate map of the target parking space corner point into the parking space line detection network to obtain the parking space recognition result of each target image for the target parking space, which serves as the initial parking space recognition result for each target image. Each initial recognition result includes the parking space corner point information and parking space line information of the target parking space.

[0163] When the acquired target images are different, the target parking spaces will have different parking space recognition results. Therefore, after obtaining the predicted coordinate map of each target parking space corner point, the parking space recognition result obtained from each target parking space corner point prediction map will be used as the initial parking space recognition result for each target image.

[0164] S408. Perform point distortion processing and point projection transformation on each initial parking space recognition result in sequence to obtain the transformation result corresponding to each initial parking space recognition result.

[0165] When the target image is captured by a fisheye lens, the fisheye lens is characterized by its short focal length and wide field of view, which can reach 180° to 270°. However, the wide field of view of a fisheye lens can lead to target distortion in the captured image. The distortion gradually increases from the center of the image to the periphery, with the least distortion in the center. Due to the imaging principle of fisheye images and the existence of calibration errors, the distance between the parking space and the vehicle affects the positional accuracy of the parking space in the world coordinate system. Generally speaking, the closer the vehicle is to the parking space, the higher its positional accuracy. Therefore, it is necessary to perform distortion processing and projection transformation on each initial parking space recognition result sequentially.

[0166] Distortion correction involves correcting distorted images based on intrinsic parameter matrices and distortion parameters. Since we only need to find the ideal positions of a few points in the distorted original image after distortion correction, we directly calculate the positions of the distortion-removed points using the intrinsic parameters and distortion coefficients of each camera obtained from the Zhang Zhengyou calibration method for fisheye calibration, as well as the new projection matrix. Then, we use the projection matrix found by the Direct Linear Transform (DLT) to realize the top-view transformation and complete the transformation of the distortion-removed points into the top-view coordinate system centered on the rear axle of the vehicle.

[0167] Suppose a point P[X, Y, 1] exists in the coordinate system of the perspective image after distortion correction. T The corresponding point in the top-view coordinate system is p[x, y, 1].T Since parking spaces are all on the ground and the ground is assumed to be perfectly level, the mapping between P and p is described using the principle of planar homography:

[0168]

[0169] Where H is the homography matrix.

[0170] At this point, the transformation result corresponding to each initial parking space recognition result can be obtained.

[0171] S409. Based on the corner information of the target parking space according to the multiple transformation results, merge the corners of the target parking space to obtain the corner fusion result; based on the parking line information of the target parking space according to the multiple transformation results, determine the parking lines with relationships; retain the parking lines with relationships and delete the parking lines without relationships to obtain the parking line fusion result.

[0172] First, after obtaining the corner point information of the target parking space from multiple transformation results, the corner points of the target parking space are fused to obtain the corner point fusion result.

[0173] Because the viewpoints of multiple fisheye cameras overlap, taking a panoramic fisheye lens as an example, when all points are projected onto the top-view coordinate system, a phenomenon occurs where two points in different images correspond to a single point in the top-view coordinate system. This is because the calibration accuracy and imaging distance of each fisheye camera differ, causing slight deviations in their projected positions. Using the closest approximation principle, assuming a point in the world coordinate system is detected by both the left and front fisheye cameras, the position of this point detected by the left fisheye camera projected onto the top-view coordinate system is P. l (x l y l The point detected by the front fisheye camera is projected to a position P in the top-view coordinate system. f (x f y f Let the positions of the left and front fisheye cameras in the top-view coordinate system be P and P, respectively. l 0 and First, calculate the distances from both objects to their respective target cameras:

[0174] h l =||P l -P l 0 || 2 ,

[0175]

[0176] Based on the comparison of the two distance values, the final fusion result for this point is:

[0177]

[0178] Secondly, after determining the parking line information for the target parking space based on the multiple transformation results, it is necessary to determine the parking line fusion result.

[0179] Based on the parking line information of the target parking space from multiple transformation results, the parking lines with relationships are identified, and the parking lines with relationships are retained while those without relationships are deleted, resulting in the parking line fusion result. The parking lines with relationships here can be those sharing the same corner point or those corresponding to the same target parking space.

[0180] In this embodiment, distortion processing and projection transformation are used to obtain the transformation result, thereby determining the parking line information for the target parking space, reducing the impact of the distance between the parking space and the vehicle on the accuracy of parking space recognition, avoiding the difference in camera calibration accuracy and imaging distance, and improving the accuracy of parking space recognition.

[0181] S410. Based on the parking line fusion result and the corner point fusion result, determine the parking space recognition result for the target vehicle.

[0182] In some implementations, such as Figure 13 As shown, S410 may include: determining whether there are dividing lines for each entry line in the parking line fusion result based on the parking line information in the parking line fusion result; if there are no dividing lines for the entry lines, obtaining the parking space recognition result based on the entry lines and their directions; if there are dividing lines for the entry lines and there are two dividing lines for the entry lines, obtaining the parking space recognition result based on the entry lines and their corresponding two dividing lines; if there are dividing lines for the entry lines and there is only one dividing line for the entry lines, performing a dividing line completion operation based on the entry lines and their corresponding dividing lines to obtain the parking space recognition result.

[0183] By understanding the relationship between the entry line and the dividing line, subsequent operations are determined, resulting in a complete parking space with both the entry line and the two dividing lines. This leads to parking space recognition results, improving the accuracy of parking space recognition and the success rate of automatic parking.

[0184] In this embodiment, target feature maps are extracted from the target image by multiple feature extraction units, which improves the accuracy of image features and mines and enhances the abstract information hidden in the target image. A target parking space corner prediction map is obtained based on the target feature map. An initial parking space recognition result is obtained based on the target parking space corner prediction map corresponding to each target image. Then, each initial parking space recognition result is sequentially subjected to point distortion processing and point projection transformation to obtain a transformation result corresponding to each initial parking space recognition result. Based on the parking space corner information of the target parking space according to the multiple transformation results, the parking space corners of the target parking space are fused to obtain a corner fusion result. Simultaneously, based on the parking line information of the target parking space according to the multiple transformation results, parking lines with correlation are determined, and parking lines with correlation are retained while those without correlation are deleted to obtain a parking line fusion result. Finally, based on the parking line fusion result and the corner fusion result, the parking space recognition result for the target vehicle is determined. Throughout the entire process of finding a parking space (garage patrol) and parking, the parking space recognition and post-processing conversion are continuously carried out, ensuring real-time updates of parking space information, improving the accuracy of parking space recognition, and thus increasing the success rate of automatic parking.

[0185] In summary, please refer to the appendix. Figure 14 , Figure 14 This diagram illustrates a parking space recognition model according to an embodiment of this application. The parking space recognition model includes a backbone network, a parking space corner detection network, a parking space corner information encoder, and a parking space line detection network. The target image is input into the backbone network for feature extraction to obtain a target feature map. The extracted target image is then input into the parking space corner detection network to obtain a target parking space corner prediction map. Parking space corner information is obtained based on the predicted target parking space corner map. Finally, the parking space corner information is input into the parking space corner information encoder to obtain the target instance embedding. Simultaneously, the extracted target image is input into the parking space corner detection network. First, it undergoes encoding processing through a first feature encoder to obtain the encoded result of the target feature map. The encoded result is then input into a grid sampling module for feature map mapping processing to obtain the target mapping result. The target summation result is then subjected to fully connected processing to obtain a fully connected result. The fully connected result is input into a second feature encoder for further encoding processing to obtain the parking space recognition result for the target parking space.

[0186] See appendix Figure 15 , Figure 15 This illustration shows a structural block diagram of a parking space recognition device according to one embodiment of this application. For use with vehicles, the device 1500 includes:

[0187] The acquisition module 1501 is used to acquire a target image of the target parking space.

[0188] The feature extraction module 1502 is used to input the target image into the backbone network for feature extraction to obtain the target feature map.

[0189] The first processing module 1503 is used to input the target feature map into the parking space corner detection network for attention mechanism operation to obtain the target space attention map.

[0190] The second processing module 1504 is used to perform convolution processing on the target space attention map to obtain the target parking space corner coordinate prediction map.

[0191] The output module 1505 is used to input the target feature map and the predicted coordinate map of the corner point of the target parking space into the parking space line detection network to obtain the parking space recognition result for the target parking space.

[0192] Optionally, the parking space corner detection network includes a first compression excitation module and a relationship-aware attention module. The first processing module 1503 is further used to input the target feature map into the first compression excitation module for feature recalibration to obtain a preprocessed feature map, which includes feature vectors of multiple spatial locations. Each spatial location's feature vector is used as a node, and the relationship between any two spatial location's feature vectors is used as a connection edge to construct a target undirected node graph. The target undirected node graph is input into the relationship-aware attention module for multi-head attention mechanism operation to obtain the attention operation result of each node in the target undirected node graph. The attention operation results and feature vectors corresponding to each node in the target undirected node graph are connected to obtain the connection result of each node in the target undirected node graph. The connection result of each node in the target undirected node graph is fully connected to obtain the aggregation result of each node in the target undirected node graph. The aggregation result of each node in the target undirected node graph is tiled to obtain a target spatial attention map for the target parking space.

[0193] Optionally, the backbone network includes a backbone network module and a second compression excitation module. The feature extraction module 1502 is further used to acquire a target image as an image to be extracted; input the image to be extracted into the backbone network module for feature extraction to obtain a target extraction result; input the target extraction result into the second compression excitation module to perform global average pooling processing on the target extraction result to obtain a target compression result; perform fully connected processing on the target compression result to obtain a target excitation result; and obtain a target feature map based on the target excitation result and the target extraction result.

[0194] Optionally, the backbone network includes multiple feature extraction units connected in series. Each feature extraction unit includes a backbone network module and a second compression excitation module. The feature extraction module 1502 is further configured to: acquire the first feature extraction unit as the target feature extraction unit and acquire the target captured image as the image to be extracted; input the image to be extracted into the target feature extraction unit and perform feature extraction on the image to be extracted to obtain an initial feature map; acquire the initial feature map as a new image to be extracted and acquire the next feature extraction unit of the target feature extraction unit as a new target feature extraction unit; return to the step of performing feature extraction on the image to be extracted through the target feature extraction unit to obtain the initial feature map, until multiple feature extraction units are traversed and the initial feature map corresponding to the last feature extraction unit is acquired as the target feature map.

[0195] Optionally, the parking space line detection network includes a first feature encoder, a grid sampling module, and a second feature encoder. The parking space corner detection network is connected to a parking space corner information encoder. The output module 1505 is further used to input the predicted coordinate map of the target parking space corner into the parking space corner information encoder for linear encoding of positional features to obtain a target instance embedding vector; input the target feature map into the first feature encoder for encoding processing to obtain the encoding result of the target feature map; input the encoding result into the grid sampling module for feature map mapping processing to obtain a target mapping result; add the target instance embedding vector to the target mapping result to obtain a target addition result; perform fully connected processing on the target addition result to obtain a fully connected result; and input the fully connected result into the second feature encoder for further encoding processing to obtain the parking space recognition result of the target parking space.

[0196] Optionally, the target parking space corner coordinate prediction map includes target parking space corner coordinate prediction maps for multiple captured images. The output module 1505 is further used to input the target feature map and the target parking space corner coordinate prediction map into the parking line detection network to obtain the parking space recognition result for each target captured image for the target parking space, which serves as the initial parking space recognition result for each target captured image. Each initial recognition result includes parking space corner information and parking line information of the target parking space. The point distortion processing and point projection transformation are sequentially performed on each initial parking space recognition result to obtain the transformation result corresponding to each initial parking space recognition result. Based on the parking space corner information of the target parking space for each of the multiple transformation results, the parking space corners of the target parking space are fused to obtain the corner fusion result. Based on the parking line information of the target parking space for each of the multiple transformation results, the parking lines with correlation are determined. The parking lines with correlation are retained, and the parking lines without correlation are deleted to obtain the parking line fusion result. Based on the parking line fusion result and the corner fusion result, the parking space recognition result for the target vehicle is determined.

[0197] Optionally, the output module 1505 is further configured to determine whether there are dividing lines for each entry line in the parking line fusion result based on the parking line information in the parking line fusion result; if there are no dividing lines for the entry lines, obtain the parking space recognition result based on the entry lines and their directions; if there are dividing lines for the entry lines and there are two dividing lines for the entry lines, obtain the parking space recognition result based on the entry lines and their corresponding two dividing lines; if there are dividing lines for the entry lines and there is only one dividing line for the entry lines, perform a dividing line completion operation based on the entry lines and their corresponding dividing lines to obtain the parking space recognition result.

[0198] Optionally, the feature extraction module 1502 is further configured to: input the sample captured image into the backbone network for feature extraction to obtain a sample feature map; input the sample feature map into the parking space corner detection network for attention mechanism operation to obtain a sample spatial attention map; perform convolution processing on the sample spatial attention map to obtain a sample parking space corner coordinate prediction map; input the sample feature map and the sample parking space corner coordinate prediction map into the parking space line detection network to obtain a parking space recognition result for the sample parking space; acquire the predicted parking space line information, predicted parking space corner information, real parking space line information, and real parking space corner information from the sample parking space recognition result; determine a first loss value based on the predicted parking space corner information and the real parking space corner information; determine a second loss value based on the predicted parking space line information and the real parking space line information; determine a final loss value based on the first loss value and the second loss value; and train the backbone network, the parking space corner detection network, and the parking space line detection network through a game-theoretic approach based on the final loss value.

[0199] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0200] Furthermore, the functions in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or as a software functional module.

[0201] See appendix Figure 16 , Figure 16 A structural block diagram of a computer-readable storage medium provided in an embodiment of this application is shown. The computer-readable storage medium 1600 stores program code that can be called by a processor to execute the methods described in the above method embodiments.

[0202] The computer-readable storage medium 1600 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 1600 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 1600 has storage space for program code 1610 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 1610 may, for example, be compressed in a suitable form.

[0203] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A parking space recognition method characterized by comprising: The method includes: Acquire a target image of the target parking space; The target image is input into the backbone network for feature extraction to obtain the target feature map; The target feature map is input into the first compression excitation module of the parking space corner detection network for feature recalibration to obtain a preprocessed feature map, which includes feature vectors of multiple spatial locations. The feature vector of each spatial location is used as a node, and the relationship between the feature vectors of any two spatial locations is used as a connecting edge to construct the target undirected node graph. The target undirected node graph is input into the relationship-aware attention module of the parking space corner detection network for multi-head attention mechanism operation to obtain the attention operation result of each node in the target undirected node graph; The attention operation results and feature vectors corresponding to each node in the target undirected node graph are concatenated to obtain the connection result of each node in the target undirected node graph. Perform full connection processing on the connection results of each node in the target undirected node graph to obtain the aggregation result of each node in the target undirected node graph; The aggregation result of each node in the target undirected node graph is tiled to obtain the target space attention graph for the target parking space. The target space attention map is convolved to obtain the target parking space corner coordinate prediction map; The target feature map and the predicted coordinate map of the target parking space corner are input into the parking space line detection network to obtain the parking space recognition result for the target parking space.

2. The method of claim 1, wherein, The backbone network includes a backbone network module and a second compression excitation module. The step of inputting the target image into the backbone network for feature extraction to obtain a target feature map includes: The target image is captured as the image to be extracted; The image to be extracted is input into the backbone network module for feature extraction to obtain the target extraction result; The target extraction result is input into the second compression excitation module, and global average pooling is performed on the target extraction result to obtain the target compression result; The target compression result is processed by a fully connected layer to obtain the target excitation result; Based on the target excitation result and the target extraction result, a target feature map is obtained.

3. The method of claim 1, wherein, The backbone network includes multiple feature extraction units connected in series, and each feature extraction unit includes a backbone network module and a second compression excitation module. The step of inputting the captured image of the target into the backbone network for feature extraction to obtain a target feature map includes: The first feature extraction unit is obtained as the target feature extraction unit, and the target captured image is obtained as the image to be extracted; The image to be extracted is input into the target feature extraction unit, and feature extraction is performed on the image to be extracted to obtain an initial feature map; The initial feature map is obtained as a new image to be extracted, and the next feature extraction unit of the target feature extraction unit is obtained as a new target feature extraction unit. Return to the step of inputting the image to be extracted into the target feature extraction unit, extracting features from the image to be extracted, and obtaining an initial feature map, until the multiple feature extraction units included in the backbone network are traversed, and the initial feature map corresponding to the last feature extraction unit is obtained as the target feature map.

4. The method of claim 1, wherein, The parking line detection network includes a first feature encoder, a grid sampling module, and a second feature encoder. The parking corner detection network is connected to a parking corner information encoder. The step of inputting the target feature map and the predicted coordinates of the target parking space corner point into the parking space line detection network to obtain the parking space recognition result for the target parking space includes: The predicted coordinates of the target parking space corner point are input into the parking space corner point information encoder for linear encoding of position features to obtain the target instance embedding vector. The target feature map is input into the first feature encoder for encoding processing to obtain the encoding result of the target feature map; The encoded result is input into the grid sampling module for feature map mapping processing to obtain the target mapping result; The target instance embedding vector is added to the target mapping result to obtain the target addition result; Perform a fully connected operation on the sum of the target values ​​to obtain a fully connected result; The fully connected result is input into the second feature encoder for further encoding to obtain the parking space identification result of the target parking space.

5. The method of claim 1, wherein, The target parking space corner coordinate prediction map includes the target parking space corner coordinate prediction map for each of the multiple target captured images; The step of inputting the target feature map and the predicted coordinates of the target parking space corner point into the parking space line detection network to obtain the parking space recognition result for the target parking space includes: The target feature map and the predicted coordinate map of the target parking space corner are input into the parking space line detection network to obtain the parking space recognition result of each target image for the target parking space, which is used as the initial parking space recognition result of each target image. Each initial parking space recognition result includes the parking space corner information and parking space line information of the target parking space. For each initial parking space recognition result, point distortion processing and point projection transformation are performed sequentially to obtain the transformation result corresponding to each initial parking space recognition result; Based on the corner information of the target parking space according to the multiple transformation results, the corners of the target parking space are fused to obtain the corner fusion result. Based on the parking line information of the target parking space from multiple transformation results, parking lines with related relationships are determined. Retain the parking lines that are related and delete the parking lines that are not related to each other to obtain the parking line merging result; Based on the parking line fusion result and the corner point fusion result, the parking space recognition result for the target vehicle is determined.

6. The method of claim 5, wherein, The step of determining the parking space recognition result for the target vehicle based on the parking space line fusion result and the corner point fusion result includes: Based on the parking line information in the parking line fusion result, determine whether there are separating lines for each entry line in the parking line fusion result; If there is no dividing line on the entry line, the parking space identification result is obtained based on the entry line and its direction; If the entry line has two dividing lines, the parking space identification result is obtained based on the entry line and the two dividing lines corresponding to the entry line. If the entry line has a dividing line and there is only one dividing line, a dividing line completion operation is performed based on the entry line and the corresponding dividing line to obtain the parking space recognition result.

7. The method of claim 1, wherein, The step of inputting the captured image of the target into the backbone network for feature extraction to obtain the target feature map includes: The sample images are input into the backbone network for feature extraction to obtain the sample feature map; The sample feature map is input into the parking space corner detection network for attention mechanism operation to obtain the sample space attention map; The sample space attention map is convolved to obtain the sample parking space corner coordinate prediction map; The sample feature map and the predicted coordinate map of the corner point of the sample parking space are input into the parking space line detection network to obtain the sample parking space recognition result for the sample parking space. Obtain the predicted parking space line information, predicted parking space corner information, actual parking space line information, and actual parking space corner information from the sample parking space recognition results; Based on the predicted parking space corner information and the actual parking space corner information, a first loss value is determined; The second loss value is determined based on the predicted parking space line information and the actual parking space line information; The final loss value is determined based on the first loss value and the second loss value; Based on the final loss value, the backbone network, the parking space corner detection network, and the parking space line detection network are trained using a game-theoretic approach.

8. A parking space recognition device, characterized by comprising: The device includes: The first acquisition module is used to acquire a target image of the target parking space. The extraction module is used to input the captured image of the target into the backbone network for feature extraction to obtain the target feature map; The computation module is used to input the target feature map into the first compression excitation module of the parking space corner detection network for feature recalibration to obtain a preprocessed feature map, which includes feature vectors of multiple spatial locations; to construct a target undirected node graph by using the feature vector of each spatial location as a node and the relationship between the feature vectors of any two spatial locations as a connection edge; to input the target undirected node graph into the relationship-aware attention module of the parking space corner detection network for multi-head attention mechanism operation to obtain the attention operation result of each node in the target undirected node graph; to connect the attention operation result and feature vector of each node in the target undirected node graph to obtain the connection result of each node in the target undirected node graph; to perform full connection processing on the connection result of each node in the target undirected node graph to obtain the aggregation result of each node in the target undirected node graph; and to perform tiling processing on the aggregation result of each node in the target undirected node graph to obtain a target spatial attention map for the target parking space. The processing module is used to perform convolution processing on the target space attention map to obtain the target parking space corner coordinate prediction map; The output module is used to input the target feature map and the predicted coordinate map of the target parking space corner point into the parking space detection network to obtain the parking space recognition result for the target parking space.

9. A vehicle characterized by comprising: include: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to perform the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores processor-executable program code, which, when executed by the processor, causes the processor to perform the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Marking parking space detection method based on semantic feature attention fusion

    CN114764785A