Semantic information fused loopback detection method and system

Through the loop closure detection method that fuses semantic information, the static semantic feature vector and the feature similarity of the bag-of-word model are used for normalized fusion, which solves the problem in the existing technology that the loop closure detection performance is affected by changes in moving objects and viewing angles, and achieves a better Early, more accurate loop detection and greater robustness.

CN118570502AInactive Publication Date: 2024-08-30NANJING XIAOZHUANG UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410845673.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When existing loopback detection methods have large changes in moving objects or camera viewing angles, the distribution of feature points is affected, resulting in a decrease in loopback detection performance and making it difficult to effectively eliminate cumulative errors.

Method used

Using a loopback detection method that fuses semantic information, the static semantic feature vector is obtained through the target detection algorithm and the bag-of-word model is used to obtain the bag-of-word vector. The semantic similarity and feature similarity are calculated respectively, and normalized fusion is performed to generate image similarity for judgment. Loopback.

Benefits of technology

It improves the distinction between loopback scenarios and non-loopback scenarios, increases the window size of loopback detection, enables loopback detection earlier and more accurately, and maintains good robustness especially in dynamic environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570502A
    Figure CN118570502A
Patent Text Reader

Abstract

The invention discloses a semantic information fused loopback detection method and system. The method comprises the steps of obtaining a to-be-detected image sequence; and inputting the to-be-detected image sequence into a pre-trained loopback detection model to obtain a loopback detection result. According to the loopback detection method and system fused with the semantic information, the semantic feature vector is constructed by utilizing the semantic information of target detection, the vector represents an inherent geometric structure in the environment and is not influenced by a moving object, the semantic similarity between images can be well measured, and the detection accuracy is improved. And finally, respectively normalizing the semantic similarity and the feature similarity obtained based on the bag-of-word model, fusing, and judging whether a loop appears in the scene according to the final image similarity. Experimental results under a TUM data set show that the method improves the distinction degree of the loopback scene and the non-loopback scene, increases the window size of the loopback scene, and can detect the loopback earlier and more easily.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a loop closure detection method and system integrating semantic information, belonging to the technical field of loop closure detection. Background Art

[0002] Visual odometry can estimate the camera pose between two adjacent frames. Back-end optimization can eliminate trajectory errors generated within a short period of time, but it cannot eliminate accumulated errors over longer time intervals. Loop closure detection, a key component of SLAM systems, primarily detects whether the camera has returned to a previously visited location. This identifies loops in the environment, resolves drift errors accumulated over long periods of motion, and provides more accurate and effective pose constraints for back-end optimization. This demonstrates that loop closure detection not only corrects accumulated errors but also establishes a globally consistent map, improving the system's positioning accuracy and mapping performance. Common loop closure detection methods include geometry-based and appearance-based methods.

[0003] Currently, mainstream loop detection methods are primarily based on the bag-of-words model, which is used by loop detection modules in the ORB-SLAM series. The main idea is to match image features with historical image features in a database. A loop is detected when the statistical value exceeds a certain threshold. However, in real-world scenarios, the presence of moving objects or significant changes in camera perspective can affect the distribution of feature points, resulting in poor feature point quality. This can also affect the calculated descriptor information, reducing loop detection performance.

[0004] It can be seen that in order to solve the above technical problems and to eliminate as much as possible the impact of large changes in object or camera perspective on the distribution of feature points, a loop detection method and system that integrates semantic information is urgently needed. Summary of the Invention

