A deep introspection metric learning method, device and storage medium

By extracting semantic and uncertainty features of images, calculating introspective similarity and training convolutional networks, it solves the problem of poor network discriminability in existing deep metric learning methods and improves robustness and discriminant performance.

CN114648648BActive Publication Date: 2024-09-27TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210158472.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-21
Publication Date
2024-09-27
Estimated Expiration
2042-02-21

AI Technical Summary

Technical Problem

Existing deep metric learning methods provide deterministic features in the image embedding space, resulting in poor network discriminability and low robustness, especially for samples with large uncertainty.

Method used

By extracting the semantic features and uncertainty features of the image, the introspective similarity is calculated, and the gradient descent algorithm is used to train the convolutional network to reduce the similarity discrimination between samples with greater uncertainty and other samples.

Benefits of technology

It improves the discriminative performance and robustness of the network, especially when dealing with samples with high uncertainty, and reduces the similarity judgment between them and other samples, thereby improving the overall recognition ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114648648B
    Figure CN114648648B
Patent Text Reader

Abstract

In the deep introspective metric learning method, device and storage medium proposed in the present application, a plurality of different image samples are obtained, and then the semantic features and uncertainty features of each sample image in the plurality of different image samples are extracted, and the semantic features and uncertainty features of each sample image are used to obtain the introspective similarity of different sample pairs, where the sample pair is composed of any two different image samples in the sample, and then the introspective similarity of different sample pairs is calculated according to a preset loss function to obtain a calculation result, and finally a preset convolutional network is trained according to the gradient descent algorithm and the calculation result, and the semantic features and uncertainty features of the target image in the metric space are extracted according to the trained convolutional network, so as to determine the introspective similarity between the target image and other images according to the semantic features and uncertainty features. Among them, the method proposed in the present application improves the discrimination performance and robustness of the network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision and machine learning technology, and in particular to a deep introspection metric learning method, device and storage medium. Background Art

[0002] The goal of deep metric learning is to reduce the distance between samples of the same category and increase the distance between samples of different categories in the embedding space. Deep metric learning has been widely used in image clustering, pedestrian recognition, room layout estimation, and instance segmentation. The commonly used method is to use a deep neural network to map the image into a discriminative embedding space and design different loss functions in the embedding space for constraints. However, deep metric learning methods usually represent images as deterministic embeddings, which only characterize the typical features of the image, which does not conform to human cognition of images.

[0003] In related technologies, images are modeled in the embedding space using probability distribution, and then the distance between image embeddings is measured using KL divergence or Monte Carlo sampling methods. However, this method uses the distribution variance as a measure of image uncertainty and still provides a confident similarity judgment, resulting in poor network discrimination and low robustness. Therefore, how to autonomously reduce the similarity judgment between samples with greater uncertainty and other samples is an urgent problem to be solved. Summary of the invention

[0004] The present application provides a deep introspection metric learning method, device and storage medium to at least solve the technical problems of poor network representation ability and low robustness in related technologies.

[0005] The first embodiment of the present application proposes a deep introspection metric learning method, including:

[0006] Acquire multiple different image samples;

[0007] Extracting semantic features and uncertainty features of each sample image from the multiple different image samples;

[0008] Using the semantic features and uncertainty features of each sample image, the introspective similarity of different sample pairs is obtained, and the sample pairs are composed of any two different image samples in the sample;

[0009] Calculating the introspective similarity of the different sample pairs according to a preset loss function to obtain a calculation result;

[0010] A preset convolutional network is trained according to the gradient descent algorithm and the calculation results, and semantic features and uncertainty features of the target image in the metric space are extracted according to the trained convolutional network, so as to determine the introspective similarity between the target image and other images according to the semantic features and uncertainty features.

[0011] The second aspect of the present application provides a deep introspection metric learning device, including:

[0012] An acquisition module, used for acquiring a plurality of different image samples;

[0013] An extraction module, used for extracting semantic features and uncertainty features of each sample image in the plurality of different image samples;

