Visual position identification method and system based on full feature aggregation

By constructing a location recognition model that combines convolutional neural networks and multilayer perceptrons, and combining it with a full feature aggregation mechanism, the problem of mismatch in visual location recognition under complex and similar scenarios is solved, and high-precision vehicle location recognition is achieved.

CN121999043APending Publication Date: 2026-05-08SHENZHEN MINIEYE INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN MINIEYE INNOVATION TECH CO LTD
Filing Date
2026-01-20
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing visual location recognition technologies suffer from mismatch problems caused by repetitive textures, lighting variations, and viewpoint disturbances in complex and similar scenarios, especially parking scenarios such as underground garages, making it difficult to achieve high-precision, fine-grained relocation.

Method used

A location recognition model based on a hybrid convolutional neural network and multilayer perceptron is adopted. Combined with a full feature aggregation mechanism, the local multi-level spatial features of the image are extracted by the convolutional neural network, and the global nonlinear interaction and fusion are performed by the multilayer perceptron to generate more discriminative image descriptors.

Benefits of technology

It improves the accuracy and robustness of visual position recognition, reduces the mismatch rate in environments with highly similar structures, and achieves more accurate vehicle position recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121999043A_ABST
    Figure CN121999043A_ABST
Patent Text Reader

Abstract

The invention provides a visual position identification method and system based on full feature aggregation. The method comprises the following steps: acquiring visual image data of a vehicle at the current moment; inputting the visual image data into a preset position recognition model, so that the position recognition model performs image convolution and full feature aggregation on the visual image data in sequence to obtain a corresponding vehicle position feature vector; a corresponding positioning feature vector is retrieved from a target database according to the vehicle position feature vector, the target database is loaded in advance according to the area where the vehicle is located currently, and the target database is constructed according to a plurality of historical visual image data of the area where the vehicle is located currently in a mapping mode; and generating a visual position identification result at the current moment according to the mapping pose information of the positioning feature vector, and performing visual positioning correction on the parking process of the vehicle according to the visual position identification result, thereby improving the accuracy of visual position identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of visual position recognition technology, and in particular to a visual position recognition method and system based on full feature aggregation. Background Technology

[0002] Visual Place Recognition (VPR), a key technology in autonomous parking systems, is primarily used to achieve global relocalization of the vehicle. When the vehicle is driving in a mapped area, VPR identifies the vehicle's precise current position by comparing real-time images with keyframe images pre-stored in the map database. This provides a reliable initial pose or corrects accumulated errors for the Simultaneous Localization and Mapping (SLAM) system, making it a core component in ensuring the robustness of parking positioning.

[0003] Existing VPR techniques can be broadly categorized into two types. One type is based on classic methods using handcrafted features, such as the Bag-of-Words (BoW) model and Virtual Local Aggregated Descriptor Vectors (VLAD). These methods extract and aggregate handcrafted local features like SIFT and ORB to construct a global representation of the image. Their advantages lie in their simplicity and interpretability. However, when faced with repetitive textures, drastic lighting changes, dynamic occlusion, and viewpoint perturbations common in parking scenarios like underground garages, the discriminative power of handcrafted features is limited, easily leading to confusion between similar locations and making it difficult to support high-precision, fine-grained relocalization requirements. The other type is based on deep learning methods, such as NetVLAD and Generalized Mean Pooling (GeM). These methods utilize convolutional neural networks (CNNs) to automatically extract image feature maps and then generate global descriptors for similarity retrieval through learnable aggregation layers, resulting in overall performance superior to handcrafted methods. However, the inherent local receptive field of convolution operations, coupled with the insufficient ability of traditional feature aggregation methods to distinguish fine-grained similar scenes, limits the ability to model long-distance spatial relationships and cross-viewpoint changes in images. In parking scenarios with highly similar structures, fine-grained mismatches may still occur. Summary of the Invention

[0004] To address the aforementioned technical problems, this application provides a visual position recognition method and system based on full feature aggregation, thereby improving the accuracy of visual position recognition.

[0005] In a first aspect, embodiments of this application provide a visual location recognition method based on full feature aggregation, comprising: Acquire visual image data of the vehicle at the current moment; The visual image data is input into a preset location recognition model, so that the location recognition model performs image convolution and full feature aggregation on the visual image data in sequence to obtain the corresponding vehicle location feature vector. The location recognition model is constructed based on a hybrid model of convolutional neural network and multilayer perceptron. The corresponding positioning feature vector is retrieved from the target database based on the vehicle's location feature vector. The target database is pre-loaded based on the area where the vehicle is currently located. The target database is constructed in mapping mode based on several historical visual image data of the area where the vehicle is currently located. The visual position recognition result at the current moment is generated based on the mapping pose information of the positioning feature vector, and the parking process of the vehicle is visually corrected based on the visual position recognition result.

[0006] This application provides a visual position recognition method based on full feature aggregation. By constructing a position recognition model that combines a convolutional neural network (CNN) and a multilayer perceptron (MLP), and introducing a full feature aggregation mechanism, it fundamentally improves the accuracy and robustness of visual position recognition in complex and similar scenes. In autonomous driving, especially in parking scenarios such as underground garages, traditional methods often fail due to factors such as repetitive textures, sudden changes in illumination, and changes in viewing angle. This embodiment efficiently extracts local and multi-level spatial features of images through a convolutional neural network model, forming rich intermediate layer feature maps. Subsequently, a multilayer perceptron model is used to perform global, non-linear interaction and fusion of these feature maps. The powerful fully connected characteristics of MLP can model the complex dependencies between distant pixels in the feature maps, overcoming the limitations of the limited receptive field of traditional CNNs, thereby achieving a deep understanding of the overall structure and contextual information of the image at the feature level. This hybrid architecture of "local convolutional perception + global MLP aggregation" gives the generated "vehicle position feature vector" stronger scene discrimination ability and invariance. Compared to existing technologies that simply use NetVLAD or GeM for pooling aggregation, this embodiment can generate more discriminative image descriptors. In subsequent retrieval and matching with the target database, it can more accurately identify the true location of the vehicle, effectively reducing the false matching rate in environments with highly similar structures and improving the accuracy of visual location recognition.

[0007] Furthermore, acquiring the vehicle's visual image data at the current moment includes: Acquire the vehicle's original visual image frame at the current moment; The original visual image frame is cropped based on a preset target region to obtain a cropped image frame. The cropped image frame is scaled to a preset size to obtain a scaled image frame; The scaled image frame is converted based on a preset color-coded sampling format to obtain a format-converted image frame. The format-converted image frame is converted into floating-point tensor data and then normalized to obtain the visual image data.

[0008] This application provides a data preprocessing method for raw visual image frames, laying a solid and high-quality data foundation for subsequent high-precision feature extraction and matching. In visual location recognition tasks, the quality and consistency of the input image directly determine the final performance. This embodiment systematically defines a complete processing chain from raw image frames to normalized tensor data: First, target region cropping is performed to eliminate interfering areas such as the sky and irrelevant buildings, focusing on scene content strongly related to positioning, such as roads, parking spaces, and signs, reducing irrelevant noise. Subsequently, scaling to a preset size not only unifies the input scale, facilitating model processing, but also optimizes computational resources to a certain extent. Conversion based on a preset color encoding format (such as RGB to YUV) helps extract features that are more consistent with human visual perception or more suitable for specific model calculations. The final floating-point conversion and normalization are key steps in mapping pixel values ​​to a standard numerical range, which accelerates model training convergence, improves numerical stability, and makes the model more adaptable to images with different brightness and contrast. The standardized preprocessing procedure provided in this embodiment ensures the "cleanliness" and "consistency" of the input features, reduces interference caused by differences in image acquisition equipment and uneven ambient lighting, and enables the position recognition model to focus on learning the essential spatial and semantic information of the scene, thereby indirectly but significantly improving the accuracy and reliability of the entire visual position recognition system.

[0009] In one possible implementation, the step of inputting the visual image data into a preset location recognition model, so that the location recognition model sequentially performs image convolution and full feature aggregation on the visual image data to obtain the corresponding vehicle location feature vector, includes: The visual image data is input into the location recognition model so that the convolutional backbone network of the location recognition model generates the corresponding intermediate layer feature map. The intermediate layer feature map is fully aggregated by several residual connection-based feature aggregators in the location recognition model to obtain the corresponding hybrid feature vector. The hybrid feature vector is subjected to channel projection, row projection and flattening operations in sequence to obtain the vehicle position feature vector.

[0010] This application provides a feature extraction method. First, based on visual image data, a convolutional backbone network within the model generates "intermediate layer feature maps," which contain rich information ranging from low-level edges to high-level semantics. Then, these maps are processed by several feature aggregators based on residual connections. Residual connections avoid the vanishing gradient problem in deep networks, ensuring training stability and depth. The MLP aggregator, through its fully connected characteristics, allows features at all locations in the feature map to interact and integrate information, achieving true global context modeling and capturing long-range spatial relationships that are easily overlooked by traditional local pooling methods. After generating the "hybrid feature vector," this embodiment further performs "channel projection" and "row projection" operations. Channel projection (e.g., using 1x1 convolutions or fully connected layers) reweights and reduces the dimensionality of feature channels, filtering out the most discriminative channel information; row projection further compresses and abstracts the spatial dimension. Finally, a "flattening operation" transforms the two-dimensional feature map into a one-dimensional vehicle position feature vector. This set of combined operations realizes the refinement process from high-dimensional, redundant intermediate features to low-dimensional, highly discriminative global descriptors. The resulting feature vectors not only have fixed dimensions, making them easy to store and retrieve, but more importantly, they highly summarize the essential content of the image and have stronger robustness to changes in viewpoint and partial occlusion. This provides the optimal input for subsequent high-precision retrieval and matching, further improving the accuracy of visual position recognition.

