Image retrieval method and device, equipment, storage medium and program product
By constructing the initial similarity matrix and converting it into an objective function of the matrix completion problem, matrix decomposition technology and regular terms are used to solve the target similarity matrix that satisfies the semi-positive and low-rank characteristics, the retrieval inaccuracy problem caused by the loss of image data is solved, and the accuracy and reliability of image retrieval is improved.
Patent Information
- Application Number
- CN202510130299.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-05
- Publication Date
- 2025-06-20
AI Technical Summary
In large-scale image search scenarios, the absence of image data often leads to a decrease in the inaccuracy and reliability of the search results.
By constructing the initial similarity matrix and converting it into an objective function of the matrix completion problem, a matrix decomposition technique and regular terms are used to solve the target similarity matrix that satisfies the semi-positive and low-rank characteristics.
This method can more accurately estimate the complete similarity matrix, improve the accuracy and reliability of image retrieval, and overcome the problem of the large-scale calculation time of traditional methods.
Smart Images

Figure CN120179843A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular, to an image retrieval method, apparatus, device, storage medium, and program product. Background Art
[0002] In the scenario of large-scale image retrieval, when a user uploads a query image, the system needs to find the most similar image in a huge image database. However, in an actual large-scale retrieval system, data loss is a common problem. For example, some features of some images may not be fully obtained due to problems such as acquisition device failures, storage problems, or other reasons. Therefore, how to implement image retrieval in the case of missing image data is an urgent problem to be solved currently. Summary of the Invention
[0003] The present invention provides an image retrieval method, apparatus, device, storage medium, and program product to solve the problem of image retrieval when there is missing image data.
[0004] The present invention provides an image retrieval method, including: obtaining an image retrieval data set and an image query data set, where the image query data set includes a plurality of complete images and a plurality of partially missing images; constructing an initial similarity matrix of the image retrieval data set and the image query data set based on the cosine similarity calculation formula; constructing a first objective function for the matrix completion problem based on the initial similarity matrix, where the first objective function is used to solve a target similarity matrix that satisfies the semi-positive definite and low-rank characteristics; solving the first objective function and outputting the target similarity matrix; and outputting an image retrieval result according to the target similarity matrix.
[0005] According to an image retrieval method provided by the present invention, the first objective function is: ; where represents the target similarity matrix to be solved, represents the initial similarity matrix, represents the Frobenius norm, and the constraint condition of the first objective function is , represents that the matrix is semi-positive definite, represents the target similarity matrix whose rank is less than or equal to the upper limit value 𝑟.
[0006] An image retrieval method provided by the present invention, the solving of the first objective function and outputting of the target similarity matrix includes: converting the similarity matrix completion problem into a low-rank matrix factorization problem based on matrix factorization technology to obtain a second objective function; incorporating a regularization term into the second objective function to obtain a third objective function, where the regularization term is used to strengthen the low-rank property of the similarity matrix; replacing the rank function in the third objective function with a differentiable Frobenius norm to obtain a fourth objective function; solving the fourth objective function and outputting the target similarity matrix.
[0007] An image retrieval method provided by the present invention, the converting of the similarity matrix completion problem into a low-rank matrix factorization problem based on matrix factorization technology to obtain a second objective function includes: using Cholesky decomposition on the target similarity matrix , so as to convert the first objective function into a second objective function; the second objective function is: ; where is a lower triangular matrix obtained by performing Cholesky decomposition on the similarity matrix with symmetry and positive semi-definiteness.
[0008] An image retrieval method provided by the present invention, the incorporating of a regularization term into the second objective function to obtain a third objective function includes: using the Lagrange operator to incorporate the constraint condition into the second objective function to obtain a third objective function; the third objective function is: .
[0009] An image retrieval method provided by the present invention, the replacing of the rank function in the third objective function with a differentiable Frobenius norm to obtain a fourth objective function includes: based on Lemma to convert the third objective function into a fourth objective function; the fourth objective function is: ; where represents 's nuclear norm.
[0010] The present invention also provides an image retrieval device, including the following modules: an acquisition module, a processing module, and an output module; the acquisition module is configured to acquire an image retrieval data set and an image query data set, and the image query data set includes a plurality of complete images and a plurality of partially missing images; the processing module is configured to construct an initial similarity matrix of the image retrieval data set and the image query data set based on a cosine similarity calculation formula; construct a first objective function for a matrix completion problem based on the initial similarity matrix, where the first objective function is used to solve a target similarity matrix that satisfies positive semi-definiteness and low-rank characteristics; solve the first objective function and output the target similarity matrix; the output module is configured to output an image retrieval result according to the target similarity matrix.
[0011] According to an image retrieval device provided by the present invention, the first objective function is: ; where represents the target similarity matrix to be solved, represents the initial similarity matrix, represents the Frobenius norm, and the constraint condition of the first objective function is , represents that the matrix is positive semi-definite, represents the target similarity matrix whose rank is less than or equal to the upper limit value 𝑟.
[0012] According to an image retrieval device provided by the present invention, the processing module is configured to convert the similarity matrix completion problem into a low-rank matrix factorization problem based on a matrix factorization technique to obtain a second objective function; incorporate a regularization term into the second objective function to obtain a third objective function, where the regularization term is used to strengthen the low-rank characteristics of the similarity matrix; replace the rank function in the third objective function with a differentiable Frobenius norm to obtain a fourth objective function; solve the fourth objective function and output the target similarity matrix.
[0013] According to an image retrieval device provided by the present invention, the processing module is configured to use Cholesky decomposition on the target similarity matrix to convert the first objective function into a second objective function; the second objective function is: ; where is a lower triangular matrix obtained by performing Cholesky decomposition on the similarity matrix with symmetry and positive semi-definiteness.
[0014] According to an image retrieval device provided by the present invention, the processing module is configured to use a Lagrange operator to impose the constraint condition Incorporate the second objective function to obtain a third objective function; the third objective function is: .
[0015] According to an image retrieval device provided by the present invention, the processing module is configured to, based on a lemma Convert the third objective function into a fourth objective function; the fourth objective function is: ; where denotes the nuclear norm of
[0016] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the image retrieval method described in any one of the above is implemented.
[0017] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the image retrieval method described in any one of the above is implemented.
[0018] The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, the image retrieval method described in any one of the above is implemented.
[0019] The image retrieval method, device, equipment, storage medium, and program product provided by the present invention can construct an initial similarity matrix of the image retrieval data set and the image query data set based on the cosine similarity calculation formula; and construct a first objective function of a matrix completion problem based on the initial similarity matrix. The first objective function is used to solve the target similarity matrix that satisfies the positive semi-definite and low-rank characteristics. Since the positive semi-definite and low-rank characteristics reflect the internal association between data, the complete similarity matrix can be estimated more accurately, making the completed result closer to the unknown complete similarity matrix, thereby improving the accuracy and reliability of image retrieval. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0021] Figure 1 is a flowchart of the image retrieval method provided by the present invention; Figure 2 is a structural diagram of the image retrieval device provided by the present invention; Figure 3It is a schematic structural diagram of the electronic device provided by the present invention. Detailed implementation manners
[0022] To make the objectives, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be clearly and completely described below with reference to the accompanying drawings in the present application. Apparently, the described embodiments are some but not all of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without making creative efforts shall fall within the scope of protection of the present application.
[0023] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific manner.
[0024] It should be noted that in this document, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, such that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or device including that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0025] To facilitate a clear description of the technical solutions in the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions and roles. Those skilled in the art can understand that terms such as "first" and "second" do not limit the quantity and execution order.
[0026] Some exemplary embodiments are described in the embodiments of the present application for illustrative purposes. It should be understood that the present application may be implemented in other ways not specifically shown in the drawings.
[0027] Such as Figure 1As shown in the figure, an embodiment of the present application provides an image retrieval method, which can be applied to an image retrieval device. The image retrieval method may include S101 - S105: S101. The image retrieval device acquires an image retrieval data set and an image query data set.
[0028] Among them, the above - mentioned image query data set includes multiple complete images and multiple partially missing images.
[0029] The image query data set Q has a dimension of . Q is a matrix, d is the feature dimension of each query image sample, np is the number of query image samples. In the image retrieval task, if an image is represented as a vector, d can be the length of the image feature vector, np is the number of images to be retrieved.
[0030] The image retrieval data set P has a dimension of . Similarly, d is the feature dimension of each retrieved image sample, np is the number of retrieved image samples. In the above - mentioned image retrieval scenario, np can be the number of images available for retrieval in the database.
[0031] S102. The image retrieval device constructs an initial similarity matrix of the image retrieval data set and the image query data set based on the cosine similarity calculation formula.
[0032] The image retrieval device can construct an initial similarity matrix of the image query data set Q and the image retrieval data set P by calculating the cosine similarity . The initial similarity matrix has a dimension of , where , n represents the number of all query images and retrieved images. This matrix can be used to measure the similarity between each image sample in the image query data set and each image sample in the image retrieval data set.
[0033] For a complete query image sample and a complete retrieved image sample , the cosine similarity calculation formula between them is: ; Among them, the vectors and Can be regarded as d A vector in an n-dimensional space. The cosine similarity value ranges from [-1, 1]. When two vectors have exactly the same direction, the cosine similarity is 1; when they have exactly opposite directions, the cosine similarity is -1; when two vectors are orthogonal (perpendicular), the cosine similarity is 0. In the calculation of data similarity, the closer the value is to 1, the more similar the two data are.
[0034] When a part of the query image sample is missing, assume its complete form is , and the incomplete form is . At this time, the common features are used to calculate the cosine similarity, and the formula is: ; Here, is The partial feature representation of, and the similarity is calculated by using the features that have common significance with the retrieved image sample .
[0035] S103. The image retrieval device constructs a first objective function for the matrix completion problem based on the initial similarity matrix.
[0036] Among them, the first objective function is used to solve the target similarity matrix that satisfies the positive semi-definite and low-rank characteristics.
[0037] Optionally, the first objective function is: ; where, Represents the target similarity matrix to be solved, Represents the initial similarity matrix, Represents the Frobenius norm, and the constraint condition of the first objective function is , Indicates that the matrix is positive semi-definite, Indicates that the rank of the target similarity matrix Is less than or equal to the upper limit value 𝑟.
[0038] Specifically, the first objective function is a minimization problem, aiming to find a matrix Such that The square of the Frobenius norm of is minimized. Indicates that the matrix is positive semi-definite. Positive semi-definiteness guarantees the non-negativity of the metric and some convexity properties, which helps to solve the optimization problem and the rationality of the results. Indicates that the rank of the target similarity matrix Is less than or equal to the upper limit value 𝑟. The rank of a matrix represents the maximum number of linearly independent rows or columns in the matrix.
[0039] S104. The image retrieval device solves the first objective function and outputs the target similarity matrix.
[0040] Optionally, the image retrieval device solves the first objective function and outputs the objective similarity matrix, including: converting the similarity matrix completion problem into a low-rank matrix factorization problem based on matrix factorization technology to obtain a second objective function; incorporating a regularization term into the second objective function to obtain a third objective function, where the regularization term is used to strengthen the low-rank property of the similarity matrix; replacing the rank function in the third objective function with a differentiable Frobenius norm to obtain a fourth objective function; solving the fourth objective function and outputting the objective similarity matrix.
[0041] Optionally, the image retrieval device converts the similarity matrix completion problem into a low-rank matrix factorization problem based on matrix factorization technology to obtain a second objective function, including: using Cholesky decomposition on the objective similarity matrix , so as to convert the first objective function into a second objective function; the second objective function is: ; where is a lower triangular matrix obtained by performing Cholesky decomposition on the similarity matrix with symmetry and positive semi-definiteness.
[0042] Specifically, the objective similarity matrix has symmetry and positive semi-definiteness. Based on these properties, the data completion device can perform Cholesky decomposition on the objective similarity matrix . Cholesky decomposition decomposes a positive semi-definite matrix into the form of , where V is a n*r matrix, and r<n is the rank of the given decomposition matrix. Performing Cholesky decomposition on the objective similarity matrix means substituting into the first objective function to obtain the second objective function . By representing with through Cholesky decomposition, the variables in the original problem can be converted from the matrix to the matrix . Such a conversion can simplify the solution of the problem.
[0043] It should be noted that when the constraint condition is satisfied, the first objective function is equivalent to the second objective function.
[0044] Optionally, the image retrieval device incorporates a regularization term into the second objective function to obtain a third objective function, including: using the Lagrange operator to incorporate the constraint condition Incorporate the second objective function to obtain a third objective function; the third objective function is: .
[0045] Specifically, based on the second objective function, considering the need to ensure the low-rank property of the similarity matrix, a regularization term can be designed to strengthen this property. A low-rank matrix can help extract the main features in the data and reduce noise and redundant information. The constraint condition is , which is to ensure the low-rank property of the matrix.
[0046] To facilitate problem-solving, the Lagrange operator can be used to add the constraint condition to the second objective function to form the third objective function , and the constraint condition is . In this way, the original constrained optimization problem can be transformed into an unconstrained optimization problem, enabling the use of various unconstrained optimization algorithms for solution.
[0047] The first term of the third objective function represents the squared loss of similarity matrix completion, taking into account the symmetry and positive semi-definiteness of the matrix. It measures the difference between the estimated matrix and the initial matrix , aiming to minimize this difference. The second term represents the rank function. Through the adjustment of , the low-rank property is added as a penalty term to the third objective function. In this way, by adjusting the size of , the accuracy of matrix completion and the importance of the low-rank property can be balanced.
[0048] Optionally, the image retrieval device replaces the rank function in the third objective function with a differentiable Frobenius norm to obtain a fourth objective function, including: Based on Lemma transform the third objective function into the fourth objective function; the fourth objective function is: ; where represents 's nuclear norm.
[0049] Specifically, in the third objective function, the calculation and optimization of the rank function are relatively difficult. To solve the rank function, based on Lemma , the Frobenius norm of the matrix is used to replace the rank function , and the obtained fourth objective function is: . The constraint condition is .
[0050] Optionally, the data completion device may solve the fourth objective function based on the gradient descent method to output the target similarity matrix. The specific steps include: Initialize the matrix , whose rank is r , the step size is γ , the weight parameter is λ , the maximum number of iterations is T ; Define ; Calculate For , calculate the gradient of ; Update the t th iteration of by moving the current matrix along the opposite direction of the gradient by γ times the distance, gradually approaching the minimum value of the objective function.
[0051] When reaching the maximum number of iterations T , calculate ; This is to obtain the final similarity matrix through the inverse process of Cholesky decomposition of the optimized matrix , completing the task of matrix completion.
[0052] Finally, output the similarity matrix as the target similarity matrix .
[0053] It should be noted that, on the one hand, this application converts the problem of estimating the original large matrix into estimating a small low-rank matrix. This process is a systematic operation based on the algebraic properties of the matrix, making the completed result closer to the unknown complete similarity matrix, thereby improving the accuracy and reliability of the completion and overcoming the problem that it is difficult to guarantee the accuracy and reliability of the completion effect in the direct completion method; on the other hand, by converting the similarity matrix completion problem into a low-rank matrix decomposition problem, the scale of the calculation is effectively reduced, solving the problem that the calculation time increases significantly in the traditional matrix completion method for large-scale matrices; on the other hand, by incorporating the regularization term, not only the effectiveness of the matrix completion result is guaranteed, making the completed matrix able to truly reflect the similarity relationship between data, but also it helps to maintain the low-rank property of the matrix, further optimizing the calculation process, improving the calculation efficiency, and ensuring that while ensuring the completion quality, the timeliness requirements can also be met.
[0054] S105. The image retrieval device outputs an image retrieval result according to the target similarity matrix.
[0055] Optionally, the image retrieval device may sort the retrieved images in descending order according to the similarity values in the target similarity matrix. The higher the similarity value, the more similar the retrieved image is to the query image. Then, a threshold is set according to actual requirements or several images with the top rankings are selected as the image retrieval results and returned to the user.
[0056] In the embodiments of the present application, an initial similarity matrix of the image retrieval data set and the image query data set may be constructed based on the cosine similarity calculation formula; and a first objective function of the matrix completion problem is constructed based on the initial similarity matrix. The first objective function is used to solve the target similarity matrix that satisfies the positive semi-definite and low-rank characteristics. Since the positive semi-definite and low-rank characteristics reflect the internal correlation between data, the complete similarity matrix can be estimated more accurately, making the completed result closer to the unknown complete similarity matrix, thereby improving the accuracy and reliability of image retrieval.
[0057] The above mainly introduces the solution provided by the embodiments of the present application from the perspective of methods. To implement the above functions, it includes the corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the form of hardware or computer software driving the hardware depends on the specific application and design constraint conditions of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0058] For the image retrieval method provided by the embodiments of the present application, the execution subject may be an image retrieval device, or a control module for image retrieval in the image retrieval device. In the embodiments of the present application, taking the image retrieval device as an example to execute the image retrieval method, the image retrieval device provided by the embodiments of the present application is described.
[0059] It should be noted that the embodiments of the present application may divide the functional modules of the image retrieval device according to the above method examples. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The above integrated modules may be implemented in the form of hardware or in the form of software functional modules. Optionally, the division of modules in the embodiments of the present application is illustrative, only a logical function division, and there may be other division methods in actual implementation.
[0060] Such as Figure 2As shown in the figure, an embodiment of the present application provides an image retrieval device 200. The image retrieval device 200 includes: an acquisition module 201, a processing module 202, and an output module 203; the acquisition module 201 is configured to acquire an image retrieval data set and an image query data set, and the image query data set includes a plurality of complete images and a plurality of partially missing images; the processing module 202 is configured to construct an initial similarity matrix of the image retrieval data set and the image query data set based on the cosine similarity calculation formula; construct a first objective function for the matrix completion problem based on the initial similarity matrix, and the first objective function is used to solve a target similarity matrix that satisfies the semi-positive definite and low-rank characteristics; solve the first objective function and output the target similarity matrix; the output module 203 is configured to output an image retrieval result according to the target similarity matrix.
[0061] Optionally, the first objective function is: ; where represents the target similarity matrix to be solved, represents the initial similarity matrix, represents the Frobenius norm, and the constraint condition of the first objective function is , represents that the matrix is semi-positive definite, represents the target similarity matrix whose rank is less than or equal to the upper limit value 𝑟.
[0062] Optionally, the processing module 202 is configured to convert the similarity matrix completion problem into a low-rank matrix factorization problem based on the matrix factorization technology to obtain a second objective function; incorporate a regularization term into the second objective function to obtain a third objective function, and the regularization term is used to strengthen the low-rank characteristics of the similarity matrix; replace the rank function in the third objective function with a differentiable Frobenius norm to obtain a fourth objective function; solve the fourth objective function and output the target similarity matrix.
[0063] Optionally, the processing module 202 is configured to use Cholesky decomposition for the target similarity matrix to convert the first objective function into a second objective function; the second objective function is: ; where is a lower triangular matrix obtained by performing Cholesky decomposition on the similarity matrix with symmetry and semi-positive definiteness.
[0064] Optionally, the processing module 202 is configured to use the Lagrange operator to incorporate the constraint condition into the second objective function to obtain a third objective function; the third objective function is: .
[0065] Optionally, the processing module 202 is configured to convert the third objective function into a fourth objective function based on the lemma ; the fourth objective function is: ; where denotes the nuclear norm of.
[0066] In the embodiments of the present application, an initial similarity matrix of the image retrieval dataset and the image query dataset can be constructed based on the cosine similarity calculation formula; and a first objective function of the matrix completion problem is constructed based on the initial similarity matrix. The first objective function is used to solve the target similarity matrix that satisfies the positive semi-definite and low-rank characteristics. Since the positive semi-definite and low-rank characteristics reflect the internal correlation between data, the complete similarity matrix can be estimated more accurately, making the completed result closer to the unknown complete similarity matrix, thereby improving the accuracy and reliability of image retrieval.
[0067] Figure 3 FIG. illustrates a schematic physical structure diagram of an electronic device, as Figure 3 shown. The electronic device may include: a processor 310, a communication interface 320, a memory 330, and a communication bus 340. Among them, the processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 can call the logical instructions in the memory 330 to execute the image retrieval method, which includes: obtaining an image retrieval dataset and an image query dataset, where the image query dataset includes multiple complete images and multiple partially missing images; constructing an initial similarity matrix of the image retrieval dataset and the image query dataset based on the cosine similarity calculation formula; constructing a first objective function of the matrix completion problem based on the initial similarity matrix, where the first objective function is used to solve the target similarity matrix that satisfies the positive semi-definite and low-rank characteristics; solving the first objective function and outputting the target similarity matrix; and outputting an image retrieval result according to the target similarity matrix.
[0068] In addition, when the logical instructions in the above-mentioned memory 330 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.
[0069] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the image retrieval method provided by the above-mentioned various methods. The method includes: obtaining an image retrieval data set and an image query data set, where the image query data set includes multiple complete images and multiple partially missing images; constructing an initial similarity matrix of the image retrieval data set and the image query data set based on the cosine similarity calculation formula; constructing a first objective function for the matrix completion problem based on the initial similarity matrix, and the first objective function is used to solve for a target similarity matrix that satisfies the semi-positive definite and low-rank characteristics; solving the first objective function and outputting the target similarity matrix; and outputting an image retrieval result according to the target similarity matrix.
[0070] In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is configured to execute the image retrieval method provided by the above-mentioned various methods. The method includes: obtaining an image retrieval data set and an image query data set, where the image query data set includes multiple complete images and multiple partially missing images; constructing an initial similarity matrix of the image retrieval data set and the image query data set based on the cosine similarity calculation formula; constructing a first objective function for the matrix completion problem based on the initial similarity matrix, and the first objective function is used to solve for a target similarity matrix that satisfies the semi-positive definite and low-rank characteristics; solving the first objective function and outputting the target similarity matrix; and outputting an image retrieval result according to the target similarity matrix.
[0071] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0072] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or equivalently replace some of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An image retrieval method, characterized in that: include: Acquire an image retrieval dataset and an image query dataset, wherein the image query dataset includes a plurality of complete images and a plurality of partially missing images; Constructing an initial similarity matrix of the image retrieval dataset and the image query dataset based on a cosine similarity calculation formula; Constructing a first objective function of the matrix completion problem based on the initial similarity matrix, wherein the first objective function is used to solve a target similarity matrix that satisfies semi-positive definite and low-rank properties; Solving the first objective function and outputting the target similarity matrix; The image retrieval result is output according to the target similarity matrix.
2. The image retrieval method according to claim 1, characterized in that: The first objective function is: ; in, represents the target similarity matrix to be solved, represents the initial similarity matrix, represents the Frobenius norm, and the constraint condition of the first objective function is , means that the matrix is positive semidefinite, Represents the target similarity matrix The rank of is less than or equal to the upper limit value 𝑟.
3. The image retrieval method according to claim 1 or 2, characterized in that: The solving the first objective function and outputting the target similarity matrix includes: Based on the matrix decomposition technology, the similarity matrix completion problem is converted into a low-rank matrix decomposition problem to obtain the second objective function; Incorporating a regularization term into the second objective function to obtain a third objective function, wherein the regularization term is used to enhance the low-rank property of the similarity matrix; Using a differentiable Frobenius norm to replace the rank function in the third objective function to obtain a fourth objective function; Solve the fourth objective function and output a target similarity matrix.
4. The image retrieval method according to claim 3, characterized in that: The similarity matrix completion problem is converted into a low-rank matrix decomposition problem based on the matrix decomposition technology to obtain the second objective function, including: Using Cholesky decomposition to calculate target similarity matrix , to convert the first objective function into a second objective function; The second objective function is: ; in, is obtained by using a similarity matrix with symmetry and semi-positive definiteness Lower triangular matrix after Cholesky decomposition.
5. The data completion method according to claim 3, characterized in that: The regularization term is incorporated into the second objective function to obtain a third objective function, comprising: Using Lagrangian operators The constraints Incorporating the second objective function to obtain a third objective function; The third objective function is: .
6. The data completion method according to claim 3, characterized in that: The adopting of the differentiable Frobenius norm to replace the rank function in the third objective function to obtain the fourth objective function includes: Based on the lemma Converting the third objective function into a fourth objective function; The fourth objective function is: ; in, express The nuclear norm of .
7. An image retrieval device, characterized in that: include: Acquisition module, processing module and output module; The acquisition module is used to acquire an image retrieval data set and an image query data set, wherein the image query data set includes a plurality of complete images and a plurality of partially missing images; The processing module is used to construct an initial similarity matrix of the image retrieval dataset and the image query dataset based on a cosine similarity calculation formula; Constructing a first objective function of the matrix completion problem based on the initial similarity matrix, wherein the first objective function is used to solve a target similarity matrix that satisfies semi-positive definite and low-rank properties; solving the first objective function and outputting the target similarity matrix; The output module is used to output the image retrieval result according to the target similarity matrix.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the image retrieval method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the image retrieval method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the image retrieval method according to any one of claims 1 to 6 is implemented.