Home textile image retrieval and re-ranking method and device based on feature fusion

Through feature fusion and Markov random walk technology, the problem of negative samples being placed first in home textile image retrieval is solved, the retrieval precision and accuracy are improved, and a more comprehensive similarity measure is provided through the fusion of high-level semantics and low-level texture information.

CN118364127BActive Publication Date: 2024-09-06CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410796082.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-09-06
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

In home textile image retrieval, existing image retrieval algorithms have small differences between image categories and complex fine-grained information, resulting in negative samples being placed at the front, low retrieval accuracy, and lack of effective solutions.

Method used

Using a method based on feature fusion, high-level features and low-level features are extracted from the image to be retrieved, combined with the image vector library to construct a weighted graph and perform a Markov random walk, and the diffusion similarity is calculated and fused to reorder the image retrieval sample library. .

Benefits of technology

It effectively reduces the number of negative samples at the front, improves the precision and accuracy of home textile image retrieval, and provides a more comprehensive and accurate similarity measure by fusing high-level semantic information and low-level texture information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118364127B
    Figure CN118364127B
Patent Text Reader

Abstract

The present application provides a method and device for reordering home textile images based on feature fusion, which relates to the field of image processing technology. The method includes: extracting features of the image to be retrieved to obtain high-level features and low-level features; determining a first retrieval list and a second retrieval list according to the high-level features, the low-level features and the corresponding image vector library; constructing a first weighted graph corresponding to the first retrieval list and a second weighted graph corresponding to the second retrieval list respectively; performing Markov random walks on the first weighted graph and the second weighted graph respectively, and obtaining a first diffusion similarity corresponding to the high-level features and a second diffusion similarity corresponding to the low-level features; fusing the first diffusion similarity with the second diffusion similarity to obtain a diffusion distance; reordering the image retrieval sample library according to the diffusion distance to obtain a target retrieval list of the image to be retrieved. The present invention can improve the accuracy of home textile image retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of image processing technology, and in particular to a method and device for retrieval and re-ranking of home textile images based on feature fusion. Background Art

[0002] At present, image retrieval algorithms are usually used for image retrieval of home textile images. Since the differences between image categories of home textile images are small, and the fine-grained information such as patterns and patterns in key areas are complex, different categories can only be distinguished by small differences, and these differences are mainly reflected in image texture, color and other information. Therefore, the retrieval results obtained by retrieving home textile images based on existing image retrieval algorithms often have the problem of negative samples being at the top. Negative samples refer to images that are of different categories from the queried home textile images but have only slight differences, resulting in low accuracy in home textile image retrieval.

[0003] There is currently no better solution to the above problems. Summary of the invention

[0004] The embodiment of the present invention provides a method and device for re-ranking home textile images based on feature fusion, so as to improve the accuracy of home textile image retrieval.

[0005] According to an embodiment of the present invention, a home textile image retrieval method based on feature fusion is provided, comprising:

[0006] Perform feature extraction on the image to be retrieved to obtain high-level features and low-level features;

[0007] Determine a first search list according to the high-level features and the corresponding first image vector library, and determine a second search list according to the low-level features and the corresponding second image vector library, wherein the first image vector library and the second image vector library are both obtained based on the image retrieval sample library of the image to be retrieved;

[0008] respectively constructing a first weighted graph corresponding to the first search list and a second weighted graph corresponding to the second search list;

[0009] Performing Markov random walk on the first weighted graph and the second weighted graph respectively, and obtaining a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature;

[0010] The first diffusion similarity and the second diffusion similarity are merged to obtain a diffusion distance;

[0011] The image retrieval sample library is reordered according to the diffusion distance to obtain a target retrieval list of the images to be retrieved.

[0012] In an exemplary embodiment, performing Markov random walk on the first weighted graph and the second weighted graph respectively and obtaining a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature includes:

[0013] The Markov random walk is restricted to the k context neighbors of the current data point of the first weighted graph or the second weighted graph, and the Markov random walk is performed on the first weighted graph and the second weighted graph respectively, and a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature are obtained.

[0014] In an exemplary embodiment, limiting the Markov random walk to k context neighbors of the current data point of the first weighted graph or the second weighted graph includes:

[0015] Constructing a k-context neighbor graph according to the first weighted graph or the second weighted graph, wherein the vertices of the k-context neighbor graph are the same as the vertices of the first weighted graph or the second weighted graph, and the weights of the edges of the k-context neighbor graph are different from the weights of the edges of the first weighted graph or the second weighted graph;

[0016] The edge weights in the k-context neighbor graph include:

[0017] ;

[0018] In the formula, E k ( i,j ) is the edge weight in the k-context neighbor graph, E( i,j ) is the edge weight of the first weighted graph or the second weighted graph, Q k ( x i ) represents x i The set of k contextual neighbors of x i and x j are all vertices of the first weighted graph or the second weighted graph.

[0019] In an exemplary embodiment, performing Markov random walk on the first weighted graph and the second weighted graph respectively and obtaining a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature includes:

[0020] In the process of performing Markov random walk on the first weighted graph and the second weighted graph respectively, the edge weights in the k-context neighbor graph are calculated from the vertex x iTo the top x j A transition probability matrix, and determining a diffusion similarity according to the transition probability matrix, wherein the diffusion similarity includes a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature;