[0011] In one possible implementation, the location recognition model is obtained by constructing a hybrid model based on a convolutional neural network model and a multilayer perceptron model, including: Collect several historical visual image data with pose information in a real scene within a preset area; Based on each of the historical visual image data and the spatial Euclidean distance between each of the historical visual image data, several triplet training samples are generated, wherein each of the spatial Euclidean distances is calculated based on each of the pose information; An initial position recognition model is obtained by hybrid construction of the convolutional neural network model and the multilayer perceptron model, wherein the convolutional neural network model is the initial convolutional backbone network and the multilayer perceptron model is a number of initial feature aggregators based on residual connections. The initial location recognition model is trained using a preset distance-aware loss function and each of the triplet training samples to obtain the location recognition model.

[0012] This application provides a method for constructing and training a location recognition model, proposing a data-driven model training paradigm guided by real-world spatial relationships. This ensures that the features learned by the model are strongly correlated with the pose information of the physical world, thus directly serving high-precision positioning. First, this embodiment collects historical image data with precise pose labels in a "real-world scene," ensuring consistency between the training data and the final application scenario and avoiding the domain gap between simulation and reality. Second, it uses the "spatial Euclidean distance" calculated from pose information as a metric to generate "triple training samples." This method links the visual similarity learning of images with real geometric distance, further improving the model's training effect. After constructing an initial model based on CNN and MLP, the initial model is trained using triple training samples and a "distance-aware loss function," enabling the feature space learned by the model to form a good mapping relationship with the real three-dimensional physical space: at locations with close physical distances, their feature vectors are highly similar in the feature space; conversely, the differences are significant. Therefore, the location recognition model trained in this way outputs vehicle location feature vectors that are naturally suitable for distance-based retrieval and localization tasks, greatly improving the geometric accuracy of visual location recognition.

[0013] Furthermore, the step of generating several triplet training samples based on each of the historical visual image data and the spatial Euclidean distance between each of the historical visual image data includes: Based on the spatial Euclidean distance between each historical visual image data, a positive sample set and a negative sample set corresponding to each historical visual image data are determined respectively. Among them, the positive sample set of any current historical visual image data is a number of first historical visual image data whose spatial Euclidean distance from the current historical visual image data is less than a preset distance threshold, and the negative sample set of the current historical visual image data is a number of second historical visual image data whose spatial Euclidean distance from the current historical visual image data is greater than or equal to the preset distance threshold. For each current historical visual image data, a preset number of triplet training samples are generated according to the corresponding positive sample set, the corresponding negative sample set, and the preset sampling rules. The triplet training samples include the first historical visual image data, the current historical visual image data, and the second historical visual image data.

[0014] This embodiment further refines the strategy for generating triplet training samples, significantly improving the effectiveness and efficiency of model training and enhancing the model's ability to distinguish difficult samples. Specifically, this embodiment first clearly defines the "positive sample set" (close to the target) and the "negative sample set" (far from the target) for each "current historical visual image data" (anchor point) based on a preset distance threshold. This division based on real geometric distance is more objective and accurate than random selection or selection based solely on visual similarity, providing clear supervision signals for model learning. Then, based on preset sampling rules and generating a preset number of triplets, it can effectively suppress overfitting caused by imbalanced training data, and by designing sampling rules, the model can learn more powerful and generalizable feature representations. This strategic sample generation method avoids training saturation caused by simple samples and prevents noise that may be introduced by random sampling, making the model training process more efficient and the goal clearer. The final trained model has better discrimination ability when faced with appearance changes and scene confusion in the real world, further improving the accuracy of visual position recognition.

[0015] Further, the step of training the initial location recognition model based on a preset distance-aware loss function and each of the triplet training samples to obtain the location recognition model includes: The first spatial Euclidean distance of each of the triplet training samples is determined based on the spatial Euclidean distance between the current historical visual image data and the first historical visual image data in the triplet training samples. The second spatial Euclidean distance of each triplet training sample is determined based on the spatial Euclidean distance between the current historical visual image data and the second historical visual image data in the triplet training samples. The interval hierarchy parameter corresponding to the triplet training sample is determined based on the first spatial Euclidean distance and the second spatial Euclidean distance in each triplet training sample. Each of the triplet training samples is input into the initial position recognition model, so that the initial position recognition model generates a corresponding triplet feature vector. The first cosine similarity of each triplet feature vector is determined based on the cosine similarity between the current feature vector and the first feature vector in the triplet feature vector; The second cosine similarity of each triplet feature vector is determined based on the cosine similarity between the current feature vector and the second feature vector in the triplet feature vector; Based on the first spatial Euclidean distance, the second spatial Euclidean distance, the first cosine similarity, the second cosine similarity, and the interval level parameters, the corresponding loss function values ​​are calculated using the distance-aware loss function. Then, the parameters of the initial location recognition model are optimized based on the loss function values ​​to obtain the location recognition model.

[0016] This embodiment further describes the specific computational process of model training using a distance-aware loss function, enabling the model to accurately learn the correspondence between the feature space and the physical space. First, this embodiment calculates the true "first-space Euclidean distance" and "second-space Euclidean distance" between samples within a triplet, and dynamically determines the "margin hierarchy parameter" based on this. This parameter is crucial; it quantifies the feature discrimination the model needs to achieve for the current triplet, and its magnitude is related to the true physical distance difference between positive and negative samples. Then, the model generates corresponding feature vectors for the triplet and calculates the "first cosine similarity" and "second cosine similarity" in the feature space. Finally, the loss function comprehensively considers the true physical distance, the similarity in the feature space, and the adaptive margin parameter. The technical concept is that the loss function value not only penalizes cases where the feature similarity does not match the true physical distance (e.g., high feature similarity despite a large physical distance, or low feature similarity despite a small physical distance), but the severity of the penalty is adjusted according to the "difficulty" of the true distance difference. For positive samples that are very close in real distance and negative samples that are very far in real distance, the model only needs to achieve a small feature margin; however, for difficult sample pairs that are relatively close in real distance, the model needs to learn a larger feature margin to distinguish them. This "distance-aware" characteristic makes model training no longer a blind process of moving closer and farther away, but rather a measured and discerning learning process. This ensures that the descriptors generated by the final location recognition model have a similarity ranking that perfectly reflects the real spatial proximity relationship, thereby achieving extremely high-precision pose estimation during retrieval and further improving the accuracy of visual location recognition.

[0017] In one possible implementation, retrieving the corresponding positioning feature vector from the target database based on the vehicle position feature vector includes: Obtain the floor information of the vehicle at the current moment; Based on the floor information, several first candidate feature vectors are obtained by filtering from the target database; The positioning feature vector is determined from each of the candidate feature vectors based on the cosine similarity between the vehicle location feature vector and each of the candidate feature vectors in the target database.

[0018] This application provides a method for retrieving location feature vectors from a target database. By introducing prior "floor information" as a retrieval filter, the search scope is greatly narrowed, improving retrieval speed and accuracy. In large or complex mapping areas, the target database may contain tens of thousands of feature vectors. Performing a global brute-force search on each one would incur huge computational costs and be prone to mismatches due to visual similarity across floors (such as passageways on different floors but with the same structure). Before calculating the cosine similarity, this embodiment first filters out "first candidate feature vectors" located on the same floor from the database based on the vehicle's current "floor information." This step achieves coarse-grained scene filtering, eliminating a large number of interference items that are geographically irrelevant. Subsequently, the cosine similarity between the vehicle's location feature vector and each candidate feature vector is calculated only within the selected candidate subset to determine the final match. Through the above process, this embodiment significantly reduces the number of similarity calculations, lowers system latency and computational resource consumption; on the other hand, by eliminating interference items that are "visually similar but physically unrelated" across floors, it effectively reduces the risk of mismatches due to scene repetition, improves the reliability of the retrieval results, and makes the final visual location recognition results more accurate and reliable.

[0019] Furthermore, the step of obtaining several candidate feature vectors from the target database based on the floor information includes: Based on the floor information, several first candidate feature vectors are determined by querying the target database. If the number of each first candidate feature vector is greater than a preset number threshold, then each first candidate feature vector is used as one of the candidate feature vectors. If the number of each of the first candidate feature vectors is less than or equal to the preset number threshold, then all feature vectors in the target database are used as the plurality of candidate feature vectors.

[0020] This embodiment provides an intelligent candidate set backoff strategy, adding flexibility and robustness to the floor selection mechanism and ensuring the stability and fault tolerance of the retrieval process in various practical application scenarios. This embodiment introduces a "preset quantity threshold" as a decision point. When the number of "first candidate feature vectors" retrieved based on floor information is sufficiently large (greater than the preset quantity threshold), it indicates that the prior information of that floor is reliable and the map data is sufficient. Directly using this subset for accurate retrieval is the optimal choice, balancing efficiency and accuracy. However, in practical applications, two situations may exist: first, the floor sensor information may occasionally err, leading to incorrect floors being retrieved, and the returned candidate set may be empty or very small; second, some floors (such as new areas) inherently have a small number of keyframes for mapping. If, in such cases, a very small candidate set is still used for retrieval, it is highly likely that insufficient data will lead to matching failures or mismatches. Therefore, when the number of candidate vectors is insufficient (less than or equal to the preset number threshold), this embodiment will automatically fall back to using "all feature vectors in the target database" as the candidate set, avoiding the failure of the entire retrieval process due to the failure of a single information source (floor information) or data sparsity, thus taking into account both the efficiency and accuracy of visual location recognition.

