A closed-loop detection system and method based on multi-scale feature fusion
The closed-loop detection method through multi-scale feature fusion and multi-dimensional similarity measurement solves the problems of poor robustness and transferability in the existing technology, achieves high accuracy and efficient closed-loop detection in different scenarios, and improves the SLAM system. positioning and mapping effects.
Patent Information
- Application Number
- CN202111324371.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-10
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-11-10
AI Technical Summary
The existing bag-of-words-based closed-loop detection method has flaws in robustness, transferability and efficiency. It is difficult to adapt to scenes with camera angles, illumination changes and obstructions. The feature extraction and matching process is complex and time-consuming, which limits the Its efficient migration and real-time performance between different scenarios.
A closed-loop detection method using multi-scale feature fusion is used to extract high-level and global features in the image through basic feature extraction, multi-scale feature extraction-fusion and multi-dimensional similarity measurement. L2 norm and attention mechanism are used for similarity measurement to improve Detection accuracy and robustness.
It achieves effective migration between different scenes and high-accuracy closed-loop detection, can effectively correct the robot's posture, build a global consistency map, and improve the positioning and mapping effects of the SLAM system.
Smart Images

Figure CN114140524B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of robot navigation, and relates to closed-loop detection in robot navigation, and in particular to a closed-loop detection technology based on multi-scale feature fusion. Background Art
[0002] Loop closure detection has become a key issue and research hotspot in the field of mobile robot navigation, especially in simultaneous localization and mapping (SLAM), because it can reduce the cumulative error of robot pose estimation and build a global consistency map, which is particularly important for autonomous robot positioning, mapping, navigation and obstacle avoidance in large scenes. Correct loop closure detection can add edge constraints to the pose graph to help further optimize the robot motion estimation and build a consistency map. Incorrect loop closure detection will lead to map construction failure. Therefore, a good loop closure detection algorithm is crucial for the consistency map and even the entire SLAM system.
[0003] Vision-based loop closure detection, also known as visual relocalization, refers to the use of images provided by visual sensors to identify previously visited locations during navigation. In recent years, scholars have conducted a lot of research on vision-based loop closure detection algorithms. Traditional algorithms can be roughly divided into two categories: bag-of-words (BoW)-based methods and global descriptor-based methods.
[0004] At present, the bag-of-words-based method is the mainstream method for closed-loop detection, which refers to extracting local features from scene images and clustering them into multiple "words"; then, based on these "words", the entire image is described in the form of a vector. Therefore, the visual closed-loop detection problem is converted into a similarity measurement problem of the description vectors of two images. The key problem of the bag-of-words-based method is how to select local features of the image. Common feature point extraction algorithms include SIFT, SURF, and ORB. Rosten E et al. disclosed a feature point extraction method for high-speed corner detection. First, FAST key points were extracted, and then the descriptors were calculated using Brief (Rosten E, Drummond T. Machine learning for high-speed corner detection [C] / / European conference on computer vision. Springer, Berlin, Heidelberg, 2006: 430-443). For general situations, the images described by the bag-of-words model can be compared one-to-one by histogram or Hamming distance, and when the distance is less than a certain threshold, the closed loop is confirmed to be detected. Although the bag-of-words model method has achieved great success, it also has many defects:
[0005] ① Poor robustness, unable to adapt to scenes with large changes in camera angle, light intensity, and obstacles. This is because the descriptors used in the bag-of-words model, such as SIFT, SURF, and ORB, can only extract local features of the image, not global features, and can only indicate the presence or absence of a certain feature, but cannot describe the relative position relationship between features. Therefore, it is difficult to have high robustness.
[0006] ② Poor transferability. The dictionary needs to be manually built in advance, and the built dictionary is extremely related to the specific environment. A method that works well in one scenario is difficult to achieve the same effect in other scenarios. Therefore, it is difficult to expand the model between different scenarios.
[0007] ③ Low efficiency, complex feature extraction and matching processes, and it takes a lot of time to extract features from images and construct feature vectors, which is not conducive to certain SLAM systems with high requirements for real-time performance; this is because the traditional closed-loop detection method includes a series of processes such as image preprocessing, feature extraction, external point screening, and establishment of feature vectors, which is time-consuming and has high performance requirements on the computing platform. It is difficult for the algorithm to run in real time on embedded devices.
[0008] Zhang Yunzhou et al. published a visual SLAM loop detection based on stacked convolutional autoencoders, which used an autoencoder to extract image features and used a similarity measurement matrix to detect loop closures, which has high accuracy on public datasets (Zhang Yunzhou, Hu Hang, Qin Cao, Chu Hao, Wu Yunxing. Visual SLAM loop detection based on stacked convolutional autoencoders [J]. Control and Decision, 2019, 34(05): 981-988).
[0009] However, neither the traditional closed-loop detection method based on the bag-of-words model nor the closed-loop detection method based on deep learning considers the multi-scale nature of features. They only extract features at one scale, which not only affects the closed-loop detection effect, but also further limits its generalization ability. It is still difficult to achieve effective migration of training models between different scenarios. Summary of the invention
[0010] In view of the problems of poor robustness and poor transferability of the current closed-loop detection methods suitable for robot navigation, a closed-loop detection method based on multi-scale feature fusion is provided. By utilizing multi-scale features and a single feature similarity measurement, high-level, abstract and global features contained in the image can be extracted. Through multi-dimensional feature similarity measurement, the accuracy and robustness of visual closed-loop detection can be improved.
[0011] The inventive idea of the present invention is to determine whether two moments are in the same position based on the similarity between the currently captured image and the earlier captured image. Therefore, the present invention has paired inputs corresponding to two branches, such as Figure 1As shown. The present invention is divided into three layers: basic feature extraction, multi-scale feature extraction-fusion and multi-dimensional similarity measurement. The basic feature extraction layer extracts the basic features of the input image. The multi-scale feature extraction-fusion layer performs multi-scale re-extraction and fusion on the extracted basic features to obtain the abstract features of the image. The multi-dimensional similarity measurement layer uses a multi-dimensional similarity measurement method to determine whether the two input images form a closed loop. The two branches are identical in the structure of the basic feature extraction layer and the feature fusion layer.
[0012] Based on the above-mentioned inventive concept, the closed-loop detection system of multi-scale feature fusion provided by the present invention comprises a basic feature extraction module and a multi-scale feature extraction-fusion module for processing similarity images to be matched composed of a current collected image and any image collected in the past, respectively, and a multi-dimensional similarity measurement module for obtaining similarity scores of images to be matched;
[0013] The basic feature extraction module has the same structure and is used to extract basic features of images to be matched for similarity;
[0014] The multi-scale feature extraction-fusion module is located behind the basic feature extraction module and is used to further perform multi-scale feature extraction on the extracted basic features and fuse them to obtain high-level features of similar images to be matched;
[0015] The multidimensional similarity measurement module is used to obtain the spatial similarity vector of each column of the high-level features of the similarity images to be matched, the channel similarity vector of each row, and the global similarity score, and obtain the final similarity score through full connection processing based on the spatial similarity vector, channel similarity vector and global similarity score.
[0016] The above-mentioned basic feature extraction module can adopt conventional CNN (Convolutional Neural Networks), and the present invention adopts VGG (Simonyan K, Zisserman A. Very deep convolutional networks for large-scale image recognition [J]. arXiv preprint arXiv: 1409.1556, 2014.). Compared with the early CNN, VGG uses a deeper network model to obtain features. It also adds modules such as ReLU activation function, local response regularization (LRN), Dropout, etc., which can reduce the risk of overfitting. In addition, its pre-training weights on multiple large data sets are disclosed on the Internet. In view of these advantages, the present invention adopts the output of the 5th pooling layer of the VGG-16 model as the image feature expression output by the basic feature extraction module, and abandons the subsequent fully connected layer.
[0017] The multi-scale feature extraction-fusion module includes a feature re-extraction unit, a multi-scale feature extraction unit, a conversion unit, and a reconstruction unit; the feature re-extraction unit is used to further extract features and reduce channel dimensions of the extracted basic features; the multi-scale feature extraction unit includes a plurality of feature operation blocks of different scales set in parallel and a first cascade layer, each feature operation block performs feature extraction of different scale receptive fields on the output of the feature re-extraction unit, and the output of each feature operation block is cascaded in the channel dimension using the first cascade layer; the conversion unit is used to reduce the channel dimension of the output result of the multi-scale feature extraction unit; the reconstruction unit includes a plurality of pooling layers of different scales set in parallel and a second cascade layer, each pooling layer performs different scale pooling operations on the output features of the conversion unit, and the output features of each pooling layer are cascaded in the spatial dimension using the second cascade layer to obtain high-level features. The feature re-extraction unit can be composed of more than one convolutional layer. When it contains more than two convolutional layers, the convolutional layers can be set in sequence; the number of filters in the convolutional layer is 64-256. The multi-scale feature extraction unit includes 3-6 feature operation blocks; the feature operation block is composed of a pooling layer and / or one or more convolutional layers; when more than two convolutional layers are included, the convolutional layers can be set in sequence; the number of filters in the convolutional layer is 64-128. Multiple feature operation block branch outputs are cascaded through the first cascade layer to form high-dimensional features. In order to simplify the high-dimensional features after cascading to reduce the amount of calculation, the present invention further uses a conversion unit to reduce the number of high-dimensional feature channels after cascading; the conversion unit can be implemented by a convolutional layer with a filter number of 64-256. Then, the output features of the conversion unit are respectively pooled through multiple parallel pooling layers of different scales to realize the spatial pyramid (SPP) operation and further refine the most critical information in the features. Finally, the output features of each pooling layer are cascaded in the spatial dimension through the second cascade layer to reconstruct high-level features for similarity judgment.
[0018] The multidimensional similarity measurement module includes a spatial similarity measurement unit, a channel similarity measurement unit, a global similarity measurement unit, a third cascade layer and a fully connected layer; the spatial similarity measurement unit performs similarity analysis on the corresponding columns of the high-level features of the two images to be matched, obtains the spatial similarity vector of the two image features to be matched on each channel, and compresses the spatial similarity vector; the channel similarity measurement unit performs similarity analysis on the corresponding rows of the high-level features of the two images to be matched, obtains the channel similarity vector of the two image features to be matched in each row, and compresses the channel similarity vector; the global similarity measurement unit performs similarity analysis on the high-level features of the two images to be matched, and obtains the global similarity score of the two image features to be matched; the third cascade layer concatenates the compressed spatial similarity vector, the compressed channel similarity vector and the global similarity score in the channel dimension to obtain the final similarity vector, and generates the final similarity score through the fully connected layer. The closed-loop detection method based on deep learning usually maps the image to an N-dimensional vector, and then measures the similarity of the two vectors by L1 norm, L2 norm or cosine distance. However, these methods have serious disadvantages. The output of the CNN convolutional layer is a three-dimensional feature map containing multiple channels, which not only contains the spatial information of the first two dimensions, but also contains the channel information of the third dimension. If the three-dimensional feature map is simply simplified to a one-dimensional vector and then the similarity is judged, the spatial information and channel information contained in the feature map will be lost. In order to solve this problem, the present invention proposes a multidimensional similarity measurement method that combines spatial similarity, channel similarity and global similarity using a multidimensional similarity measurement module. In the present invention, the L2 norm is used to measure the similarity of two features.
[0019] The expression of L2 norm is as follows:
[0020]
[0021] Among them, x 1i and x 2i Represent the i-th element of two N-dimensional vectors respectively.
[0022] The purpose of convolution and pooling operations is to improve perception, which extracts multi-scale information in the spatial dimension and performs feature fusion in the channel dimension. However, convolution and pooling fuse all channels in the input feature map with the same weight, and cannot distinguish the importance of each channel. In order to solve this problem, the present invention introduces an attention mechanism before the multidimensional similarity measurement module performs feature similarity measurement. The attention mechanism here includes two attention units with the same structure, which respectively perform channel selection on the high-level features of the two images to be matched, so that the model can pay more attention to the channels with large information content, while suppressing the information of those unimportant channels.
[0023] The spatial similarity measurement unit is used to obtain the spatial similarity of two features, including a spatial similarity calculation subunit and a first compression subunit composed of a one-dimensional convolution layer and a global average pooling layer; the specific operation is: first, the spatial similarity calculation subunit uses the L2 norm to perform similarity analysis on the corresponding columns of the high-level features of the two images to be matched, and obtains the spatial similarity vector of the two image features to be matched on each channel; then, the spatial similarity vector is compressed using the one-dimensional convolution layer and the global pooling layer set in sequence. The channel similarity measurement unit has similar operations to the spatial similarity measurement unit, including a channel similarity calculation subunit and a second compression subunit composed of a one-dimensional convolution layer and a global average pooling layer; the specific operation is: first, the channel similarity calculation subunit uses the L2 norm to perform similarity analysis on the corresponding rows of the high-level features of the two images to be matched, and obtains the channel similarity vector of the two image features to be matched in each row; then, the channel similarity vector is compressed using the one-dimensional convolution layer and the global average pooling layer set in sequence. The global similarity measurement unit uses the L2 norm to directly perform similarity analysis on the high-level features of the two images to be matched, and obtains an L2 norm similarity score of the original features. Finally, the compressed spatial similarity vector, the compressed channel similarity vector and the global similarity score are cascaded through the third cascade layer to form the final similarity vector, and the final similarity score is formed through the fully connected layer. Based on the final similarity score, it can be determined whether the two images to be matched are from the same location.
[0024] The convolution operation of each convolutional layer used in the above multi-scale feature extraction-fusion module and multi-dimensional similarity measurement module is followed by a Dropout operation, a BatchNormalization operation, and a LeakRelu activation function.
[0025] The present invention further provides a closed-loop detection method based on multi-scale feature fusion, which uses the closed-loop detection system based on multi-scale feature fusion given above and operates according to the following steps:
[0026] S1 extracts basic features from the similarity images to be matched composed of the robot's current collected image and any image collected in the past;
[0027] S2 processes the basic features corresponding to the similar images to be matched respectively to obtain the corresponding high-level features;
[0028] S3 obtains the spatial similarity vector of each column of the high-level features of the similarity to be matched images, the channel similarity vector of each row, and the global similarity score, and obtains the final similarity score through full connection processing based on the spatial similarity vector, the channel similarity vector, and the global similarity score;
[0029] S4 determines whether the robot has completed the closed-loop detection based on the final similarity score.
[0030] In the above step S2, the steps for processing the basic features are as follows:
[0031] S21 performs further feature extraction and channel dimension reduction on the extracted basic features;
[0032] S22 performs feature extraction of receptive fields of different scales on the features extracted in step S21, and cascades the extraction results in the channel dimension;
[0033] S23 performs channel dimension reduction on the result obtained in step S22;
[0034] S24 performs pooling operations of different scales on the output features obtained in step S23, and cascades the obtained results in the spatial dimension to obtain high-level features.
[0035] The above step S3 specifically includes the following sub-steps:
[0036] S31 performs similarity analysis on the corresponding columns of the high-level features of the two images to be matched, obtains the spatial similarity vector of the two image features to be matched in each channel, and compresses the spatial similarity vector;
[0037] S32 performs similarity analysis on the corresponding rows of the high-level features of the two images to be matched, obtains the channel similarity vectors of the two image features to be matched in each row, and compresses the channel similarity vectors;
[0038] S33 performs similarity analysis on the high-level features of the two images to be matched, and obtains a global similarity score of the features of the two images to be matched;
[0039] S34 concatenates the compressed spatial similarity vector, the compressed channel similarity vector and the global similarity score in the channel dimension to obtain a final similarity vector, and generates a final similarity score through full connection processing.
[0040] In step S31, the L2 norm is used to perform similarity analysis on the corresponding columns of the high-level features of the two images to be matched, and the spatial similarity vector of the two image features to be matched in each channel is obtained; then the spatial similarity vector is compressed through convolution operation and global pooling in turn.
[0041] In step S32, the L2 norm is used to perform similarity analysis on the corresponding rows of the high-level features of the two images to be matched, and the channel similarity vectors of the two image features to be matched in each row are obtained; then, the channel similarity vectors are compressed through convolution operations and global pooling in sequence.
[0042] In step S33, the L2 norm is used to directly perform similarity analysis on the high-level features of the two images to be matched, and an L2 norm similarity score of the original feature is obtained.
[0043] In the above step S4, whether the current image collected by the robot and any image collected in the past are closed loops is determined based on the final similarity score; and then whether the robot has reached a place it has reached before is determined to complete the closed loop detection.
[0044] The closed-loop detection system and method for multi-scale feature fusion provided by the present invention have the following beneficial effects:
[0045] 1) The present invention takes into account the different receptive field information of the image and the different dimensional information of the features, and uses the basic feature extraction module, the multi-scale feature extraction-fusion module and the multi-dimensional similarity measurement module to construct a unified end-to-end network system. Compared with the strategy of separating feature extraction and similarity measurement in the traditional method, the present invention can directly output the closed-loop detection result, and at the same time has a high accuracy and a high recall rate. It can effectively correct the estimated posture of the robot in the SLAM system, assist the robot in repositioning when the posture is lost, correct the robot's trajectory cumulative error that increases over time, and construct a global consistency map, so that the robot can obtain more accurate positioning and better mapping effect.
[0046] 2) Different from the traditional method based on a single scale, in order to maximize the use of rich information in the image, the present invention proposes a multi-scale feature extraction-fusion strategy that can utilize the information of different receptive fields of the image, including the use of feature operation blocks of different scales and pooling layers of different scales. Feature operation blocks of different scales can extract high-level features of different receptive fields in the image, and pooling layers of different scales can further refine the most critical information in the features.
[0047] 3) Different from the single-dimensional similarity measurement method in traditional methods, the present invention takes into account the geometric characteristics of features and designs a multi-dimensional similarity measurement module that combines spatial similarity and channel similarity to more comprehensively evaluate the similarity of images. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a principle block diagram of the closed-loop detection system of multi-scale feature fusion of the present invention.
[0049] Figure 2 Schematic diagram of the VGG-16 network structure.
[0050] Figure 3 Schematic diagram of the multi-scale feature extraction and fusion module structure.
[0051] Figure 4 Schematic diagram of the principle of spatial similarity measurement unit.
[0052] Figure 5 Schematic diagram of the similarity calculation principle in three dimensions.
[0053] Figure 6 This is a schematic diagram of the attention mechanism.
[0054] Figure 7 These are some samples from the KITTI dataset.
[0055] Figure 8 Some samples of TUM dataset.
[0056] Fig. 9 The true pose 3D view (a) and closed-loop true value binarization matrix (b) of the KITTI dataset 00 sequence.
[0057] Fig.10 Similarity matrices obtained by closed-loop tests of different methods for the KITTI dataset 05 sequence; among them, (a) corresponds to the closed-loop true value binarization matrix, (b) corresponds to the similarity matrix obtained by the FabMap2.0 test, (c) is the similarity matrix obtained by the VGG-16 test, (d) is the similarity matrix obtained by the closed-loop detection method based on the autoencoder test, and (e) is the similarity matrix obtained by the test of the method of the present invention.
[0058] Fig.11 PR curves obtained by closed-loop testing of different methods for the KITTI dataset (02, 05 sequences) and the TUM dataset (fr3_office); (a) corresponds to the KITTI02 sequence, (b) corresponds to the KITTI05 sequence, and (c) corresponds to TUM fr3_office. DETAILED DESCRIPTION
[0059] Example 1
[0060] The closed-loop detection system of multi-scale feature fusion provided in this embodiment is as follows: Figure 1 As shown, it includes a basic feature extraction module and a multi-scale feature extraction-fusion module for processing similarity images to be matched composed of a current collected image and any image collected in the past, and a multi-dimensional similarity measurement module for obtaining similarity scores of the images to be matched. In this embodiment, in order to improve the detection efficiency, two basic feature extraction modules with the same structure and two multi-scale feature extraction-fusion modules with the same structure are respectively set.
[0061] like Figure 2As shown, in this embodiment, both basic feature modules use the VGG-16 model, and the output of the 5th pooling layer of the VGG-16 model is used as the feature expression of the image, while the subsequent fully connected layer is discarded. For the specific network structure of the VGG-16 model, see Simonyan K, Zisserman A. Very deep convolutional networks for large-scale image recognition [J]. arXiv preprint arXiv: 1409.1556, 2014. Considering that the Places365-Standard dataset has rich multi-scene images, the VGG-16 network weights trained on it are finally selected as pre-training weights and remain unchanged.
[0062] The multi-scale feature extraction-fusion module is located behind the basic feature extraction module, and is used to further perform multi-scale feature extraction on the extracted basic features and fuse them to obtain high-level features of similar images to be matched. Figure 3As shown, the multi-scale feature extraction-fusion module includes a feature re-extraction unit, a multi-scale feature extraction unit, a conversion unit, and a reconstruction unit. The feature re-extraction unit is used to further extract features and reduce channel dimensions of the extracted basic features; in this embodiment, the feature re-extraction unit is composed of two consecutive convolutional layers a and b; the kernel size of convolutional layer a is c1×c1 (c1=1), and the number of filters is f1=128; the kernel size of convolutional layer b is c2×c2 (c2=3), and the number of filters is f2=64. The multi-scale feature extraction unit includes a plurality of feature operation blocks and a first cascade layer with different structures and the same channel dimensions arranged in parallel; in this embodiment, the multi-scale feature extraction unit includes five feature operation blocks (feature operation block a-feature operation block e), feature operation block a is composed of a convolution layer c (kernel size is c1×c1, the number of filters is f3=64), feature operation block b is composed of a convolution layer c and a convolution layer d (kernel size is c2×c2, the number of filters is f3=64) arranged in sequence, and feature operation block c is composed of a convolution layer c and three convolution layers d arranged in sequence. The feature operation block d is composed of a convolution layer c and two convolution layers d arranged in sequence, and the feature operation block e is composed of a pooling layer a of size p1×p1 (p1=2); each feature operation block performs operations of different scales on the features extracted by the feature re-extraction unit, and uses the first cascade layer to cascade the outputs of the four convolution branches and the pooling branches in the channel dimension to form a high-dimensional feature of shape H×W×5f3 (H×W×320 in this embodiment) (H and W are the height and width of the features of each channel, which vary with the size of the input image; 320 is the number of channels). The conversion unit is used to perform channel dimensionality reduction on the output results of the multi-scale feature extraction unit; the conversion unit is composed of a convolution layer e (kernel size is c1×c1, the number of filters is M=128), and the convolution layer e performs convolution operations on the features after cascading the first cascade layer. The reconstruction unit includes multiple pooling layers of different scales arranged in parallel and a second cascade layer; in this embodiment, the reconstruction unit includes three pooling layers (pooling layer b-pooling layer d), the size of pooling layer b is p2×p2 (p2=2), the size of pooling layer c is p3×p3 (p3=4), and the size of pooling layer c is p4×p4 (p4=8), each pooling layer performs pooling operations on the output features of the conversion unit respectively, and uses the second cascade layer to cascade the output features of the three pooling layers in the spatial dimension (after cascading, N=N1+N2+N3, N1, N2 and N3 respectively represent the spatial dimensions of the reconstructed features output by each pooling layer) to obtain high-level features (i.e., feature 1 and feature 2).
[0063] The multidimensional similarity measurement module includes two attention units with the same structure, a spatial similarity measurement unit, a channel similarity measurement unit, a global similarity measurement unit, a third cascade layer and a fully connected layer. In this embodiment, the two attention units use a multiplicative attention mechanism to extract channels from feature 1 and feature 2, respectively, so that the model can pay more attention to channels with large amounts of information while suppressing the information of unimportant channels; Figure 6 As shown in , the attention unit first processes the input high-level features using the global average pooling layer, LeakRelu activation function and Sigmoid function in sequence, and then multiplies the processing result with the high-level features of the original input, and the result is further added to the high-level features of the original input to complete the channel extraction of the high-level features of the input. The spatial similarity measurement unit is used to obtain the spatial similarity of two features, including a spatial similarity calculation subunit and a first compression subunit consisting of a one-dimensional convolutional layer f (kernel size is 1, the number of filters is k=4) and a global average pooling layer; as shown in Figure 4 As shown, the spatial similarity calculation subunit performs similarity analysis on the corresponding columns of the two high-level features processed by the attention unit (for example, each column of feature 1 and feature 2 is an N-dimensional vector, the first column of feature 1 and feature 2 is compared with the first column of feature 2, the second column of feature 1 is compared with the second column of feature 2, and so on) according to formula (1). Each pair of N-dimensional vectors will obtain a similarity score between 0 and 1, so for all columns, an M×1 (M=128 in this embodiment) spatial similarity vector will be obtained, representing the spatial similarity of the two features in each channel; then, the M-dimensional spatial similarity vector is compressed using a one-dimensional convolutional layer and a global pooling layer that are set in sequence to obtain a k×1 compressed spatial similarity vector. The channel similarity measurement unit operates similarly to the spatial similarity measurement unit, including a channel similarity calculation subunit and a second compression subunit composed of a one-dimensional convolution layer f and a global average pooling layer. The channel similarity calculation subunit uses the L2 norm to perform similarity analysis on the corresponding rows of the two high-level features processed by the attention unit according to formula (1) to obtain the channel similarity vectors of the two features in each row; then, the channel similarity vector is compressed using the one-dimensional convolution layer and the global pooling layer set in sequence to obtain a k×1 compressed channel similarity vector. The global similarity measurement unit directly performs similarity analysis on the two high-level features processed by the attention unit according to formula (1) using the L2 norm to obtain an L2 norm similarity score of the original feature. Finally, as Figure 5As shown, the compressed spatial similarity vector, the compressed channel similarity vector and the global similarity score are cascaded through the third cascade layer to form a (2k+1)×1 final similarity vector, and the final similarity score is formed through the fully connected layer. According to the final similarity score, it can be determined whether the two images are from the same location.
[0064] The convolution operation of each convolutional layer used by the above multi-scale feature extraction-fusion module and the multi-dimensional similarity measurement module is followed by a Dropout operation with a ratio of 0.1, a BatchNormalization operation, and an activation function of LeakRelu with α=0.2 (α is the slope of the activation function when the input is negative).
[0065] Application Examples
[0066] In order to verify the effectiveness of the present invention for closed-loop detection of robot movement, this application example conducted experiments on two public datasets of different scene scales, and compared the present invention method with FabMap2.0, VGG-16, and closed-loop detection methods based on autoencoders under multiple evaluation indicators. The experiment used an Intel Core i10 processor with a main frequency of 2.8GHz and an NVIDIA GeForce GTX 2080Ti graphics card.
[0067] (I) Dataset
[0068] 1. The KITTI dataset of large-scale scenes collected by a car-mounted stereo camera is used (paper: Fritsch J, Kuehnl T, Geiger AA new performance measure and evaluation benchmark for road detection algorithms [C] / / 16th International IEEE Conference on Intelligent Transportation Systems (ITSC2013). IEEE, 2013: 1693-1700. Website: http: / / www.cvlibs.net / datasets / kitti / eval_odometry.php). The KITTI dataset consists of 22 stereo sequences. Samples of some datasets are as follows: Figure 7 As shown. The left eye images of the sequence 00, 01, 02, 03, 04, 05, 06, 07, 09 containing real odometer information are selected for the experiment. This application example uses the samples in the KITTI dataset to form sample pairs to construct the training set and test set. The training set uses the sequence 00, 01, 03, 04, 06, 07, 09, and the test set uses the sequence 02, 05.
[0069] 2. In order to verify the transferability of the algorithm, experiments were conducted on the TUM dataset collected from small-scale indoor scenes (paper: Schubert D, Goll T, Demmel N, et al. The TUM VI benchmark for evaluating visual-inertial odometry [C] / / 2018 IEEE / RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2018: 1680-1687. Website: https: / / vision.in.tum.de / data / datasets:). Some images of the TUM dataset are shown below. Figure 8 As shown in the figure. This application example uses samples in the TUM dataset to form sample pairs to construct training and test sets. The training set uses the fr1_room, fr2_pioneer_slam, fr2_poineer_slam2, and fr2_rpy sequences, and the test set uses the fr3_office sequence.
[0070] In order to train the network in a supervised manner, labels of the training data must be provided to indicate whether two images are closed loops. However, since the KITTI dataset and the TUM dataset only provide odometry information for each image, closed loop labels must be manually marked. The label value marking strategy for this application example is shown in formula (2).
[0071]
[0072] Through the odometer information, the pose matrix T, T of each frame image can be constructed i 、T j Represent the pose matrices of the i-th frame image and the j-th frame image respectively. Functions trans(·) and angle(·) represent the translation and rotation parts of the pose transformation matrix respectively. When the translation component of the camera pose does not exceed t1 meters and the rotation component does not exceed t2 degrees, the two images are considered closed loops. For the KITTI dataset, t1 and t2 are 6 and 15 respectively. For the TUM dataset, t1 and t2 are 1 and 0.3 respectively. Fig. 9 The real pose 3D view and closed loop ground truth binary matrix of the KITTI dataset 00 sequence are shown (i.e., if the two images are closed loops, the value is 1; if the two images are not closed loops, the value is 0). In (a), the circle represents each keyframe, and the keyframe corresponding to the intersection of the trajectory represents a closed loop. In (b), the dimension of the matrix is the number of images in the dataset. The 1 in the matrix indicates that the two frames with the corresponding coordinates are closed loops, and zero indicates non-closed loops.
[0073] (II) Closed-loop detection system training with multi-scale feature fusion
[0074] In this application example, for the KITTI dataset and the TUM dataset, the corresponding training sets are used to train the corresponding multi-scale feature fusion closed-loop detection system according to the method given below.
[0075] The closed-loop detection system with multi-scale feature fusion mentioned above first uses the He Normal method to initialize the trainable weights other than the basic feature extraction module, and then performs training according to the following training steps:
[0076] S1′ uses the basic feature extraction module to extract basic features from the two images of the sample pair in the training set;
[0077] S2′ uses a multi-scale feature extraction-fusion module to process the basic features of the two images of the sample pair respectively to obtain the corresponding high-level features; the steps for processing the basic features are as follows:
[0078] S21′ uses a feature re-extraction unit to further extract features and reduce channel dimensions on the extracted basic features;
[0079] S22′ uses a plurality of feature operation blocks of different scales arranged in parallel to operate on the features extracted by the feature re-extraction unit, and uses the first cascade layer to cascade the outputs of each feature operation block in the channel dimension;
[0080] S23′ uses the conversion unit to perform channel dimension reduction on the result output by the first cascade layer;
[0081] S24′ uses the multiple pooling layers set in parallel by the reconstruction unit to perform pooling operation on the output features of the conversion unit, and then uses the second cascade layer to cascade the output features of each pooling layer in the spatial dimension to obtain high-level features;
[0082] S3′ obtains the similarity scores of the two images based on the high-level features corresponding to the samples, which specifically includes the following sub-steps:
[0083] S31′ uses a spatial similarity measurement unit to perform similarity analysis on the corresponding columns of the two high-level features processed by the attention unit, obtains a spatial similarity vector of the two features on each channel, and compresses the spatial similarity vector;
[0084] S32′ uses the channel similarity measurement unit to perform similarity analysis on the corresponding rows of the two high-level features processed by the attention unit, obtains the channel similarity vectors of the two features in each row, and compresses the channel similarity vectors;
[0085] S33′ uses a global similarity measurement unit to perform similarity analysis on the two high-level features processed by the attention unit to obtain a global similarity score of the two features;
[0086] S34′ uses the third cascade layer to concatenate the compressed spatial similarity vector, the compressed channel similarity vector and the global similarity score in the channel dimension to obtain a final similarity vector, and generates a final similarity score through a fully connected layer;
[0087] S4′ calculates the loss value according to the following formula based on the final similarity score and the corresponding closed-loop label in the training set:
[0088]
[0089] in,
[0090]
[0091] represents the closed-loop true value label of the lth pair of input training sample pairs, represents the final similarity score of the lth pair of input training samples, and d represents the distance between the two samples (with the similarity score y pred On the contrary), m is the set threshold, 0.2 is selected here, and L is the number of sample pairs input into the system during the training process.
[0092] S5′ optimizes the system parameters according to the loss value.
[0093] This embodiment uses a back propagation algorithm to update system parameters (here, the system parameters include the weights of other trainable convolutional layers and fully connected layers except the basic feature extraction module), and specifically uses the stochastic gradient descent method (SGD) to optimize the system parameters (Ruder S. An overview of gradient descent optimization algorithms [J]. arXiv preprint arXiv: 1609.04747, 2016.).
[0094] Repeat the above steps S1 ′-S5 ′ to continuously reduce the system loss value until the closed-loop detection system performance converges to a good and stable level (ie, the loss value tends to be stable).
[0095] (III) Closed-loop detection system test of multi-scale feature fusion
[0096] Use the trained multi-scale feature fusion closed-loop detection system to test the sample pairs in the corresponding test sets of the KITTI dataset and the TUM dataset according to the following steps:
[0097] S1 uses the basic feature extraction module to extract basic features from the two to-be-matched images of the sample pair in the test set;
[0098] S2 uses a multi-scale feature extraction-fusion module to process the basic features corresponding to the two images to be matched respectively to obtain the corresponding high-level features; the steps for processing the basic features are as follows:
[0099] S21 uses the feature re-extraction unit to further extract the basic features and perform channel dimension reduction;
[0100] S22 uses a plurality of feature operation blocks of different scales arranged in parallel to operate on the features extracted by the feature re-extraction unit, and uses the first cascade layer to cascade the outputs of each feature operation block in the channel dimension;
[0101] S23 uses a conversion unit to perform channel dimension reduction on the output of the first cascade layer;
[0102] S24 uses the multiple pooling layers set in parallel by the reconstruction unit to perform pooling operation on the output features of the conversion unit, and uses the second cascade layer to cascade the output features of each pooling layer in the spatial dimension to obtain high-level features;
[0103] S3 obtains the similarity scores of the two images to be matched based on the high-level features corresponding to the two images, which specifically includes the following sub-steps:
[0104] S31 uses a spatial similarity measurement unit to perform similarity analysis on the corresponding columns of the two high-level features processed by the attention unit, obtains a spatial similarity vector of the two features on each channel, and compresses the spatial similarity vector;
[0105] S32 uses the channel similarity measurement unit to perform similarity analysis on the corresponding rows of the two high-level features processed by the attention unit, obtains the channel similarity vectors of the two features in each row, and compresses the channel similarity vectors;
[0106] S33 uses a global similarity measurement unit to perform similarity analysis on the two high-level features processed by the attention unit to obtain a global similarity score of the two features;
[0107] S34 uses the third cascade layer to concatenate the compressed spatial similarity vector, the compressed channel similarity vector and the global similarity score in the channel dimension to obtain the final similarity vector, and generates the final similarity score through the fully connected layer;
[0108] S4 uses the final similarity score as a closed-loop prediction.
[0109] Here, the final similarity score is used as the closed-loop prediction label value of the sample pair in the test set.
[0110] After training the network using the training set given above, the network is compared with the FabMap2.0 loop detection method (Cummins M, Newman P. FAB-MAP: Probabilistic localization and mapping in the space of appearance [J]. The International Journal of Robotics Research, 2008, 27 (6): 647-665.), the loop detection method based on autoencoder (Gao X, Zhang T. Unsupervised learning to detect loops using deep neural networks for visual SLAM system [J]. Autonomous robots, 2017, 41 (1): 1-18.) and the loop detection method that directly uses the VGG-16 convolution output to measure similarity through the L2 norm on the test set.
[0111] The verification indicators used in this application example are the most commonly used in the field of computer vision: similarity matrix and PR curve.
[0112] The similarity matrix results of different methods tested on the KITTI dataset 05 sequence are as follows: Fig.10 As shown, it can be seen from the results that compared with the similarity matrices of other methods, the similarity matrix of the method of the present invention is closer to the true value matrix. In the similarity matrix of the method of the present invention, there is a clear difference between black and white pixels, which means that the method can clearly distinguish between closed-loop images and non-closed-loop images. On the contrary, VGG-16 and the autoencoder have many pixels between black and white, and the image tends to be gray as a whole. This shows that the two can only recognize images with high similarity and have poor adaptability to subtle changes in image appearance. The similarity matrix of FabMap2.0 has a large number of omissions compared to other methods, with only some scattered line segments, indicating that the detection ability of the traditional closed-loop detection method based on the "bag of words model" is very weak, far inferior to the method based on deep learning.
[0113] The PR curve results of different methods in the KITTI dataset (02, 05 sequences) and TUM dataset (fr3_office) test dataset are as follows Fig.11As shown. A good algorithm needs to have both high precision and recall, so the PR curve should shift to the upper right. From the results, it can be seen that the deep learning-based VGG-16, autoencoder and the method of the present invention are significantly better than the traditional FabMap2.0 method based on the bag-of-words model. At the same time, compared with VGG-16 and autoencoder, the method of the present invention is also greatly improved.
[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit its protection scope. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that after reading the present invention, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the pending claims of the invention.
[0115] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0116] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. 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 device that provides the functions specified in a block or multiple blocks.
[0117] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0118] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit its protection scope. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that after reading the present invention, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the pending claims of the invention.
Claims
1. A closed-loop detection system with multi-scale feature fusion, characterized in that: include: A basic feature extraction module and a multi-scale feature extraction-fusion module for processing similar images to be matched composed of a current collected image and any image collected in the past, and a multi-dimensional similarity measurement module for obtaining similarity scores of images to be matched; A basic feature extraction module is used to extract basic features of images to be matched with similarity; Multi-scale feature extraction-fusion module, used to perform multi-scale feature extraction on the extracted basic features and fuse them to obtain high-level features of two similar images to be matched; The multidimensional similarity measurement module is used to obtain the spatial similarity vector of each column of the high-level features of the similarity images to be matched, the channel similarity vector of each row, and the global similarity score, and obtain the final similarity score through full connection processing based on the spatial similarity vector, channel similarity vector and global similarity score.
2. According to claim 1, the closed-loop detection system with multi-scale feature fusion is characterized in that The basic feature extraction module adopts VGG, and the output of the 5th pooling layer of the VGG-16 model is used as the output of the basic feature extraction module.
3. According to claim 1, the closed-loop detection system of multi-scale feature fusion is characterized in that The multi-scale feature extraction-fusion module includes a feature re-extraction unit, a multi-scale feature extraction unit, a conversion unit, and a reconstruction unit; the feature re-extraction unit is used to perform further feature extraction and channel dimension reduction on the extracted basic features; the multi-scale feature extraction unit includes a plurality of feature operation blocks of different scales arranged in parallel and a first cascade layer, each feature operation block performs feature extraction of different scale receptive fields on the output of the feature re-extraction unit, and the output of each feature operation block is cascaded in the channel dimension using the first cascade layer; the conversion unit is used to perform channel dimension reduction on the output result of the multi-scale feature extraction unit; the reconstruction unit includes a plurality of pooling layers of different scales arranged in parallel and a second cascade layer, each pooling layer performs different scale pooling operations on the output features of the conversion unit, and the output features of each pooling layer are cascaded in the spatial dimension using the second cascade layer to obtain high-level features.
4. The closed-loop detection system of multi-scale feature fusion according to claim 3, characterized in that The feature re-extraction unit can be composed of more than one convolutional layer. When it contains more than two convolutional layers, the convolutional layers can be set in sequence; the number of filters in the convolutional layer is 64-256; the multi-scale feature extraction unit includes 3-6 feature operation blocks; the feature operation block is composed of a pooling layer and / or one or more convolutional layers; when it contains more than two convolutional layers, the convolutional layers can be set in sequence; the number of filters in the convolutional layer is 64-128.
5. The closed-loop detection system of multi-scale feature fusion according to claim 1, characterized in that The multidimensional similarity measurement module includes a spatial similarity measurement unit, a channel similarity measurement unit, a global similarity measurement unit, a third cascade layer and a fully connected layer; the spatial similarity measurement unit performs similarity analysis on the corresponding columns of the high-level features of the two images to be matched, obtains the spatial similarity vector of the two image features to be matched on each channel, and compresses the spatial similarity vector; The channel similarity measurement unit performs similarity analysis on the corresponding rows of the high-level features of the two images to be matched, obtains the channel similarity vectors of the two image features to be matched in each row, and compresses the channel similarity vectors; The global similarity measurement unit performs similarity analysis on the high-level features of the two images to be matched to obtain a global similarity score of the features of the two images to be matched; the third cascade layer concatenates the compressed spatial similarity vector, the compressed channel similarity vector and the global similarity score in the channel dimension to obtain a final similarity vector, and generates a final similarity score through a fully connected layer.
6. The closed-loop detection system of multi-scale feature fusion according to claim 5, characterized in that the space The similarity measurement unit includes a spatial similarity calculation subunit and a first compression subunit composed of a one-dimensional convolution layer and a global average pooling layer; the specific operation is: first, the spatial similarity calculation subunit uses the L2 norm to perform similarity analysis on the corresponding columns of the high-level features of the two images to be matched, and obtains the spatial similarity vectors of the two image features to be matched on each channel; then, the spatial similarity vectors are compressed using the one-dimensional convolution layer and the global pooling layer set in sequence; the channel similarity measurement unit includes a channel similarity calculation subunit and a second compression subunit composed of a one-dimensional convolution layer and a global average pooling layer; the specific operation is: first, the channel similarity calculation subunit uses the L2 norm to perform similarity analysis on the corresponding rows of the high-level features of the two images to be matched, and obtains the channel similarity vectors of the two image features to be matched in each row; then, the channel similarity vectors are compressed using the one-dimensional convolution layer and the global pooling layer set in sequence; the global similarity measurement unit uses the L2 norm to directly perform similarity analysis on the two image features to be matched, and obtains an L2 norm similarity score of an original feature.
7. A closed loop detection method based on multi-scale feature fusion, characterized in that The following steps are involved: S1 extracts basic features from the similarity images to be matched composed of the robot's current collected image and any image collected in the past; S2 processes the basic features corresponding to the similar images to be matched respectively to obtain the corresponding high-level features; S3 obtains the spatial similarity vector of each column of the high-level features of the similarity to be matched images, the channel similarity vector of each row, and the global similarity score, and obtains the final similarity score through full connection processing based on the spatial similarity vector, the channel similarity vector, and the global similarity score; S4 determines whether the robot has completed the closed-loop detection based on the final similarity score.
8. The closed-loop detection method of multi-scale feature fusion according to claim 7, characterized in that In step S2, the steps for processing the basic features are as follows: S21 performs further feature extraction and channel dimension reduction on the extracted basic features; S22 performs feature extraction of receptive fields of different scales on the features extracted in step S21, and cascades the extraction results in the channel dimension; S23 performs channel dimension reduction on the result obtained in step S22; S24 performs pooling operations of different scales on the output features obtained in step S23, and cascades the obtained results in the spatial dimension to obtain high-level features.
9. The closed-loop detection method of multi-scale feature fusion according to claim 7, characterized in that Step S3 specifically includes the following sub-steps: S31 performs similarity analysis on the corresponding columns of the high-level features of the two images to be matched, obtains the spatial similarity vector of the two image features to be matched in each channel, and compresses the spatial similarity vector; S32 performs similarity analysis on the corresponding rows of the high-level features of the two images to be matched, obtains the channel similarity vectors of the two image features to be matched in each row, and compresses the channel similarity vectors; S33 performs similarity analysis on the high-level features of the two images to be matched, and obtains a global similarity score of the features of the two images to be matched; S34 concatenates the compressed spatial similarity vector, the compressed channel similarity vector and the global similarity score in the channel dimension to obtain a final similarity vector, and generates a final similarity score through full connection processing.
10. The closed-loop detection method of multi-scale feature fusion according to claim 9, characterized in that In step S31, the L2 norm is used to perform similarity analysis on the corresponding columns of the high-level features of the two images to be matched, and the spatial similarity vector of the two image features to be matched on each channel is obtained; then the spatial similarity vector is compressed by convolution operation and global pooling in sequence; In step S32, the L2 norm is used to perform similarity analysis on the corresponding rows of the high-level features of the two images to be matched, and the channel similarity vectors of the two image features to be matched in each row are obtained; then the channel similarity vectors are compressed by convolution operation and global pooling in sequence; In step S33, the L2 norm is used to directly perform similarity analysis on the high-level features of the two images to be matched, and an L2 norm similarity score of the original feature is obtained.