[0021] Wherein, the transition probability matrix includes:

[0022] ;

[0023] In the formula, is the transition probability matrix, E k ( i,j ) is the edge weight in the k-context neighbor graph.

[0024] In an exemplary embodiment, the fusing the first diffusion similarity and the second diffusion similarity to obtain the diffusion distance includes:

[0025] Constructing a first alternating diffusion factor according to the first diffusion similarity K il , and construct a second alternating diffusion factor according to the second diffusion similarity K jl ;

[0026] According to the diffusion distance calculation formula, according to the first alternating diffusion factor K il The second alternating diffusion factor K jl calculating the diffusion distance;

[0027] The diffusion distance calculation formula includes:

[0028] ;

[0029] In the formula, d ij is the diffusion distance.

[0030] In an exemplary embodiment, extracting features from the image to be retrieved to obtain high-level features and low-level features includes:

[0031] The image to be retrieved is used as an input of a neural network model to obtain the high-level features and the low-level features.

[0032] In an exemplary embodiment, determining the first search list according to the high-level features and the corresponding first image vector library, and determining the second search list according to the low-level features and the corresponding second image vector library, includes:

[0033] Calculating a first cosine distance between the high-level feature and each corresponding image vector in the first image vector library, and calculating a second cosine distance between the low-level feature and each corresponding image vector in the second image vector library;

[0034] The first cosine distance is sorted by size to obtain the sorted first search list, and the second cosine distance is sorted by size to obtain the sorted second search list, wherein the first search list is obtained by sorting the first image vector library based on the first cosine distance, and the second search list is obtained by sorting the second image vector library based on the second cosine distance.

[0035] According to another embodiment of the present invention, a home textile image retrieval device based on feature fusion is provided, comprising:

[0036] A feature extraction module is used to extract features of the image to be retrieved and obtain high-level features and low-level features;

[0037] A retrieval list determination module, used to determine a first retrieval list according to the high-level features and the corresponding first image vector library, and to determine a second retrieval list according to the low-level features and the corresponding second image vector library, wherein the first image vector library and the second image vector library are both obtained based on an image retrieval sample library of the image to be retrieved;

[0038] A weighted graph construction module, used to respectively construct a first weighted graph corresponding to the first search list and a second weighted graph corresponding to the second search list;

[0039] A random walk module, used for performing Markov random walk on the first weighted graph and the second weighted graph respectively, and obtaining a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature;

[0040] a fusion module, configured to fuse the first diffusion similarity with the second diffusion similarity to obtain a diffusion distance;

[0041] A reordering module is used to reorder the image retrieval sample library according to the diffusion distance to obtain a target retrieval list of the images to be retrieved.

[0042] According to yet another embodiment of the present invention, there is further provided an electronic device, including:

[0043] Home textile image retrieval device based on feature fusion;

[0044] a memory configured to store instructions;

[0045] and a processor configured to call the instructions from the memory and implement the above-mentioned home textile image retrieval method based on feature fusion when executing the instructions.

[0046] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps in the above method embodiment when running.

[0047] This application first extracts high-level features and low-level features from the image to be retrieved, and combines two image vector libraries to determine the retrieval list, which can more comprehensively describe the characteristics of home textile images. At the same time, a weighted graph is constructed and a Markov random walk is performed to obtain diffusion similarity, which can effectively consider the internal structure and similarity information of the image, thereby reducing the problem of negative samples being placed in front. Finally, by fusing the diffusion similarity to obtain the diffusion distance and reordering the image retrieval sample library, the precision and accuracy of home textile image retrieval can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 is a flow chart of a home textile image retrieval method based on feature fusion according to an embodiment of the present invention;

[0049] Figure 2 is a schematic flow chart of a home textile image retrieval method based on feature fusion according to an embodiment of the present invention;

[0050] Figure 3 is a feature visualization schematic diagram according to an embodiment of the present invention;

[0051] Figure 4 It is a schematic diagram of obtaining a search list according to an embodiment of the present invention. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0053] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0054] The following is a detailed description of the home textile image retrieval method based on feature fusion provided by the embodiment of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0055] In this embodiment, a home textile image retrieval method based on feature fusion is provided. Figure 1 and Figure 2 ,A home textile image retrieval method based on feature fusion includes the following steps:

[0056] S101, extracting features from the image to be retrieved to obtain high-level features and low-level features.

[0057] In this embodiment, high-level features are used to represent semantic information of the image to be retrieved, and low-level features are used to represent texture and style information of the image to be retrieved.

[0058] Specifically, a convolutional neural network can be used to extract features from the image to be retrieved. Different layers of the convolutional neural network have different attribute characteristics. At the bottom layer of the network, the features extracted are mainly detailed features such as texture and color; most of the features extracted in the middle layer are style details, etc., and most of the features extracted from the high-level network are overall features of the image.

[0059] S102. Determine a first search list based on high-level features and the corresponding first image vector library, and determine a second search list based on low-level features and the corresponding second image vector library, wherein both the first image vector library and the second image vector library are obtained based on an image retrieval sample library of the image to be retrieved.