[0021] Further, determining the positioning feature vector from the candidate feature vectors based on the cosine similarity between the vehicle position feature vector and each candidate feature vector in the target database includes: The norm of the vehicle location feature vector is calculated to obtain the corresponding query norm; Based on the query norm and the norm of each candidate feature vector, norm range filtering and norm ratio filtering are performed on each candidate feature vector to select a number of filter feature vectors from each candidate feature vector. Calculate the cosine similarity between the vehicle location feature vector and each of the selected feature vectors, and determine the selected feature vector corresponding to the maximum cosine similarity as the positioning feature vector.

[0022] This embodiment adds a fast pre-filtering mechanism based on feature vector norms before cosine similarity retrieval. Through a lightweight and efficient screening method, it further eliminates obviously mismatched candidate feature vectors, improving the accuracy and efficiency of the retrieval process with almost no increase in computational burden. This embodiment is based on the technical principle that in a well-trained model, feature vectors describing similar scenes often exhibit correlation in their norms within a certain range. Therefore, by comparing the query norm with the norm of each candidate feature vector in the database, two-step filtering can be performed: first, "norm range filtering," quickly eliminating candidates whose norms differ significantly from the query norm and clearly do not belong to the same lighting or scene intensity level (e.g., images taken in extremely dark environments versus images taken in extremely bright environments); second, a more refined "norm ratio filtering," judging their consistency based on the ratio of the two. After these two rapid numerical comparisons, a large number of obviously irrelevant candidate vectors are excluded before entering the computationally intensive cosine similarity calculation. Finally, only the filtered subset of "selected feature vectors" undergoes precise cosine similarity calculation, and the most similar vector is selected. Since the computational complexity of norm calculation is much lower than that of full cosine similarity calculation, this embodiment significantly reduces the number of candidates requiring exact matching, thereby accelerating the overall retrieval speed. Simultaneously, its filtering based on the statistical properties of feature vectors helps eliminate abnormal matches caused by extreme lighting or exposure differences, resulting in more stable and accurate final matching results.

[0023] Secondly, embodiments of this application provide a visual location recognition system based on full feature aggregation, including an acquisition module, a location recognition module, a retrieval module, and a positioning module; The acquisition module is used to acquire visual image data of the vehicle at the current moment; The location recognition module is used to input the visual image data into a preset location recognition model, so that the location recognition model sequentially performs image convolution and full feature aggregation on the visual image data to obtain the corresponding vehicle location feature vector. The location recognition model is obtained by a hybrid construction based on a convolutional neural network model and a multilayer perceptron model. The retrieval module is used to retrieve the corresponding positioning feature vector from the target database based on the vehicle's location feature vector. The target database is pre-loaded based on the area where the vehicle is currently located. The target database is constructed in mapping mode based on several historical visual image data of the area where the vehicle is currently located. The positioning module is used to generate a visual position recognition result at the current moment based on the mapping pose information of the positioning feature vector, and to perform visual positioning correction on the parking process of the vehicle based on the visual position recognition result. Attached Figure Description

[0024] Figure 1 A flowchart illustrating a visual location recognition method based on full feature aggregation provided in this application embodiment; Figure 2 A schematic diagram of the overall architecture of a visual location recognition method based on full feature aggregation provided in this application embodiment during the application process; Figure 3 A schematic diagram of the structure of a full MLP feature aggregator in a visual location recognition method based on full feature aggregation provided in an embodiment of this application; Figure 4 A schematic diagram of the database architecture in a visual location recognition method based on full feature aggregation provided in an embodiment of this application; Figure 5 A schematic diagram of database retrieval results in a visual location recognition method based on full feature aggregation provided in an embodiment of this application; Figure 6 This is a schematic diagram illustrating the process of correcting the positioning of a SLAM system based on the visual position recognition result in a visual position recognition method based on full feature aggregation, as provided in an embodiment of this application. Figure 7 A schematic diagram illustrating the operation flow of the VPR and SLAM system during the application of a visual position recognition method based on full feature aggregation provided in this application embodiment; Figure 8 This is a schematic diagram of the structure of a visual position recognition system based on full feature aggregation, provided in an embodiment of this application. Detailed Implementation

[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0026] It should be noted that the step numbers in this document are only for the convenience of explaining the specific embodiments and are not intended to limit the order in which the steps are performed. In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of that feature.

[0027] Example 1: like Figure 1 As shown, Embodiment 1 provides a visual location recognition method based on full feature aggregation, including steps S1-S4: Step S1: Obtain the visual image data of the vehicle at the current moment; Step S2: Input the visual image data into a preset location recognition model, so that the location recognition model performs image convolution and full feature aggregation on the visual image data in sequence to obtain the corresponding vehicle location feature vector. The location recognition model is constructed based on a hybrid model of convolutional neural network and multilayer perceptron. Step S3: Retrieve the corresponding positioning feature vector from the target database based on the vehicle position feature vector. The target database is preloaded based on the area where the vehicle is currently located. The target database is constructed in the mapping mode based on several historical visual image data of the area where the vehicle is currently located. Step S4: Generate the visual position recognition result at the current moment based on the mapping pose information of the positioning feature vector, and perform visual positioning correction on the parking process of the vehicle based on the visual position recognition result.

[0028] This application provides a visual position recognition method based on full feature aggregation. By constructing a position recognition model that combines a convolutional neural network (CNN) and a multilayer perceptron (MLP), and introducing a full feature aggregation mechanism, it fundamentally improves the accuracy and robustness of visual position recognition in complex and similar scenes. In autonomous driving, especially in parking scenarios such as underground garages, traditional methods often fail due to factors such as repetitive textures, sudden changes in illumination, and changes in viewing angle. This embodiment efficiently extracts local and multi-level spatial features of images through a convolutional neural network model, forming rich intermediate layer feature maps. Subsequently, a multilayer perceptron model is used to perform global, non-linear interaction and fusion of these feature maps. The powerful fully connected characteristics of MLP can model the complex dependencies between distant pixels in the feature maps, overcoming the limitations of the limited receptive field of traditional CNNs, thereby achieving a deep understanding of the overall structure and contextual information of the image at the feature level. This hybrid architecture of "local convolutional perception + global MLP aggregation" gives the generated "vehicle position feature vector" stronger scene discrimination ability and invariance. Compared to existing technologies that simply use NetVLAD or GeM for pooling aggregation, this embodiment can generate more discriminative image descriptors. In subsequent retrieval and matching with the target database, it can more accurately identify the true location of the vehicle, effectively reducing the false matching rate in environments with highly similar structures and improving the accuracy of visual location recognition.

[0029] In a preferred embodiment, such as Figure 2As shown, this embodiment consists of a training end and a deployment end. The training end is used to collect historical data, train the location recognition model, and build a target database. The deployment end is used to deploy the trained location recognition model, input the real-time collected visual image data into the location recognition model for inference, perform retrieval and matching in the target database based on the model's output, and finally obtain the visual location recognition result, which is then sent to the positioning system for relocation to perform visual positioning correction for the vehicle's parking process.

[0030] Furthermore, in step S1, acquiring the vehicle's visual image data at the current moment includes: Acquire the vehicle's original visual image frame at the current moment; The original visual image frame is cropped based on a preset target region to obtain a cropped image frame. The cropped image frame is scaled to a preset size to obtain a scaled image frame; The scaled image frame is converted based on a preset color-coded sampling format to obtain a format-converted image frame. The format-converted image frame is converted into floating-point tensor data and then normalized to obtain the visual image data.

[0031] This application provides a data preprocessing method for raw visual image frames, laying a solid and high-quality data foundation for subsequent high-precision feature extraction and matching. In visual location recognition tasks, the quality and consistency of the input image directly determine the final performance. This embodiment systematically defines a complete processing chain from raw image frames to normalized tensor data: First, target region cropping is performed to eliminate interfering areas such as the sky and irrelevant buildings, focusing on scene content strongly related to location, such as roads, parking spaces, and signs, reducing irrelevant noise. Subsequently, scaling to a preset size not only unifies the input scale, facilitating model processing, but also optimizes computational resources to a certain extent. Conversion based on a preset color encoding format (such as RGB to YUV) helps extract features that are more consistent with human visual perception or more suitable for specific model calculations. The final floating-point conversion and normalization are key steps in mapping pixel values ​​to a standard numerical range, which accelerates model training convergence, improves numerical stability, and makes the model more adaptable to images with different brightness and contrast. The standardized preprocessing procedure provided in this embodiment ensures the "cleanliness" and "consistency" of the input features, reduces interference caused by differences in image acquisition equipment and uneven ambient lighting, and enables the position recognition model to focus on learning the essential spatial and semantic information of the scene, thereby indirectly but significantly improving the accuracy and reliability of the entire visual position recognition system.

[0032] In a preferred embodiment, data preprocessing is required for the input data during both model training and real-time inference. Specifically, during model training, the acquired RGB images are resized and converted from RGB to YUV (BT.601) and divided by 255. By inserting QuantStub at the network input of the model and setting scale=1 / 255, the normalization can be integrated into the quantization parameters to maintain consistency. During real-time inference, the NV12 images are ROI+resized, converted to YUV444, and then normalized by 255.

[0033] In one possible implementation, step S2, inputting the visual image data into a preset location recognition model, so that the location recognition model sequentially performs image convolution and full feature aggregation on the visual image data to obtain the corresponding vehicle location feature vector, includes: The visual image data is input into the location recognition model so that the convolutional backbone network of the location recognition model generates the corresponding intermediate layer feature map. The intermediate layer feature map is fully aggregated by several residual connection-based feature aggregators in the location recognition model to obtain the corresponding hybrid feature vector. The hybrid feature vector is subjected to channel projection, row projection and flattening operations in sequence to obtain the vehicle position feature vector.