[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a loop detection method and system that integrates semantic information. The method uses the semantic information of target detection to construct a semantic feature vector. This vector represents the inherent geometric structure of the environment, is not affected by moving objects, and can effectively measure the semantic similarity between images. Finally, the semantic similarity and the feature similarity obtained based on the bag-of-words model are normalized and fused. The final image similarity is used to determine whether a loop occurs in the scene. Experimental results using the TUM dataset show that this method improves the discrimination between loop and non-loop scenes, increases the window size of loop scenes, and can detect loops earlier and more easily.

[0006] To achieve the above object, the present invention is implemented by adopting the following technical solutions: In a first aspect, the present invention provides a loop closure detection method integrating semantic information, comprising: Obtaining a sequence of images to be detected; Inputting the image sequence to be detected into a pre-trained loop closure detection model to obtain a loop closure detection result; The loop detection model includes a first similarity acquisition module, a second similarity acquisition module, a similarity fusion module and a judgment module, wherein the first similarity acquisition module is used to obtain a static semantic feature vector of the image sequence to be detected according to the target detection algorithm, so as to determine the semantic feature similarity based on the static semantic feature vector; the second similarity acquisition module is used to obtain a static bag-of-words vector of the image sequence to be detected according to the bag-of-words model, and obtain the bag-of-words feature similarity based on the static bag-of-words vector; the similarity fusion module is used to normalize the semantic similarity and the bag-of-words feature similarity respectively and then fuse them to obtain the image similarity; the judgment module is used to determine the loop detection result based on the image similarity.

[0007] Furthermore, a static semantic feature vector of the image sequence to be detected is obtained according to the target detection algorithm, including: Identify static and dynamic target frames in the image sequence to be detected using a target detection algorithm, and obtain semantic information of each target frame, including category, upper left corner and lower right corner coordinates; Convert the obtained semantic information into vector form, remove the dynamic target frame information, and retain the remaining static target frame information; Determine the number of categories k and the number of instances s of each category in the retained static target box information, where the number of categories k is determined based on the relevance of the category to the current scene, and the number of instances s is determined by the correlation coefficient and the probability distribution function; Assign a weight to each of the determined categories, sort the k categories from high to low according to the weight value, and sort the s instances in each category from high to low according to the confidence level; According to the sorted categories and instances, the coordinate difference of the target box center point is calculated, and the edge vector is generated based on the coordinate difference. The set of edge vectors is used as the static semantic feature vector.

[0008] Furthermore, determining the semantic feature similarity based on the static semantic feature vector includes: Obtain the vocabulary vector of the static target box information according to the bag-of-words model, calculate the similarity between the vocabulary vectors, and obtain the first similarity; performing rotation normalization and scale normalization on the static semantic feature vector to obtain an intermediate feature vector, and performing similarity calculation on the intermediate feature vector to obtain a second similarity; The first similarity and the second similarity are normalized and fused to obtain the semantic feature similarity.

[0009] Furthermore, a static bag-of-words vector of the image sequence to be detected is obtained according to the bag-of-words model, including: Extract feature points from the image sequence to be detected, remove the feature points in the dynamic area, and obtain static feature points; Cluster static feature points to generate static visual words, and build a bag dictionary based on the static visual words; The image sequence to be detected is represented by a bag of words according to the static visual words in the constructed dictionary to obtain a static bag of words vector.

[0010] Furthermore, the bag-of-words feature similarity is obtained based on the static bag-of-words vector, including: Calculate the prior similarity S between the first and second frames based on the static bag-of-words vector, and normalize the similarities between other frames with reference to the prior similarity S to obtain the normalized image similarity; The normalized image similarity is calculated using the L2 norm or cosine similarity to obtain the bag-of-words feature similarity.

[0011] In a second aspect, the present invention provides a loop closure detection system integrating semantic information, comprising: Acquisition module: used to acquire the image sequence to be detected; Detection module: used to input the image sequence to be detected into a pre-trained loop detection model to obtain loop detection results; The loop detection model includes a first similarity acquisition module, a second similarity acquisition module, a similarity fusion module and a judgment module, wherein the first similarity acquisition module is used to obtain a static semantic feature vector of the image sequence to be detected according to the target detection algorithm, so as to determine the semantic feature similarity according to the static semantic feature vector; the second similarity acquisition module is used to obtain a static bag-of-words vector of the image sequence to be detected according to the bag-of-words model, and obtain the feature similarity according to the static bag-of-words vector; the similarity fusion module is used to normalize the semantic similarity and feature similarity respectively and then fuse them to obtain image similarity; the judgment module is used to determine the loop detection result according to the image similarity.

[0012] In a third aspect, the present invention provides a computer device including a processor and a storage medium; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to the first aspect.

[0013] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the program implements the steps of the method described in the first aspect when executed by a processor.

[0014] Compared with the prior art, the present invention has the following beneficial effects: The loop detection method for integrating semantic information provided by the present invention introduces a target detection network to improve the traditional bag-of-words model, and proposes a bag-of-words model that only contains static area features. At the same time, according to the semantic information of the image, a semantic feature vector based on the topological structure is constructed to represent the inherent geometric information in the space, which greatly eliminates the influence of dynamic scenes on image similarity. Image similarity is generated by integrating the feature similarity of the bag-of-words model with the semantic similarity of the semantic topological map. The results on the data set show that this method can significantly improve the discrimination of image similarity in loop scenes and non-loop scenes, as well as the window size of loop detection, can detect loops earlier, and can maintain good robustness in dynamic environments, proving the effectiveness of the method. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 This is a flow chart of the loop closure detection method that integrates semantic information; Figure 2 This is a schematic diagram of the bag of visual words model; Figure 3 It is a schematic diagram of a k-ary tree dictionary with a depth of d; Figure 4 It is a schematic diagram of the semantic topology graph structure; Figure 5 is a schematic diagram of rotation normalization; Figure 6 It is a schematic diagram of closed-loop detection; Figure 7 It is a schematic diagram of the camera motion trajectory; Figure 8 This is a schematic diagram of the fr1_room sequence similarity results; Figure 9 This is a schematic diagram of the fr2_desk loopback scenario; Figure 10 It is a schematic diagram of the similarity result comparison; Figure 11 This is a schematic diagram of the basic framework of the loop detection module. DETAILED DESCRIPTION

[0016] The technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations on the technical solution of the present application. Unless there is a conflict, the embodiments of the present application and the technical features in the embodiments can be combined with each other.

[0017] The term "and / or" in this document simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. Additionally, the character " / " in this document generally indicates an "or" relationship between the related objects. Example 1

[0018] Figure 1 This is a flow chart of a loop closure detection method for integrating semantic information in the first embodiment of the present invention. The loop closure detection method for integrating semantic information provided in this embodiment can be applied to a terminal and can be executed by a loop closure detection system for integrating semantic information. The system can be implemented in software and / or hardware and can be integrated into a terminal, such as any smartphone, tablet computer, or computer device with communication capabilities. Figure 1 , the method of this implementation specifically includes the following steps: Obtaining a sequence of images to be detected; Inputting the image sequence to be detected into a pre-trained loop closure detection model to obtain a loop closure detection result; The loop detection model includes a first similarity acquisition module, a second similarity acquisition module, a similarity fusion module and a judgment module, wherein the first similarity acquisition module is used to obtain a static semantic feature vector of the image sequence to be detected according to the target detection algorithm, so as to determine the semantic feature similarity based on the static semantic feature vector; the second similarity acquisition module is used to obtain a static bag-of-words vector of the image sequence to be detected according to the bag-of-words model, and obtain the bag-of-words feature similarity based on the static bag-of-words vector; the similarity fusion module is used to normalize the semantic similarity and the bag-of-words feature similarity respectively and then fuse them to obtain the image similarity; the judgment module is used to determine the loop detection result based on the image similarity.

[0019] The static semantic feature vector of the image sequence to be detected is obtained according to the target detection algorithm, including: Identify static and dynamic target frames in the image sequence to be detected using a target detection algorithm, and obtain semantic information of each target frame, including category, upper left corner and lower right corner coordinates; Convert the obtained semantic information into vector form, remove the dynamic target frame information, and retain the remaining static target frame information; Determine the number of categories k and the number of instances s of each category in the retained static target box information, where the number of categories k is determined based on the relevance of the category to the current scene, and the number of instances s is determined by the correlation coefficient and the probability distribution function; Assign a weight to each of the determined categories, sort the k categories from high to low according to the weight value, and sort the s instances in each category from high to low according to the confidence level; According to the sorted categories and instances, the coordinate difference of the target box center point is calculated, and the edge vector is generated based on the coordinate difference. The set of edge vectors is used as the static semantic feature vector.

[0020] Determine semantic feature similarity based on static semantic feature vectors, including: Obtain the vocabulary vector of the static target box information according to the bag-of-words model, calculate the similarity between the vocabulary vectors, and obtain the first similarity; performing rotation normalization and scale normalization on the static semantic feature vector to obtain an intermediate feature vector, and performing similarity calculation on the intermediate feature vector to obtain a second similarity; The first similarity and the second similarity are normalized and fused to obtain the semantic feature similarity.

[0021] The static bag-of-words vector of the image sequence to be detected is obtained according to the bag-of-words model, including: Extract feature points from the image sequence to be detected, remove the feature points in the dynamic area, and obtain static feature points; Cluster static feature points to generate static visual words, and build a bag dictionary based on the static visual words; The image sequence to be detected is represented by a bag of words according to the static visual words in the constructed dictionary to obtain a static bag of words vector.

[0022] The bag-of-words feature similarity is obtained based on the static bag-of-words vector, including: Calculate the prior similarity S between the first and second frames based on the static bag-of-words vector, and normalize the similarities between other frames with reference to the prior similarity S to obtain the normalized image similarity; The normalized image similarity is calculated using the L2 norm or cosine similarity to obtain the bag-of-words feature similarity.

[0023] This paper improves the loop detection algorithm and proposes a loop detection algorithm that combines semantic information. The algorithm obtains the prior semantic target frame of the image based on the target detection algorithm module, and counts the mode of the motion weights of the feature points in each target frame after feature matching, retains the target frame information whose prior information and weight mode are both within the static range, and uses semantic feature vectors to represent the information and relative position of each target frame in the image. Finally, the semantic similarity and feature similarity are fused to obtain the final image similarity, which improves the loop detection effect when the quality of feature points is not high in some scenarios. The basic framework of the method provided in this embodiment is as follows: Figure 11 As shown in the figure, in addition to being used to generate semantic vectors, target detection information also provides dynamic target boxes to the bag-of-words model to generate bag-of-words feature vectors in a purely static environment.

[0024] Next, this embodiment is described with reference to specific cases: The bag-of-words model is a commonly used method in computer vision and natural language processing. This model ignores word order and grammatical structure and only considers the frequency of word occurrence. It can handle large-scale data well and is widely used in image recognition and similarity judgment.

[0025] The bag-of-words model uses a series of visual "words" to represent image features. For example, if an image contains a person or a car, the visual features "person" and "car" correspond to the words in the bag-of-words model. Of course, the bag-of-words model generally does not detect high-level semantic information with target boxes, but rather discrete feature point information. In different scenes, features in different areas correspond to different visual words, while features in similar areas correspond to roughly the same visual words. Therefore, image information can be represented using the words that the image contains. By counting the number or proportion of identical words between two images, the similarity between the images can be quickly calculated, which improves the speed of image matching.

[0026] like Figure 2 As shown in the figure, these visual words form a dictionary. Unlike feature points, each word is not extracted from a single image, but a combination of certain features. Therefore, the dictionary is equivalent to a collection of various word combinations. The dictionary generation problem is transformed into a clustering problem. Clustering problems are particularly common in unsupervised learning. K-means is a simple and effective clustering method. data, want to classify Class, first randomly select Data is used as the initial cluster center, and then the distance from each data to each cluster center is calculated, and the one with the smallest distance value is selected as its classification. Then the mean of each type of data is calculated as the new cluster center. If the cluster center does not change much, the algorithm is considered to have converged and the classification is completed. Otherwise, the above steps are repeated to update the cluster center. Since the initial cluster center of the K-means algorithm is randomly generated, the results of each clustering are different, and the clustering results depend on the quality of the initial cluster center. The K-means++ algorithm overcomes the above shortcomings. This method randomly selects the first cluster center, and then calculates the distance of all sample points to the nearest cluster center. Then, according to formula (1), the probability of each sample point being selected as the next cluster center is calculated, and the sample point with the largest probability value is selected as the next cluster center. The above steps are repeated until the first cluster center is selected. Cluster centers.

[0027]

[0028] in, Indicates the cluster centers, represents the set of sample points, Represents the minimum distance from the sample point to all cluster centers. After clustering, a large-scale dictionary will be obtained. By searching the dictionary, the words contained in an image can be determined. In order to improve the speed of dictionary retrieval, it is generally used. As shown in Figure 3, all samples are clustered into Classify, get the first layer clustering results, then perform the same operation on each node of the first layer, repeat the above steps until the preset depth is reached, and finally all the words of the leaf nodes constitute the dictionary.

[0029] With a visual dictionary, any image can be represented by different word combinations. However, the feature distribution in an image is discriminative, so words should also have different discriminative degrees. This requires adding different weights to them to distinguish them. A common approach is TF-IDF (term frequency–inverse document frequency), which is a statistical technique in the field of text retrieval. TF represents the frequency of a word appearing in an image. The larger the TF value, the higher the word's discriminative degree. IDF is used to measure the importance of a word. The lower the frequency of a word in the dictionary, the more important it is. The TF value and IDF value are calculated using formula (2):

[0030] In TF, For words The number of times it appears in a single image, is the total number of words in a single image, in IDF, For words The number of feature points included, is the total number of feature points in the dictionary, and the word Weight:

[0031] At this point, we can use the bag-of-words feature vector to represent any image :

[0032] Due to the similarity of features, the bag-of-words vector is a sparse vector, for any two given tape vectors and , can be achieved through Paradigm to calculate the similarity between two images:

[0033] Or using cosine similarity:

[0034] For different environments with similar structures, simply using similarity scores is not necessarily helpful. For example, there are often many tables and chairs of the same style in different offices. Although they are placed in different positions, the bag-of-words model only performs statistics and does not consider the relative positions of words, so it is easy to cause misrecognition. Considering this situation, this paper first takes a prior similarity before calculating the similarity. :

[0035] It represents the similarity between the first frame image and the second frame image, and then the similarity between other image frames refers to Normalize:

[0036] Furthermore, the words in the bag-of-words model are derived by clustering the descriptors of feature points, without considering the dynamic nature of the environment. This makes misidentification more likely when dynamic targets appear in an image and the dynamic area accounts for a large proportion. For example, in two images of the same person in different scenes, if the person occupies a larger area, the visual words ultimately retrieved for the person will be greater than those retrieved for the static area. When calculating image similarity, there is a high probability that the two images of different scenes will be judged as the same scene. Taking this into account, when generating the bag-of-words vector for an image, this paper first removes the feature points in the dynamic area based on the prior information of the target detection algorithm, and then generates a bag-of-words vector containing only static features, which more accurately represents the static scene.

[0037] The bag-of-words model only considers whether the image's key words exist in the dictionary, and then calculates the similarity between images based on the key words. Obviously, it doesn't leverage the inherent spatial location information of the environment, but only the image's appearance. This makes it prone to misjudgment of similar-looking scenes. The target bounding box obtained through object detection not only contains the object's category information but also its location information. Processing this information yields spatial geometric information. Therefore, this high-level semantic information can be used to describe the semantic similarity between images, improving the robustness of loop detection.

[0038] The semantic information obtained by target detection includes the category of the target box, the coordinates of the upper left corner and the lower right corner. This information is converted into a vector form:

[0039] in, represents the semantic vector generated by image A, Indicates the first The category and location information of the target box. Indicates the categories, represents the category confidence, and Respectively represent the upper left corner coordinates and lower right corner coordinates of the target box.

[0040] Although the semantic vector While this can represent the location of objects in an image to a certain extent, the dimensionality of the semantic vectors varies across images, necessitating the creation of semantic vectors with uniform dimensionality. Furthermore, images may contain moving objects, which can significantly impact the distribution of semantic vectors, necessitating the filtering of dynamic objects. Taking these two considerations into account, this paper utilizes static object bounding boxes to generate a semantic feature vector with a graph-like structure and uniform dimensionality.

[0041] For dynamic objects, the dynamic target frame can be removed directly using prior information. Only the static target box information is retained in the image, and then the position of the target box in the image is considered. Although the diagonal vertex coordinates of the target box can represent the accurate position of the target box, they cannot be used to represent the topological structure of the target level. Therefore, the center coordinates of the target box can be used to represent ,then The representation is converted into:

[0042] Represents the center coordinate of the target frame, which can be calculated by formula (11):

[0043] in, At this point, the vertex coordinates of the semantic graph structure, that is, the center coordinates of the target box, are obtained. Connecting each vertex will form a graph structure, as shown in Figure 4.

[0044] When there are multiple objects in the image, the number of edges in the graph will increase dramatically, consuming a lot of memory space, so it is necessary to determine the rules for creating vertices and edges. The dimension is , the number of categories is , the number of instances of each category is Since the scene does not contain all categories, we can only take the top categories that are highly relevant to the scene as the In addition, target detection also has the possibility of misidentification, and the number of instances of each category is not the same, so consider only ranking the confidence level first. The instance information of is added to the feature vector, and the dimension of the feature vector is unified:

[0045] in, Indicates the The detection information of the class category, that is, Class, confidence first The target box center point set, and The larger the value, the richer the feature vector information, but it also takes up more storage space and is more troublesome to process. This needs to be determined based on the actual scenario. and The value of . Assume that the number of image frames in the dataset is , No. The total number of times a category appears in the dataset is , in The number of times it appears on an image is , the number of times all categories appear is , then:

[0046] exist and Set the correlation coefficient between ,when , then the category is added to the semantic information. Similarly, set the number of times each category appears in an image to ,statistics When the number of images that meet the requirements ,calculate The probability distribution of the selected probability is greater than the threshold δ. , corresponding to The final result is:

[0047] Determine the number of vertices Finally, we need to determine the number of edges. From the above analysis, we can see that if edges are established between all vertices, edges, each edge is represented by the coordinates of the vertices at both ends, then the dimension of the final edge is would be huge, namely:

[0048] This will greatly occupy storage space and is very time-consuming to process. Since the minimum connected graph formed by static objects in the same scene will not change significantly, this paper considers using the minimum connected graph to store the relative positions between vertices. First, different weights need to be assigned to each category. , here we also use the TF-IDF method, and then according to the weight value From high to low Sort by categories, and in each category by confidence From high to low instances are sorted, and the The confidence level in the category is ranked The target frame center point coordinates If not, set , then the final sorting result is shown in formula (16).

[0049]

[0050] Then according to formula (16), use coordinate minus the The coordinates generate edge vectors, if the If the first coordinate is 0, use the coordinate minus the The coordinates generate edge vectors, if the The coordinate is 0, then the The edge vector is 0, and so on, it will generate Edge vectors, i.e. eigenvectors:

[0051] The obtained semantic feature vector cannot be used directly, because the geometric structure of the image obtained from different perspectives of the same scene has inconsistent scales and rotations, so it is necessary to Perform rotation normalization and scale normalization. Fixed, so in the same scenario, the first few items in formula (16) are generally the same, but in different scenarios they are generally different, so The first edge vector Normalize to the standard. First calculate the angle between the vector and the horizontal direction And its own mold length :

[0052]

[0053] in , is a vector exist The direction of the component, is a vector exist The component in the direction, then take the first vertex in formula (16) as the origin and rotate all points clockwise Degrees, so far the rotation normalization is completed, such as Figure 5 shown.

[0054] In the figure, green represents the original graph structure, and red represents the graph structure after rotation and normalization. The coordinates of each vertex after rotation can be calculated using formula (20):

[0055] in and Respectively represent the rotation center point and the point to be rotated, Represents the point after rotation, and then according to Length of mold , all edges in the graph are scaled normalized according to formula (21).

[0056]

[0057] At this point, the feature vector has rotation invariance and scale invariance. After obtaining the semantic feature vector of the image, the semantic similarity between images is calculated using formula (22):

[0058] in Represents the similarity of semantic words, that is, the static semantic information appearing in the image is used to generate vocabulary vectors in the same way as the bag-of-words model , Indicates the The number of times a category appears is calculated using the same method as the bag-of-words model. This step can filter out image sequences with little semantic relevance. Next, calculate , suppose the feature vectors of the two images are:

[0059] Then the feature vector similarity for:

[0060] Then according to formula (8) Normalize and finally use the bag-of-words feature similarity and semantic feature similarity Perform similarity fusion to obtain the final image similarity:

[0061] in Represents the final similarity of the image, Indicates the degree to which semantic information regulates similarity.

[0062] The main idea of ​​loop detection is to find the image with the highest similarity in the image data set and determine whether the similarity meets certain conditions. If so, a loop is detected, otherwise, there is no loop.

[0063] like Figure 6 As shown, the loop detection algorithm is shown in the following Algorithm 1.

[0064]

[0065] After the loop is detected, Sim3 backend optimization is performed, and the optimized camera pose and common view map points are propagated to other key frames for pose optimization and map point fusion.

[0066] Experiment and analysis This example selects the sub-datasets fr1_room sequence, fr2_desk sequence, and fr2_desk_with_person sequence in the TUM dataset as experimental data. Figure 7 As shown in Figure 1, both fr1_room and fr2_desk contain loop closure scenes, which are very suitable for loop closure verification. A moving person is added to the fr2_desk_with_person scene to test the robustness of the loop closure detection algorithm in a dynamic environment.

[0067] In order to better evaluate the performance of the algorithm, recall rate, image similarity and average similarity of loop scenes are selected Average similarity with non-loop scenes The ratio of is used as the evaluation criterion. This ratio effectively reflects the distinction between loop closure and non-loop closure scenes. Recall is redefined as the ratio of the number of consecutive frames that indicate loop closure to the number of actual loop closure frames. Furthermore, the trajectory errors estimated in the three scenarios are compared with those of ORB-SLAM3, and the mean squared error of ATE is still used as the evaluation metric.

[0068] The fr1_room sequence contains two loop closure scenes. The target image is the first frame, and the two loop closure scenes are around the 90th frame and the 1000th frame respectively. The feature point similarity obtained based on the bag-of-words model and the semantic similarity obtained based on semantic information are shown in Figure 8a and b.

[0069] Depend on Figure 8It can be seen that the loop detection algorithm based on the bag-of-words model has a highest similarity of 0.045 in the non-closed-loop scenario. In the closed-loop scenario, the highest similarity of the first closed-loop is 0.12, and the highest similarity of the second closed-loop scenario is 0.11. It is not difficult to see that the similarity difference between the closed-loop and non-closed-loop scenarios is not large, and the number of consecutive closed-loop frames is relatively small, making it difficult to detect loops. The similarity calculated based on semantic information is generally higher. The highest similarity in the non-loop scenario is 0.53, and the highest similarities in the two closed-loop scenarios are 0.78 and 0.76 respectively. The minimum similarity difference in the non-loop scenario is 0.23. Although the similarity difference between the loop scene and the non-loop scene is relatively large, the discrimination is not high. In order to better fuse the semantic similarity, the semantic similarity is binarized with a double threshold, and then fused with the similarity according to formula (26). The effect is as follows: Figure 8 Figure 9 As shown in Figures c and d, it is not difficult to see that the semantic similarity after double-threshold binarization can more clearly distinguish between loop and non-loop scenes. The similarity obtained by fusion on this basis can also clearly distinguish between loop and non-loop scenes.

[0070] Because loop closure detection sets the interval between loop closure frames, in the fr1_room sequence, loop closure is only detected around frame 1000. In the fr2_desk sequence, the target frame is frame 1, and the loop closure frame is around frame 2550. The loop closure scene diagram is shown in Figure 9. In the fr2_desk_with_person sequence, the target frame is around frame 130, and the loop closure frame is around frame 2500. The final similarity of the image sequences for these two scenes is shown in Figure 10.

[0071] Depend on Figure 10 It can be seen that even in dynamic environments, the semantic similarity of images can clearly distinguish between loop and non-loop scenes. In contrast, the similarity calculated based on the bag-of-words model is smaller in dynamic environments and has lower discrimination, with the maximum loop similarity being only 0.061. This is because dynamic targets will greatly change the distribution of feature points in the image, but the semantic features will not be affected. Therefore, after fusing semantic information, only the similarity of loop scenes is improved, and the similarity of non-loop scenes is not improved, thereby significantly improving the average similarity of loop scenes. Average similarity with non-loop scenes The quantitative results are shown in Table 1.

[0072]

[0073] As shown in Table 1, this method significantly improves the distinction between loop and non-loop scenes and effectively increases the loop detection window size, making it easier and earlier for the system to detect loops. Furthermore, in the sequence fr2_desk_with_person, the bag-of-words-based method fails to detect loops because the dynamic object (person) significantly changes the image's appearance. However, the semantic feature vector is insensitive to dynamic objects, so the loop detection method, after integrating semantic information, still detects loops in this scene, maintaining high robustness.

[0074] To more comprehensively measure the effectiveness of this method, we compared it with ORB-SLAM3. We still used the mean square error (MSE) of ATE to evaluate positioning accuracy, measured in meters. The average of 20 experiments was used as the final result. This method is called Ours-2, and the positioning accuracy comparison is shown in Table 2.

[0075]

[0076] As can be seen from the table, since the algorithm provided in this embodiment detects the loop closure scene in advance, the camera pose optimization is more accurate, and the improvement is more obvious in the fr2_desk_with_person sequence. This is because the bag-of-words model-based method does not detect loop closure information and does not perform more detailed pose optimization. However, the method that combines semantic information detects loop closure and performs pose optimization, resulting in a more accurate pose.

[0077] The method provided in this embodiment mainly studies the loop detection algorithm. The target detection network is introduced to improve the traditional bag-of-words model, and a bag-of-words model that only contains static area features is proposed. At the same time, according to the semantic information of the image, a semantic feature vector based on the topological structure is constructed to represent the inherent geometric information in the space, which greatly eliminates the influence of dynamic scenes on image similarity. Image similarity is generated by fusing the feature similarity of the bag-of-words model with the semantic similarity of the semantic topological map. The results on the data set show that this method can significantly improve the discrimination of image similarity in loop scenes and non-loop scenes, as well as the window size of loop detection, can detect loops earlier, and can maintain good robustness in dynamic environments, proving the effectiveness of the method. Example 2

[0078] This embodiment provides a loop closure detection system integrating semantic information, including: Acquisition module: used to acquire the image sequence to be detected; Detection module: used to input the image sequence to be detected into a pre-trained loop detection model to obtain loop detection results; The loop detection model includes a first similarity acquisition module, a second similarity acquisition module, a similarity fusion module and a judgment module, wherein the first similarity acquisition module is used to obtain a static semantic feature vector of the image sequence to be detected according to the target detection algorithm, so as to determine the semantic feature similarity according to the static semantic feature vector; the second similarity acquisition module is used to obtain a static bag-of-words vector of the image sequence to be detected according to the bag-of-words model, and obtain the feature similarity according to the static bag-of-words vector; the similarity fusion module is used to normalize the semantic similarity and feature similarity respectively and then fuse them to obtain image similarity; the judgment module is used to determine the loop detection result according to the image similarity.

[0079] The loop closure detection system for integrating semantic information provided in the embodiment of the present invention can execute the loop closure detection method for integrating semantic information provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. Example 3

[0080] An embodiment of the present invention further provides a computer device, including a processor and a storage medium; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the following method: Obtaining a sequence of images to be detected; Inputting the image sequence to be detected into a pre-trained loop closure detection model to obtain a loop closure detection result; The loop detection model includes a first similarity acquisition module, a second similarity acquisition module, a similarity fusion module and a judgment module, wherein the first similarity acquisition module is used to obtain a static semantic feature vector of the image sequence to be detected according to the target detection algorithm, so as to determine the semantic feature similarity based on the static semantic feature vector; the second similarity acquisition module is used to obtain a static bag-of-words vector of the image sequence to be detected according to the bag-of-words model, and obtain the bag-of-words feature similarity based on the static bag-of-words vector; the similarity fusion module is used to normalize the semantic similarity and the bag-of-words feature similarity respectively and then fuse them to obtain the image similarity; the judgment module is used to determine the loop detection result based on the image similarity.

[0081] For details of each step in this embodiment, please refer to the first embodiment, which will not be described in detail here. Since this embodiment and the first embodiment adopt the same technical concept, it also has the technical effects as described in the first embodiment. Example 4

[0082] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the following method: Obtaining a sequence of images to be detected; Inputting the image sequence to be detected into a pre-trained loop closure detection model to obtain a loop closure detection result; The loop detection model includes a first similarity acquisition module, a second similarity acquisition module, a similarity fusion module and a judgment module, wherein the first similarity acquisition module is used to obtain a static semantic feature vector of the image sequence to be detected according to the target detection algorithm, so as to determine the semantic feature similarity based on the static semantic feature vector; the second similarity acquisition module is used to obtain a static bag-of-words vector of the image sequence to be detected according to the bag-of-words model, and obtain the bag-of-words feature similarity based on the static bag-of-words vector; the similarity fusion module is used to normalize the semantic similarity and the bag-of-words feature similarity respectively and then fuse them to obtain the image similarity; the judgment module is used to determine the loop detection result based on the image similarity.

[0083] For details of each step in this embodiment, please refer to the first embodiment, which will not be described in detail here. Since this embodiment and the first embodiment adopt the same technical concept, they also have the technical effects as described in the first embodiment.

[0084] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0085] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A system that specifies the functions of a box or boxes.