[0060] The first retrieval list is a candidate image list determined based on high-level features and the corresponding first image vector library, and the first retrieval list includes images having similar semantic information to the image to be retrieved; the second retrieval list is a candidate image list determined based on low-level features and the corresponding second image vector library, and the second retrieval list includes images having similar texture and style information to the image to be retrieved.

[0061] The first image vector library and the second image vector library are both obtained based on an image retrieval sample library of the image to be retrieved.

[0062] Specifically, the image retrieval sample library is a database containing a large number of image samples, in which the image samples are used to construct an image vector library. The first image vector library is obtained based on the image retrieval sample library of the image to be retrieved, which contains image vectors corresponding to high-level features; and the second image vector library is also obtained based on the image retrieval sample library of the image to be retrieved, which contains image vectors corresponding to low-level features. In other words, the first image vector library and the second image vector library are both constructed based on the image retrieval sample library where the image to be retrieved is located, and are used to store feature vectors of similar images.

[0063] S103 , constructing a first weighted graph corresponding to the first search list and a second weighted graph corresponding to the second search list respectively.

[0064] A weighted graph is a graph that weights the edges in the graph, that is, assigning a weight value to each edge in the graph. In the image retrieval scenario, a weighted graph is used to represent the similarity relationship between images, and the weight value can represent the degree of similarity between images.

[0065] Specifically, the first weighted graph is constructed based on the images in the first search list, where each node in the graph represents a candidate image, and the weight of the edge represents the similarity between images; the second weighted graph is similarly constructed based on the images in the second search list, where each node in the graph represents a candidate image, and the weight of the edge represents the similarity between images.

[0066] An example of constructing a weighted graph based on a search list is given below:

[0067] For example, if the image to be retrieved is x1, the retrieval list Q={xi | i=2,3,…n+1}, x i represents the most similar result to the image in the image library, and the ranking is i-1, and n represents the number of images in the search list Q. Assume that the list corresponding to all images is X={x1,x2,...,x n+1}, the image vector is V={v1,v2,...,v n+1 First, we build a weighted graph G = {X, E}, where X is a vertex set, each vertex corresponds to an image, and E represents an edge set. The weight of the edge is proportional to the similarity Sc between the data points. The similarity here is represented by the cosine distance. Each element in E is defined as:

[0068] ;(1)

[0069] It is worth mentioning that , when i=j, E(i,j)=1.

[0070] This results in a symmetric weighted graph G:

[0071] ; (2)

[0072] S104 , performing Markov random walk on the first weighted graph and the second weighted graph respectively, and obtaining a first diffusion similarity corresponding to the high-level features and a second diffusion similarity corresponding to the low-level features.

[0073] Markov random walk is a process in which a random variable moves along the edges of a graph. When performing a random walk between nodes in a graph, the probability of movement depends on the connection between the nodes, that is, the weight of the edge. In image retrieval, the Markov random walk algorithm can be used to calculate the similarity between images. By performing a random walk in a graph, the degree of association between different images can be evaluated, thereby calculating the similarity between images.

[0074] Diffusion similarity is used to measure the similarity between images. In this embodiment, diffusion similarity is calculated by Markov random walk algorithm.

[0075] According to the example of constructing a weighted graph according to the search list in S103, the symmetric weighted graph G can be known. In order to realize the diffusion of similarity information, firstly, the row random matrix P is obtained from the weighted graph G:

[0076] ; (3)

[0077] At this time, the row random matrix P no longer satisfies the symmetry and satisfies the following properties:

[0078] ; (4)

[0079] This property is used to define the Markov random walk on the graph G, where P is the transfer matrix, p ij Represents the vertex x i Transfer to x j The diffusion process diffuses the similarity information according to the weight of the edge. This process can be regarded as a random walk process on a weighted graph.

[0080] The transition matrix P contains the geometric information of the data set. The transition probability defined by the matrix P directly reflects the local geometry defined by the neighbors of each vertex in the weighted graph. i , x j ) means that in one time step, from vertex x i to x j The transition probability and edge weight E(x i , xj ). For t ≥ 0, within t time steps, i Transfer to x j The probability of P(t) (x i , x j ), during the diffusion process, the similarity information is chained forward over time, and all local geometric shapes are gradually captured. Ideally, the diffusion process can reveal the underlying geometric structure of the data manifold.

[0081] In order to realize the diffusion process, the following methods can be used:

[0082] ; (5)

[0083] Where t is a positive integer and 0<α<1 is a decay coefficient that makes P(t) converge as t→∞. Intuitively, α controls the diffusion of P(t) under fixed t: the larger the value of α, the greater the influence of each vertex on other vertices. Typically, α is set between 0.8 and 0.95.

[0084] For any , P (t) converges to a fixed non-trivial solution:

[0085] ; (6)

[0086] Among them, In+1 is the identity matrix of size (n+1)×(n+1).

[0087] When t→∞, the proof process of P (t) convergence is as follows:

[0088] 1. For formula (5), P (t) can be written as follows:

[0089] ; (7)

[0090] in, It is in the form of an infinite geometric series, and its general form is If a = 1, and r is replaced by αP, we get the geometric series .

[0091] 2. For infinite geometric series , and its first n terms sum:

[0092] When r≠1,

[0093] ; (8)

[0094] When |r|<1, ;

[0095] ; (9)

[0096] 3. For infinite geometric series , since P is a row random matrix, the absolute values ​​of all its eigenvalues ​​are less than or equal to 1, so ; and 0<α<1, so we can get , satisfying the conditions in step 2.

[0097] 4. For the infinite geometric series in the text , find the sum of the first t terms:

[0098] When αP≠1,

[0099] ; (10)

[0100] When |αP|<1, ;

[0101] ; (11)

[0102] 5. From steps 1 and 4, we can conclude that:

[0103] ; (12)

[0104] Formula (6) is proved.

[0105] S105: Merge the first diffusion similarity and the second diffusion similarity to obtain a diffusion distance.

[0106] Diffusion distance refers to the comprehensive similarity measure obtained by fusing high-level features and low-level features.

[0107] The process of fusing the first diffusion similarity with the second diffusion similarity to obtain the diffusion distance is to fuse two different levels of similarity together to obtain a comprehensive similarity measure.

[0108] Specifically, the first diffusion similarity is a similarity measure calculated for high-level features, while the second diffusion similarity is a similarity measure calculated for low-level features. These two similarity measures consider the semantic information and texture / style information of the image respectively, so by fusing these two similarity measures, a more comprehensive and integrated image similarity measure can be obtained.

[0109] S106 , reordering the image retrieval sample library according to the diffusion distance to obtain a target retrieval list of images to be retrieved.

[0110] According to the diffusion distance obtained by the above fusion, each image in the image retrieval sample library can be sorted to obtain the similarity ranking between the image and the image to be retrieved, so that the most similar image is ranked in front, so that the image most similar to the image to be retrieved is displayed first in the image retrieval results.

[0111] By reordering, a similarity measure calculated based on the diffusion distance can be obtained, and the images in the image retrieval sample library can be arranged according to the degree of similarity with the image to be retrieved, and the final target retrieval list can be obtained, where the target retrieval list contains images arranged from high to low according to similarity, and is used in the image retrieval system to display the image results with the highest similarity.

[0112] This embodiment first extracts high-level features and low-level features from the image to be retrieved, and combines two image vector libraries to determine the retrieval list, which can more comprehensively describe the characteristics of the home textile image. At the same time, a weighted graph is constructed and a Markov random walk is performed to obtain the diffusion similarity, which can effectively consider the internal structure and similarity information of the image, thereby reducing the problem of negative samples being placed in the front. Finally, by fusing the diffusion similarity to obtain the diffusion distance and reordering the image retrieval sample library, the precision and accuracy of the home textile image retrieval can be improved.

[0113] In one implementation of this embodiment, Markov random walks are performed on the first weighted graph and the second weighted graph respectively, and a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature are obtained, including the following steps:

[0114] S201, restricting the Markov random walk to the k context neighbors of the current data point of the first weighted graph or the second weighted graph, and performing Markov random walk on the first weighted graph and the second weighted graph respectively, and obtaining a first diffusion similarity corresponding to the high-level features and a second diffusion similarity corresponding to the low-level features.

[0115] For the ideal case of S104, the diffusion process can reveal the underlying geometric structure of the data manifold, but the diffusion process is sensitive to noise. If the actual topological structure of the data manifold changes due to noise or outliers, the diffusion process may not be able to capture the correct topological structure. Since noise and outliers affect the distribution of data points, this will cause a certain error in the transfer matrix during the diffusion process. At this time, introducing local constraints can reduce the impact of noisy data points on the diffusion process.

[0116] That is, the Markov random walk is restricted to the k context neighbors of the current data point of the first weighted graph or the second weighted graph, and the Markov random walk is performed on the first weighted graph and the second weighted graph respectively, and the first diffusion similarity corresponding to the high-level features and the second diffusion similarity corresponding to the low-level features are obtained, thereby reducing the influence of noise and outliers on the diffusion process and improving the accuracy and robustness of image similarity.

[0117] In this embodiment, under local constraints, Markov random walks are performed on the first weighted graph and the second weighted graph respectively, so as to obtain a first diffusion similarity corresponding to high-level features and a second diffusion similarity corresponding to low-level features, which is beneficial to reducing the impact of noise and outliers on the diffusion process and improving the accuracy and robustness of image similarity.

[0118] In one implementation of this embodiment, limiting the Markov random walk to the k context neighbors of the current data point of the first weighted graph or the second weighted graph includes the following steps:

[0119] S301. Construct a k-context neighbor graph according to the first weighted graph or the second weighted graph, wherein the vertices of the k-context neighbor graph are the same as the vertices of the first weighted graph or the second weighted graph, and the weights of the edges of the k-context neighbor graph are different from the weights of the edges of the first weighted graph or the second weighted graph.

[0120] In the diffusion process of S104, when calculating the probability of wandering from vertex xi to xj, all paths between vertex xi and xj are considered. If there are several noise points in the retrieval list, such as negative sample images, then the paths passing through these noise points will affect the calculation of the transition probability.