[0034] This application provides a feature extraction method. First, based on visual image data, a convolutional backbone network within the model generates "intermediate layer feature maps," which contain rich information ranging from low-level edges to high-level semantics. Then, these maps are processed by several feature aggregators based on residual connections. Residual connections avoid the vanishing gradient problem in deep networks, ensuring training stability and depth. The MLP aggregator, through its fully connected characteristics, allows features at all locations in the feature map to interact and integrate information, achieving true global context modeling and capturing long-range spatial relationships that are easily overlooked by traditional local pooling methods. After generating the "hybrid feature vector," this embodiment further performs "channel projection" and "row projection" operations. Channel projection (e.g., using 1x1 convolutions or fully connected layers) reweights and reduces the dimensionality of feature channels, filtering out the most discriminative channel information; row projection further compresses and abstracts the spatial dimension. Finally, a "flattening operation" transforms the two-dimensional feature map into a one-dimensional vehicle position feature vector. This set of combined operations realizes the refinement process from high-dimensional, redundant intermediate features to low-dimensional, highly discriminative global descriptors. The resulting feature vectors not only have fixed dimensions, making them easy to store and retrieve, but more importantly, they highly summarize the essential content of the image and have stronger robustness to changes in viewpoint and partial occlusion. This provides the optimal input for subsequent high-precision retrieval and matching, further improving the accuracy of visual position recognition.

[0035] In a preferred embodiment, the input data of the location recognition model is preprocessed image patches (i.e., visual image data), and the output is a global feature descriptor with a size of 320×320; the convolutional backbone network in the location recognition model outputs a feature map with dimensions C=1024 and H=W=20; the structure of the full MLP feature aggregator (MixVPR) in the location recognition model is as follows: Figure 3 As shown, the parameters can be mix_depth=4, mlp_ratio=1, C_out=1024, R=4, corresponding to the output feature dimension D=C_out·R=4096.

[0036] The image patch is processed on a single-frame basis, with one image patch corresponding to one frame. The image patch is obtained by cropping the original image by ROI (optional), resizing to a fixed size (e.g., 320×320), converting the color space to YUV (three-channel), and normalizing to 255. After the preprocessed image patch is input into the model, it first passes through a convolutional backbone network (e.g., ResNet50) to extract intermediate layer feature maps F∈R^{C×H×W} (e.g., C=1024, H=W=20). Then, the feature maps are flattened in space to F'∈R^{C×(H·W)}, and multiple FeatureMixerLayers are stacked for MLP mixing in the (H·W) dimension. Each layer includes LayerNorm, two fully connected layers, and ReLU activation, with residual connections used for output to obtain the mixed feature vector. Finally, channel projection (C→C_out) and row projection (H·W→R) are performed sequentially on the mixed feature vector, and the vector is flattened to obtain the vehicle position feature vector f∈R^{C_out·R} (e.g., 1024×4=4096).

[0037] The FeatureMixerLayer can be represented as: X←X + MLP(LN(X)), where LN is the layer normalization, and MLP contains two fully connected layers and a non-linear activation (e.g., ReLU), used to perform full MLP mixing on the feature sequences of each channel in the spatial dimension (H·W). The dimension of the vehicle position feature vector satisfies D = C_out·R. By configuring C_out and R, a trade-off between accuracy and computing power can be achieved, and the feature dimension of the deployment end and the retrieval end can be kept consistent (e.g., D=4096).

[0038] In addition, the model can be configured to perform L2 normalization on the vehicle location feature vector. During the training phase, the feature vector is usually normalized to stabilize the learning metric; during the real-time inference phase, norm normalization can also be used on the CPU side or in subsequent similarity calculations to achieve cosine similarity.

[0039] In one possible implementation, step S2, which involves constructing the location recognition model based on a hybrid convolutional neural network model and a multilayer perceptron model, includes: Collect several historical visual image data with pose information in a real scene within a preset area; Based on each of the historical visual image data and the spatial Euclidean distance between each of the historical visual image data, several triplet training samples are generated, wherein each of the spatial Euclidean distances is calculated based on each of the pose information; An initial position recognition model is obtained by hybrid construction of the convolutional neural network model and the multilayer perceptron model, wherein the convolutional neural network model is the initial convolutional backbone network and the multilayer perceptron model is a number of initial feature aggregators based on residual connections. The initial location recognition model is trained using a preset distance-aware loss function and each of the triplet training samples to obtain the location recognition model.

[0040] This application provides a method for constructing and training a location recognition model, proposing a data-driven model training paradigm guided by real-world spatial relationships. This ensures that the features learned by the model are strongly correlated with the pose information of the physical world, thus directly serving high-precision positioning. First, this embodiment collects historical image data with precise pose labels in a "real-world scene," ensuring consistency between the training data and the final application scenario and avoiding the domain gap between simulation and reality. Second, it uses the "spatial Euclidean distance" calculated from pose information as a metric to generate "triple training samples." This method links the visual similarity learning of images with real geometric distance, further improving the model's training effect. After constructing an initial model based on CNN and MLP, the initial model is trained using triple training samples and a "distance-aware loss function," enabling the feature space learned by the model to form a good mapping relationship with the real three-dimensional physical space: at locations with close physical distances, their feature vectors are highly similar in the feature space; conversely, the differences are significant. Therefore, the location recognition model trained in this way outputs vehicle location feature vectors that are naturally suitable for distance-based retrieval and localization tasks, greatly improving the geometric accuracy of visual location recognition.

[0041] Furthermore, the step of generating several triplet training samples based on each of the historical visual image data and the spatial Euclidean distance between each of the historical visual image data includes: Based on the spatial Euclidean distance between each historical visual image data, a positive sample set and a negative sample set corresponding to each historical visual image data are determined respectively. Among them, the positive sample set of any current historical visual image data is a number of first historical visual image data whose spatial Euclidean distance from the current historical visual image data is less than a preset distance threshold, and the negative sample set of the current historical visual image data is a number of second historical visual image data whose spatial Euclidean distance from the current historical visual image data is greater than or equal to the preset distance threshold. For each current historical visual image data, a preset number of triplet training samples are generated according to the corresponding positive sample set, the corresponding negative sample set, and the preset sampling rules. The triplet training samples include the first historical visual image data, the current historical visual image data, and the second historical visual image data.

[0042] This embodiment further refines the strategy for generating triplet training samples, significantly improving the effectiveness and efficiency of model training and enhancing the model's ability to distinguish difficult samples. Specifically, this embodiment first clearly defines the "positive sample set" (close to the target) and the "negative sample set" (far from the target) for each "current historical visual image data" (anchor point) based on a preset distance threshold. This division based on real geometric distance is more objective and accurate than random selection or selection based solely on visual similarity, providing clear supervision signals for model learning. Then, based on preset sampling rules and generating a preset number of triplets, it can effectively suppress overfitting caused by imbalanced training data, and by designing sampling rules, the model can learn more powerful and generalizable feature representations. This strategic sample generation method avoids training saturation caused by simple samples and prevents noise that may be introduced by random sampling, making the model training process more efficient and the goal clearer. The final trained model has better discrimination ability when faced with appearance changes and scene confusion in the real world, further improving the accuracy of visual position recognition.

[0043] Further, the step of training the initial location recognition model based on a preset distance-aware loss function and each of the triplet training samples to obtain the location recognition model includes: The first spatial Euclidean distance of each of the triplet training samples is determined based on the spatial Euclidean distance between the current historical visual image data and the first historical visual image data in the triplet training samples. The second spatial Euclidean distance of each triplet training sample is determined based on the spatial Euclidean distance between the current historical visual image data and the second historical visual image data in the triplet training samples. The interval hierarchy parameter corresponding to the triplet training sample is determined based on the first spatial Euclidean distance and the second spatial Euclidean distance in each triplet training sample. Each of the triplet training samples is input into the initial position recognition model, so that the initial position recognition model generates a corresponding triplet feature vector. The first cosine similarity of each triplet feature vector is determined based on the cosine similarity between the current feature vector and the first feature vector in the triplet feature vector; The second cosine similarity of each triplet feature vector is determined based on the cosine similarity between the current feature vector and the second feature vector in the triplet feature vector; Based on the first spatial Euclidean distance, the second spatial Euclidean distance, the first cosine similarity, the second cosine similarity, and the interval level parameters, the corresponding loss function values ​​are calculated using the distance-aware loss function. Then, the parameters of the initial location recognition model are optimized based on the loss function values ​​to obtain the location recognition model.

[0044] This embodiment further describes the specific computational process of model training using a distance-aware loss function, enabling the model to accurately learn the correspondence between the feature space and the physical space. First, this embodiment calculates the true "first-space Euclidean distance" and "second-space Euclidean distance" between samples within a triplet, and dynamically determines the "margin hierarchy parameter" based on this. This parameter is crucial; it quantifies the feature discrimination the model needs to achieve for the current triplet, and its magnitude is related to the true physical distance difference between positive and negative samples. Then, the model generates corresponding feature vectors for the triplet and calculates the "first cosine similarity" and "second cosine similarity" in the feature space. Finally, the loss function comprehensively considers the true physical distance, the similarity in the feature space, and the adaptive margin parameter. The technical concept is that the loss function value not only penalizes cases where the feature similarity does not match the true physical distance (e.g., high feature similarity despite a large physical distance, or low feature similarity despite a small physical distance), but the severity of the penalty is adjusted according to the "difficulty" of the true distance difference. For positive samples that are very close in real distance and negative samples that are very far in real distance, the model only needs to achieve a small feature margin; however, for difficult sample pairs that are relatively close in real distance, the model needs to learn a larger feature margin to distinguish them. This "distance-aware" characteristic makes model training no longer a blind process of moving closer and farther away, but rather a measured and discerning learning process. This ensures that the descriptors generated by the final location recognition model have a similarity ranking that perfectly reflects the real spatial proximity relationship, thereby achieving extremely high-precision pose estimation during retrieval and further improving the accuracy of visual location recognition.

