A method for measuring inter-domain differences in image datasets
By performing mathematical feature analysis on image data sets and establishing targeted mathematical measurement methods, the Wasserstein measurement and Sinkhorn iteration method are used for optimization, which solves the problem that the existing technology cannot effectively measure the differences between image data sets between different domains, and realizes accurate and generalized measurements of differences between image data sets, improving the generalization of image task domain adaptation.
Patent Information
- Application Number
- CN202311013494.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-11
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2043-08-11
AI Technical Summary
The prior art cannot effectively measure the differences between image data sets between different domains, and the existing methods cannot satisfy non-negative, symmetry, non-degradability and triangular inequality at the same time, resulting in limitations in its application scenarios.
By performing mathematical feature analysis on the image data set, a mathematical measurement method with targeted image features is established, and the Wasserstein measurement and Sinkhorn iteration method are used for optimization to achieve a complete measurement of the differences between image data sets.
Accurate and general measurements of differences between image data sets are realized, and can be generalized to areas with strict definitions of distance, improving the generalization of image task domain adaptation, and saving computing resources and running time.
Smart Images

Figure CN117409217B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of computer vision. Background Art
[0002] In computer vision, a domain usually refers to the source or distribution of a data set. In real-world scenarios, there are usually multiple different domains, each with different data distributions, that is, statistical characteristics of different data samples. Due to the different data distributions in different domains, a model trained on one domain cannot be simply applied directly to another domain. The domain adaptation problem refers to the ability of a model to adaptively solve the same tasks in the corresponding domain based on data from different domains. The essence of the domain adaptation problem is to transfer the knowledge of the source domain to the target domain. Therefore, it is necessary to measure the distance between the two domains, that is, the distance between the data distributions of the two domains, in order to find their commonalities and differences, so as to achieve a model trained in the source domain that can be effectively applied to the target domain.
[0003] At present, the commonly used methods for calculating the difference in metric distribution in neural networks mainly include KL divergence, JS divergence and Hellinger metric. KL divergence and JS divergence are simple to calculate and have low computational cost, but they do not satisfy the symmetry and triangle inequality in the metric definition, so they are not universal; although the Hellinger metric satisfies the metric definition, it does not have the generalization of topological spaces with different attributes. In addition, the above metric difference calculation methods cannot calculate the distance between non-overlapping distributions, that is, they cannot give the difference size between almost unrelated image data sets.
[0004] As mentioned above, current domain measurement methods have the following main shortcomings:
[0005] Most current image similarity measurement methods directly compare the similarity between two images, or use feature classifiers to compare the similarity between two image sets. Using feature classifiers will inevitably have a feature bias towards one or some specific data sets, and the judgment of complex or extreme environment image sets is prone to large deviations.
[0006] Most existing methods cannot simultaneously satisfy non-negativity, symmetry, non-degeneracy and triangle inequality, and cannot be extended to fields with strict distance definition requirements, which limits the application scenarios of these methods.
[0007] Existing set measurement methods require calculating the single element distance for each element in the set to be measured one by one. However, due to the high dimension of the image, this method has a large computational overhead in the image set domain difference measurement task. Summary of the invention
[0008] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.
[0009] To this end, the purpose of the present invention is to propose an inter-domain difference measurement method for image datasets, which is used to achieve inter-domain difference measurement of complete image datasets.
[0010] To achieve the above-mentioned purpose, the first embodiment of the present invention proposes a method for measuring inter-domain differences of image datasets, including:
[0011] Performing mathematical feature analysis on the image data set to achieve mathematical abstraction of difference measurement of the image data set;
[0012] Establishing a mathematical measurement method with image feature targeting based on the mathematical abstraction;
[0013] Optimizing the mathematical measurement method;
[0014] A to-be-processed image data set is obtained, and a difference measurement is performed on the to-be-processed image data set according to an optimized mathematical measurement method.
[0015] In addition, the inter-domain difference measurement method for image datasets according to the above embodiment of the present invention may also have the following additional technical features:
[0016] Furthermore, in one embodiment of the present invention, performing mathematical feature analysis on the image data set includes:
[0017] For each image in the image dataset, each pixel therein is regarded as a dimension;
[0018] Define a dimension as p 2 The standard metric space (N, d) defines a mapping f:A→N from an arbitrary space A to N, so that all images can be mapped into the standard metric space, so that the differences in the image data sets are abstracted as discrete distribution distances in the standard metric space.
[0019] Furthermore, in one embodiment of the present invention, the establishing of a mathematical measurement method with image feature targeting based on the mathematical abstraction includes:
[0020] The Wasserstein metric is used for the measurement of high-dimensional discrete distribution:
[0021]
[0022] Where S is the source domain image distribution, T is the target domain image distribution, and Π[S,T] is the set of all joint distributions of the source domain image distribution and the target domain image distribution;
[0023] The metric d in the standard metric space is constructed as follows:
[0024]
[0025] in is an adjustable parameter, which is related to the dimension p of the standard metric space 2 about; among
[0026]
[0027] Where x and y are images in the source domain image set and the target domain image set, respectively, μ x represents the mean value of image pixels, σ x Represents the standard deviation of image pixels, σ xy Represents the pixel covariance of two images.
[0028] Furthermore, in one embodiment of the present invention, after establishing a mathematical measurement method with image feature targeting based on the mathematical abstraction, it also includes calculating the high-dimensional image measurement according to the mathematical measurement method, specifically including:
[0029] Perform an equivalent transformation on the Wasserstein metric:
[0030] W[S,T]=min P <C,P>
[0031] C ij =d(x i ,y j ),
[0032] Where C is a distance matrix, whose elements consist of the distances between single images in different datasets, i.e., the metric values in the standard metric space, x i is the i-th image in the source domain image dataset, y j is the jth image in the target domain image dataset; P is the coupling matrix, which represents the optimal transmission scheme; the inner product of the distance matrix C and the coupling matrix P of the optimal transmission is the obtained Wasserstein metric.
[0033] Furthermore, in one embodiment of the present invention, it is characterized in that it also includes:
[0034] Matrix entropy is introduced to iteratively approximate the solution of the Wasserstein metric:
[0035] H(P)=-∑ ij P ij logP ij
[0036]
[0037] where ε is an adjustable regularization constant, is the regularized Wasserstein metric; the regularized Wasserstein metric is approximated using the Sinkhorn iteration method:
[0038]
[0039] u (0) =[0] |S| ,v (0) =[0] |T| T
[0040] u (n+1) =u (n) +ε(logμ-LSE J K(u (n) ,v (n) ))
[0041] v (n+1) =v (n) +ε(logv-LSE I K(u (n+1) ,v (n) ))
[0042]
[0043] Where |S| is the cardinality of S, that is, the number of images in the source domain image dataset, |T| is the number of images in the target domain image dataset; μ is a number whose elements are A column vector with |S| elements, where v is a vector with all elements A row vector of |T| elements, which represent the weight of each image in the two image datasets; u (0) is a column vector with |S| elements whose elements are all 0, v (0) is an element The row vector with a total of |T| elements is used as the starting point for iteration in formula (6), where LSE is the logsumexp function, which takes the maximum value of each row or column;
[0044] After a set number of iterations, the final vector is obtained, and the regularized coupling matrix is obtained, and finally the regularized Wasserstein metric is obtained:
[0045]
[0046]
[0047] Where m is the maximum number of iterations, is the regularized coupling matrix.
[0048] Furthermore, in one embodiment of the present invention, the optimizing the mathematical measurement method comprises:
[0049] The regularized Wasserstein metric is solved according to the random filling method, which includes setting a positive integer random threshold r and randomly selecting from the source domain image dataset and the target domain image dataset without duplication or omission each time. and The distance matrix is constructed for each image, and the regularized Wasserstein metric is calculated. The sum of the regularized Wasserstein metric for each batch is obtained to approximate the original regularized Wasserstein metric from the positive direction:
[0050]
[0051] Where S r and T r Respectively represent the image sets randomly selected from the source domain image dataset and the target domain image dataset in a single batch;
[0052] The computation time is reduced by replacing the original regularized Wasserstein metric with the approximate regularized Wasserstein metric calculated by the random filling method.
[0053] To achieve the above-mentioned purpose, the second aspect of the present invention proposes an inter-domain difference measurement device for image datasets, comprising the following modules:
[0054] An analysis module, used for performing mathematical feature analysis on the image data set to achieve mathematical abstraction of difference measurement of the image data set;
[0055] A construction module, for establishing a mathematical measurement method targeted at image features based on the mathematical abstraction;
[0056] An optimization module, used for optimizing the mathematical measurement method;
[0057] The measurement module is used to obtain the image data set to be measured and perform difference measurement on the image data set to be processed according to the optimized mathematical measurement method.
[0058] To achieve the above-mentioned purpose, the third aspect of the present invention proposes a computer device, characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, it implements the above-mentioned inter-domain difference measurement method for image data sets.
[0059] To achieve the above-mentioned purpose, the fourth aspect of the present invention proposes a computer-readable storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, it implements the above-mentioned inter-domain difference measurement method for image data sets.
[0060] The inter-domain difference measurement method for image datasets proposed in the embodiment of the present invention completes the mathematical abstraction of the difference measurement of image datasets by analyzing the mathematical features of image datasets; based on the mathematical abstraction, a set of mathematical measurement methods with targeted image features is established, and an optimization method is proposed in the calculation method, which significantly improves the optimization effect; thus, a complete set of inter-domain difference measurement methods for image datasets is formed.
[0061] The present invention is universal for various types of image data sets, can calculate the differences between image data sets in an objective quantitative manner, improves the generalization of image task domain adaptation, and saves computing resources and running time. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0063] Figure 1 A schematic diagram of a flow chart of an inter-domain difference measurement method for an image dataset provided by an embodiment of the present invention.
[0064] Figure 2 A schematic diagram of an inter-domain difference measurement device for image datasets provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0065] Embodiments of the present invention are described in detail below, examples of which 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 invention, and should not be construed as limiting the present invention.
[0066] The following describes an inter-domain difference measurement method for image datasets according to an embodiment of the present invention with reference to the accompanying drawings.
[0067] Figure 1 A schematic diagram of a flow chart of an inter-domain difference measurement method for an image dataset provided by an embodiment of the present invention.
[0068] like Figure 1 As shown, the inter-domain difference measurement method for image datasets includes the following steps:
[0069] S101: Perform mathematical feature analysis on the image data set to achieve mathematical abstraction of difference measurement of the image data set;
[0070] Two different image datasets can be viewed as two sets, where each image is an element in the set; the comparison of the difference between the two sets is based on the comparison of the elements in them, which requires that all elements in the set are comparable, that is, the elements must have the same structure. For each image, each pixel in it is regarded as a dimension, and the value of the dimension is the corresponding pixel value, so that each image can be regarded as a point in a high-dimensional space.
[0071] Furthermore, in one embodiment of the present invention, performing mathematical feature analysis on the image data set includes:
[0072] For each image in the image dataset, consider each pixel in it as a dimension;
[0073] Define a dimension as p 2 The standard metric space (N, d) defines a mapping f:A→N from any space A to N, so that all images can be mapped to the standard metric space, so that the differences in image data sets are abstracted as discrete distribution distances in the standard metric space.
[0074] S102: Establish mathematical measurement methods with image characteristics based on mathematical abstraction;
[0075] Furthermore, in one embodiment of the present invention, a mathematical measurement method with image feature targeting is established based on mathematical abstraction, including:
[0076] The Wasserstein metric is used for the measurement of high-dimensional discrete distribution:
[0077]
[0078] Where S is the source domain image distribution, T is the target domain image distribution, and Π[S,T] is the set of all joint distributions of the source domain image distribution and the target domain image distribution;
[0079] The metric d in the standard metric space is constructed as follows:
[0080]
[0081] in is an adjustable parameter, which is related to the dimension p of the standard metric space 2 about; among
[0082]
[0083] Where x and y are images in the source domain image set and the target domain image set, respectively, μx represents the mean value of image pixels, σ x Represents the standard deviation of image pixels, σ xy Represents the pixel covariance of two images.
[0084] The meaning of formula (1) is to find a joint distribution with the minimum transformation cost, which is the Wasserstein metric.
[0085] Since ‖xy‖ in formula (1) is defined by the metric d in the standard metric space, it can be derived to prove that W[S,T] satisfies non-negativity, non-degeneracy, symmetry and triangle inequality, that is, W[S,T] also satisfies the metric definition, indicating that the metric method has good universality and generalization.
[0086] The similarity kernel function between single elements corresponds to the metric d in the standard metric space, which represents the distance between two images mapped to the standard metric space. Different from the general image similarity comparison task, the comparison task in the image domain does not require precise alignment between images, but hopes that images with similar semantic information have a high degree of alignment.
[0087] Based on this, the similarity kernel function between single elements adopts the SSIM index, as shown in formula (3). This index takes into account the brightness, contrast and structural information of the image at the same time. Compared with the Euclidean distance used in traditional work, it is more suitable for measuring the similarity of images within and between domains. In addition, the SSIM index is insensitive to image translation, scaling, and rotation, which is a defect in the task of precise image alignment, but it is an advantage in the task of measuring the similarity of images within and between domains.
[0088] Since the value range of this index is (0,1], the more similar the input images are, the closer the calculation result is to 1. Conversely, the more different the input images are, the closer the calculation result is to 0. In order to construct the metric d in the standard metric space, it is necessary to perform negative correlation processing on this index. Experimental results show that the SSIM index of images in the same domain is lower than 0.3, while the SSIM index of images in different domains is lower than 0.1. Therefore, it is necessary to construct a convex mapping so that the absolute value of the metric of the same domain image is lower than the difference between the metric values of the two different domain images, so as to achieve the effect of small distance within the domain and large distance between domains. Therefore, the construction of d is as shown in formula (2).
[0089] Furthermore, in one embodiment of the present invention, after establishing a mathematical measurement method with image feature targeting based on mathematical abstraction, it also includes calculating the high-dimensional image measurement according to the mathematical measurement method, specifically including:
[0090] Perform an equivalent transformation on the Wasserstein metric:
[0091] W[S,T]=min P <C,P>
[0092] C ij =d(x i ,y j ),
[0093] Among them, C is a distance matrix, whose elements are composed of the distances between single images in different datasets, that is, the metric values in the standard metric space, and x i is the i-th image in the source domain image dataset, y j is the jth image in the target domain image dataset; P is the coupling matrix, which represents the optimal transmission scheme; the inner product of the distance matrix C and the coupling matrix P of the optimal transmission is the obtained Wasserstein metric.
[0094] Furthermore, in one embodiment of the present invention, it also includes:
[0095] Introduce matrix entropy to iteratively approximate the solution of Wasserstein metric:
[0096] H(P)=-∑ ij P ij logP ij
[0097]
[0098] where ε is an adjustable regularization constant, is the regularized Wasserstein metric; the regularized Wasserstein metric is approximated using the Sinkhorn iteration method:
[0099]
[0100] u (0) =[0] |S| ,v (0) =[0] |T| T
[0101] u (n+1) =u (n) +ε(logμ-LSE J K(u (n) ,v (n) ))
[0102] v (n+1) =v (n) +ε(logv-LSE I K(u (n+1) ,v (n) ))
[0103]
[0104] Where |S| is the cardinality of S, that is, the number of images in the source domain image dataset, |T| is the number of images in the target domain image dataset; μ is a number whose elements are A column vector with |S| elements, where v is a vector with all elements A row vector of |T| elements, which represent the weight of each image in the two image datasets; u (0) is a column vector with |S| elements whose elements are all 0, v (0) is an element The row vector with a total of |T| elements is used as the starting point for iteration in formula (6), where LSE is the logsumexp function, which takes the maximum value of each row or column;
[0105] After a set number of iterations, the final vector is obtained, and the regularized coupling matrix is obtained, and finally the regularized Wasserstein metric is obtained:
[0106]
[0107]
[0108] Where m is the maximum number of iterations, is the regularized coupling matrix.
[0109] S103: Optimize mathematical measurement methods;
[0110] The overall calculation process of the metric is divided into three steps. The first step is to complete the mapping of all images to the standard metric space, and uniformly scale all images to p×p size, that is, the dimension of the standard metric space N. The second step is to complete the construction of the distance matrix, match and measure the single image of the source image dataset and the target image dataset, and obtain each element in the distance matrix C. The third step is to complete the approximate iterative solution of the Wasserstein metric, and iterate to obtain the regularization matrix based on C. The inner product of the two matrices is used to obtain the metric value.
[0111] The step that consumes the most computing resources and time is step 2. If each image in the source domain image dataset and the target domain image dataset is measured in pairs, it will take a very long time to complete the measurement of two common datasets. This proposal proposes to use the optimization method of random filling of the distance matrix to reduce the computational overhead.
[0112] Furthermore, in one embodiment of the present invention, the mathematical measurement method is optimized, including:
[0113] The regularized Wasserstein metric is solved according to the random filling method, which includes setting a positive integer random threshold r and randomly selecting from the source domain image dataset and the target domain image dataset without duplication or omission each time. and The distance matrix is constructed for each image, and the regularized Wasserstein metric is calculated. The sum of the regularized Wasserstein metric for each batch is obtained to approximate the original regularized Wasserstein metric from the positive direction:
[0114]
[0115] Where S r and T r Respectively represent the image sets randomly selected from the source domain image dataset and the target domain image dataset in a single batch;
[0116] The computation time is reduced by replacing the original regularized Wasserstein metric with the approximate regularized Wasserstein metric calculated by the random filling method.
[0117] The approximate regularized Wasserstein metric calculated by the random filling method can be slightly larger than the exact value of the regularized Wasserstein metric within the acceptable error range, that is, Must be in , so the approximate solution can replace the exact solution for analysis and use in practical applications. This method greatly reduces the computational overhead and reduces the computational time to the original
[0118] S104: Obtain a dataset of images to be processed, and perform difference measurement on the dataset of images to be processed according to an optimized mathematical measurement method.
[0119] The inter-domain difference measurement method for image datasets proposed in the embodiment of the present invention completes the mathematical abstraction of the difference measurement of image datasets by analyzing the mathematical features of image datasets; based on the mathematical abstraction, a set of mathematical measurement methods with targeted image features is established, and an optimization method is proposed in the calculation method, which significantly improves the optimization effect; thus, a complete set of inter-domain difference measurement methods for image datasets is formed.
[0120] Compared with the prior art, the advantages of the present invention are:
[0121] 1) Current image similarity measurement methods mostly compare the similarity between two images, which is prone to large deviations in the judgment of complex or extreme environment image sets. This proposal completes the mathematical abstraction of the image dataset difference measurement task by analyzing the mathematical characteristics of the image dataset, so that it can accurately describe the inter-domain metric distance.
[0122] 2) Most existing methods cannot simultaneously satisfy non-negativity, symmetry, non-degeneracy, and triangle inequality. This proposal proposes to use the SSIM kernel function to calculate the similarity between single elements, the Sinkhorn high-dimensional metric method to solve it, and optimize the calculation process through block matrix operations, and finally obtain a rigorous domain metric method that meets non-negativity, symmetry, non-degeneracy, and triangle inequality, so that this metric method can be extended to scenarios with strict definition requirements for distance.
[0123] In order to implement the above embodiment, the present invention also proposes an inter-domain difference measurement device for image datasets.
[0124] Figure 2 A schematic diagram of the structure of an inter-domain difference measurement device for image datasets provided by an embodiment of the present invention.
[0125] like Figure 2 As shown, the inter-domain difference measurement device for image data sets includes: an analysis module 100, a construction module 200, an optimization module 300, and a measurement module 400, wherein:
[0126] An analysis module is used to perform mathematical feature analysis on the image data set to achieve mathematical abstraction of difference measurement of the image data set;
[0127] Building blocks for establishing mathematical measurement methods targeted at image features based on mathematical abstractions;
[0128] Optimization module, used to optimize mathematical measurement methods;
[0129] The measurement module is used to obtain the image data set to be measured and perform difference measurement on the image data set to be processed according to the optimized mathematical measurement method.
[0130] To achieve the above-mentioned purpose, the third aspect of the present invention proposes a computer device, characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, it implements the above-mentioned inter-domain difference measurement method for image data sets.
[0131] To achieve the above-mentioned purpose, the fourth aspect of the present invention proposes a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the inter-domain difference measurement method for image data sets as described above is implemented.
[0132] 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 invention. 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.
[0133] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0134] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A method for measuring inter-domain differences in image datasets, characterized in that: The following steps are involved: Perform mathematical feature analysis on the image data set to achieve mathematical abstraction of the difference measurement of the image data set, wherein for each image in the image data set, each pixel therein is regarded as a dimension, and a dimension is defined as p 2 A standard metric space (N, d) defines a mapping f:A→N from any space A to N, so that all images can be mapped into the standard metric space, so that the difference of the image data set is abstracted as the distance of discrete distribution in the standard metric space; Establishing a mathematical measurement method with image feature targeting based on the mathematical abstraction; Optimizing the mathematical measurement method; Obtaining a data set of images to be processed, and performing difference measurement on the data set of images to be processed according to an optimized mathematical measurement method; wherein, The method of establishing a mathematical measurement method with image feature targeting based on the mathematical abstraction includes: The Wasserstein metric is used for the measurement of high-dimensional discrete distribution: Where S is the source domain image distribution, T is the target domain image distribution, and Π[S,T] is the set of all joint distributions of the source domain image distribution and the target domain image distribution; The metric d in the standard metric space is constructed as follows: in is an adjustable parameter, which is related to the dimension p of the standard metric space 2 about; among Where x and y are images in the source domain image set and the target domain image set, respectively, μ x represents the mean value of image pixels, σ x Represents the standard deviation of image pixels, σ xy Represents the pixel covariance of two images; The optimizing of the mathematical measurement method comprises: The regularized Wasserstein metric is solved according to the random filling method, which includes setting a positive integer random threshold r and randomly selecting from the source domain image dataset and the target domain image dataset without duplication or omission each time. and The distance matrix is constructed for each image, and the regularized Wasserstein metric is calculated. The sum of the regularized Wasserstein metric for each batch is obtained to approximate the original regularized Wasserstein metric from the positive direction: Where S r and T r Respectively represent the image sets randomly selected from the source domain image dataset and the target domain image dataset in a single batch; The computation time is reduced by replacing the original regularized Wasserstein metric with the approximate regularized Wasserstein metric calculated by the random filling method.
2. The method according to claim 1, characterized in that After establishing a mathematical measurement method with image feature targeting based on the mathematical abstraction, the method further includes calculating the high-dimensional image measurement according to the mathematical measurement method, specifically including: Perform an equivalent transformation on the Wasserstein metric: W[S,T]=min P <C,P> C ij =d(x i ,y j ), Among them, C is a distance matrix, whose elements are composed of the distances between single images in different datasets, that is, the metric values in the standard metric space, and x i is the i-th image in the source domain image dataset, y j is the jth image in the target domain image dataset; P is the coupling matrix, which represents the optimal transmission scheme; the inner product of the distance matrix C and the coupling matrix P of the optimal transmission is the obtained Wasserstein metric.
3. The method according to claim 2, characterized in that Also includes: Matrix entropy is introduced to iteratively approximate the solution of the Wasserstein metric: H(P)=-∑ ij P ij logP ij where ε is an adjustable regularization constant, is the regularized Wasserstein metric; the regularized Wasserstein metric is approximated using the Sinkhorn iteration method: u (0) =[0] |S| ,v (0) =[0] |T| T in (n+1) =in (n) +ε(logμ-LSE J K(in (n) ,v (n) )) v (n+1) =v (n) +ε(logv-LSE I K(u (n+1) ,v (n) )) Where |S| is the cardinality of S, that is, the number of images in the source domain image dataset, |T| is the number of images in the target domain image dataset; μ is a number whose elements are A column vector with |S| elements, where v is a vector with all elements A row vector of |T| elements, which represent the weight of each image in the two image datasets; u (0) is a column vector with |S| elements whose elements are all 0, v (0) is an element The row vector with a total of |T| elements is used as the starting point for iteration in formula (6), where LSE is the logsumexp function, which takes the maximum value of each row or column; After a set number of iterations, the final vector is obtained, and the regularized coupling matrix is obtained, and finally the regularized Wasserstein metric is obtained: Where m is the maximum number of iterations, is the regularized coupling matrix.
4. A device for measuring inter-domain differences of image datasets, characterized in that: Includes the following modules: The analysis module is used to perform mathematical feature analysis on the image data set to realize mathematical abstraction of the difference measurement of the image data set, wherein, for each image in the image data set, each pixel therein is regarded as a dimension, and a dimension is defined as p 2 A standard metric space (N, d) defines a mapping f:A→N from any space A to N, so that all images can be mapped into the standard metric space, so that the difference of the image data set is abstracted as the distance of discrete distribution in the standard metric space; A construction module, for establishing a mathematical measurement method targeted at image features based on the mathematical abstraction; An optimization module, used for optimizing the mathematical measurement method; The measurement module is used to obtain the image data set to be measured, and perform difference measurement on the image data set to be measured according to the optimized mathematical measurement method; wherein, The building blocks are also used to: The Wasserstein metric is used for the measurement of high-dimensional discrete distribution: Where S is the source domain image distribution, T is the target domain image distribution, and Π[S,T] is the set of all joint distributions of the source domain image distribution and the target domain image distribution; The metric d in the standard metric space is constructed as follows: in is an adjustable parameter, which is related to the dimension p of the standard metric space 2 about; among Where x and y are images in the source domain image set and the target domain image set, respectively, μ x represents the mean value of image pixels, σ x Represents the standard deviation of image pixels, σ xy Represents the pixel covariance of two images; The optimization module is also used to: The regularized Wasserstein metric is solved according to the random filling method, which includes setting a positive integer random threshold r and randomly selecting from the source domain image dataset and the target domain image dataset without duplication or omission each time. and The distance matrix is constructed for each image, and the regularized Wasserstein metric is calculated. The sum of the regularized Wasserstein metric for each batch is obtained to approximate the original regularized Wasserstein metric from the positive direction: Where S r and T r Respectively represent the image sets randomly selected from the source domain image dataset and the target domain image dataset in a single batch; The computation time is reduced by replacing the original regularized Wasserstein metric with the approximate regularized Wasserstein metric calculated by the random filling method.
5. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for measuring inter-domain differences for image data sets as described in any one of claims 1 to 3 is implemented.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for measuring inter-domain differences for image datasets according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Robust feature learning method based on hierarchical feature alignment
CN111950635A