[0121] Therefore, limiting the random walk on the weighted graph to the range of k context neighbors of the current data point can alleviate the impact of noise on the transition probability calculation. In this embodiment, a k context neighbor graph is constructed according to the first weighted graph or the second weighted graph, where the k context neighbor graph G K The vertices of the k-context neighbor graph G are the same as the vertices of the first weighted graph or the second weighted graph. K The weights of the edges of are different from the weights of the edges of the first weighted graph or the second weighted graph.

[0122] It should be noted that the meaning of “ / ” is that the steps of constructing the k-context neighbor graph by the first weighted graph and the second weighted graph are consistent, but the k-context neighbor graph constructed according to the first weighted graph is inconsistent with the k-context neighbor graph constructed according to the second weighted graph.

[0123] Specifically, the k-context neighbor graph G K The edge weights in include:

[0124] ; (13)

[0125] In the formula, E k ( i,j ) is the edge weight in the k-context neighbor graph, E( i,j ) is the edge weight of the first weighted graph or the second weighted graph, Q k ( x i ) represents x i The set of k contextual neighbors of x i and x j are all vertices of the first weighted graph or the second weighted graph.

[0126] That is, when xj belongs to x i When the k contextual neighbor set is selected, the weight is set to the original similarity E(i, j), and the weights between non-contextual neighbor points are set to 0.

[0127] This implementation constructs a k-context neighbor graph based on the first weighted graph or the second weighted graph, so that the Markov random walk is restricted to the local neighborhood of the current data point, which is beneficial to reducing the impact of noise and outliers on the diffusion process, while better capturing the similarity between data points.

[0128] In one implementation of this embodiment, Markov random walks are performed on the first weighted graph and the second weighted graph respectively, and a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature are obtained, including the following steps:

[0129] S401, in the process of performing Markov random walk on the first weighted graph and the second weighted graph respectively, according to the edge weights in the k-context neighbor graph, calculate the number of nodes from the vertex x i To the top x j A transfer probability matrix is ​​provided, and a diffusion similarity is determined according to the transfer probability matrix, wherein the diffusion similarity includes a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature.

[0130] Among them, the transition probability matrix includes:

[0131] ; (14)

[0132] In the formula, is the transition probability matrix, E k ( i,j ) is the edge weight in the k-context neighbor graph.

[0133] For the transition probability matrix , which still satisfies the convergence solution of the above formula (6).

[0134] use Replacing the original transition probability matrix P can reduce the impact of noise. The matrix P maintains complete information about the similarity of each data point with all other data points, while Only the similarity information of each data point with its contextual neighbors is retained.

[0135] How to determine the set Q k (x j ) and how to define the contextual neighbor relationship between two points, this embodiment introduces contextual similarity. Let Q n (x i ) represents the image x i The search result list of Q n (x j ) represents the image x j , then x i and x j The context similarity can be measured by the Jaccard similarity coefficient:

[0136] ; (15)

[0137] in, Indicates the cardinality of a set after the intersection or union operation.

[0138] So, given an image x, we retrieve a list Q for it n Each image in (x) is queried twice to obtain an additional n search lists. The intersection and union between the two search lists are calculated respectively, and then x and the corresponding search result list Q are calculated by formula (15). n The context similarity of each image in (x) is calculated, and the top k images with the highest context similarity are selected and recorded as the k context neighbor set Q of image x. k , that is, image x and set Q k The images in are contextual neighbor relations. The specific process of obtaining the contextual neighbor set is as follows.

[0139] Among them, formula (15) uses additional context information, but it also has some limitations. First, calculating the intersection and union of two neighbor sets is very time-consuming, especially when the Jaccard distance of all image pairs needs to be calculated. Second, when calculating the neighbor set, the weights of all neighbors are the same, and each valid neighbor point is recorded as 1. In fact, images closer to the query image x should be more similar to x.

[0140] For the problem that calculating the intersection and union of two neighbor sets is very time-consuming, the neighbor set can be encoded into a simpler but equivalent vector, which makes calculations on the two vectors more convenient and can effectively reduce the computational complexity. Here, sparse context coding is used to solve this problem, encoding the neighbor set into a neighbor vector, and then converting the set calculation into a vector calculation. Specifically, sparse context coding converts the neighbor set Q into a vector by an indicator function. n (x i ) is converted into an N g dimensional nearest neighbor vector :

[0141] ; (16)

[0142] Generally speaking, Ng is much larger than n, which is the total number of image libraries. is defined as follows:

[0143] ; (17)

[0144] From formula (17), we can see that the binary vector Each item in indicates whether the corresponding image belongs to the n nearest neighbors of xi. If it is one of the n nearest neighbors of xi, then the corresponding item is 1, otherwise it is 0.

[0145] When calculating the neighbor set, the weights of all neighbors are the same. Formula (15) assumes that each neighbor is equal and each element in the neighbor set has the same weight. To solve this problem, the weights can be redistributed according to the original distance between the query image and the image in the retrieval list, and the new indicator function is as follows:

[0146] ; (18)

[0147] Where Sc represents the cosine similarity, which is the same as formula (1). In this case, the weight of the nearest neighbor is larger, and the weight of the distant neighbor is smaller.

[0148] Based on the definition of the indicator function, the calculation method of the intersection and union of Qn(xi) and Qn(xj) can be rewritten as a vector calculation:

[0149] ; (19-a)

[0150] ;(19-b)

[0151] Among them, the MIN operation is used to calculate the minimum value of the corresponding elements in the two input vectors, and the MAX operation is used to calculate the maximum value of the corresponding elements in the two input vectors. Next, the cardinality of the intersection and union can be obtained by calculating the L1 norm:

[0152] ; (20-a)

[0153] ;(20-b)

[0154] Therefore, we can rewrite the Jaccard similarity in formula (15) as:

[0155] ;(twenty one)

[0156] At this point, the problems of slow calculation and equal weight of data points in the original Jaccard similarity have been solved. According to the new Jaccard similarity formula, the context neighbor set Q is obtained. k , the transition probability matrix is ​​obtained by formula (13) and formula (14): , that is, the diffusion matrix based on local constraints, and then local constrained diffusion. Finally, the converged solution of the diffusion result is obtained :

[0157] ;(twenty two)

[0158] The converged solution contains the similarity information between the query image and the retrieval list.

[0159] This implementation method performs Markov random walk on the first weighted graph and the second weighted graph respectively, and obtains a first diffusion similarity corresponding to the high-level features and a second diffusion similarity corresponding to the low-level features, which is conducive to more accurately calculating the diffusion similarities corresponding to the high-level features and the low-level features, and improving the accurate measurement of image similarity.

[0160] In one implementation of this embodiment, fusing the first diffusion similarity and the second diffusion similarity to obtain the diffusion distance includes the following steps:

[0161] S501: Constructing a first alternating diffusion factor according to the first diffusion similarity K il , and construct the second alternating diffusion factor according to the second diffusion similarity K jl .

[0162] S502, according to the diffusion distance calculation formula, according to the first alternating diffusion factor K il With the second alternating diffusion factor K jl Calculate the diffusion distance.

[0163] The first weighted graph corresponding to the high-level features, the second weighted graph corresponding to the low-level features, the transition probability matrix corresponding to the high-level features, and the transition probability matrix corresponding to the low-level features are respectively denoted as Ghigh , G low and , The goal of this embodiment of fusion diffusion is to learn a new similarity measure , It is possible to utilize the complementarity between multiple visual features to obtain an enhanced similarity measure.

[0164] In order to capture the common similarity information in two weighted graphs, we can obtain the transfer matrix (convergence solution) Construct an alternating diffusion operator; then calculate the diffusion distance between samples, that is, the distance between images after fusion similarity. Sort by diffusion distance to get the final search list. The specific process is as follows:

[0165] (1) Construct the alternating diffusion operator K:

[0166] ;(twenty three)

[0167] (2) Calculate the diffusion distance between two samples:

[0168] ;(twenty four)

[0169] In the formula, d ij is the diffusion distance.

[0170] Intuitively, alternating diffusion operates on the same vertex set V, but the diffusion process is divided into two steps. The transition probability matrix of the first step is , the transition probability matrix of the second step is . Therefore, the combination of two consecutive steps is a new weighted graph A Markov chain on , where the transition probabilities are determined by the alternating diffusion operator K.

[0171] This implementation can effectively fuse the similarity information of different features to obtain a more comprehensive and accurate diffusion distance, so as to perform a more accurate image similarity measurement.

[0172] In one implementation of this embodiment, feature extraction is performed on the image to be retrieved to obtain high-level features and low-level features, including the following steps:

[0173] S601: Use the image to be retrieved as the input of the neural network model to obtain high-level features and low-level features.

[0174] This embodiment uses resnet50 as the feature extraction network. The resnet50 model includes five stages. Stage 1 is the lowest layer of the model and Stage 5 is the highest layer of the model. For the image to be retrieved, the Gard-CAM method is used to generate a heat map, which can visualize the features extracted by each stage, such as Figure 3 shown.

[0175] in, Figure 4 The heatmaps corresponding to different stages in resnet50. Stage 4 and stage 5 are high-level models that extract more semantic information; Stage 1, stage 2, and stage 3 are low-level models that extract more texture and style information.

[0176] For the image to be retrieved, the features extracted after the 5th stage carry more semantic information, and the features extracted after stage 2 carry more texture information, and high-level features vhigh and low-level features vlow are output.

[0177] When performing image retrieval, this embodiment extracts high-level features and low-level features through a neural network model, which can more effectively characterize and measure the content features of the image, thereby improving the accuracy and robustness of image retrieval.

[0178] In one implementation of this embodiment, determining a first search list according to high-level features and a corresponding first image vector library, and determining a second search list according to low-level features and a corresponding second image vector library includes the following steps:

[0179] S701, calculating the first cosine distance between the high-level feature and each image vector in the corresponding first image vector library, and calculating the second cosine distance between the low-level feature and each image vector in the corresponding second image vector library.

[0180] S702. Sort the first cosine distance by size to obtain a sorted first search list, and sort the second cosine distance by size to obtain a sorted second search list, wherein the first search list is obtained by sorting the first image vector library based on the first cosine distance, and the second search list is obtained by sorting the second image vector library based on the second cosine distance.