[0045] In a preferred embodiment, the model training process mainly includes a training data construction stage and a model training stage. In the training data construction stage, image sequence data of parking scenarios are collected, including various typical parking environments such as underground garages and surface parking lots. The image sequence data mainly consists of visual images from the parking mapping stage and their corresponding image pose information. The parking mapping stage refers to the process where, when the vehicle is in parking mapping / learning mode (e.g., ParkingMapping mode), the system, while completing semantic map / trajectory mapping, samples keyframes from continuous images from the forward-looking camera according to a displacement threshold, and stores each frame as associated with its corresponding odometer / SLAM pose. The odometer / SLAM pose includes the vehicle's current x, y, z coordinates, quaternion pose, timestamp, and floor identification information. After preprocessing the collected visual images using the data preprocessing method described above, the aforementioned historical visual image data is obtained.

[0046] To construct triplet training samples, the spatial Euclidean distance between each image pair is first calculated based on SLAM pose. An image pair refers to a binary tuple consisting of two frames selected from several historical visual image datasets, such as the query image I_q and the candidate image I_d; these correspond to poses T_q and T_d, respectively. The spatial Euclidean distance between image pairs can be calculated using the pose translation: d(q,d)=||t_q−t_d||_2, where t_q and t_d are the three-dimensional translation vectors of T_q and T_d, respectively. Then, a 6-level distance hierarchy annotation system is established, with the specific distance hierarchy as follows: Ultra-close distance: 0-0.3 meters, different perspectives from the same location. Close-range layer: 0.3-0.8 meters, adjacent positions Mid-range layer: 0.8-1.5 meters, adjacent area Difficult negative sample level: 1.5-3.0 meters, different locations with similar appearances. Medium negative sample level: 3.0-8.0 meters, clearly different locations. Simple negative sample level: >8.0 meters, completely different scenarios. Training sample pairs are constructed based on distance levels to ensure a reasonable distribution of positive and negative samples. Among them, 0-0.3 meters, 0.3-0.8 meters, and 0.8-1.5 meters are positive sample levels; 1.5-3.0 meters, 3.0-8.0 meters, and >8.0 meters are negative sample levels.

[0047] Iterate through all historical visual image data. For each current historical visual image data, use it as an anchor point and calculate the spatial Euclidean distance between the anchor point and other historical visual image data. Then, perform distance hierarchical annotation on other historical visual image data based on the above-mentioned 6-level distance hierarchy annotation system. Based on the distance hierarchy annotation, divide other historical visual image data into a positive sample set or a negative sample set for the anchor point. Select some positive samples from the positive sample set and some negative samples from the negative sample set. Combine these positive and negative samples with the anchor point to construct several triplet training samples (anchor, positive, negative). Each triplet training sample consists of a positive sample, an anchor point, and a negative sample.

[0048] Furthermore, to suppress overfitting caused by imbalanced training data, the number of triplet samples generated for each query image can be limited (e.g., a fixed number of triplets can be generated per query image), and a frequency penalty weight can be introduced for frequently used database images (e.g., the sampling weight is proportional to 1 / √n, where n is the number of times the image is selected as a candidate) to avoid excessive gradient contribution from a few locations. Further, database image pools for each partition can be loaded in parallel, and a cross-partition negative sample pool can be constructed to reduce construction time and increase negative sample diversity. Furthermore, in addition to filtering positive samples by distance threshold, quality scoring can be combined with heading angle difference, and a stratified sampling strategy (e.g., proportional sampling from high-quality / medium-quality / the entire set) can be adopted to balance hard examples and diversity. The positive sample quality score can be defined as: q = 0.7·(1−d / d0)+ 0.3·(1−|Δyaw| / yaw0), where d is the spatial distance, Δyaw is the heading angle difference, and d0 and yaw0 are normalized scales (e.g., d0=0.5m, yaw0=90°). High / medium / low quality sets can be stratified for sampling based on q from high to low. Negative samples can be categorized by distance into difficult negative sample layers (e.g., 1.5-3.0m), medium negative sample layers (e.g., 3.0-8.0m), and easy negative sample / cross-regional negative sample layers (e.g., >8.0m or from other regions). Sampling ratios for each layer are set to simultaneously cover difficult examples that are "similar in appearance but different in location" and easy examples that are "significantly different." Negative samples are processed using a stratified strategy: medium / difficult negative samples within the same scene place (divided by distance interval), unmatched random negative samples within the place, and negative samples across places, to enhance the model’s ability to distinguish scenes that are similar in appearance but different in location.

[0049] During the model training phase, an initial location recognition model is designed, consisting of a convolutional backbone network (e.g., ResNet50) and a full MLP feature aggregator (MixVPR). The data processing within the model is the same as in the real-time inference phase, and will not be described further here.

[0050] For the parking application scenario of this application, due to the common problems in parking scenarios such as underground garages, such as repetitive textures, drastic lighting changes, dynamic occlusion, and viewpoint perturbations, this application's embodiment designs an adaptive Margin (margin hierarchy parameter) distance-aware loss function to improve the model's fine-grained discrimination ability for similar scenes. This function, combined with the distance hierarchy annotations inherent in the training samples, optimizes the initial position recognition model, allowing the weight of positive samples to decrease with increasing distance, while assigning higher weights to difficult negative samples to emphasize separability, thereby improving the stability of fine-grained ranking. For any triplet training sample containing anchor point i, positive sample j, and negative sample k, let their feature vectors be respectively... , , The cosine similarity is , Based on spatial distance , The distance level to which it belongs is selected by adaptive interval. And can be based on Set weights The distance-aware loss function is then: ; in, For adaptive interval hierarchy parameters, by The value determines, The value is mainly determined by the dynamic changes in the distance hierarchy of negative samples. For example, a specific value selection rule is as follows: Positive samples vs. hard negative samples (1.5-3.0 meters): margin = 0.36 Positive samples vs. moderately negative samples (3.0-8.0 meters): margin = 0.45 Positive samples vs. simple negative samples (>8.0 meters): margin = 0.60 Furthermore, a ranking consistency constraint can be introduced to ensure that samples closer to the anchor point (smaller spatial distance) have higher feature similarity in the feature space. This complements the distance-aware loss function and aims to refine the distance ranking relationship in the feature space. Therefore, the final loss function in this embodiment is as follows: ; Where λ is the balance coefficient, which is usually set to 0.3. Let distance-aware loss function be used. For sorting consistency constraints.

[0051] ; For any two training samples (i, j, k) and (i, p, n) with the same anchor point, calculate the ranking consistency loss between the two positive samples (j, p) and the two negative samples (k, n) based on their anchor point i. Taking j and p as an example, when hour, The value is 1; otherwise The value is -1; when hour, The value is 1, otherwise The value is -1, and Substituting the values ​​into the above formula yields the ranking consistency loss between two positive samples. The role of the ranking consistency constraint is to introduce more refined supervision. Even if both are positive samples, the model cannot "lazily" learn their features to be equally similar. The model must reflect the corresponding differences in feature similarity based on the differences in their true distances from the Anchor, thereby forming a more accurate metric relationship in the parameter space and improving the model's localization accuracy during the inference phase.

[0052] In the process of optimizing model parameters based on loss function, progressive training is introduced. In the warm-up phase, only basic metric learning loss (such as MultiSimilarityLoss) is used. In the transition phase, the weight of fine-grained ranking loss is gradually increased to achieve stable convergence and improve the ability to distinguish similar positions.

[0053] In one possible implementation, step S3, retrieving the corresponding positioning feature vector from the target database based on the vehicle position feature vector, includes: Obtain the floor information of the vehicle at the current moment; Based on the floor information, several first candidate feature vectors are obtained by filtering from the target database; The positioning feature vector is determined from each of the candidate feature vectors based on the cosine similarity between the vehicle location feature vector and each of the candidate feature vectors in the target database.

[0054] This application provides a method for retrieving location feature vectors from a target database. By introducing prior "floor information" as a retrieval filter, the search scope is greatly narrowed, improving retrieval speed and accuracy. In large or complex mapping areas, the target database may contain tens of thousands of feature vectors. Performing a global brute-force search on each one would incur huge computational costs and be prone to mismatches due to visual similarity across floors (such as passageways on different floors but with the same structure). Before calculating the cosine similarity, this embodiment first filters out "first candidate feature vectors" located on the same floor from the database based on the vehicle's current "floor information." This step achieves coarse-grained scene filtering, eliminating a large number of interference items that are geographically irrelevant. Subsequently, the cosine similarity between the vehicle's location feature vector and each candidate feature vector is calculated only within the selected candidate subset to determine the final match. Through the above process, this embodiment significantly reduces the number of similarity calculations, lowers system latency and computational resource consumption; on the other hand, by eliminating interference items that are "visually similar but physically unrelated" across floors, it effectively reduces the risk of mismatches due to scene repetition, improves the reliability of the retrieval results, and makes the final visual location recognition results more accurate and reliable.

[0055] Furthermore, the step of obtaining several candidate feature vectors from the target database based on the floor information includes: Based on the floor information, several first candidate feature vectors are determined by querying the target database. If the number of each first candidate feature vector is greater than a preset number threshold, then each first candidate feature vector is used as one of the candidate feature vectors. If the number of each of the first candidate feature vectors is less than or equal to the preset number threshold, then all feature vectors in the target database are used as the plurality of candidate feature vectors.