[0086] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction system that is implemented in the process. Figure 1 a process or multiple processes and / or boxes Figure 1The function specified in one or more boxes.

[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0088] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A loop closure detection method integrating semantic information, characterized in that: include: Obtaining a sequence of images to be detected; Inputting the image sequence to be detected into a pre-trained loop detection model to obtain a loop detection result; The loop detection model includes a first similarity acquisition module, a second similarity acquisition module, a similarity fusion module and a judgment module, wherein the first similarity acquisition module is used to obtain a static semantic feature vector of an image sequence to be detected according to a target detection algorithm, so as to determine the semantic feature similarity according to the static semantic feature vector; the second similarity acquisition module is used to obtain a static bag-of-words vector of an image sequence to be detected according to a bag-of-words model, and obtain the bag-of-words feature similarity according to the static bag-of-words vector; the similarity fusion module is used to normalize the semantic similarity and the bag-of-words feature similarity respectively and then fuse them to obtain the image similarity; the judgment module is used to determine the loop detection result according to the image similarity.

2. The loop closure detection method integrating semantic information according to claim 1, characterized in that: According to the target detection algorithm, the static semantic feature vector of the image sequence to be detected is obtained, including: Identify static and dynamic target frames in the image sequence to be detected by using a target detection algorithm, and obtain semantic information of each target frame, wherein the semantic information includes category, upper left corner and lower right corner coordinates; The obtained semantic information is converted into vector form, the dynamic target frame information is removed, and the remaining static target frame information is retained; Determine the number of categories k and the number of instances s of each category in the retained static target box information, wherein the number of categories k is determined according to the relevance of the category to the current scene, and the number of instances s is determined by the correlation coefficient and the probability distribution function; Assign a weight to each of the determined categories, sort the k categories from high to low according to the weight value, and sort the s instances in each category from high to low according to the confidence; According to the sorted categories and instances, the coordinate difference of the center point of the target box is calculated, and the edge vector is generated according to the coordinate difference, and the set of edge vectors is used as the static semantic feature vector.