[0181] After obtaining the high-level feature v high and low-level features v low Afterwards, this embodiment compares the high-level features and the low-level features with the corresponding image vector libraries respectively, wherein the image vector library corresponding to the high-level features is the first image vector library, and the image vector library corresponding to the low-level features is the second image vector library, and outputs the first search list Q according to the size of the cosine distance.high and the second search list Q low The first search list is obtained by sorting the first image vector library based on the first cosine distance, and the second search list is obtained by sorting the second image vector library based on the second cosine distance. The specific process is as follows Figure 4 shown.

[0182] This implementation can evaluate the similarity between two vectors by calculating the cosine distance, and can perform image retrieval more effectively, thereby improving the accuracy and efficiency of image retrieval.

[0183] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of various embodiments of the present invention.

[0184] In this embodiment, a home textile image retrieval device based on feature fusion is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0185] A home textile image retrieval device based on feature fusion may include:

[0186] A feature extraction module is used to extract features of the image to be retrieved and obtain high-level features and low-level features;

[0187] A retrieval list determination module is used to determine a first retrieval list according to high-level features and a corresponding first image vector library, and to determine a second retrieval list according to low-level features and a corresponding second image vector library, wherein both the first image vector library and the second image vector library are obtained based on an image retrieval sample library of the image to be retrieved;

[0188] A weighted graph construction module, used to respectively construct a first weighted graph corresponding to the first search list and a second weighted graph corresponding to the second search list;

[0189] A random walk module, used for performing Markov random walk on the first weighted graph and the second weighted graph respectively, and obtaining a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature;

[0190] A fusion module, used for fusing the first diffusion similarity with the second diffusion similarity to obtain a diffusion distance;

[0191] The reordering module is used to reorder the image retrieval sample library according to the diffusion distance to obtain a target retrieval list of images to be retrieved.

[0192] This embodiment first extracts high-level features and low-level features from the image to be retrieved through the feature extraction module, and determines the retrieval list by combining the two image vector libraries through the retrieval list determination module, which can more comprehensively describe the characteristics of the home textile image. At the same time, the weighted graph is constructed through the weighted graph construction module and the random walk module, and the Markov random walk is performed to obtain the diffusion similarity, which can effectively consider the internal structure and similarity information of the image, thereby reducing the problem of negative samples being placed in front. Finally, the diffusion distance is obtained by fusing the diffusion similarity through the fusion module, and the image retrieval sample library is reordered through the reordering module, which can improve the precision and accuracy of home textile image retrieval.

[0193] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0194] An embodiment of the present invention further provides an electronic device, including:

[0195] Home textile image retrieval device based on feature fusion;

[0196] a memory configured to store instructions;

[0197] and a processor configured to call instructions from the memory and implement the above-mentioned home textile image retrieval method based on feature fusion when executing the instructions.

[0198] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0199] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0200] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps in the above method embodiment when running.

[0201] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0202] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0203] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present invention shall be included in the protection scope of the present invention.

Claims

1. A home textile image retrieval method based on feature fusion, characterized in that: include: Perform feature extraction on the image to be retrieved to obtain high-level features and low-level features; Determine a first search list according to the high-level features and the corresponding first image vector library, and determine a second search list according to the low-level features and the corresponding second image vector library, wherein the first image vector library and the second image vector library are both obtained based on the image retrieval sample library of the image to be retrieved; respectively constructing a first weighted graph corresponding to the first search list and a second weighted graph corresponding to the second search list; Performing Markov random walk on the first weighted graph and the second weighted graph respectively, and obtaining a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature; The first diffusion similarity and the second diffusion similarity are merged to obtain a diffusion distance; Reordering the image retrieval sample library according to the diffusion distance to obtain a target retrieval list of the images to be retrieved; The performing of Markov random walk on the first weighted graph and the second weighted graph respectively, and obtaining a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature, comprises: Limiting the Markov random walk to the k context neighbors of the current data point of the first weighted graph or the second weighted graph, performing Markov random walk on the first weighted graph and the second weighted graph respectively, and obtaining a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature; The step of limiting the Markov random walk to the k context neighbors of the current data point of the first weighted graph or the second weighted graph includes: Constructing a k-context neighbor graph according to the first weighted graph or the second weighted graph, wherein the vertices of the k-context neighbor graph are the same as the vertices of the first weighted graph or the second weighted graph, and the weights of the edges of the k-context neighbor graph are different from the weights of the edges of the first weighted graph or the second weighted graph; The edge weights in the k-context neighbor graph include: ; In the formula, E k ( i,j ) is the edge weight in the k-context neighbor graph, E( i,j ) is the edge weight of the first weighted graph or the second weighted graph, Q k ( x i ) represents x i The set of k contextual neighbors of x i and x j are all vertices of the first weighted graph or the second weighted graph; The performing of Markov random walk on the first weighted graph and the second weighted graph respectively, and obtaining a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature, comprises: In the process of performing Markov random walk on the first weighted graph and the second weighted graph respectively, the edge weights in the k-context neighbor graph are calculated from the vertex x i To the top x j A transition probability matrix, and determining a diffusion similarity according to the transition probability matrix, wherein the diffusion similarity includes a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature; Wherein, the transition probability matrix includes: ; In the formula, is the transition probability matrix, E k ( i,j ) is the edge weight in the k-context neighbor graph; The high-level features are used to represent the semantic information of the image to be retrieved, and the low-level features are used to represent the texture and style information of the image to be retrieved; The first search list is a candidate image list determined according to the high-level features and the corresponding first image vector library, and the first search list includes images having similar semantic information to the image to be searched; the second search list is a candidate image list determined according to the low-level features and the corresponding second image vector library, and the second search list includes images having similar texture and style information to the image to be searched; The first image vector library is constructed by acquiring image vectors of high-level features in the image retrieval sample library, and the second image vector library is constructed by acquiring image vectors of low-level features in the image retrieval sample library.