[0056] This embodiment provides an intelligent candidate set backoff strategy, adding flexibility and robustness to the floor selection mechanism and ensuring the stability and fault tolerance of the retrieval process in various practical application scenarios. This embodiment introduces a "preset quantity threshold" as a decision point. When the number of "first candidate feature vectors" retrieved based on floor information is sufficiently large (greater than the preset quantity threshold), it indicates that the prior information of that floor is reliable and the map data is sufficient. Directly using this subset for accurate retrieval is the optimal choice, balancing efficiency and accuracy. However, in practical applications, two situations may exist: first, the floor sensor information may occasionally err, leading to incorrect floors being retrieved, and the returned candidate set may be empty or very small; second, some floors (such as new areas) inherently have a small number of keyframes for mapping. If, in such cases, a very small candidate set is still used for retrieval, it is highly likely that insufficient data will lead to matching failures or mismatches. Therefore, when the number of candidate vectors is insufficient (less than or equal to the preset number threshold), this embodiment will automatically fall back to using "all feature vectors in the target database" as the candidate set, avoiding the failure of the entire retrieval process due to the failure of a single information source (floor information) or data sparsity, thus taking into account both the efficiency and accuracy of visual location recognition.

[0057] Further, determining the positioning feature vector from the candidate feature vectors based on the cosine similarity between the vehicle position feature vector and each candidate feature vector in the target database includes: The norm of the vehicle location feature vector is calculated to obtain the corresponding query norm; Based on the query norm and the norm of each candidate feature vector, norm range filtering and norm ratio filtering are performed on each candidate feature vector to select a number of filter feature vectors from each candidate feature vector. Calculate the cosine similarity between the vehicle location feature vector and each of the selected feature vectors, and determine the selected feature vector corresponding to the maximum cosine similarity as the positioning feature vector.

[0058] This embodiment adds a fast pre-filtering mechanism based on feature vector norms before cosine similarity retrieval. Through a lightweight and efficient screening method, it further eliminates obviously mismatched candidate feature vectors, improving the accuracy and efficiency of the retrieval process with almost no increase in computational burden. This embodiment is based on the technical principle that in a well-trained model, feature vectors describing similar scenes often exhibit correlation in their norms within a certain range. Therefore, by comparing the query norm with the norm of each candidate feature vector in the database, two-step filtering can be performed: first, "norm range filtering," quickly eliminating candidates whose norms differ significantly from the query norm and clearly do not belong to the same lighting or scene intensity level (e.g., images taken in extremely dark environments versus images taken in extremely bright environments); second, a more refined "norm ratio filtering," judging their consistency based on the ratio of the two. After these two rapid numerical comparisons, a large number of obviously irrelevant candidate vectors are excluded before entering the computationally intensive cosine similarity calculation. Finally, only the filtered subset of "selected feature vectors" undergoes precise cosine similarity calculation, and the most similar vector is selected. Since the computational complexity of norm calculation is much lower than that of full cosine similarity calculation, this embodiment significantly reduces the number of candidates requiring exact matching, thereby accelerating the overall retrieval speed. Simultaneously, its filtering based on the statistical properties of feature vectors helps eliminate abnormal matches caused by extreme lighting or exposure differences, resulting in more stable and accurate final matching results.

[0059] It should be noted that system initialization and database loading are required before implementing the visual position recognition method of this application. In a preferred embodiment, system initialization and database loading include the following steps: 1. VPR module initialization Load the quantized MixVPR model file (.hbm format); initialize the BPU inference engine and allocate input / output buffers; employ thread-safe initialization and cache reuse mechanisms (such as atomic flags and mutexes) to ensure safe initialization and inference reuse in a multi-threaded environment.

[0060] 2. Three-level cache database construction and loading A three-level cache database architecture, such as Figure 4 As shown, it includes a persistence layer, an indexing layer, and a computation layer.

[0061] Persistent layer: The feature vectors, poses, floors and timestamps are serialized into a database file in Protobuf format and saved in association with the semantic map, which facilitates cross-process / cross-startup loading.

[0062] Index layer: After loading the database, a floor index (floor_id → feature ID set) and an ID mapping (image_id → contiguous memory index) are built for candidate filtering and rapid location of metadata.

[0063] Computation layer: All feature vectors are organized into a contiguous memory array flat_descriptors[N×D] and the norm of each feature flat_norms[N] is cached, providing a data layout foundation for cosine similarity calculation, prefetching and NEON SIMD acceleration.

[0064] Furthermore, the system can dynamically determine whether to trigger norm range filtering and norm ratio pruning based on the number of candidates, in order to achieve a balance between speed and recall.

[0065] Regarding the construction of the target database, in mapping mode, the system writes the features and poses of sampled frames into the Protobuf database and associates the database file with the semantic map path to disk when a save map command is received. An adaptive sampling mechanism is implemented, triggering image sampling based on a distance threshold (e.g., 0.2 meters, configurable) and calculating the Euclidean distance between the current pose and the previously processed pose. The current pose can be obtained from the vehicle odometer / fusion positioning module output, for example, by taking the pose of the latest frame from the input Odometry data. The current frame is processed only when the Euclidean distance between two frames reaches the threshold, extracting features and storing them in a three-level cache database. Each feature record contains a unique image_id, timestamp, feature vector, pose, and floor information; the image_id can be generated by an auto-incrementing counter to ensure uniqueness. "Processing the current frame" refers to performing preprocessing and feature extraction on the currently sampled image and performing data storage and retrieval. The first frame is processed unconditionally to ensure database initialization.

[0066] During visual location recognition, the system loads the corresponding database and builds an index and contiguous memory cache based on the current semantic map path. By receiving NV12 format images directly output from the camera, the system performs the image preprocessing steps described above through BPU hardware acceleration. The normalization in the preprocessing chain can be fused to the quantization parameters (e.g., scale=1 / 255) to ensure consistency between training and deployment. The preprocessing output tensor serves as the input to the location recognition model.

[0067] Then, the BPU is used to perform quantized inference of the location recognition model, outputting a 4096-dimensional localization feature vector through a convolutional backbone network and a MixVPR aggregator. Real-time inference is performed on a single frame basis: each input real-time image (or ROI image patch) outputs a localization feature vector (e.g., 4096-dimensional), which is used for subsequent database retrieval. The single-frame inference latency depends on hardware computing power, input size, and candidate library size, and can be accelerated through hardware preprocessing and retrieval to meet real-time requirements.

[0068] During database retrieval, when information about the current floor exists and the number of features for the same floor reaches a preset threshold, a candidate set for the same floor is built first; otherwise, it falls back to the candidate set for the entire database. For example, when the current floor ID is not 0 and the number of features for the same floor is ≥50, a candidate set is built only within that floor; when the number is insufficient, it falls back to the candidate set for the entire database to avoid missed detections due to sparse floor data.

[0069] Before performing cosine similarity matching, norm pruning can be performed, including norm range filtering and norm ratio filtering. Specifically, the norm ||f_i||_2 of each feature vector is pre-cached in the database. The query norm ||f_q||_2 of the located feature vector is calculated online and subjected to norm range filtering (e.g., [0.8||f_q||, 1.25||f_q||]) and norm ratio filtering (e.g., [0.5, 1.25]) to reduce invalid similarity calculations. To ensure numerical stability, the query norm can be calculated as ||f_q||_2 = sqrt(Σf_q[k]^2) + ε, and the library norm is calculated similarly; when the library norm is less than ε, the candidate is skipped. Furthermore, candidate shrinkage adopts a protection mechanism: the candidate set is only truly reduced when the number of candidates after norm range filtering reaches a preset lower limit (e.g., ≥10); otherwise, the original candidate set is maintained to avoid over-pruning. The norm range filtering involves iterating through the candidate set. If the norm of a candidate feature vector ||f_i||_2 ∉ [0.8||f_q||, 1.25||f_q||], the candidate is discarded. The norm ratio filtering involves iterating through the candidate set and calculating the norm ratio r_i = ||f_q||_2 / ||f_i||_2. If r_i ∉ [0.5, 1.25], the candidate is discarded. Furthermore, if SLAM / odometry can provide coarse localization pose, spatial constraints can be introduced to further limit the candidate range.

[0070] Furthermore, an early stopping threshold can be set: when the best_similarity (maximum cosine similarity) reaches the early stopping threshold (e.g., 0.95), the traversal is terminated early to reduce the average matching computation. Candidate feature vectors adopt a contiguous memory layout (e.g., stored contiguously in N×D form), and subsequent candidates are prefetched to hide memory access latency; for example, multiple cache lines of the next batch of candidates can be prefetched at a fixed prefetch distance. NEON SIMD is used to vectorize and parallelize the calculation of dot product and norm (multi-way accumulation reduces data dependency). Combining contiguous memory layout and prefetching reduces memory access overhead and improves throughput. When the similarity reaches a high threshold (e.g., sim≥0.95), the scan can be terminated early to reduce the average computation. The above acceleration strategies can significantly reduce the matching latency of a single query and improve throughput.