3. The loop closure detection method integrating semantic information according to claim 2, characterized in that: Determine the semantic feature similarity based on the static semantic feature vector, including: Obtain the vocabulary vector of the static target box information according to the bag-of-words model, calculate the similarity between the vocabulary vectors, and obtain the first similarity; Performing rotation normalization and scale normalization on the static semantic feature vector to obtain an intermediate feature vector, and performing similarity calculation on the intermediate feature vector to obtain a second similarity; The first similarity and the second similarity are normalized and fused to obtain the semantic feature similarity.

4. The loop closure detection method integrating semantic information according to claim 1, characterized in that: According to the bag-of-words model, the static bag-of-words vector of the image sequence to be detected is obtained, including: Extract feature points from the image sequence to be detected, remove the feature points in the dynamic area, and obtain static feature points; Cluster static feature points to generate static visual words, and build a bag dictionary based on the static visual words; The image sequence to be detected is represented by a bag of words according to the static visual words in the constructed dictionary to obtain a static bag of words vector.

5. The loop closure detection method integrating semantic information according to claim 4 is characterized in that: The bag-of-words feature similarity is obtained based on the static bag-of-words vector, including: The prior similarity S between the first frame and the second frame image is calculated according to the static word bag vector, and the similarities between other frame images are normalized after being calculated with reference to the prior similarity S to obtain the normalized image similarity; The normalized image similarity is calculated using the L2 norm or cosine similarity to obtain the bag-of-words feature similarity.

6. A loop detection system integrating semantic information, characterized in that: include: Acquisition module: used to acquire the image sequence to be detected; Detection module: used to input the image sequence to be detected into a pre-trained loop detection model to obtain loop detection results; The loop detection model includes a first similarity acquisition module, a second similarity acquisition module, a similarity fusion module and a judgment module, wherein the first similarity acquisition module is used to obtain a static semantic feature vector of an image sequence to be detected according to a target detection algorithm, so as to determine the semantic feature similarity according to the static semantic feature vector; the second similarity acquisition module is used to obtain a static bag-of-words vector of an image sequence to be detected according to a bag-of-words model, and obtain the feature similarity according to the static bag-of-words vector; the similarity fusion module is used to normalize the semantic similarity and the feature similarity respectively and then fuse them to obtain the image similarity; the judgment module is used to determine the loop detection result according to the image similarity.

7. A computer device, characterized in that: including processor and storage medium; The storage medium is used to store instructions; The processor is used to operate according to the instructions to execute the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 5 are implemented.

Citation Information

Cited By

  • ATS-oriented semantic-driven single-image-based 3D multi-target detection method

    CN120107845A