Method, medium and system for similar image retrieval
By acquiring the hue map of the image to be retrieved and using a feature extraction model to output primary and secondary color features, the problem of inaccurate retrieval by traditional models in the field of art and design is solved, achieving higher image retrieval accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAMEN UNIV OF TECH
- Filing Date
- 2025-12-31
- Publication Date
- 2026-05-29
AI Technical Summary
In the fields of art, film design, and home design, existing technologies cannot meet the needs of finding works with specific color distributions using similar image retrieval models trained in traditional methods, resulting in inaccurate retrieval results.
By acquiring the hue map of the image to be retrieved, the primary and secondary color features are output using a pre-trained feature extraction model. Image similarity is calculated, and a specific classification loss function is used to train the model to improve the accuracy of color feature extraction.
It improves the accuracy of image retrieval results in the field of art and design, meeting the need to find works with specific color distributions.
Smart Images

Figure CN121434427B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image retrieval technology, and in particular to a similar image retrieval method, medium and system. Background Technology
[0002] Similar image retrieval refers to the process of finding the image most similar to a user-provided query image from a large-scale image database.
[0003] In related technologies, image retrieval aims to achieve content-level semantic retrieval. The training goal of the model is to make the extracted features highly invariant to color changes; that is, even if the image's hue changes, the extracted features should still remain similar to the original features. While this "color invariance" improves generality, it cannot be applied to certain specific scenarios, such as in the fields of art, film design, and interior design. In these fields, it is usually necessary to find works with specific color distributions, rather than products with specific semantic content. Therefore, models trained using traditional methods often fail to provide search results that meet user needs in these fields. Summary of the Invention
[0004] This invention aims to at least partially address one of the technical problems in related technologies. Therefore, one objective of this invention is to propose a similar image retrieval method that can meet the image retrieval needs of the art and design field and effectively improve the accuracy of image retrieval results.
[0005] In a first aspect, embodiments of the present invention propose a similar image retrieval method, comprising the following steps: obtaining a hue map corresponding to an image to be retrieved, and inputting the hue map into a pre-trained feature extraction model to output a first color feature and a second color feature corresponding to the image to be retrieved through the feature extraction model, wherein the first color feature represents the primary color feature of the image to be retrieved, and the second color feature represents the secondary color feature of the image to be retrieved; calculating the similarity between the image to be retrieved and any image in the image database based on the first color feature and the second color feature; and determining the target image corresponding to the image to be retrieved based on the similarity.
[0006] The classification loss function used to train the feature extraction model is expressed by the following formula:
[0007] ;
[0008] ;
[0009] ;
[0010] ;
[0011] ;
[0012] ;
[0013] in, This represents the total loss function of the feature extraction model. Indicates the loss of the first color. Indicates the loss of the second color. This represents the penalty coefficient corresponding to the loss of the first color. This represents the penalty coefficient corresponding to the loss of the second color. This represents the distance between the currently output first color category and the first true category. This represents the distance between the first color category output in the previous iteration and the first true color category. This indicates the distance between the currently output second color category and the second true category. This represents the distance between the second color category output in the previous iteration and the second true category. Indicates the color loss weight, This represents the traditional classification loss function.
[0014] According to an embodiment of the present invention, a similar image retrieval method first obtains the hue map corresponding to the image to be retrieved, and inputs the hue map into a pre-trained feature extraction model to output a first color feature and a second color feature corresponding to the image to be retrieved through the feature extraction model; calculates the similarity between the image to be retrieved and any image in the image database based on the first color feature and the second color feature; and determines the target image corresponding to the image to be retrieved based on the similarity; thereby meeting the image retrieval needs in the field of art and design and effectively improving the accuracy of image retrieval results.
[0015] In some embodiments, determining the target image corresponding to the image to be retrieved based on the similarity includes: sorting the inventory images in descending order according to the similarity calculation result, and obtaining a preset number of inventory images as target images according to the sorting result; and displaying the target images to the user in order according to the sorting result.
[0016] In some embodiments, obtaining the hue map corresponding to the image to be retrieved includes: converting the image to be retrieved to the HSV space and extracting the H channel to obtain the hue map corresponding to the image to be retrieved.
[0017] In some embodiments, the similarity is calculated using the following formula:
[0018]
[0019]
[0020]
[0021] in, Indicates similarity. This represents the first color feature corresponding to the image to be retrieved. This represents the first color feature corresponding to the current inventory image. This represents the similarity value corresponding to the first color feature. This represents the second color feature corresponding to the image to be retrieved. This represents the second color feature corresponding to the current inventory image. This represents the similarity value corresponding to the second color feature. This represents the similarity weight of the first color feature.
[0022] Secondly, embodiments of the present invention provide a computer-readable storage medium storing a similar image retrieval program thereon, which, when executed by a processor, implements the similar image retrieval method as described above.
[0023] Thirdly, this invention proposes a similar image retrieval system, comprising: a feature extraction module, which acquires a hue map corresponding to an image to be retrieved and inputs the hue map into a pre-trained feature extraction model to output a first color feature and a second color feature corresponding to the image to be retrieved, wherein the first color feature represents the primary color feature of the image to be retrieved, and the second color feature represents the secondary color feature of the image to be retrieved; a similarity calculation module, which calculates the similarity between the image to be retrieved and any image in the image database based on the first color feature and the second color feature; and a retrieval module, which determines a target image corresponding to the image to be retrieved based on the similarity.
[0024] The classification loss function used to train the feature extraction model is expressed by the following formula:
[0025] ;
[0026] ;
[0027] ;
[0028] ;
[0029] ;
[0030] ;
[0031] in, This represents the total loss function of the feature extraction model. Indicates the loss of the first color. Indicates the loss of the second color. This represents the penalty coefficient corresponding to the loss of the first color. This represents the penalty coefficient corresponding to the loss of the second color. This represents the distance between the currently output first color category and the first true category. This represents the distance between the first color category output in the previous iteration and the first true color category. This indicates the distance between the currently output second color category and the second true category. This represents the distance between the second color category output in the previous iteration and the second true category. Indicates the color loss weight, This represents the traditional classification loss function.
[0032] In some embodiments, the retrieval module is further configured to: sort the inventory images in descending order according to the similarity calculation results, and obtain a preset number of inventory images as target images according to the sorting results; and display the target images to the user in order according to the sorting results.
[0033] In some embodiments, the feature extraction module is further configured to: convert the image to be retrieved to HSV space and extract the H channel to obtain the hue map corresponding to the image to be retrieved.
[0034] The similar image retrieval method according to embodiments of the present invention extracts the first color feature and the second color feature corresponding to the image to be retrieved through a feature extraction model; then, it calculates the similarity based on the first color feature and the second color feature to complete the image retrieval; it can meet the image retrieval needs in the field of art and design and effectively improve the accuracy of image retrieval results.
[0035] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0036] Figure 1 This is a schematic flowchart of the similar image retrieval method according to an embodiment of the present invention;
[0037] Figure 2 This is a block diagram of a similar image retrieval system according to an embodiment of the present invention. Detailed Implementation
[0038] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0039] The similar image retrieval method of the present invention is described below with reference to the accompanying drawings.
[0040] Please see Figure 1 , Figure 1 This is a flowchart illustrating a similar image retrieval method according to an embodiment of the present invention, such as... Figure 1 As shown, the similar image retrieval method includes the following steps:
[0041] S101, obtain the hue map corresponding to the image to be retrieved, and input the hue map into the pre-trained feature extraction model, so as to output the first color feature and the second color feature corresponding to the image to be retrieved through the feature extraction model.
[0042] Wherein, the first color feature represents the primary color feature of the image to be retrieved, and the second color feature represents the secondary color feature of the image to be retrieved.
[0043] In some embodiments, the classification loss function used to train the feature extraction model is expressed by the following formula:
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050] in, This represents the total loss function of the feature extraction model. Indicates the loss of the first color. Indicates the loss of the second color. This represents the penalty coefficient corresponding to the loss of the first color. This represents the penalty coefficient corresponding to the loss of the second color. This represents the distance between the currently output first color category and the first true category. This represents the distance between the first color category output in the previous iteration and the first true color category. This indicates the distance between the currently output second color category and the second true category. This represents the distance between the second color category output in the previous iteration and the second true category. Indicates the color loss weight, This represents the traditional classification loss function, which can be the cross-entropy loss function or other classification loss functions.
[0051] In some embodiments, obtaining the hue map corresponding to the image to be retrieved includes: converting the image to be retrieved to the HSV space and extracting the H channel to obtain the hue map corresponding to the image to be retrieved.
[0052] As an example, during the training phase of a feature extraction model, images of various colors are first collected. Then, for each image, its corresponding color label is assigned to generate training samples. Specifically, the color wheel can be divided into N equal parts (preferably, it can be divided into 12 equal parts); resulting in N color categories (e.g., red, orange-red, yellow, blue, etc.). It is understood that an image may contain multiple colors; therefore, for an image, two labels can be used: a primary label (corresponding to the first color feature) and a secondary label (corresponding to the second color feature). If the image contains only one color category, the second color label is the same as the first color label.
[0053] Next, a loss function is constructed. During optimization, the goal is for the predicted class to gradually approach the true class along the color wheel. If, in the current iteration, the distance between the predicted class and the true class is greater than the distance between the predicted class and the true class in the previous iteration, it indicates that the predicted class in the current iteration is further away from the true class compared to the previous iteration; in this case, a larger loss is applied to the model. Conversely, if the distance is smaller, it indicates that the predicted class in the current iteration is closer to the true class than the previous iteration, meaning the model is gradually converging, and a smaller loss is applied.
[0054] Specifically, define the color distance matrix. .in, Indicates the first The color category and the first The distance between color categories. The distance between adjacent colors on the color wheel is defined as 1. The distance between opposite colors (complementary colors) on the color wheel is 6, representing the colors with the greatest difference. The distances for other color categories are values between 1 and 6 based on their position on the color wheel. See Table 1 for specific categories and distances. The diagonal line represents the distance between a color and its own category, which is 0.
[0055] Category 1 Category 2 Category 3 Category 4 Category 5 Category 6 Category 7 Category 8 Category 9 Category 10 Category 11 Category 12 Category 1 0 1 2 3 4 5 6 5 4 3 2 1 Category 2 1 0 1 2 3 4 5 6 5 4 3 2 Category 3 2 1 0 1 2 3 4 5 6 5 4 3 Category 4 3 2 1 0 1 2 3 4 5 6 5 4 Category 5 4 3 2 1 0 1 2 3 4 5 6 5 Category 6 5 4 3 2 1 0 1 2 3 4 5 6 Category 7 6 5 4 3 2 1 0 1 2 3 4 5 Category 8 5 6 5 4 3 2 1 0 1 2 3 4 Category 9 4 5 6 5 4 3 2 1 0 1 2 3 Category 10 3 4 5 6 5 4 3 2 1 0 1 2 Category 11 2 3 4 5 6 5 4 3 2 1 0 1 Category 12 1 2 3 4 5 6 5 4 3 2 1 0 Table 1
[0056] Then, the RGB images in the training set are converted to HSV space (where H represents hue, S represents saturation, and V represents lightness). Next, the hue map corresponding to the images in the training set is extracted and input into the initial feature extraction model (which can be a CNN or transformer deep learning model) to output the corresponding first color feature and second color feature through the initial feature extraction model. The features are then input into the classification module to obtain the first color category and the second color category.
[0057] Then, in the color distance matrix, find the distance between the first color category and the first true category of the current iteration output, and obtain the distance between the first color category and the first true category of the previous iteration output stored in the history (preferably, in the first iteration, the initial distance can be assumed to be 6).
[0058] It should be noted that when the model is first trained, it is relatively unstable and there is a higher possibility of color jumps (colors deviating further from the true color than in the previous iteration). A higher tolerance should be given to these jumps. As the model converges, these jumps should not occur. Therefore, with each iteration, the loss penalty for these jumps should be gradually increased.
[0059] Next, the classification loss function used to train the feature extraction model is expressed by the following formula:
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066] in, This represents the total loss function of the feature extraction model. Indicates the loss of the first color. Indicates the loss of the second color. This represents the penalty coefficient corresponding to the loss of the first color. This represents the penalty coefficient corresponding to the loss of the second color. This represents the distance between the currently output first color category and the first true category. This represents the distance between the first color category output in the previous iteration and the first true color category. This indicates the distance between the currently output second color category and the second true category. This represents the distance between the second color category output in the previous iteration and the second true category. Indicates the color loss weight, This represents the traditional classification loss function.
[0067] In this way, the initial feature extraction model can be trained based on the above loss function, and after it meets the convergence condition, the classification and loss calculation modules can be discarded to obtain the final feature extraction model.
[0068] S102, calculate the similarity between the image to be retrieved and any image in the image database based on the first color feature and the second color feature.
[0069] S103, determine the target image corresponding to the image to be retrieved based on similarity.
[0070] In some embodiments, determining the target image corresponding to the image to be retrieved based on similarity includes: sorting the inventory images in descending order according to the similarity calculation results, and obtaining a preset number of inventory images as target images according to the sorting results; and displaying the target images to the user in order according to the sorting results.
[0071] In some embodiments, similarity is calculated using the following formula:
[0072]
[0073]
[0074]
[0075] in, Indicates similarity. This represents the first color feature corresponding to the image to be retrieved. This represents the first color feature corresponding to the current inventory image. This represents the similarity value corresponding to the first color feature. This represents the second color feature corresponding to the image to be retrieved. This represents the second color feature corresponding to the current inventory image. This represents the similarity value corresponding to the second color feature. This represents the similarity weight of the first color feature.
[0076] As an example, firstly, after acquiring the image to be retrieved, the image is converted to the HSV color space, and its H channel is extracted to obtain the hue map corresponding to the image to be retrieved. Next, the hue map is input into a pre-trained feature extraction model to output the first and second color features corresponding to the image to be retrieved.
[0077] Next, based on the first color feature and the second color feature, the similarity between the image to be retrieved and any image in the image database is calculated.
[0078] Specifically, similarity is calculated using the following formula:
[0079]
[0080]
[0081]
[0082] in, Indicates similarity. This represents the first color feature corresponding to the image to be retrieved. This represents the first color feature corresponding to the current inventory image. This represents the similarity value corresponding to the first color feature. This represents the second color feature corresponding to the image to be retrieved. This represents the second color feature corresponding to the current inventory image. This represents the similarity value corresponding to the second color feature. This represents the similarity weight of the first color feature. It should be noted that this first color feature similarity weight can be set by the user (preferably, the weight can be set to 0.7). The larger the weight value, the more the search results rely on the first color feature; the smaller the weight value, the more the results rely on the second color feature.
[0083] Next, after calculating the similarity score for each image in the image library, all images are sorted in descending order based on similarity. Then, the top N images are selected as target images. Finally, the target images are displayed to the user in order based on the descending order. In other words, the target images that the model determines are most similar are placed first, so that users can find the image they need more quickly when browsing in order.
[0084] In summary, the similar image retrieval method according to embodiments of the present invention firstly obtains the hue map corresponding to the image to be retrieved, and inputs the hue map into a pre-trained feature extraction model to output a first color feature and a second color feature corresponding to the image to be retrieved through the feature extraction model. The first color feature represents the primary color feature of the image to be retrieved, and the second color feature represents the secondary color feature of the image to be retrieved. Based on the first color feature and the second color feature, the similarity between the image to be retrieved and any image in the image database is calculated. Based on the similarity, the target image corresponding to the image to be retrieved is determined. This achieves the goal of meeting the image retrieval needs in the field of art and design, and effectively improves the accuracy of image retrieval results.
[0085] Secondly, embodiments of the present invention provide a computer-readable storage medium storing a similar image retrieval program thereon, which, when executed by a processor, implements the similar image retrieval method as described above.
[0086] Thirdly, such as Figure 2 As shown in the figure, this embodiment of the invention proposes a similar image retrieval system, including: a feature extraction module 10, a similarity calculation module 20, and a retrieval module 30.
[0087] The feature extraction module 10 is used to obtain the hue map corresponding to the image to be retrieved, and input the hue map into the pre-trained feature extraction model so as to output the first color feature and the second color feature corresponding to the image to be retrieved through the feature extraction model. The first color feature represents the main color feature of the image to be retrieved, and the second color feature represents the secondary color feature of the image to be retrieved.
[0088] The similarity calculation module 20 is used to calculate the similarity between the image to be retrieved and any image in the image library based on the first color feature and the second color feature.
[0089] The retrieval module 30 is used to determine the target image corresponding to the image to be retrieved based on similarity.
[0090] In some embodiments, the retrieval module is further configured to: sort the inventory images in descending order according to the similarity calculation results, and obtain a preset number of inventory images as target images according to the sorting results; and display the target images to the user in order according to the sorting results.
[0091] In some embodiments, the classification loss function used to train the feature extraction model is expressed by the following formula:
[0092]
[0093]
[0094]
[0095]
[0096]
[0097]
[0098] in, This represents the total loss function of the feature extraction model. Indicates the loss of the first color. Indicates the loss of the second color. This represents the penalty coefficient corresponding to the loss of the first color. This represents the penalty coefficient corresponding to the loss of the second color. This represents the distance between the currently output first color category and the first true category. This represents the distance between the first color category output in the previous iteration and the first true color category. This indicates the distance between the currently output second color category and the second true category. This represents the distance between the second color category output in the previous iteration and the second true category. Indicates the color loss weight, This represents the traditional classification loss function.
[0099] In some embodiments, the feature extraction module is further configured to: convert the image to be retrieved to the HSV space and extract the H channel to obtain the hue map corresponding to the image to be retrieved.
[0100] It should be noted that the above description of similar image retrieval methods also applies to this similar image retrieval system, and will not be repeated here.
[0101] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0102] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0103] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0104] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this invention and simplifying the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0105] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0106] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0107] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can mean that the first and second features are in direct contact, or that they are in indirect contact through an intermediate medium. Furthermore, "above," "over," and "on top" of the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.
[0108] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A similar image retrieval method, characterized in that, Includes the following steps: Obtain the hue map corresponding to the image to be retrieved, and input the hue map into a pre-trained feature extraction model, so as to output the first color feature and the second color feature corresponding to the image to be retrieved through the feature extraction model, wherein the first color feature represents the main color feature of the image to be retrieved, and the second color feature represents the secondary color feature of the image to be retrieved; Calculate the similarity between the image to be retrieved and any image in the image database based on the first color feature and the second color feature; The target image corresponding to the image to be retrieved is determined based on the similarity. The classification loss function used to train the feature extraction model is expressed by the following formula: ; ; ; ; ; ; in, This represents the total loss function of the feature extraction model. Indicates the loss of the first color. Indicates the loss of the second color. This represents the penalty coefficient corresponding to the loss of the first color. This represents the penalty coefficient corresponding to the loss of the second color. This represents the distance between the currently output first color category and the first true category. This represents the distance between the first color category output in the previous iteration and the first true color category. This indicates the distance between the currently output second color category and the second true category. This represents the distance between the second color category output in the previous iteration and the second true category. Indicates the color loss weight, This represents the traditional classification loss function.
2. The similar image retrieval method as described in claim 1, characterized in that, Determining the target image corresponding to the image to be retrieved based on the similarity includes: The inventory images are sorted in descending order based on the similarity calculation results, and a preset number of inventory images are obtained as target images based on the sorting results. The target images are displayed to the user in order according to the arrangement results.
3. The similar image retrieval method as described in claim 1, characterized in that, Obtain the hue map corresponding to the image to be retrieved, including: The image to be retrieved is converted to HSV space, and the H channel is extracted to obtain the hue map corresponding to the image to be retrieved.
4. The similar image retrieval method as described in claim 1, characterized in that, The similarity is calculated using the following formula: ; ; ; in, Indicates similarity. This represents the first color feature corresponding to the image to be retrieved. This represents the first color feature corresponding to the current inventory image. This represents the similarity value corresponding to the first color feature. This represents the second color feature corresponding to the image to be retrieved. This represents the second color feature corresponding to the current inventory image. This represents the similarity value corresponding to the second color feature. This represents the similarity weight of the first color feature.
5. A computer-readable storage medium, characterized in that, It stores a similar image retrieval program, which, when executed by the processor, implements the similar image retrieval method as described in any one of claims 1-4.
6. A similar image retrieval system, characterized in that, include: The feature extraction module is used to obtain the hue map corresponding to the image to be retrieved, and input the hue map into a pre-trained feature extraction model, so as to output the first color feature and the second color feature corresponding to the image to be retrieved through the feature extraction model, wherein the first color feature represents the main color feature of the image to be retrieved, and the second color feature represents the secondary color feature of the image to be retrieved; A similarity calculation module is used to calculate the similarity between the image to be retrieved and any image in the image library based on the first color feature and the second color feature. The retrieval module is used to determine the target image corresponding to the image to be retrieved based on the similarity. The classification loss function used to train the feature extraction model is expressed by the following formula: ; ; ; ; ; ; in, This represents the total loss function of the feature extraction model. Indicates the loss of the first color. Indicates the loss of the second color. This represents the penalty coefficient corresponding to the loss of the first color. This represents the penalty coefficient corresponding to the loss of the second color. This represents the distance between the currently output first color category and the first true category. This represents the distance between the first color category output in the previous iteration and the first true color category. This indicates the distance between the currently output second color category and the second true category. This represents the distance between the second color category output in the previous iteration and the second true category. Indicates the color loss weight, This represents the traditional classification loss function.
7. The similar image retrieval system as described in claim 6, characterized in that, The retrieval module is also used for: The inventory images are sorted in descending order based on the similarity calculation results, and a preset number of inventory images are obtained as target images based on the sorting results. The target images are displayed to the user in order according to the arrangement results.
8. The similar image retrieval system as described in claim 6, characterized in that, The feature extraction module is also used for: The image to be retrieved is converted to HSV space, and the H channel is extracted to obtain the hue map corresponding to the image to be retrieved.
Citation Information
Patent Citations
Image retrieval device and method and medium recording image retrieval program
JP1999238077A
Device and method for image processing
JP2001216317A