A feature extraction method and device for selecting training samples based on multi-evidence fusion
By introducing a variety of image retrieval algorithms in the training phase of the feature extraction network to update negative sample points, the problems of poor feature extraction quality and large models are solved, the robustness and matching accuracy of feature extraction are improved, and more accurate features are achieved match.
Patent Information
- Application Number
- CN202310582786.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-22
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2043-05-22
AI Technical Summary
The existing technology has problems with poor feature extraction quality and large models during the feature extraction process, especially under time, day and night and seasonal changes, large viewing angle changes, and weak texture scenes, resulting in a decrease in positioning accuracy.
A feature extraction method based on multi-evidence fusion is used to select training samples. A variety of image retrieval algorithms are introduced in the training phase of the feature extraction network to determine anchor points, positive sample points and negative sample points, and different image retrieval algorithms are used to calculate similarity and update the negative sample points and fuse them to calculate the loss function to improve the training effect of the descriptor.
It improves the reliability and matching accuracy of descriptors, increases the information content of samples, enhances the robustness of feature extraction, avoids additional computational burden, and improves the accuracy of matching pairs.
Smart Images

Figure CN116664867B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to image local feature extraction and matching technology and image retrieval technology, and in particular to a feature extraction method and device for selecting training samples based on multi-evidence fusion. Background Art
[0002] Visual localization technology is a positioning technology based on computer vision. Its main purpose is to estimate the camera position and posture with six degrees of freedom relative to the reference scene given a query image. Compared with GPS positioning, visual localization can achieve 3D positioning and can be widely used in various scenarios, such as indoors and large and complex outdoor environments. At the same time, visual localization can also be applied to augmented reality, mixed reality, virtual reality, and self-driving cars. The main process of visual localization is divided into feature extraction and matching, image retrieval, 3D reconstruction, pose solution, etc. The quality of image feature extraction plays a decisive role in downstream tasks such as visual localization. (Toft C, Maddern W, Torii A, et al. Long-term visual localization revisited [J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020, 44 (4): 2074-2088.). In recent years, deep learning-based methods have focused on learning feature descriptors with strong discriminative power, in the hope of obtaining robust matching under day and night and seasonal changes, large viewing angle changes, and weak texture scenes. However, in existing datasets, there are often some essentially inseparable weak texture scenes and repeated structures, which bring some noise to the training and affect the learning effect of the descriptor. How to avoid inseparable samples that often appear in shooting during training is an important technology to further improve the performance of the descriptor.
[0003] The current mainstream feature extraction method is generally to learn feature point detectors and descriptors end-to-end through convolutional neural networks, which can match well in many daily scenes. However, when it comes to scenes with large appearances such as time, day and night, and seasons, or scenes with weak texture areas where it is difficult to detect feature points, the number and quality of feature matching will be greatly reduced, resulting in a decrease in positioning accuracy. One of the more popular feature extraction algorithms is D2-Net (Dusmanu M, Rocco I, Pajdla T, et al. D2-net: A trainable cnn for joint description and detection of local features [C]. Proceedings of the ieee / cvf conference on computer vision and pattern recognition. 2019: 8092-8101.), which models feature point scores through feature map spatial characteristics and adds them to the descriptor loss. The feature points obtained are not limited to edge positions, but are often areas with high descriptor reliability. There are also some distributions in weak texture areas, but the feature point accuracy of this model is not high. Fan et al. proposed a domain invariant feature extraction method (Fan B, Yang Y, Feng W, et al. Seeing through darkness: Visual localization at night via weakly supervised learning of domain invariant features [J]. IEEE Transactions on Multimedia, 2022.), which improves the matching performance of local features for day and night images with drastic and complex illumination changes through adversarial learning, but its structure is more complex, the training difficulty is increased, and adversarial learning introduces additional computational burden. Li et al. proposed a decoupled local feature learning framework (Li K, Wang L, Liu L, et al. Decoupling makes weakly supervised local feature better [C]. Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition. 2022: 15838-15848.), which searches for sample learning descriptors in a line-to-window manner, and then learns feature points on the learned descriptor network. The samples generated in this way are more informative, but the model of this method is larger and the test speed is slower. Summary of the invention
[0004] The present invention provides a feature extraction method and device for selecting training samples based on multi-evidence fusion, so as to solve the technical problems of poor feature extraction quality or large model in the prior art.
[0005] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0006] In one aspect, the present invention provides a feature extraction method for selecting training samples based on multi-evidence fusion, and the feature extraction method for selecting training samples based on multi-evidence fusion includes:
[0007] Introducing a variety of different image retrieval algorithms during the training phase of the feature extraction network;
[0008] The feature extraction network is trained; wherein the training process includes: determining anchor points, positive sample points and negative sample points in the input image; using each image retrieval algorithm to calculate the positive sample similarity between the anchor point and the positive sample point, and the negative sample similarity between the anchor point and the negative sample point; based on the calculated positive sample similarity and negative sample similarity, updating the negative sample point to obtain updated negative sample points; fusing the updated negative sample points obtained by using a plurality of different image retrieval algorithms, and calculating the loss function;
[0009] The trained feature extraction network is used to extract features from the image to be processed to obtain the extraction result.
[0010] Furthermore, when training the feature extraction network, the input images of the feature extraction network are image pairs in the same scene, and the training data set has corresponding depth information and camera parameter information.
[0011] Further, the determining of the anchor point, the positive sample point and the negative sample point in the input image includes:
[0012] Sample anchor points and obtain positive sample points corresponding to the anchor points based on the camera transformation between the input image pairs;
[0013] All points outside the rectangular window centered on the positive sample point are taken as the negative sample set;
[0014] According to the matching degree between the descriptors of each point in the negative sample set and the descriptors of the positive sample points, a point closest to the positive sample point is selected as the negative sample point.
[0015] Furthermore, when training the feature extraction network, the initial anchor points are obtained by randomly sampling grid points, and the descriptors of each data point are obtained by normalizing the feature map output by the backbone network of the feature extraction network.
[0016] Furthermore, taking all points outside the rectangular window centered on the positive sample point as a negative sample set; and selecting a point closest to the positive sample point as a negative sample point according to the degree of matching between the descriptors of each point in the negative sample set and the descriptors of the positive sample point, including:
[0017] By setting the distance K, a set of points in the target image whose distance from the positive sample point is greater than K is taken as a negative sample set, and a point most similar to the positive sample point is selected from the negative sample set as a negative sample point to achieve negative sample selection; wherein the distance between data points refers to the Euclidean distance between the descriptors of the corresponding data points. The smaller the Euclidean distance, the more similar the two corresponding points are.
[0018] Further, the method of using each image retrieval algorithm to calculate the positive sample similarity between the anchor point and the positive sample point, and the negative sample similarity between the anchor point and the negative sample point; based on the calculated positive sample similarity and negative sample similarity, updating the negative sample point to obtain the updated negative sample point includes:
[0019] Get the square area centered on the anchor point, the square area centered on the positive sample point, and the square area centered on the negative sample point;
[0020] The image retrieval algorithm is used to calculate the similarity between the square area centered on the anchor point and the square area centered on the positive sample point, and the positive sample similarity s between the anchor point and the positive sample point is obtained. pos , and calculate the similarity between the square area centered on the anchor point and the square area centered on the negative sample point, and obtain the negative sample similarity s between the anchor point and the negative sample point neg ;
[0021] When pos / s neg >1, update the K value, the update formula is: K=K·s pos / s neg , and then based on the updated K value, repeat the process of selecting negative samples to obtain updated negative sample points.
[0022] Furthermore, the loss function is expressed as:
[0023]
[0024] Among them, L desc represents the loss function, m represents the marginal value of triple loss, g(·) represents the sample aggregation function, d1 represents the descriptor corresponding to the anchor point, represents the descriptor of the updated negative sample point obtained by the i-th image retrieval algorithm, i = 1, 2, ..., δ; δ represents the number of types of image retrieval algorithms, d posIt represents the Euclidean distance between the descriptor corresponding to the anchor point and the descriptor corresponding to the positive sample point.
[0025] On the other hand, the present invention further provides a feature extraction device for selecting training samples based on multi-evidence fusion, the feature extraction device for selecting training samples based on multi-evidence fusion comprises:
[0026] Feature extraction network training module for:
[0027] Introducing a variety of different image retrieval algorithms during the training phase of the feature extraction network;
[0028] The feature extraction network is trained; wherein the training process includes: determining anchor points, positive sample points and negative sample points in the input image; using each image retrieval algorithm to calculate the positive sample similarity between the anchor point and the positive sample point, and the negative sample similarity between the anchor point and the negative sample point; based on the calculated positive sample similarity and negative sample similarity, updating the negative sample point to obtain updated negative sample points; fusing the updated negative sample points obtained by using a plurality of different image retrieval algorithms, and calculating the loss function;
[0029] Feature extraction network test module for:
[0030] The trained feature extraction network is used to extract features from the image to be processed to obtain the extraction result.
[0031] The beneficial effects brought about by the technical solution provided by the present invention include at least:
[0032] The technical solution of the present invention introduces multiple image retrieval algorithms in the training stage of the feature extraction network, updates negative samples, increases the information content of the samples, and further enhances the training effect of the descriptor, which can improve the reliability of the descriptor, thereby obtaining more accurate and more matching pairs in the matching stage. Moreover, the technical solution of the present invention only introduces more calculation amount during training. When extracting local features using the trained feature extraction network, it is the same as the general feature extraction network. Therefore, it does not increase the additional calculation burden. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0034] Figure 1 It is a schematic diagram of the execution flow of a feature extraction method for selecting training samples based on multi-evidence fusion provided by an embodiment of the present invention;
[0035] Figure 2 is a schematic diagram of the structure of a feature extraction network provided by an embodiment of the present invention;
[0036] Figure 3 Schematic diagram of negative sample points selected by multiple evidences provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0038] First embodiment
[0039] In response to the technical problems of poor feature extraction quality or large models in the prior art, this embodiment provides a feature extraction method for selecting training samples based on multi-evidence fusion. This method improves the accuracy and quantity of feature matching without increasing additional reasoning time, and can be extended to the training of any end-to-end feature extraction network, for example, it can be used for the training of feature extraction networks in visual positioning tasks.
[0040] The execution flow of this method is as follows Figure 1 As shown, the following steps are included:
[0041] S1, introduces a variety of different image retrieval algorithms in the training stage of the feature extraction network;
[0042] It should be noted that, in this embodiment, multiple image retrieval algorithms are selected to obtain stable results. For example, from the perspective of timeliness, the early non-learning image retrieval method perceptual hashing algorithm (Zauner C. Implementation and benchmarking of perceptual image hash functions [J]. 2010.) obtains image hash codes based on discrete Fourier transform, and quickly implements similarity calculation based on the Hamming distance between hash codes; the extended deep learning-based hash algorithm CSQ (Yuan L, Wang T, Zhang X, et al. Central similarity quantization for efficient image and video retrieval [C]. Proceedings of the IEEE / CVF conference on computer vision and pattern recognition. 2020: 3083-3092.) has higher accuracy and robustness to changing scenes; the aggregation-based global image representation method NetVLAD (Arandjelovic R, Gronat P, Torii A, et al. NetVLAD: CNN architecture for weakly supervised place recognition [C]. Proceedings of the IEEE conference on computer vision and pattern recognition. 2020: 3083-3092.) recognition.2016:5297-5307.) is more suitable for tasks such as scene recognition.
[0043] The feature extraction network D is an existing network, which is used as the training object and participates in the preliminary selection of negative samples. The feature extraction network D can use D2-Net, ASLFeat (Luo Z, Zhou L, Bai X, et al. Aslfeat: Learning local features of accurate shape and localization [C]. Proceedings of the IEEE / CVF conference on computer vision and pattern recognition. 2020: 6589-6598.) and other feature extraction networks, such as Figure 2 As shown in the figure, the descriptor graph output by the feature extraction network is used to predict the matching degree of two points, select negative samples, and calculate the loss function.
[0044] S2, training the feature extraction network; the training process includes: determining anchor points, positive sample points and negative sample points in the input image; using each image retrieval algorithm to calculate the positive sample similarity between the anchor point and the positive sample point, and the negative sample similarity between the anchor point and the negative sample point; based on the calculated positive sample similarity and negative sample similarity, updating the negative sample point to obtain updated negative sample points; fusing the updated negative sample points obtained by using a plurality of different image retrieval algorithms, and calculating the loss function;
[0045] It should be noted that, in this embodiment, the data set can use the MegaDepth data set (Li Z, Snavely N. Megadepth: Learning single-view depth prediction from internet photos [C]. Proceedings of the IEEE conference on computer vision and pattern recognition. 2018: 2041-2050.), which contains a total of 327k image pairs in 118 scenes as a training set, 78 scenes as a verification set, and each image has corresponding depth information and camera parameter information.
[0046] Based on the above, this embodiment calculates the similarity of the negative samples selected by the feature extraction network according to the descriptor branch, and then confirms the difficulty of the sample and whether it needs to be updated by comparing the similarity with the positive sample, and selects new negative samples for samples of different difficulty levels according to pre-designed rules.
[0047] Specifically, in this embodiment, the training process of the feature extraction network is as follows:
[0048] S21, preloading the parameters of the feature extraction network D and preparing the image retrieval method; wherein, during training, the image retrieval algorithm only performs inference without updating parameters, and only updates the weight parameters of the feature extraction network D;
[0049] S22, inputting the image into the feature extraction network; wherein, in this embodiment, the input image is an image pair of the same scene, the image pair has a large number of common view areas, and the data set has corresponding depth information and camera parameter information, so as to obtain real corresponding points through camera transformation;
[0050] S23, sampling anchor points, and obtaining positive sample points corresponding to the anchor points according to the camera transformation between the input image pairs; taking all points outside the rectangular window centered on the positive sample points as the negative sample set; selecting the most difficult points (the points closest to the positive sample points) as the negative sample points according to the matching degree between the descriptors of each point in the negative sample set and the descriptors of the positive sample points; wherein the initial anchor points are obtained by randomly sampling grid points, and the descriptors of each data point are obtained by L2 normalization of the feature map output by the backbone network of the feature extraction network;
[0051] S24, input the image blocks corresponding to the square area centered on the anchor point, the square area centered on the positive sample point, and the square area centered on the negative sample point into the image retrieval algorithm, calculate the positive sample similarity and the negative sample similarity, re-determine the negative sample selection range according to the calculated positive and negative sample similarities, repeat the negative sample selection process according to the re-determined negative sample selection range, update the negative sample points, and merge the negative sample points updated by using multiple image retrieval algorithms into the loss function L; the specific process is as follows:
[0052] S241, using the descriptor branch of the existing feature extraction network D to extract the descriptor feature graph F1, F2∈R of the input image pair I1 and I2 BatchSize×H×W×C , perform L2 normalization of the channel dimension on the extracted feature maps F1 and F2 respectively, obtain dense descriptor sub-maps F'1 = L2normalization (F1), F'2 = L2normalization (F2), and sample the descriptor d1∈R corresponding to the anchor point on the descriptor sub-map c And the descriptor d2∈R of the positive sample point c , calculate the Euclidean distance d between the two pos =||d1-d2||2, the smaller it is, the more similar the descriptors are. By setting the distance K (that is, setting a fixed spatial safety distance), the neighboring area of the corresponding point is regarded as a safety range, and a most similar difficult negative sample is selected outside the safety range, that is: the set of points in image I2 whose Euclidean distance to the positive sample point in the descriptor space is greater than K is taken as the negative sample set, and a most similar difficult negative sample is selected from it, and its corresponding descriptor d n2 ∈R c , that is, satisfying the negative sample distance d neg =||d1-d n2 ||2 is the smallest in the negative sample set, where R represents the number domain, H is the feature map height, W is the feature map width, C is the channel dimension of the feature map, L2normalization(.) represents L2 normalization, and ||.||2 represents the Euclidean distance between two descriptor vectors; the distance K is used to form a square area centered on the corresponding point to avoid selecting points that are too close and too similar in space as negative samples;
[0053] S242, sampling N×N square areas P1, P2 and P centered at the anchor point, positive sample point and negative sample point respectively. n2 , using the image retrieval algorithm to calculate the similarity between square areas, including the positive sample similarity s between the anchor point and the positive sample point pos =Similarity(P1,P2), and the negative sample similarity s between the anchor point and the negative sample point neg =Similarity(P1,P n2 ), the larger the similarity value, the more similar the two images are. Similarity(·) represents the image retrieval algorithm, which is used to calculate the similarity of two images;
[0054] S243, the positive sample similarity s obtained by using the image retrieval algorithm pos Similarity with negative samples s neg In contrast, when the negative sample points are more similar than the corresponding points, there is s pos / s neg >1, indicating that the triplet is essentially indistinguishable and the selection of negative samples fails. At this time, the new larger distance is updated according to the degree of similarity, that is, the K value is updated, K = K s pos / s neg , and then repeat the process of selecting negative samples;
[0055] It should be noted that, in this embodiment, a variety of methods are used to calculate the similarity, such as Figure 3 As shown, the distance of the safety range is updated, and negative samples are selected respectively to obtain more informative triplets;
[0056] S244, multiple negative samples selected after updating using different image retrieval algorithms are added to the triplet loss function to simultaneously optimize multiple negative samples. The triplet loss of multiple negative samples fused is expressed as:
[0057]
[0058] Among them, L desc represents the loss function, m represents the marginal value of the triplet loss, and the marginal value m is used to cut off the gradient when the distance of the negative sample is much larger than the distance of the positive sample, so that the network no longer optimizes the samples that have been fully learned. In training, m is set to 1; g(·) represents the sample aggregation function, and the typical average value can be used. d1 represents the descriptor corresponding to the anchor point, represents the descriptor of the updated negative sample point obtained by the i-th image retrieval algorithm, i = 1, 2, ..., δ; δ represents the number of image retrieval algorithms, and the Euclidean distance between the δ negative samples and the descriptor of the anchor point is calculated, and the sample aggregation function g(·) is used to jointly optimize, dpos It represents the Euclidean distance between the descriptor corresponding to the anchor point and the descriptor corresponding to the positive sample point.
[0059] When multiple methods find the same negative sample, according to the above loss, it is equivalent to giving this negative sample a greater weight. When all methods find the same negative sample, it is equivalent to the original triplet loss.
[0060] S3, using the trained feature extraction network to extract features from the image to be processed to obtain the extraction result.
[0061] It should be noted that, in this embodiment, the above S3 is to input the test image into the trained feature extraction network, and output the extracted local features, including feature points and their descriptors.
[0062] In summary, this embodiment introduces multiple image retrieval algorithms in the training stage of the feature extraction network, updates negative samples, and selects multiple negative samples through multiple evidences to improve the effect of descriptor learning, thereby increasing the amount of information in the samples and improving the reliability of the descriptors, thereby obtaining more accurate and more matching pairs in the matching stage. Moreover, the technical solution of this embodiment only introduces more calculations during training. When extracting local features using the trained feature extraction network, it is the same as the general feature extraction network, so it does not increase the additional calculation burden. The descriptor of the improved feature extraction network has stronger discrimination ability and can provide more and more stable matches for downstream tasks such as three-dimensional reconstruction and visual positioning.
[0063] Second embodiment
[0064] This embodiment provides a feature extraction device for selecting training samples based on multi-evidence fusion, including:
[0065] Feature extraction network training module for:
[0066] Introducing a variety of different image retrieval algorithms during the training phase of the feature extraction network;
[0067] The feature extraction network is trained; wherein the training process includes: determining anchor points, positive sample points and negative sample points in the input image; using each image retrieval algorithm to calculate the positive sample similarity between the anchor point and the positive sample point, and the negative sample similarity between the anchor point and the negative sample point; based on the calculated positive sample similarity and negative sample similarity, updating the negative sample point to obtain updated negative sample points; fusing the updated negative sample points obtained by using a plurality of different image retrieval algorithms, and calculating the loss function;
[0068] Feature extraction network test module for:
[0069] The trained feature extraction network is used to extract features from the image to be processed to obtain the extraction result.
[0070] The feature extraction device for selecting training samples based on multi-evidence fusion in this embodiment corresponds to the feature extraction method for selecting training samples based on multi-evidence fusion in the first embodiment; wherein, the functions implemented by each functional module in the feature extraction device for selecting training samples based on multi-evidence fusion correspond one-to-one to each process step in the feature extraction method for selecting training samples based on multi-evidence fusion; therefore, they will not be repeated here.
[0071] In addition, it should be noted that the present invention can be provided as a method, an apparatus or a computer program product. Therefore, the embodiments of the present invention can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the embodiments of the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0072] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the 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 the 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, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal 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.
[0073] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, so that a series of operation steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide for implementing the process in 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.
[0074] It should also be noted that, in this article, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0075] Finally, it should be noted that the above is a preferred embodiment of the present invention. It should be pointed out that although the preferred embodiment of the present invention has been described, for those skilled in the art, once the basic creative concept of the present invention is known, several improvements and modifications can be made without departing from the principles of the present invention, and these improvements and modifications should also be regarded as the protection scope of the present invention. Therefore, the attached claims are intended to be interpreted as including the preferred embodiment and all changes and modifications that fall within the scope of the embodiments of the present invention.
Claims
1. A feature extraction method for selecting training samples based on multi-evidence fusion, It is characterized in that include: Introducing a variety of different image retrieval algorithms during the training phase of the feature extraction network; The feature extraction network is trained; wherein the training process includes: determining anchor points, positive sample points and negative sample points in the input image; using each image retrieval algorithm to calculate the positive sample similarity between the anchor point and the positive sample point, and the negative sample similarity between the anchor point and the negative sample point; based on the calculated positive sample similarity and negative sample similarity, updating the negative sample point to obtain updated negative sample points; fusing the updated negative sample points obtained by using a plurality of different image retrieval algorithms, and calculating the loss function; Use the trained feature extraction network to extract features from the image to be processed and obtain the extraction result; When training the feature extraction network, the input images of the feature extraction network are image pairs of the same scene, and the training data set has corresponding depth information and camera parameter information; The step of determining the anchor point, the positive sample point and the negative sample point in the input image comprises: Sample anchor points and obtain positive sample points corresponding to the anchor points based on the camera transformation between the input image pairs; All points outside the rectangular window centered on the positive sample point are taken as the negative sample set; According to the matching degree between the descriptors of each point in the negative sample set and the descriptors of the positive sample points, a point closest to the positive sample point is selected as the negative sample point; The method of taking all points outside the rectangular window centered on the positive sample point as a negative sample set and selecting a point closest to the positive sample point as a negative sample point according to the matching degree between the descriptors of each point in the negative sample set and the descriptors of the positive sample point includes: By setting the distance K, a set of points in the target image whose distance from the positive sample point is greater than K is taken as a negative sample set, and a point most similar to the positive sample point is selected from the negative sample set as a negative sample point to achieve negative sample selection; wherein the distance between data points refers to the Euclidean distance between the descriptors of the corresponding data points, and the smaller the Euclidean distance, the more similar the two corresponding points are; The method comprises: calculating the positive sample similarity between the anchor point and the positive sample point, and the negative sample similarity between the anchor point and the negative sample point by using each image retrieval algorithm; updating the negative sample point based on the calculated positive sample similarity and negative sample similarity to obtain the updated negative sample point, including: Get the square area centered on the anchor point, the square area centered on the positive sample point, and the square area centered on the negative sample point; The image retrieval algorithm is used to calculate the similarity between the square area centered on the anchor point and the square area centered on the positive sample point, and the positive sample similarity s between the anchor point and the positive sample point is obtained. pos , and calculate the similarity between the square area centered on the anchor point and the square area centered on the negative sample point, and obtain the negative sample similarity s between the anchor point and the negative sample point neg ; When pos / s neg >1, update the K value, the update formula is: K=K·s pos / s neg , and then based on the updated K value, repeat the process of selecting negative samples to obtain updated negative sample points; The loss function is expressed as: Among them, L desc represents the loss function, m represents the marginal value of triple loss, g(·) represents the sample aggregation function, d 1 Represents the descriptor corresponding to the anchor point, represents the descriptor of the updated negative sample point obtained by the i-th image retrieval algorithm, i = 1, 2, ..., δ; δ represents the number of types of image retrieval algorithms, d pos It represents the Euclidean distance between the descriptor corresponding to the anchor point and the descriptor corresponding to the positive sample point.
2. The feature extraction method for selecting training samples based on multi-evidence fusion as claimed in claim 1, It is characterized in that When training the feature extraction network, the initial anchor points are obtained by randomly sampling grid points, and the descriptors of each data point are obtained by normalizing the feature map output by the backbone network of the feature extraction network.
3. A feature extraction device for selecting training samples based on multi-evidence fusion, It is characterized in that include: Feature extraction network training module for: Introducing a variety of different image retrieval algorithms during the training phase of the feature extraction network; The feature extraction network is trained; wherein the training process includes: determining anchor points, positive sample points and negative sample points in the input image; using each image retrieval algorithm to calculate the positive sample similarity between the anchor point and the positive sample point, and the negative sample similarity between the anchor point and the negative sample point; based on the calculated positive sample similarity and negative sample similarity, updating the negative sample point to obtain updated negative sample points; fusing the updated negative sample points obtained by using a plurality of different image retrieval algorithms, and calculating the loss function; Feature extraction network test module for: Use the trained feature extraction network to extract features from the image to be processed and obtain the extraction result; When training the feature extraction network, the input images of the feature extraction network are image pairs of the same scene, and the training data set has corresponding depth information and camera parameter information; The step of determining the anchor point, the positive sample point and the negative sample point in the input image comprises: Sample anchor points and obtain positive sample points corresponding to the anchor points based on the camera transformation between the input image pairs; All points outside the rectangular window centered on the positive sample point are taken as the negative sample set; According to the matching degree between the descriptors of each point in the negative sample set and the descriptors of the positive sample points, a point closest to the positive sample point is selected as the negative sample point; The method of taking all points outside the rectangular window centered on the positive sample point as a negative sample set and selecting a point closest to the positive sample point as a negative sample point according to the matching degree between the descriptors of each point in the negative sample set and the descriptors of the positive sample point includes: By setting the distance K, a set of points in the target image whose distance from the positive sample point is greater than K is taken as a negative sample set, and a point most similar to the positive sample point is selected from the negative sample set as a negative sample point to achieve negative sample selection; wherein the distance between data points refers to the Euclidean distance between the descriptors of the corresponding data points, and the smaller the Euclidean distance, the more similar the two corresponding points are; The method comprises: calculating the positive sample similarity between the anchor point and the positive sample point, and the negative sample similarity between the anchor point and the negative sample point by using each image retrieval algorithm; updating the negative sample point based on the calculated positive sample similarity and negative sample similarity to obtain the updated negative sample point, including: Get the square area centered on the anchor point, the square area centered on the positive sample point, and the square area centered on the negative sample point; The image retrieval algorithm is used to calculate the similarity between the square area centered on the anchor point and the square area centered on the positive sample point, and the positive sample similarity s between the anchor point and the positive sample point is obtained. pos , and calculate the similarity between the square area centered on the anchor point and the square area centered on the negative sample point, and obtain the negative sample similarity s between the anchor point and the negative sample point neg ; When pos / s neg >1, update the K value, the update formula is: K=K·s pos / s neg , and then based on the updated K value, repeat the process of selecting negative samples to obtain updated negative sample points; The loss function is expressed as: Among them, L desc represents the loss function, m represents the marginal value of triple loss, g(·) represents the sample aggregation function, d 1 Represents the descriptor corresponding to the anchor point, represents the descriptor of the updated negative sample point obtained by the i-th image retrieval algorithm, i = 1, 2, ..., δ; δ represents the number of types of image retrieval algorithms, d pos It represents the Euclidean distance between the descriptor corresponding to the anchor point and the descriptor corresponding to the positive sample point.
Citation Information
Patent Citations
Clothing retrieval technology based on deep metric learning
CN111914109A
Semantic segmentation model training method, semantic segmentation method, storage medium and terminal
CN114926469A
