Disclosure of Invention
The present invention aims to solve at least one of the technical problems in the related art to some extent.
Therefore, the invention aims to provide an inter-domain difference measurement method for an image data set, which is used for realizing inter-domain difference measurement of a complete image data set.
To achieve the above object, an embodiment of a first aspect of the present invention provides an inter-domain difference measurement method for an image dataset, including:
performing mathematical feature analysis on an image dataset to realize mathematical abstraction of difference measurement of the image dataset;
establishing a mathematical measurement method with image characteristic pertinence based on the mathematical abstraction;
optimizing the mathematical measure;
and acquiring an image data set to be processed, and carrying out difference measurement on the image data set to be processed according to an optimized mathematical measurement method.
In addition, an inter-domain difference measurement method for an image dataset according to the above embodiment of the present invention may further have the following additional technical features:
further, in one embodiment of the present invention, the performing mathematical feature analysis on the image dataset includes:
regarding each image in the image dataset, regarding each pixel therein as a dimension;
define a dimension as p 2 The standard metric space (N, d) defines a mapping f of arbitrary space a to N a→n such that all images can be mapped into the standard metric space, whereby the differences of the image dataset are abstracted to the distances of discrete distribution in the standard metric space.
Further, in an embodiment of the present invention, the establishing a mathematical metric method with image feature pertinence based on the mathematical abstraction includes:
the Wasserstein metric is used for the metric of the high-dimensional discrete distribution:
s is the source domain image distribution, T is the target domain image distribution, and pi [ S, T ] is the set of all the 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:
wherein the method comprises the steps ofIs an adjustable parameter and is related to the dimension p of the standard measurement space 2 Related to; wherein the method comprises the steps of
Wherein x and y are images of the source domain image set and the target domain image set, respectively, μ x Representing the mean value, sigma, of the pixels of the image x Representing the standard deviation, sigma, of the pixels of the image xy Representing the covariance of two image pixels.
Further, in one embodiment of the present invention, after establishing a mathematical measurement method with image feature pertinence based on the mathematical abstraction, the method further includes calculating a high-dimensional image measurement according to the mathematical measurement method, which specifically includes:
equivalent transformation of Wasserstein metric:
W[S,T]=min P <C,P>
C ij =d(x i ,y j ),
wherein C is a distance matrix in which the elements consist of the distances of individual images between different data sets, i.e. the metric values in a standard metric space, x i Is the ith image, y in the source domain image dataset j Is the j-th image in the target domain image dataset; p is a coupling matrix, representing an optimal transmission scheme; the inner product of the distance matrix C and the coupling matrix P of optimal transmission is the obtained Wasserstein metric.
Further, in one embodiment of the present invention, the method further includes:
introducing matrix entropy to perform iterative approximate solution on the Wasserstein metric:
H(P)=-∑ ij P ij logP ij
where epsilon is an adjustable regularization constant,is a regularized wasperstein metric; the regularized Wasserstein measurement is approximately solved by using a Sinkhorn iteration method:
u (0) =[0] |S| ,v (0) =[0] |T| T
u (n+1) =u (n) +ε(logμ-LSE J K(u (n) ,v (n) ))
v (n+1) =v (n) +ε(logv-LSE I K(u (n+1) ,v (n) ))
where |s| is the cardinal number of S, i.e., the number of pictures of the source domain image dataset, and |t| is the number of pictures of the target domain image dataset; mu being an elementColumn vectors of total S elements, v being an element +.>Row vectors of total |T| elements, which respectively represent the weights of each image of two image datasets; u (u) (0) Is a column vector with 0 elements and total I S elements, v (0) Is an element ∈>Performing iteration in the formula (6) by taking a row vector of total I and T as an iteration starting point, wherein LSE is a logsumexp function, and the LSE is the maximum value of each row or each column;
obtaining a final vector after carrying out set times of iteration, obtaining a regularized coupling matrix, and finally obtaining regularized Wasserstein measurement:
where m is the maximum number of iterations,is a regularized coupling matrix.
Further, in an embodiment of the present invention, the optimizing the mathematical metric method includes:
solving regularized Wasserstein metrics according to random filling method, comprising setting a positive integer random threshold r, each time without undue experimentation from a source domain image dataset and a targetDomain image dataset random selectionAnd->The distance matrix is constructed by the sheet image, regularized Wasserstein metrics are calculated, and the sum of the regularized Wasserstein metrics of each batch is obtained from forward approximation to the original regularized Wasserstein metrics:
wherein S is r And T r Respectively representing image sets randomly selected from a source domain image dataset and a target domain image dataset in a single batch;
the approximate regularized Wasserstein metric calculated by the random filling method is used for replacing the original regularized Wasserstein metric, so that the time required for calculation is reduced.
To achieve the above object, an embodiment of the second aspect of the present invention provides an inter-domain difference measurement device for an image dataset, including:
the analysis module is used for carrying out mathematical characteristic analysis on the image data set and realizing mathematical abstraction of difference measurement of the image data set;
the construction module is used for establishing a mathematical measurement method with image characteristic pertinence based on the mathematical abstraction;
the optimizing module is used for optimizing the mathematical measurement method;
and the measurement module is used for acquiring an image data set to be measured and carrying out difference measurement on the image data set to be processed according to the optimized mathematical measurement method.
To achieve the above object, an embodiment of the present invention provides a computer device, which is characterized by comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements an inter-domain difference measurement method for image data sets as described above when executing the computer program.
To achieve the above object, a fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements an inter-domain difference measurement method for image data sets as described above.
According to the inter-domain difference measurement method for the image data set, mathematical abstraction of the difference measurement of the image data set is completed through mathematical feature analysis of the image data set; a set of mathematical measurement method with image characteristic pertinence is established based on the mathematical abstraction, and an optimization method is provided on the calculation mode, so that the optimization effect is remarkably improved; a complete set of inter-domain difference measurement methods for the image dataset is formed.
The invention has universality for various image data sets, can calculate the difference between the image data sets in an objective quantitative mode, improves the generalization of image task domain self-adaption, and saves calculation resources and running time.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative and intended to explain the present invention and should not be construed as limiting the invention.
An inter-domain difference measurement method for an image dataset according to an embodiment of the present invention is described below with reference to the accompanying drawings.
Fig. 1 is a flow chart of an inter-domain difference measurement method for an image dataset according to an embodiment of the present invention.
As shown in fig. 1, the inter-domain difference measurement method for an image dataset includes the following steps:
s101: performing mathematical characteristic analysis on the image data set to realize mathematical abstraction of difference measurement of the image data set;
two different sets of image data may be considered two sets, with each image being an element of a set; the comparison of the differences between the two sets is based on the comparison of the elements therein, requiring that all elements in the set be comparable, i.e. that the elements must be structurally identical to each other. For each image, each pixel 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 the high-dimensional space.
Further, in one embodiment of the invention, performing mathematical feature analysis on an image dataset includes:
regarding each image in the image dataset, regarding each pixel therein as a dimension;
define a dimension as p 2 The standard metric space (N, d) defines a mapping f of arbitrary space a to N, a→n, such that all images can be mapped into the standard metric space, whereby differences in the image dataset are abstracted to discrete distributed distances in the standard metric space.
S102: establishing a mathematical measurement method with image characteristic pertinence based on mathematical abstraction;
further, in one embodiment of the present invention, a mathematical metric method with image feature pertinence is established based on mathematical abstraction, including:
the Wasserstein metric is used for the metric of the high-dimensional discrete distribution:
s is the source domain image distribution, T is the target domain image distribution, and pi [ 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:
wherein the method comprises the steps ofIs an adjustable parameter and is related to the dimension p of the standard measurement space 2 Related to; wherein the method comprises the steps of
Wherein x and y are images of the source domain image set and the target domain image set, respectively, μ x Representing the mean value, sigma, of the pixels of the image x Representing the standard deviation, sigma, of the pixels of the image xy Representing the covariance of two image pixels.
The meaning of the formula (1) is to find a joint distribution with the minimum transformation cost, namely the Wasserstein measurement.
Since the II x-y II in the formula (1) is defined by the metric d in the standard metric space, W [ S, T ] can be derived to prove that W [ S, T ] meets the non-negativity, non-degeneracy, symmetry and triangle inequality, namely W [ S, T ] also meets the metric definition, and the metric mode has good universality and generalization.
The single-element similarity kernel corresponds to a metric d in the standard metric space, representing the distance between two images mapped into the standard metric space. Unlike a general image similarity comparison task, the image domain comparison task does not require precise alignment between images, but rather it is desirable that images with similar semantic information have a higher degree of alignment.
Based on the above, the single-element similarity kernel function adopts an SSIM index, as shown in formula (3), and the index simultaneously considers the brightness, contrast and structural information of the image, so that compared with Euclidean distance used in the traditional work, the single-element similarity kernel function is more suitable for measuring the similarity of intra-domain and inter-domain images. Furthermore, SSIM index has insensitivity to image translation, scaling, rotation, which is a drawback in the task of image accurate alignment, but is instead an advantage in the task of intra-domain, inter-domain image similarity measurement.
In order to construct the measurement d in the standard measurement space, the experimental result shows that the SSIM index of the same-domain image is lower than 0.3 and the SSIM index of the different-domain image is lower than 0.1, so that a downward convex mapping is required to be constructed, the absolute value of the measurement of the same-domain image is lower than the difference between the measurement values of two different-domain images, and the effects of small intra-domain distance and large inter-domain distance are achieved.
Further, in one embodiment of the present invention, after establishing the mathematical measurement method with image feature pertinence based on the mathematical abstraction, the method further includes calculating the high-dimensional image measurement according to the mathematical measurement method, which specifically includes:
equivalent transformation of Wasserstein metric:
W[S,T]=min P <C,P>
C ij =d(x i ,y j ),
wherein C is a distance matrix, wherein the elements consist of the distances of individual images between different data sets, i.e. the metric values in a standard metric space, x i Is the ith image, y in the source domain image dataset j Is the j-th image in the target domain image dataset; p is a coupling matrix, representing an optimal transmission scheme; the inner product of the distance matrix C and the coupling matrix P of optimal transmission is the obtained Wasserstein metric.
Further, in one embodiment of the present invention, the method further includes:
introducing matrix entropy to perform iterative approximate solution on Wasserstein measurement:
H(P)=-∑ ij P ij logP ij
where epsilon is an adjustable regularization constant,is a regularized wasperstein metric; the regularized Wasserstein measurement is approximately solved by using a Sinkhorn iteration method:
u (0) =[0] |S| ,v (0) =[0] |T| T
u (n+1) =u (n) +ε(logμ-LSE J K(u (n) ,v (n) ))
v (n+1) =v (n) +ε(logv-LSE I K(u (n+1) ,v (n) ))
where |s| is the cardinal number of S, i.e., the number of pictures of the source domain image dataset, and |t| is the number of pictures of the target domain image dataset; mu being an elementColumn vectors of total S elements, v being an element +.>Row vectors of total |t| elements representing each image of two image datasetsWeights of (2); u (u) (0) Is a column vector with 0 elements and total I S elements, v (0) Is an element ∈>Performing iteration in the formula (6) by taking a row vector of total I and T as an iteration starting point, wherein LSE is a logsumexp function, and the LSE is the maximum value of each row or each column;
obtaining a final vector after carrying out set times of iteration, obtaining a regularized coupling matrix, and finally obtaining regularized Wasserstein measurement:
where m is the maximum number of iterations,is a regularized coupling matrix.
S103: optimizing a logarithmic metric method;
the overall calculation process of the metrics 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, i.e. the dimension of the standard metric space N. And secondly, completing construction of a distance matrix, and carrying out matching measurement on single images of the source image dataset and the target image dataset to obtain each element in the distance matrix C. The third step is to complete the approximate iteration solution of Wasserstein measurement, and iterate to obtain a regularized matrix by taking C as a base pointAnd obtaining the inner product of the two matrixes to obtain a metric value.
The most consumed computing resource and computing time in the overall step is step two. If a pairing metric is performed for each image of the source domain image dataset and the target domain image dataset, the metric for the two common datasets takes a very long time to complete. The proposal proposes an optimization method using distance matrix random filling to reduce the computational overhead.
Further, in one embodiment of the present invention, optimizing the digital metric method includes:
solving regularized Wasserstein metrics according to a random fill method includes setting a positive integer random threshold r, randomly selecting from a source domain image dataset and a target domain image dataset each time without undue experimentationAnd->The distance matrix is constructed by the sheet image, regularized Wasserstein metrics are calculated, and the sum of the regularized Wasserstein metrics of each batch is obtained from forward approximation to the original regularized Wasserstein metrics:
wherein S is r And T r Respectively representing image sets randomly selected from a source domain image dataset and a target domain image dataset in a single batch;
the approximate regularized Wasserstein metric calculated by the random filling method is used for replacing the original regularized Wasserstein metric, so that the time required for calculation is reduced.
The approximate regularized Wasserstein metric calculated by random filling method can be slightly larger than the accurate value of the regularized Wasserstein metric within the acceptable error range, namelyMust be at->So the approximation solution is in the right neighborhood of (3) and the approximation solution is in factThe method can replace accurate solution for analysis and use when in use. The method greatly reduces calculation cost, and changes calculation time into original +.>
S104: and acquiring an image data set to be processed, and carrying out difference measurement on the image data set to be processed according to the optimized mathematical measurement method.
According to the inter-domain difference measurement method for the image data set, mathematical abstraction of the difference measurement of the image data set is completed through mathematical feature analysis of the image data set; a set of mathematical measurement method with image characteristic pertinence is established based on the mathematical abstraction, and an optimization method is provided on the calculation mode, so that the optimization effect is remarkably improved; a complete set of inter-domain difference measurement methods for the image dataset is formed.
Compared with the prior art, the invention has the advantages that:
1) The current image similarity measurement method is mainly used for comparing the similarity between two images, and large deviation is easy to occur in the judgment of a complex or extreme environment image set; the mathematical abstraction of the image dataset difference measurement task is completed through the mathematical feature analysis of the image dataset, so that the mathematical abstraction can accurately describe the inter-domain measurement distance.
2) Most of the existing methods cannot meet the requirements of non-negativity, symmetry, non-degeneracy and triangular inequality at the same time. The proposal provides a method for calculating the similarity among single elements by using an SSIM kernel function and solving the similarity by using a sink horn high-dimensionality method, and optimizing the calculation process by using a block matrix operation mode, so as to finally obtain a strict domain measurement mode conforming to non-negativity, symmetry, non-degeneracy and triangle inequality, and the measurement mode can be popularized to a scene with strict definition requirements on distance.
In order to implement the above embodiment, the present invention also proposes an inter-domain difference measurement device for an image dataset.
Fig. 2 is a schematic structural diagram of an inter-domain difference measurement device for an image dataset according to an embodiment of the present invention.
As shown in fig. 2, the inter-domain difference measurement device for an image dataset includes: an analysis module 100, a construction module 200, an optimization module 300, a metrics module 400, wherein,
the analysis module is used for carrying out mathematical characteristic analysis on the image data set and realizing mathematical abstraction of difference measurement of the image data set;
the construction module is used for establishing a mathematical measurement method with image characteristic pertinence based on mathematical abstraction;
the optimization module is used for optimizing the digital measurement method;
and the measurement module is used for acquiring the image data set to be measured and carrying out difference measurement on the image data set to be processed according to the optimized mathematical measurement method.
To achieve the above object, an embodiment of a third aspect of the present invention provides a computer device, which is characterized by comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the inter-domain difference measurement method for image dataset as described above when executing the computer program.
To achieve the above object, a fourth aspect of the present invention provides a computer-readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements an inter-domain difference measurement method for image dataset as described above.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present invention, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
While embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the invention, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the invention.