[0014] A processing module, used for obtaining the introspective similarity of different sample pairs by using the semantic features and uncertainty features of each sample image, wherein the sample pair is composed of any two different image samples in the sample;

[0015] A calculation module, used to calculate the introspective similarity of the different sample pairs according to a preset loss function to obtain a calculation result;

[0016] A determination module is used to train a preset convolutional network according to a gradient descent algorithm and the calculation results, and extract semantic features and uncertainty features of a target image in a metric space according to the trained convolutional network, so as to determine the introspective similarity between the target image and other images according to the semantic features and uncertainty features.

[0017] The third aspect of the present application proposes a non-temporary computer-readable storage medium, wherein the non-temporary computer-readable storage medium stores a computer program; when the computer program is executed by a processor, the method shown in the first aspect above is implemented.

[0018] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:

[0019] In the deep introspective metric learning method, device and storage medium proposed in the present application, a plurality of different image samples are obtained, and then the semantic features and uncertainty features of each sample image in the plurality of different image samples are extracted, and the semantic features and uncertainty features of each sample image are used to obtain the introspective similarity of different sample pairs, where the sample pair is composed of any two different image samples in the sample, and then the introspective similarity of different sample pairs is calculated according to a preset loss function to obtain a calculation result, and finally a preset convolutional network is trained according to the gradient descent algorithm and the calculation result, and the semantic features and uncertainty features of the target image in the metric space are extracted according to the trained convolutional network, so as to determine the introspective similarity between the target image and other images according to the semantic features and uncertainty features. Among them, the introspective similarity of different sample pairs obtained by the semantic features and uncertainty features of the samples in the present application gives the least similarity discrimination to samples with relatively high uncertainty, so that the trained convolutional network can autonomously reduce the similarity discrimination between it and other samples for samples with large uncertainty, thereby improving the discrimination performance and robustness of the network.

[0020] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0022] Figure 1 A flowchart of a deep introspection metric learning method provided according to an embodiment of the present application;

[0023] Figure 2 A schematic diagram of the structure of a deep introspection metric learning device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0024] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0025] The following describes the deep introspection metric learning method and device of the embodiments of the present application with reference to the accompanying drawings.

[0026] Embodiment 1

[0027] Figure 1 A flowchart of a deep introspection metric learning method provided according to an embodiment of the present application is shown in FIG. Figure 1 As shown, this may include:

[0028] Step 101: Acquire a plurality of different image samples.

[0029] In this embodiment, the number of different image samples acquired each time may be the same, for example, 120 different image samples are acquired each time.

[0030] Step 102: extracting semantic features and uncertainty features of each sample image from a plurality of different image samples.

[0031] In one embodiment of the present invention, the semantic features and uncertainty features of each sample can be extracted in the embedding space through a preset convolutional network. Also, in one embodiment of the present invention, the semantic features and uncertainty features of each sample have the same dimension, which is 512 dimensions.

[0032] Step 103: Using the semantic features and uncertainty features of each sample image, obtain the introspective similarity of different sample pairs.

[0033] In this embodiment, the sample pair is composed of any two different image samples in the sample.

[0034] In one embodiment of the present invention, the method for obtaining the introspective similarity of different sample pairs by using the semantic features and uncertainty features of each sample image may include the following steps:

[0035] Step a: Calculate the semantic distance between different sample pairs using the semantic features of each sample.

[0036] In one embodiment of the present invention, the method of calculating the semantic distance between different sample pairs using the semantic feature of each sample may include:

[0037] Sample x i With sample x j The semantic distance of the composed sample pairs is:

[0038] α(x i ,x j )=||s i -s j ||2

[0039] Among them, α(x i ,x j ) is the sample x i With sample x j The semantic distance between i is the sample x i The semantic features of s j is the sample x j semantic features.

[0040] Step b: Calculate the uncertainty of different sample pairs using the uncertainty characteristics of each sample.

[0041] In one embodiment of the present invention, a method for calculating the uncertainty of different sample pairs using the uncertainty feature of each sample may include:

[0042] Sample x i With sample x j The uncertainty of the sample pairs is:

[0043] β(x i ,x j )=||u i +u j ||2

[0044] Among them, β(x i ,x j ) is the sample x i With sample x j The uncertainty between i is the sample x i The uncertainty characteristic, u j is the sample x j uncertainty characteristics.

[0045] Step c: According to the semantic distance and uncertainty of different sample pairs, the introspective similarity of different sample pairs is obtained.

[0046] In one embodiment of the present invention, a method for obtaining the introspective similarity of different sample pairs according to the semantic distance and uncertainty of different sample pairs may include the following steps:

[0047] Step 1: Calculate the relative uncertainty of different sample pairs using Formula 1, where Formula 1 is:

[0048]

[0049] Among them, r_conf(x i ,x j ) is the sample x i With sample x j is the relative uncertainty between, γ is the introspective preference constant, γ>0. In this embodiment, the value range of γ is 0-5.

[0050] Step 2: Using the relative uncertainty of the different sample pairs, the introspective similarity of the different sample pairs is obtained by formula 2, where formula 2 is:

[0051]

[0052] In this embodiment, D IN(x i ,x j ) is the sample x i With sample x j Introspective similarity based on Euclidean distance.

[0053] Step 104: Calculate the introspective similarity of different sample pairs according to a preset loss function to obtain a calculation result.

[0054] Among them, in this embodiment, when the preset loss function is different, the results of calculating the introspective similarity of different sample pairs according to the preset loss function are also different.

[0055] Specifically, in one embodiment of the present invention, when the preset loss function is a margin loss function, the introspective similarity of the different sample pairs is calculated according to the margin loss function, and the method for obtaining the calculation result includes:

[0056]

[0057] Among them, y is the sample pair (x i ,x j ), where L is the category label, () takes 1 according to probability p and takes 0 according to probability 1-p. [·] + =max(·,0), ξ and ω are predefined margin parameters, and φ is a positive constant.

[0058] And, in the embodiment of the present invention, y is a sample pair (x i ,x j ) is a vector of semantic features and uncertainty features. For example, assuming the sample pair is (x1, x2), then y is (s1, u1, s2, u2).

[0059] Further, in one embodiment of the present invention, when the preset loss function is a softmax loss function, the introspective similarity of different sample pairs is calculated according to the softmax loss function, and the method for obtaining the calculation result includes:

[0060]

[0061]

[0062] Among them, p j is the class proxy of the sample, N is the number of image samples obtained, C IN (x i ,p j ) is an introspective measure based on cosine similarity, C(x i ,p j) is the cosine similarity.

[0063] Step 105: train a preset convolutional network according to the gradient descent algorithm and the calculation results, and extract semantic features and uncertainty features of the target image in the metric space according to the trained convolutional network, so as to determine the introspective similarity between the target image and other images according to the semantic features and uncertainty features.

[0064] Among them, in one embodiment of the present invention, the back propagation of the trained convolutional network is analyzed to obtain the following results:

[0065]

[0066] In the embodiment of the present invention, the gradient H(u i ,u j ) will decrease as the sample uncertainty increases, that is, samples with greater uncertainty have less impact on the trained network. Based on this, the trained convolutional network can autonomously reduce the similarity judgment between samples with greater uncertainty and other samples, thereby improving the network's discrimination performance and robustness.

[0067] The deep introspective metric learning method proposed in the present application obtains a plurality of different image samples, then extracts the semantic features and uncertainty features of each sample image in the plurality of different image samples, and uses the semantic features and uncertainty features of each sample image to obtain the introspective similarity of different sample pairs, where the sample pair is composed of any two different image samples in the sample, and then calculates the introspective similarity of different sample pairs according to a preset loss function to obtain a calculation result, and finally trains a preset convolutional network according to the gradient descent algorithm and the calculation result, and extracts the semantic features and uncertainty features of the target image in the metric space according to the trained convolutional network, so as to determine the introspective similarity between the target image and other images according to the semantic features and uncertainty features. Among them, the introspective similarity of different sample pairs obtained by the semantic features and uncertainty features of the samples in the present application gives the least similarity discrimination to samples with relatively high uncertainty, so that the trained convolutional network can autonomously reduce the similarity discrimination between it and other samples for samples with large uncertainty, thereby improving the discrimination performance and robustness of the network.