2. The method according to claim 1, characterized in that: The step of fusing the first diffusion similarity with the second diffusion similarity to obtain a diffusion distance includes: Constructing a first alternating diffusion factor according to the first diffusion similarity K il , and construct a second alternating diffusion factor according to the second diffusion similarity K jl ; According to the diffusion distance calculation formula, according to the first alternating diffusion factor K il The second alternating diffusion factor K jl calculating the diffusion distance; The diffusion distance calculation formula includes: ; In the formula, d ij is the diffusion distance.

3. The method according to claim 1, characterized in that: The feature extraction of the image to be retrieved to obtain high-level features and low-level features includes: The image to be retrieved is used as an input of a neural network model to obtain the high-level features and the low-level features.

4. The method according to claim 1, characterized in that: The step of determining a first search list according to the high-level features and the corresponding first image vector library, and determining a second search list according to the low-level features and the corresponding second image vector library, comprises: Calculating a first cosine distance between the high-level feature and each corresponding image vector in the first image vector library, and calculating a second cosine distance between the low-level feature and each corresponding image vector in the second image vector library; The first cosine distance is sorted by size to obtain the sorted first search list, and the second cosine distance is sorted by size to obtain the sorted second search list, wherein the first search list is obtained by sorting the first image vector library based on the first cosine distance, and the second search list is obtained by sorting the second image vector library based on the second cosine distance.

5. A home textile image retrieval device based on feature fusion, characterized in that: include: A feature extraction module is used to extract features of the image to be retrieved and obtain high-level features and low-level features; A retrieval list determination module, used to determine a first retrieval list according to the high-level features and the corresponding first image vector library, and to determine a second retrieval list according to the low-level features and the corresponding second image vector library, wherein the first image vector library and the second image vector library are both obtained based on an image retrieval sample library of the image to be retrieved; A weighted graph construction module, used to respectively construct a first weighted graph corresponding to the first search list and a second weighted graph corresponding to the second search list; A random walk module, used for performing Markov random walk on the first weighted graph and the second weighted graph respectively, and obtaining a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature; a fusion module, configured to fuse the first diffusion similarity with the second diffusion similarity to obtain a diffusion distance; A reordering module, used for reordering the image retrieval sample library according to the diffusion distance to obtain a target retrieval list of the images to be retrieved; The random walk module is further used to limit the Markov random walk to the k context neighbors of the current data point of the first weighted graph or the second weighted graph, and perform Markov random walks on the first weighted graph and the second weighted graph respectively, and obtain a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature; The random walk module is further used to construct a k-context neighbor graph according to the first weighted graph or the second weighted graph, wherein the vertices of the k-context neighbor graph are the same as the vertices of the first weighted graph or the second weighted graph, and the weights of the edges of the k-context neighbor graph are different from the weights of the edges of the first weighted graph or the second weighted graph; The edge weights in the k-context neighbor graph include: ; In the formula, E k ( i,j ) is the edge weight in the k-context neighbor graph, E( i,j ) is the edge weight of the first weighted graph or the second weighted graph, Q k ( x i ) represents x i The set of k contextual neighbors of x i and x j are all vertices of the first weighted graph or the second weighted graph; The random walk module is further used to calculate the edge weights from the vertex according to the edge weights in the k-context neighbor graph during the Markov random walk on the first weighted graph and the second weighted graph. x i To the top x j A transition probability matrix, and determining a diffusion similarity according to the transition probability matrix, wherein the diffusion similarity includes a first diffusion similarity corresponding to the high-level feature and a second diffusion similarity corresponding to the low-level feature; Wherein, the transition probability matrix includes: ; In the formula, is the transition probability matrix, E k ( i,j ) is the edge weight in the k-context neighbor graph; The high-level features are used to represent the semantic information of the image to be retrieved, and the low-level features are used to represent the texture and style information of the image to be retrieved; The first search list is a candidate image list determined according to the high-level features and the corresponding first image vector library, and the first search list includes images having similar semantic information to the image to be searched; the second search list is a candidate image list determined according to the low-level features and the corresponding second image vector library, and the second search list includes images having similar texture and style information to the image to be searched; The first image vector library is constructed by acquiring image vectors of high-level features in the image retrieval sample library, and the second image vector library is constructed by acquiring image vectors of low-level features in the image retrieval sample library.

6. An electronic device, characterized in that: include: The device according to claim 5; a memory configured to store instructions; and a processor configured to call the instructions from the memory and implement the home textile image retrieval method based on feature fusion according to any one of claims 1 to 4 when executing the instructions.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 4 when executed.