[0071] Finally, the cosine similarity between the query feature and the database feature is calculated for each candidate in the filtered set. The image_id corresponding to the highest similarity is taken as best_match_id, and the mapping pose and floor information corresponding to this feature are read from the database to form the VPR relocalization result (i.e., visual position recognition result). The matching result includes at least the success flag, matched_image_id, similarity, matched_pose, matched_floor_id, and processing time. Figure 5 As shown, this is based on the current visual image data ( Figure 5 (Left) Historical visual image data obtained by matching in the database ( Figure 5 (Right) Subsequently, the corresponding visual location recognition result can be extracted from the historical visual image data.

[0072] The current VPR relocalization result can also be verified, including: checking if the highest similarity is greater than a threshold (the threshold is configurable, e.g., 0.8); verifying if the floor identifier of the matched feature is consistent with the current floor; and if SLAM has a coarse pose, checking the reasonableness of the VPR result and the SLAM pose. A comprehensive judgment is made to decide whether to accept the VPR relocalization result. The comprehensive judgment logic may include: the database search matching result is successful and the highest similarity is ≥ the threshold; the matched floor is consistent with the current floor or meets the floor backoff strategy; the vehicle state meets the constraints (e.g., the steering wheel angle is less than the threshold to avoid false matching due to sharp turns); and the difference between the VPR matched pose and the current coarse localization / odometer pose is within a reasonable range. If the above conditions are met, the VPR relocalization result is accepted; otherwise, it is rejected and the original localization is maintained / other recovery strategies are entered. When the VPR relocalization result is accepted, the mapping pose corresponding to best_match_id is output as matched_pose.

[0073] In a preferred embodiment, in step S4, the visual positioning correction of the vehicle parking process based on the visual position recognition result specifically includes: During parking, a state machine / state manager coordinates the working modes of VPR (Visual Position Recognition) and SLAM (Site Layout Analysis), and sends necessary context such as the current mode, floor information, and current semantic map path to the VPR module. When the location system is in normal operation, VPR results may not be used or the frequency of VPR calls may be reduced; when the location system enters relocation mode, the VPR result selection and fusion process is activated, such as... Figure 6As shown, after the VPR outputs the relocation result, reliability verification is first performed on thresholds, floors, and vehicle states. If the verification passes, the matched_pose is provided as the initial value for relocation to the localization / SLAM module. In a preferred embodiment, when the system successfully relocates in multiple consecutive frames, the (VPR matched mapping pose point, current odometry pose point) of each frame is used as a matching point pair. Nonlinear least squares optimization with Huber robust kernel is used to solve for the two-dimensional translation and heading angle corrections (Δx, Δy, Δyaw) to minimize the weighted point-to-point residuals, where the weights can be given by similarity, thereby obtaining the alignment transformation between the mapping coordinate system and the current operating coordinate system. The above alignment transformation is used to initialize map matching / semantic matching and trigger subsequent feature optimization and pose update. If the optimization cost is less than the threshold and the localization system state changes from the relocation state to the normal localization state and remains stable within several consecutive frames / a certain mileage, then SLAM is determined to have been restored. If verification fails or optimization does not converge, discard the current VPR result and maintain the original location / enter a degradation strategy (e.g., wait for subsequent frames to relocate again or fall back to full library search).

[0074] Furthermore, the matching results from consecutive multiple frames can be used to estimate coordinate system alignment transformations to improve stability. For example, the state machine side only invokes the localization module's relocation settings when vpr_result.success is true and vpr_result.similarity exceeds relocalization_select_similarity; and it can require |steering_wheel_angle|<0.6 to avoid mismatches caused by sharp turns. Nonlinear optimization is triggered only when the number of matching point pairs within the window exceeds a threshold (e.g., >5); new matching point pairs are added to the window only when the vehicle travel distance or time interval exceeds a threshold to reduce redundant observations.

[0075] VPR inference, retrieval, and database operations are decoupled from the SLAM main thread through asynchronous communication / shared channels to avoid blocking the main localization process, and output debugging information for visualization and threshold tuning.

[0076] The overall operation process of VPR and SLAM is as follows: Figure 7 As shown, in mapping mode, samples are written to the database according to the displacement threshold and saved to disk along with the map; in positioning mode, the VPR database corresponding to the current semantic map is loaded and matched online; when the positioning system enters the repositioning state, the state machine decides whether to adopt the VPR result based on the VPR success and similarity threshold, floor consistency, vehicle status and other conditions, and inputs the result into the positioning module for fusion and recovery.

[0077] Regarding the handling of exceptions in each module: When the VPR module fails to initialize, the SLAM system continues to run but has no relocation capability. When a model inference exception occurs, the exception is captured and the current frame is skipped, without affecting system stability. When the database load / save fails, false is returned, without affecting system operation. When a match fails, a failure flag is returned, allowing the caller to attempt other recovery strategies.

[0078] Example 2: like Figure 8 As shown, Embodiment 2 provides a visual location recognition system based on full feature aggregation, including an acquisition module 10, a location recognition module 20, a retrieval module 30, and a positioning module 40; The acquisition module 10 is used to acquire visual image data of the vehicle at the current moment; The location recognition module 20 is used to input the visual image data into a preset location recognition model, so that the location recognition model sequentially performs image convolution and full feature aggregation on the visual image data to obtain the corresponding vehicle location feature vector. The location recognition model is obtained by a hybrid construction based on a convolutional neural network model and a multilayer perceptron model. The retrieval module 30 is used to retrieve the corresponding positioning feature vector from the target database based on the vehicle position feature vector. The target database is preloaded based on the area where the vehicle is currently located. The target database is constructed in the mapping mode based on several historical visual image data of the area where the vehicle is currently located. The positioning module 40 is used to generate a visual position recognition result at the current moment based on the mapping pose information of the positioning feature vector, and to perform visual positioning correction on the parking process of the vehicle based on the visual position recognition result.

[0079] Furthermore, the acquisition module 10 acquires the vehicle's visual image data at the current moment, including: Acquire the vehicle's original visual image frame at the current moment; The original visual image frame is cropped based on a preset target region to obtain a cropped image frame. The cropped image frame is scaled to a preset size to obtain a scaled image frame; The scaled image frame is converted based on a preset color-coded sampling format to obtain a format-converted image frame. The format-converted image frame is converted into floating-point tensor data and then normalized to obtain the visual image data.

[0080] Furthermore, the location recognition module 20 inputs the visual image data into a preset location recognition model, so that the location recognition model sequentially performs image convolution and full feature aggregation on the visual image data to obtain the corresponding vehicle location feature vector, including: The visual image data is input into the location recognition model so that the convolutional backbone network of the location recognition model generates the corresponding intermediate layer feature map. The intermediate layer feature map is fully aggregated by several residual connection-based feature aggregators in the location recognition model to obtain the corresponding hybrid feature vector. The hybrid feature vector is subjected to channel projection, row projection and flattening operations in sequence to obtain the vehicle position feature vector.

[0081] In one possible implementation, the visual location recognition system further includes a model training module, which is used to construct the location recognition model based on a hybrid convolutional neural network model and a multilayer perceptron model, including: Collect several historical visual image data with pose information in a real scene within a preset area; Based on each of the historical visual image data and the spatial Euclidean distance between each of the historical visual image data, several triplet training samples are generated, wherein each of the spatial Euclidean distances is calculated based on each of the pose information; An initial position recognition model is obtained by hybrid construction of the convolutional neural network model and the multilayer perceptron model, wherein the convolutional neural network model is the initial convolutional backbone network and the multilayer perceptron model is a number of initial feature aggregators based on residual connections. The initial location recognition model is trained using a preset distance-aware loss function and each of the triplet training samples to obtain the location recognition model.

[0082] Furthermore, the step of generating several triplet training samples based on each of the historical visual image data and the spatial Euclidean distance between each of the historical visual image data includes: Based on the spatial Euclidean distance between each historical visual image data, a positive sample set and a negative sample set corresponding to each historical visual image data are determined respectively. Among them, the positive sample set of any current historical visual image data is a number of first historical visual image data whose spatial Euclidean distance from the current historical visual image data is less than a preset distance threshold, and the negative sample set of the current historical visual image data is a number of second historical visual image data whose spatial Euclidean distance from the current historical visual image data is greater than or equal to the preset distance threshold. For each current historical visual image data, a preset number of triplet training samples are generated according to the corresponding positive sample set, the corresponding negative sample set, and the preset sampling rules. The triplet training samples include the first historical visual image data, the current historical visual image data, and the second historical visual image data.

[0083] Further, the step of training the initial location recognition model based on a preset distance-aware loss function and each of the triplet training samples to obtain the location recognition model includes: The first spatial Euclidean distance of each of the triplet training samples is determined based on the spatial Euclidean distance between the current historical visual image data and the first historical visual image data in the triplet training samples. The second spatial Euclidean distance of each triplet training sample is determined based on the spatial Euclidean distance between the current historical visual image data and the second historical visual image data in the triplet training samples. The interval hierarchy parameter corresponding to the triplet training sample is determined based on the first spatial Euclidean distance and the second spatial Euclidean distance in each triplet training sample. Each of the triplet training samples is input into the initial position recognition model, so that the initial position recognition model generates a corresponding triplet feature vector. The first cosine similarity of each triplet feature vector is determined based on the cosine similarity between the current feature vector and the first feature vector in the triplet feature vector; The second cosine similarity of each triplet feature vector is determined based on the cosine similarity between the current feature vector and the second feature vector in the triplet feature vector; Based on the first spatial Euclidean distance, the second spatial Euclidean distance, the first cosine similarity, the second cosine similarity, and the interval level parameters, the corresponding loss function values ​​are calculated using the distance-aware loss function. Then, the parameters of the initial location recognition model are optimized based on the loss function values ​​to obtain the location recognition model.

[0084] In one possible implementation, the retrieval module 30 retrieves the corresponding positioning feature vector from the target database based on the vehicle position feature vector, including: Obtain the floor information of the vehicle at the current moment; Based on the floor information, several first candidate feature vectors are obtained by filtering from the target database; The positioning feature vector is determined from each of the candidate feature vectors based on the cosine similarity between the vehicle location feature vector and each of the candidate feature vectors in the target database.

[0085] Furthermore, the step of obtaining several candidate feature vectors from the target database based on the floor information includes: Based on the floor information, several first candidate feature vectors are determined by querying the target database. If the number of each first candidate feature vector is greater than a preset number threshold, then each first candidate feature vector is used as one of the candidate feature vectors. If the number of each of the first candidate feature vectors is less than or equal to the preset number threshold, then all feature vectors in the target database are used as the plurality of candidate feature vectors.

[0086] Further, determining the positioning feature vector from the candidate feature vectors based on the cosine similarity between the vehicle position feature vector and each candidate feature vector in the target database includes: The norm of the vehicle location feature vector is calculated to obtain the corresponding query norm; Based on the query norm and the norm of each candidate feature vector, norm range filtering and norm ratio filtering are performed on each candidate feature vector to select a number of filter feature vectors from each candidate feature vector. Calculate the cosine similarity between the vehicle location feature vector and each of the selected feature vectors, and determine the selected feature vector corresponding to the maximum cosine similarity as the positioning feature vector.

[0087] This application provides a visual position recognition system based on full feature aggregation. By constructing a position recognition model that combines a convolutional neural network (CNN) and a multilayer perceptron (MLP), and introducing a full feature aggregation mechanism, the accuracy and robustness of visual position recognition in complex and similar scenes are fundamentally improved. In autonomous driving, especially in parking scenarios such as underground garages, traditional methods often fail due to factors such as repetitive textures, sudden changes in illumination, and changes in viewing angle. This embodiment efficiently extracts local and multi-level spatial features of images through a convolutional neural network model, forming rich intermediate layer feature maps. Subsequently, a multilayer perceptron model is used to perform global, non-linear interaction and fusion of these feature maps. The powerful fully connected characteristics of MLP can model the complex dependencies between distant pixels in the feature maps, overcoming the limitations of the limited receptive field of traditional CNNs, thereby achieving a deep understanding of the overall structure and contextual information of the image at the feature level. This hybrid architecture of "local convolutional perception + global MLP aggregation" gives the generated "vehicle position feature vector" stronger scene discrimination ability and invariance. Compared to existing technologies that simply use NetVLAD or GeM for pooling aggregation, this embodiment can generate more discriminative image descriptors. In subsequent retrieval and matching with the target database, it can more accurately identify the true location of the vehicle, effectively reducing the false matching rate in environments with highly similar structures and improving the accuracy of visual location recognition.

[0088] For a more detailed explanation of the working principle and procedures of this embodiment, please refer to the relevant description in Embodiment 1.

[0089] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above descriptions are merely specific embodiments of this application and are not intended to limit the scope of protection of this application. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application for those skilled in the art.

Claims

1. A visual location recognition method based on full feature aggregation, characterized in that, include: Acquire visual image data of the vehicle at the current moment; The visual image data is input into a preset location recognition model, so that the location recognition model performs image convolution and full feature aggregation on the visual image data in sequence to obtain the corresponding vehicle location feature vector. The location recognition model is constructed based on a hybrid model of convolutional neural network and multilayer perceptron. The corresponding positioning feature vector is retrieved from the target database based on the vehicle's location feature vector. The target database is pre-loaded based on the area where the vehicle is currently located. The target database is constructed in mapping mode based on several historical visual image data of the area where the vehicle is currently located. The visual position recognition result at the current moment is generated based on the mapping pose information of the positioning feature vector, and the parking process of the vehicle is visually corrected based on the visual position recognition result.

2. The visual location recognition method based on full feature aggregation as described in claim 1, characterized in that, The acquisition of the vehicle's visual image data at the current moment includes: Acquire the vehicle's original visual image frame at the current moment; The original visual image frame is cropped based on a preset target region to obtain a cropped image frame. The cropped image frame is scaled to a preset size to obtain a scaled image frame; The scaled image frame is converted based on a preset color-coded sampling format to obtain a format-converted image frame. The format-converted image frame is converted into floating-point tensor data and then normalized to obtain the visual image data.

3. The visual location recognition method based on full feature aggregation as described in claim 1, characterized in that, The step of inputting the visual image data into a preset location recognition model, so that the location recognition model sequentially performs image convolution and full feature aggregation on the visual image data to obtain the corresponding vehicle location feature vector, includes: The visual image data is input into the location recognition model so that the convolutional backbone network of the location recognition model generates the corresponding intermediate layer feature map. The intermediate layer feature map is fully aggregated by several residual connection-based feature aggregators in the location recognition model to obtain the corresponding hybrid feature vector. The hybrid feature vector is subjected to channel projection, row projection and flattening operations in sequence to obtain the vehicle position feature vector.

4. The visual location recognition method based on full feature aggregation as described in claim 1, characterized in that, The location recognition model is obtained by constructing a hybrid model based on convolutional neural network and multilayer perceptron, including: Collect several historical visual image data with pose information in a real scene within a preset area; Based on each of the historical visual image data and the spatial Euclidean distance between each of the historical visual image data, several triplet training samples are generated, wherein each of the spatial Euclidean distances is calculated based on each of the pose information; An initial position recognition model is obtained by hybrid construction of the convolutional neural network model and the multilayer perceptron model, wherein the convolutional neural network model is the initial convolutional backbone network and the multilayer perceptron model is a number of initial feature aggregators based on residual connections. The initial location recognition model is trained using a preset distance-aware loss function and each of the triplet training samples to obtain the location recognition model.

5. The visual location recognition method based on full feature aggregation as described in claim 4, characterized in that, The step of generating several triplet training samples based on each of the historical visual image data and the spatial Euclidean distance between each of the historical visual image data includes: Based on the spatial Euclidean distance between each historical visual image data, a positive sample set and a negative sample set corresponding to each historical visual image data are determined respectively. Among them, the positive sample set of any current historical visual image data is a number of first historical visual image data whose spatial Euclidean distance from the current historical visual image data is less than a preset distance threshold, and the negative sample set of the current historical visual image data is a number of second historical visual image data whose spatial Euclidean distance from the current historical visual image data is greater than or equal to the preset distance threshold. For each current historical visual image data, a preset number of triplet training samples are generated according to the corresponding positive sample set, the corresponding negative sample set, and the preset sampling rules. The triplet training samples include the first historical visual image data, the current historical visual image data, and the second historical visual image data.

6. The visual location recognition method based on full feature aggregation as described in claim 5, characterized in that, The step of training the initial location recognition model based on a preset distance-aware loss function and each of the triplet training samples to obtain the location recognition model includes: The first spatial Euclidean distance of each of the triplet training samples is determined based on the spatial Euclidean distance between the current historical visual image data and the first historical visual image data in the triplet training samples. The second spatial Euclidean distance of each triplet training sample is determined based on the spatial Euclidean distance between the current historical visual image data and the second historical visual image data in the triplet training samples. The interval hierarchy parameter corresponding to the triplet training sample is determined based on the first spatial Euclidean distance and the second spatial Euclidean distance in each triplet training sample. Each of the triplet training samples is input into the initial position recognition model, so that the initial position recognition model generates a corresponding triplet feature vector. The first cosine similarity of each triplet feature vector is determined based on the cosine similarity between the current feature vector and the first feature vector in the triplet feature vector; The second cosine similarity of each triplet feature vector is determined based on the cosine similarity between the current feature vector and the second feature vector in the triplet feature vector; Based on the first spatial Euclidean distance, the second spatial Euclidean distance, the first cosine similarity, the second cosine similarity, and the interval level parameters, the corresponding loss function values ​​are calculated using the distance-aware loss function. Then, the parameters of the initial location recognition model are optimized based on the loss function values ​​to obtain the location recognition model.

7. The visual location recognition method based on full feature aggregation as described in claim 1, characterized in that, The step of retrieving the corresponding positioning feature vector from the target database based on the vehicle position feature vector includes: Obtain the floor information of the vehicle at the current moment; Based on the floor information, several first candidate feature vectors are obtained by filtering from the target database; The positioning feature vector is determined from each of the candidate feature vectors based on the cosine similarity between the vehicle location feature vector and each of the candidate feature vectors in the target database.

8. The visual location recognition method based on full feature aggregation as described in claim 7, characterized in that, The step of obtaining several candidate feature vectors from the target database based on the floor information includes: Based on the floor information, several first candidate feature vectors are determined by querying the target database. If the number of each first candidate feature vector is greater than a preset number threshold, then each first candidate feature vector is used as one of the candidate feature vectors. If the number of each of the first candidate feature vectors is less than or equal to the preset number threshold, then all feature vectors in the target database are used as the plurality of candidate feature vectors.

9. The visual position recognition method based on full feature aggregation as described in claim 7, characterized in that, The step of determining the positioning feature vector from each of the candidate feature vectors based on the cosine similarity between the vehicle position feature vector and each of the candidate feature vectors in the target database includes: The norm of the vehicle location feature vector is calculated to obtain the corresponding query norm; Based on the query norm and the norm of each candidate feature vector, norm range filtering and norm ratio filtering are performed on each candidate feature vector to select a number of filter feature vectors from each candidate feature vector. Calculate the cosine similarity between the vehicle location feature vector and each of the selected feature vectors, and determine the selected feature vector corresponding to the maximum cosine similarity as the positioning feature vector.

10. A visual position recognition system based on full feature aggregation, characterized in that, It includes an acquisition module, a location recognition module, a retrieval module, and a positioning module; The acquisition module is used to acquire visual image data of the vehicle at the current moment; The location recognition module is used to input the visual image data into a preset location recognition model, so that the location recognition model sequentially performs image convolution and full feature aggregation on the visual image data to obtain the corresponding vehicle location feature vector. The location recognition model is obtained by a hybrid construction based on a convolutional neural network model and a multilayer perceptron model. The retrieval module is used to retrieve the corresponding positioning feature vector from the target database based on the vehicle's location feature vector. The target database is pre-loaded based on the area where the vehicle is currently located. The target database is constructed in mapping mode based on several historical visual image data of the area where the vehicle is currently located. The positioning module is used to generate a visual position recognition result at the current moment based on the mapping pose information of the positioning feature vector, and to perform visual positioning correction on the parking process of the vehicle based on the visual position recognition result.