[0068] Embodiment 2

[0069] Further, Figure 2 A schematic diagram of the structure of a deep introspection metric learning device provided according to an embodiment of the present application is shown in FIG. Figure 2 As shown, this may include:

[0070] An acquisition module, used for acquiring a plurality of different image samples;

[0071] An extraction module, used for extracting semantic features and uncertainty features of each sample image in the plurality of different image samples;

[0072] A processing module, used for obtaining the introspective similarity of different sample pairs by using the semantic features and uncertainty features of each sample image, wherein the sample pair is composed of any two different image samples in the sample;

[0073] A calculation module, used to calculate the introspective similarity of the different sample pairs according to a preset loss function to obtain a calculation result;

[0074] A determination module is used to train a preset convolutional network according to a gradient descent algorithm and the calculation results, and extract semantic features and uncertainty features of a target image in a metric space according to the trained convolutional network, so as to determine the introspective similarity between the target image and other images according to the semantic features and uncertainty features.

[0075] In order to implement the above embodiments, the present disclosure also proposes a non-transitory computer-readable storage medium.

[0076] The non-temporary computer-readable storage medium provided in the embodiment of the present disclosure stores a computer program; when the computer program is executed by a processor, it can achieve the following Figure 1 The deep introspective metric learning method shown.

[0077] In the deep introspective metric learning method, device and storage medium proposed in the present application, a plurality of different image samples are obtained, and then the semantic features and uncertainty features of each sample image in the plurality of different image samples are extracted, and the semantic features and uncertainty features of each sample image are used to obtain the introspective similarity of different sample pairs, where the sample pair is composed of any two different image samples in the sample, and then the introspective similarity of different sample pairs is calculated according to a preset loss function to obtain a calculation result, and finally a preset convolutional network is trained according to the gradient descent algorithm and the calculation result, and the semantic features and uncertainty features of the target image in the metric space are extracted according to the trained convolutional network, so as to determine the introspective similarity between the target image and other images according to the semantic features and uncertainty features. Among them, the introspective similarity of different sample pairs obtained by the semantic features and uncertainty features of the samples in the present application gives the least similarity discrimination to samples with relatively high uncertainty, so that the trained convolutional network can autonomously reduce the similarity discrimination between it and other samples for samples with large uncertainty, thereby improving the discrimination performance and robustness of the network.

[0078] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0079] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0080] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A deep introspective metric learning method, characterized in that The following steps are involved: Acquire multiple different image samples; Extracting semantic features and uncertainty features of each sample image from the multiple different image samples; Using the semantic features and uncertainty features of each sample image, the introspective similarity of different sample pairs is obtained, and the sample pairs are composed of any two different image samples in the sample; Calculating the introspective similarity of the different sample pairs according to a preset loss function to obtain a calculation result; Training a preset convolutional network according to the gradient descent algorithm and the calculation results, and extracting semantic features and uncertainty features of the target image in the metric space according to the trained convolutional network, so as to determine the introspective similarity between the target image and other images according to the semantic features and uncertainty features; The method of obtaining the introspective similarity of different sample pairs by using the semantic features and uncertainty features of each sample image comprises: Calculating semantic distances between different sample pairs using the semantic features of each sample; Calculating the uncertainty of different sample pairs using the uncertainty characteristics of each sample; According to the semantic distance and uncertainty of the different sample pairs, the introspective similarity of the different sample pairs is obtained; The calculating the semantic distances of different sample pairs using the semantic features of each sample includes: Sample x i With sample x j The semantic distance of the composed sample pairs is: α(x i ,x j )=||s i -s j ||2 Among them, α(x i ,x j ) is the sample x i With sample x j The semantic distance between i is the sample x i The semantic features of s j is the sample x j The semantic features of The calculating the uncertainty of different sample pairs using the uncertainty feature of each sample includes: Sample x i With sample x j The uncertainty of the sample pairs is: β(x i ,x j )=||u i +u j ||2 Among them, β(x i ,x j ) is the sample x i With sample x j The uncertainty between i is the sample x i The uncertainty characteristic, u j is the sample x j uncertainty characteristics; The step of obtaining the introspective similarity of different sample pairs according to the semantic distance and uncertainty of the different sample pairs includes: The relative uncertainty of different sample pairs is calculated using Formula 1, where Formula 1 is: Among them, r_conf(x i ,x j ) is the sample x i With sample x j The relative uncertainty between , γ is the introspective preference constant; By using the relative uncertainty of the different sample pairs, the introspective similarity of the different sample pairs is obtained by Formula 2, where Formula 2 is:

2. The method according to claim 1, characterized in that The extracting the semantic features and uncertainty features of each sample image from the multiple different image samples includes: The semantic features and uncertainty features of each sample are extracted in the embedding space through a preset convolutional network.

3. The method according to claim 1, characterized in that The preset loss function is a margin loss function. The calculating of the introspective similarity of the different sample pairs according to the preset loss function to obtain the calculation result includes: Among them, y is the sample pair (x i ,x j ), where L is the category label, I(p) takes 1 according to probability p and takes 0 according to probability 1-p. [·] + =max(·,0), ξ and ω are predefined margin parameters, and φ is a positive constant.

4. The method according to claim 1, characterized in that The preset loss function is a softmax loss function. The calculating of the introspective similarity of the different sample pairs according to the preset loss function to obtain the calculation result includes: Among them, p j is the class proxy of the sample, N is the number of image samples, C IN (x i ,p j ) is an introspective measure based on cosine similarity, C(x i ,p j ) is the cosine similarity.

5. A deep introspection metric learning device, characterized in that: Includes the following modules: An acquisition module, used for acquiring a plurality of different image samples; An extraction module, used for extracting semantic features and uncertainty features of each sample image in the plurality of different image samples; A processing module, used for obtaining the introspective similarity of different sample pairs by using the semantic features and uncertainty features of each sample image, wherein the sample pair is composed of any two different image samples in the sample; A calculation module, used to calculate the introspective similarity of the different sample pairs according to a preset loss function to obtain a calculation result; A determination module, used to train a preset convolutional network according to a gradient descent algorithm and the calculation result, and extract semantic features and uncertainty features of a target image in a metric space according to the trained convolutional network, so as to determine the introspective similarity between the target image and other images according to the semantic features and uncertainty features; The method of obtaining the introspective similarity of different sample pairs by using the semantic features and uncertainty features of each sample image comprises: Calculating semantic distances between different sample pairs using the semantic features of each sample; Calculating the uncertainty of different sample pairs using the uncertainty characteristics of each sample; According to the semantic distance and uncertainty of the different sample pairs, the introspective similarity of the different sample pairs is obtained; The calculating the semantic distances of different sample pairs using the semantic features of each sample includes: Sample x i With sample x j The semantic distance of the composed sample pairs is: α(x i ,x j )=||s i -s j ||2 Among them, α(x i ,x j ) is the sample x i With sample x j The semantic distance between i is the sample x i The semantic features of s j is the sample x j The semantic features of The calculating the uncertainty of different sample pairs using the uncertainty feature of each sample includes: Sample x i With sample x j The uncertainty of the sample pairs is: β(x i ,x j )=||u i +u j ||2 Among them, β(x i ,x j ) is the sample x i With sample x j The uncertainty between i is the sample x i The uncertainty characteristic, u j is the sample x j uncertainty characteristics; The step of obtaining the introspective similarity of different sample pairs according to the semantic distance and uncertainty of the different sample pairs includes: The relative uncertainty of different sample pairs is calculated using Formula 1, where Formula 1 is: Among them, r_conf(x i ,x j ) is the sample x i With sample x j The relative uncertainty between , γ is the introspective preference constant; By using the relative uncertainty of the different sample pairs, the introspective similarity of the different sample pairs is obtained by Formula 2, where Formula 2 is:

6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.