CN110879846A - Image retrieval method and device, electronic equipment and computer-readable storage medium - Google Patents

Image retrieval method and device, electronic equipment and computer-readable storage medium Download PDF

Info

Publication number
CN110879846A
CN110879846A CN201811034090.0A CN201811034090A CN110879846A CN 110879846 A CN110879846 A CN 110879846A CN 201811034090 A CN201811034090 A CN 201811034090A CN 110879846 A CN110879846 A CN 110879846A
Authority
CN
China
Prior art keywords
attribute
image
field
retrieved
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811034090.0A
Other languages
Chinese (zh)
Inventor
戴世稳
彭齐荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Intellifusion Technologies Co Ltd
Original Assignee
Shenzhen Intellifusion Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Intellifusion Technologies Co Ltd filed Critical Shenzhen Intellifusion Technologies Co Ltd
Priority to CN201811034090.0A priority Critical patent/CN110879846A/en
Publication of CN110879846A publication Critical patent/CN110879846A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the invention provides an image retrieval method, an image retrieval device and electronic equipment, wherein the method comprises the following steps: extracting attribute values of an image to be retrieved; compressing the attribute value of the image to be retrieved to obtain an attribute field of the image to be retrieved; and searching the attribute fields in attribute field partitions corresponding to the attribute fields in an image library to obtain an image search result, wherein the image library comprises a plurality of attribute field partitions, the attribute fields in each attribute field partition belong to the same attribute type, and each attribute field has an index relationship with the image in the image library. The embodiment of the invention can improve the image retrieval efficiency.

Description

Image retrieval method and device, electronic equipment and computer-readable storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image retrieval method and apparatus, and an electronic device.
Background
Image retrieval is one of the currently common techniques, such as: face image retrieval or retrieval of other images. At present, image retrieval mainly adopts a mode that a large number of images are stored in an image library, and when image retrieval is needed, the similarity between an image to be retrieved and each image stored in the image library is calculated, so that an image with the highest similarity with the image to be retrieved or the similarity meeting preset conditions is obtained as a retrieval result. However, the image search method is low in search efficiency.
Disclosure of Invention
The embodiment of the invention provides an image retrieval method and device, electronic equipment and a computer readable storage medium, which can improve the image retrieval efficiency.
In a first aspect, an embodiment of the present invention provides an image retrieval method, including:
extracting attribute values of an image to be retrieved;
compressing the attribute value of the image to be retrieved to obtain an attribute field of the image to be retrieved;
and searching the attribute fields in attribute field partitions corresponding to the attribute fields in an image library to obtain an image search result, wherein the image library comprises a plurality of attribute field partitions, the attribute fields in each attribute field partition belong to the same attribute type, and each attribute field has an index relationship with the image in the image library.
Optionally, the attribute field in the image library is used for representing an attribute value and a confidence of the attribute value;
the extracting of the attribute value of the image to be retrieved comprises the following steps:
extracting an attribute value of an image to be retrieved and a confidence coefficient of the attribute value;
compressing the attribute value of the image to be retrieved to obtain the attribute field of the image to be retrieved, including:
and compressing the attribute value of the image to be retrieved and the confidence coefficient of the attribute value to obtain an attribute field of the image to be detected, wherein the attribute field is used for representing the attribute value and the confidence coefficient of the attribute value.
Optionally, the image to be retrieved includes M attribute values, where M is an integer greater than or equal to 1;
compressing the attribute value of the image to be retrieved and the confidence coefficient of the attribute value to obtain the attribute field of the image to be detected, including:
compressing the M attribute values of the image to be retrieved and the confidence degrees of the M attribute values to obtain N attribute fields, wherein the N attribute fields at least comprise M attribute bytes, each attribute byte represents one attribute value and the confidence degree of the attribute value, a target attribute field exists in the N attribute fields, the target attribute field comprises a plurality of attribute bytes, the attribute values represented by the attribute bytes belong to the same attribute type, and N is a positive integer less than or equal to M.
Optionally, the retrieving the attribute field in the attribute field partition corresponding to the attribute field in the image library to obtain an image retrieval result includes:
and searching the N attribute fields in N attribute field partitions in the image library respectively to obtain N attribute field search results, and determining N image search results which have an index relationship with the N attribute field search results in the image library, wherein the N attribute field partitions correspond to the N attribute fields respectively.
In a second aspect, an embodiment of the present invention provides an image retrieval apparatus, including:
the first extraction module is used for extracting the attribute value of the image to be retrieved;
the first compression module is used for compressing the attribute value of the image to be retrieved to obtain an attribute field of the image to be detected;
and the first retrieval module is used for retrieving the attribute fields in attribute field partitions corresponding to the attribute fields in an image library to obtain an image retrieval result, wherein the image library comprises a plurality of attribute field partitions, the attribute fields in the same attribute field partition belong to the same attribute type, and each attribute field has an index relationship with the image in the image library.
In a third aspect, an embodiment of the present invention provides an electronic device, including: the image retrieval method comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the computer program to realize the steps in the image retrieval method provided by the embodiment of the invention.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps in the image retrieval method provided by the embodiment of the present invention.
In the embodiment of the invention, the attribute value of the image to be retrieved is extracted; compressing the attribute value of the image to be retrieved to obtain an attribute field of the image to be retrieved; and searching the attribute fields in attribute field partitions corresponding to the attribute fields in an image library to obtain an image search result, wherein the image library comprises a plurality of attribute field partitions, the attribute fields in the same attribute field partition belong to the same attribute type, and each attribute field has an index relationship with the image in the image library. Due to the fact that the attribute values are compressed and the plurality of attribute fields in the image library are partitioned, only the corresponding attribute fields need to be searched during searching, and therefore image searching efficiency can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of an image retrieval method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another image retrieval method according to an embodiment of the present invention;
FIG. 3 is a diagram of an attribute field provided by an embodiment of the invention;
FIG. 4 is a schematic structural diagram of an image retrieval apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of another image retrieval apparatus according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of another image retrieval apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic flow chart of an image retrieval method according to an embodiment of the present invention, as shown in fig. 1, including the following steps:
101. and extracting the attribute value of the image to be retrieved.
The image to be retrieved may be a face image, and the attribute values may be attribute values of age, gender, race, hair, hat, glasses, and the like. Of course, the image to be retrieved may be other images, such as: a vehicle image, an animal image, or the like, for which the above-described attribute value may be a vehicle color, a vehicle model, a vehicle type, or the like, and for an animal image, the above-described attribute value may be a color, a category, a body length, or the like.
It should be noted that the attribute value extracted in step 101 may be one or more attribute values. In addition, the image to be searched may also be referred to as a search condition.
102. And compressing the attribute value of the image to be retrieved to obtain an attribute field of the image to be detected.
In this step, when a plurality of attribute values are extracted in step 101, the plurality of attribute values may be compressed to obtain a plurality of attribute fields, and each attribute field is used to indicate one or more corresponding attribute values. The attribute field may be one or more bytes, each byte may include a set of binary numbers, that is, the compression in the embodiment of the present invention may refer to compressing the attribute values into binary numbers, so as to reduce the amount of computation in the search. For example: the glasses attribute value can be represented by 4 binary numbers, such as 0000 to indicate whether glasses are not determined to be worn, 0001 to indicate that glasses are not worn, 0010 to indicate that common glasses (such as myopia glasses) are worn, and 0011 to indicate that sunglasses are worn. Another example is: the hat attribute value can be represented by 4 binary numbers, such as 0000 for uncertainty of whether to wear hat, 0001 for not wearing hat, and 0010 for wearing hat. Another example is: the hair attribute values can be represented by 4 binary numbers, such as 0000 for indeterminate hair length, 0001 for short hair, and 0010 for long hair. Of course, the above binary numbers can also be converted into decimal numbers, for example: for the glasses attribute value, 0 may be used to indicate that it is uncertain whether or not glasses are worn, 1 indicates that glasses are not worn, 2 indicates that ordinary glasses are worn, and 3 indicates that sunglasses are worn.
Another example is: for the national attribute field, 0 may be used to represent han nationality, 1 may represent nationality such as nationality or Uyghur nationality, and for the age attribute field, it may be divided by age groups, where 0 represents uncertainty, 1 represents (0, 5] year, 2 represents (5, 10] year, etc., and for the gender attribute field, 0 may represent uncertainty, 1 represents male, and 2 represents female.
103. And searching the attribute fields in attribute field partitions corresponding to the attribute fields in an image library to obtain an image search result, wherein the image library comprises a plurality of attribute field partitions, the attribute fields in each attribute field partition belong to the same attribute type, and each attribute field has an index relationship with the image in the image library.
The image library may be a local image library or a remote image library, and further the image library may refer to images stored on one or more storage devices.
It should be noted that the attribute values of each image in the image library are compressed into attribute fields, and the attribute fields of the images are divided according to attribute types in the image library to obtain a plurality of attribute field partitions. For example: the image attribute values include: age, gender, ethnicity, and accessories (e.g., glasses, hair, and hat), which are compressed into an age attribute field, a gender attribute field, a ethnicity attribute field, and an accessories attribute field, respectively; then, partitioning the attribute field of each image according to the age attribute field, the gender attribute field, the ethnic attribute field and the accessory attribute field to obtain a plurality of attribute field partitions; i.e., the age attribute field of each image is divided into an age attribute field partition, the gender attribute field of each image is divided into a gender attribute field partition, etc., not listed here. In addition, because the image and the attribute field have a corresponding relationship, after partitioning, an index relationship between each attribute field and the corresponding image is established, so that the corresponding image can be indexed through the attribute field.
In addition, the attribute field partition in the image library and the corresponding index relationship may be preset, for example: before step 101 is executed, the attribute value of each image is extracted, compressed to obtain the attribute field of each image, partitioned, and indexed. Of course, the attribute field partition and the corresponding index relationship in the image library may also be sent by a certain device, for example: after one device generates the image library, the image library can be shared, so that the rest devices do not need to perform the image library establishment process.
The above-mentioned retrieving the attribute field in the attribute field partition corresponding to the attribute field in the image library may be retrieving the attribute field in the attribute field partition corresponding to the attribute field, for example: the attribute fields obtained in step 102 include an age attribute field, a gender attribute field, a ethnic attribute field, and an accessory attribute field, and then step 103 searches the age attribute field, the gender attribute field, the ethnic attribute field, and the accessory attribute field in an age attribute field partition, a gender attribute field partition, a ethnic attribute field partition, and an accessory attribute field partition in the image library, respectively, to obtain one or more image search results, each image search result corresponding to one or more images.
In one embodiment, when the attribute field of the image to be detected includes a plurality of attribute fields (such as an age attribute field, a gender attribute field, a ethnic attribute field, an accessory attribute field, and the like), each attribute field is searched in the attribute field partition corresponding to the image library to obtain a plurality of search results, a plurality of image search results having an index relationship with the plurality of search results are found in the image library, and an image common to the plurality of image search results is taken as a final search result.
Wherein each image retrieval result comprises at least one image. In addition, the above-mentioned retrieval may be to search for an attribute field with a similarity higher than a certain threshold and index to obtain a corresponding image, or to search for one or more attribute fields with the highest similarity and index to obtain a corresponding image. The search may be performed by a bit operation, for example: comparing the attribute field of the image to be retrieved with the attribute field in the image library by bit operation, wherein the bit can be compared with the bit, and if the attribute field is 8 binary numbers, comparing the 8 binary comparison values of the image to be retrieved with the 8 binary numbers in the image library one by one according to the bit, thereby obtaining the similarity of the two.
In the above steps, the attribute values are compressed into attribute fields, so that the calculation amount of retrieval can be reduced, the data storage capacity can be reduced, in addition, the attribute fields are partitioned in the image library, and retrieval is only carried out in the corresponding attribute field partitions during retrieval, so that the retrieval range is reduced, and the retrieval efficiency is improved.
It should be noted that the image retrieval method provided by the embodiment of the present invention can be applied to an image retrieval device, for example: and the computer, the server, the mobile phone and other devices can perform image retrieval.
In the embodiment of the invention, the attribute value of the image to be retrieved is extracted; compressing the attribute value of the image to be retrieved to obtain an attribute field of the image to be retrieved; and searching the attribute fields in attribute field partitions corresponding to the attribute fields in an image library to obtain an image search result, wherein the image library comprises a plurality of attribute field partitions, the attribute fields in the same attribute field partition belong to the same attribute type, and each attribute field has an index relationship with the image in the image library. Due to the fact that the attribute values are compressed and the plurality of attribute fields in the image library are partitioned, only the corresponding attribute fields need to be searched during searching, and therefore image searching efficiency can be improved.
Referring to fig. 2, fig. 2 is a schematic flow chart of another image retrieval method according to an embodiment of the present invention, as shown in fig. 2, including the following steps:
201. and extracting the attribute value of the image to be retrieved.
202. And compressing the attribute value of the image to be retrieved to obtain an attribute field of the image to be detected.
203. And searching the attribute fields in attribute field partitions corresponding to the attribute fields in an image library to obtain an image search result, wherein the image library comprises a plurality of attribute field partitions, the attribute fields in the same attribute field partition belong to the same attribute type, and each attribute field has an index relationship with the image in the image library.
204. And searching the characteristic value of the image to be searched in the image searching result to obtain a characteristic value searching result.
The feature value may be used to describe information of the feature of the image to be retrieved, for example: the characteristics of the face contour, the shape of five sense organs, the face skin color and the like of the face image are described. In addition, the feature values of the image to be retrieved may be extracted when extracting the attribute values, for example: the feature values of the image may be extracted by a feature extraction module. In the embodiment of the present invention, the manner of extracting the feature value is not limited.
In addition, the image library stores the feature values of the images, and the image search result in step 203 is one or more images, so that similar images can be matched in the image search result in step 203 by a feature value similarity matching algorithm when the search is performed in step 204.
More accurate feature value search results can be searched through step 204 because step 204 further screens out images with high feature value similarity on the basis of the image search results of step 203.
It should be noted that step 204 is optional, for example: in some scenarios, the image retrieval result of step 203 only needs to be obtained.
In an alternative embodiment, the attribute field within the image library is used to represent an attribute value and a confidence level for that attribute value;
the extracting of the attribute value of the image to be retrieved comprises the following steps:
extracting an attribute value of an image to be retrieved and a confidence coefficient of the attribute value;
compressing the attribute value of the image to be retrieved to obtain the attribute field of the image to be retrieved, including:
and compressing the attribute value of the image to be retrieved and the confidence coefficient of the attribute value to obtain an attribute field of the image to be detected, wherein the attribute field is used for representing the attribute value and the confidence coefficient of the attribute value.
Where attribute fields within the image library are used to represent an attribute value and a confidence level for that attribute value, it is understood that each attribute field represents one or more attribute values and the confidence level for those attribute values. For example: the gender attribute field of an image may indicate both the gender attribute value of the image and the confidence level of the gender attribute value. Take the example of an 8-bit attribute field, where bits 5 to 8 represent the attribute value, bits 2 to 4 represent the confidence, and another bit may be reserved or represent the version number.
Similarly, the description of the attribute field in the image library can also be referred to in the attribute field of the image to be detected, which is not described herein again.
In this embodiment, since a confidence is added to each attribute in the attribute field, the accuracy of image retrieval can be further improved. Specifically, the confidence of the attribute value of the image to be retrieved may be compared with the confidence of the attribute value in the image library, for example: and if the confidence coefficient of the eyeglass attribute value of the image to be retrieved is 10, comparing the confidence coefficient of the eyeglass attribute value of the image to be retrieved with the confidence coefficient of each eyeglass attribute value in the image library in the retrieval process, so as to select a retrieval result with high image library confidence coefficient and 10 similarity, so as to retrieve the retrieval result similar to the confidence coefficient of the image to be retrieved, and further improve the accuracy of image retrieval.
In addition, it should be noted that, in the embodiment of the present invention, since the confidence of the attribute value is represented by the attribute field, and since the attribute field may be a set of binary numbers, the confidence may be represented by a discrete interval value, for example: three-bit binary number, 001 indicates a confidence of 1, 011 indicates a confidence of 3, and 100 indicates a confidence of 4. This may support distinguishing confidence in the identification of various attribute values to further improve the accuracy of image retrieval.
Optionally, each attribute field in the attribute fields of the image to be retrieved is further used for representing a version number;
each attribute field in the image library is also used to represent a version number.
The version number may be an algorithm version for extracting attribute values, an algorithm version for extracting feature values, a version number of a system, or the like, which is not limited. Specifically, the version number may be represented by a bit at a specific position of the attribute field, for example: from high to low, the 1 st digit value is used to indicate a version number, for example: 0 is used to denote the old version and 1 denotes the new version.
The attribute field also represents the version number, so that the retrieval range can be further reduced in the retrieval process, and the retrieval efficiency is further improved.
Optionally, in the foregoing embodiment, the image to be retrieved includes M attribute values, where M is an integer greater than or equal to 1;
compressing the attribute value of the image to be retrieved and the confidence coefficient of the attribute value to obtain the attribute field of the image to be detected, including:
compressing the M attribute values of the image to be retrieved and the confidence degrees of the M attribute values to obtain N attribute fields, wherein the N attribute fields at least comprise M attribute bytes, each attribute byte represents one attribute value and the confidence degree of the attribute value, a target attribute field exists in the N attribute fields, the target attribute field comprises a plurality of attribute bytes, the attribute values represented by the attribute bytes belong to the same attribute type, and N is a positive integer less than or equal to M.
The N attribute field presence target attribute field may be that N attribute fields have an attribute field including a plurality of attribute bytes, that is, there are attribute fields in the N attribute fields that can represent a plurality of attribute values and confidence levels of the plurality of attribute values, that is, one attribute field may represent a plurality of attribute values and confidence levels of the plurality of attribute values. For example: the accessory attribute field may include a hair attribute byte, a hat attribute byte, and a glasses attribute byte. As shown in fig. 3, three accessory attribute fields (accesses), a race attribute field (race), an age attribute field (age), and a gender attribute field (gender) are included. Each attribute field is a 4-byte int type field, and each byte can represent an attribute value. For example: the accessory attribute field includes a hair attribute byte, a hat attribute byte, and a glasses attribute byte. Further, of the 8 bits of each byte, from high to low, the 1 st bit is used to distinguish between old and new versions, the 2 nd to 4 th bits represent confidence, and the 5 th to 8 th bits represent attribute values, so that each field can represent 4 attribute values, each attribute value has 16 values at most, and each value has 8 confidence intervals. The gender attribute field is 209, i.e., 11010001, bit 1 indicates a new version, bits 2 to 4 indicate confidence of 5, bits 5 to 8 indicate 0001 attribute value of 1, i.e., male. Further, two bytes may be occupied in the age attribute field, respectively indicating the interval of the age and the actual age value. In addition, the attribute field may be a long type field.
It should be noted that fig. 3 is only an example, and in some embodiments, the number of bytes included in different attribute fields may also be different, and may be specifically set according to actual requirements.
In this embodiment, since one attribute field can represent a plurality of attribute values and the confidence levels of the plurality of attribute values, the data amount can be reduced. In addition, the attribute field may further include reserved attribute bytes to support retrieval of more attribute values, thereby improving compatibility of the method.
Optionally, the extracting the attribute value of the image to be retrieved and the confidence of the attribute value include:
and extracting the attribute value of the image to be retrieved and the confidence coefficient of the attribute value through a pre-trained neural network.
The neural network may be obtained by training a depth algorithm through a large image data set, and the input of the neural network is an image, and a certain attribute value including the image and the confidence of the attribute value are output. For example: aiming at the confidence coefficient of the attribute value of the glasses, a large image data set can be used for training a deep learning algorithm, so that the algorithm can know what the glasses are more deeply, because the image is concentrated by using various glasses, then, an image is input, the attribute value and the confidence coefficient of the glasses in the image can be obtained, the confidence coefficient of whether the glasses are worn can be calculated by both the glasses-free method and the glasses-worn method, if the confidence coefficient of the glasses-free method is 0, the confidence coefficient of the glasses-worn method is 100, and the confidence coefficient can measure the probability of whether the image is the glasses.
In this embodiment, the accuracy of the attribute value and the confidence may be improved by extracting the attribute value and the confidence through the neural network trained in advance.
Of course, in this embodiment, the attribute values and the confidence levels extracted by the neural network are not limited, for example: confidence may also be derived by algorithms for confidence calculation, such as: the confidence level of each attribute value may be obtained by a Belief Propagation algorithm (Belief Propagation), and the like, which is not limited.
Optionally, the retrieving the attribute field in the attribute field partition corresponding to the attribute field in the image library to obtain an image retrieval result includes:
and searching the N attribute fields in N attribute field partitions in the image library respectively to obtain N attribute field search results, and determining N image search results which have an index relationship with the N attribute field search results in the image library, wherein the N attribute field partitions correspond to the N attribute fields respectively.
It can be understood that the N attribute field partitions correspond to the N attribute fields respectively, that the attribute types corresponding to the N attribute field partitions are the same as the attribute types of the N attribute fields, for example: the N attribute fields are respectively an age attribute field, a gender attribute field, a ethnic attribute field and an accessory attribute word, the N attribute field partitions are respectively an age attribute field partition, a gender attribute field partition, a ethnic attribute field partition and an accessory attribute word partition, and the age attribute field, the gender attribute field, the ethnic attribute field and the accessory attribute word are respectively searched in the age attribute field partition, the gender attribute field partition, the ethnic attribute field partition and the accessory attribute word partition.
Furthermore, when one attribute field comprises attribute bytes corresponding to a plurality of attribute values, the attribute field partition can be further divided into a plurality of sub-partitions, and the retrieval is carried out according to the sub-partitions during the retrieval. For example: the accessory attribute field comprises a hair attribute byte, a glasses attribute byte and a hat attribute byte, the accessory attribute field partition is divided into a hair attribute byte partition, a glasses attribute byte partition and a hat attribute byte partition, and during retrieval, the hair attribute byte, the glasses attribute byte and the hat attribute partition are respectively retrieved in the hair attribute byte partition, the glasses attribute byte partition and the hat attribute byte partition. This can further improve the retrieval efficiency.
It should be noted that the N search image results refer to search image results obtained by searching in the N attribute field partitions, and each search image result may include one or more search images. In addition, when searching in the attribute field partition, filtering can be performed in a bit operation mode, so that similar attribute fields are obtained, and images indexed by the attribute fields are obtained.
In this embodiment, since the N attribute fields are searched in the corresponding N attribute field partitions, the search range can be narrowed, and the search efficiency can be improved.
Optionally, the image library further stores feature values of the images;
the extracting of the attribute value of the image to be retrieved and the confidence of the attribute value includes:
extracting a characteristic value and an attribute value of an image to be retrieved and a confidence coefficient of the attribute value;
the method further comprises the following steps:
and searching the characteristic value of the image to be searched in the N image searching results to obtain a characteristic value searching result.
In one embodiment, an image common to the N image retrieval results is used as a final image retrieval result, and the feature value of the image to be retrieved is retrieved in the final image retrieval result to obtain a feature value retrieval result. The search range can be further reduced by taking the image shared by the N image search results as the final image search result, so that the search efficiency is further improved.
In this embodiment, it is possible to further perform a search using the feature values of the image in the search result corresponding to the attribute value and the confidence, and thus it is possible to improve the accuracy of the image search.
This embodiment is also to be understood as a further limitation to step 204.
As an optional implementation manner, before extracting the attribute value of the image to be retrieved, the method further includes:
extracting attribute values of a plurality of images;
compressing the attribute values of the plurality of images to obtain attribute fields of the plurality of images;
and partitioning according to the attribute type of the attribute field to obtain a plurality of attribute field partitions, storing the attribute field partitions in the image library, and establishing an index relationship between each attribute field and the image.
The above-mentioned extracting the attribute values of the image and compressing may refer to an implementation for the image to be retrieved, which is not described herein again.
The partition may be obtained by dividing the attribute fields of the images according to attribute types to obtain a plurality of attribute field partitions. For example: the attribute value field includes: the attribute field of each image can be partitioned according to the age attribute field, the gender attribute field, the ethnic attribute field and the accessory attribute field to obtain a plurality of attribute field partitions; i.e., the age attribute field of each image is divided into an age attribute field partition, the gender attribute field of each image is divided into a gender attribute field partition, etc., not listed here. In addition, because the image and the attribute field have a corresponding relationship, after partitioning, an index relationship between each attribute field and the corresponding image can be established, so that the corresponding image can be indexed through the attribute field.
In the embodiment, the attribute field is partitioned, so that the search only needs to be carried out in the corresponding attribute field partition during the search, and the search efficiency is further improved.
In this embodiment, various optional embodiments are added to the embodiment shown in fig. 1, and the retrieval efficiency can be further improved.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an image retrieving apparatus according to an embodiment of the present invention, as shown in fig. 4, including:
a first extraction module 401, configured to extract an attribute value of an image to be retrieved;
a first compression module 402, configured to compress the attribute value of the image to be retrieved to obtain an attribute field of the image to be detected;
a first retrieving module 403, configured to retrieve the attribute field in an attribute field partition corresponding to the attribute field in an image library, so as to obtain an image retrieving result, where the image library includes multiple attribute field partitions, the attribute field included in each attribute field partition belongs to the same attribute type, and each attribute field has an index relationship with an image in the image library.
Optionally, the attribute field in the image library is used for representing an attribute value and a confidence of the attribute value;
the first extraction module 401 is configured to extract an attribute value of an image to be retrieved and a confidence level of the attribute value;
the first compression module 402 is configured to compress the attribute value of the image to be retrieved and the confidence level of the attribute value to obtain an attribute field of the image to be detected, where the attribute field is used to represent the attribute value and the confidence level of the attribute value.
Optionally, the image to be retrieved includes M attribute values, where M is an integer greater than or equal to 1;
the first compression module 402 is configured to compress the M attribute values of the image to be retrieved and the confidence degrees of the M attribute values to obtain N attribute fields, where the N attribute fields at least include M attribute bytes, each attribute byte represents one attribute value and the confidence degree of the attribute value, a target attribute field exists in the N attribute fields, the target attribute field includes multiple attribute bytes, the multiple attribute values represented by the multiple attribute bytes belong to the same attribute type, and N is a positive integer less than or equal to M.
Optionally, the first extracting module 401 is configured to extract the attribute value of the image to be retrieved and the confidence of the attribute value through a pre-trained neural network.
Optionally, the first retrieving module 403 is configured to retrieve the N attribute fields in N attribute field partitions in the image library respectively to obtain N attribute retrieval results, and determine N image retrieval results having an index relationship with the N attribute retrieval results in the image library, where the N attribute field partitions correspond to the N attribute fields respectively.
Optionally, the image library further stores feature values of the images;
the first extraction module 401 is configured to extract a feature value and an attribute value of an image to be retrieved, and a confidence level of the attribute value;
as shown in fig. 5, the apparatus further comprises
And a second retrieval module 404, configured to retrieve the feature value of the image to be retrieved in the N image retrieval results to obtain a feature value retrieval result.
Optionally, each attribute field in the attribute fields of the image to be retrieved is further used for representing a version number;
each attribute field in the image library is also used to represent a version number.
Optionally, as shown in fig. 6, the apparatus further comprises
A second extraction module 405 for extracting attribute values of the plurality of images;
a second compression module 406, configured to compress the attribute values of the multiple images to obtain attribute fields of the multiple images;
the establishing module 407 is configured to perform partitioning according to the attribute type of the attribute field to obtain the multiple attribute field partitions, store the multiple attribute field partitions in the image library, and establish an index relationship between each attribute field and the image.
It should be noted that the above device can be applied to an image retrieval apparatus, for example: and the computer, the server, the mobile phone and other devices can perform image retrieval.
The community management device provided in the embodiment of the present invention can implement each implementation manner in the method embodiments of fig. 1 and fig. 2, and has corresponding beneficial effects, and for avoiding repetition, details are not repeated here.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 7, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein:
the processor 701 is configured to call the computer program stored in the memory 702, and perform the following steps:
extracting attribute values of an image to be retrieved;
compressing the attribute value of the image to be retrieved to obtain an attribute field of the image to be retrieved;
and searching the attribute fields in attribute field partitions corresponding to the attribute fields in an image library to obtain an image search result, wherein the image library comprises a plurality of attribute field partitions, the attribute fields in each attribute field partition belong to the same attribute type, and each attribute field has an index relationship with the image in the image library.
Optionally, the attribute field in the image library is used for representing an attribute value and a confidence of the attribute value;
the extracting of the attribute value of the image to be retrieved performed by the processor 701 includes:
extracting an attribute value of an image to be retrieved and a confidence coefficient of the attribute value;
the compressing the attribute value of the image to be retrieved executed by the processor 701 to obtain the attribute field of the image to be detected includes:
and compressing the attribute value of the image to be retrieved and the confidence coefficient of the attribute value to obtain an attribute field of the image to be detected, wherein the attribute field is used for representing the attribute value and the confidence coefficient of the attribute value.
Optionally, the image to be retrieved includes M attribute values, where M is an integer greater than or equal to 1;
the compressing, performed by the processor 701, the attribute value of the image to be retrieved and the confidence level of the attribute value to obtain an attribute field of the image to be detected includes:
compressing the M attribute values of the image to be retrieved and the confidence degrees of the M attribute values to obtain N attribute fields, wherein the N attribute fields at least comprise M attribute bytes, each attribute byte represents one attribute value and the confidence degree of the attribute value, a target attribute field exists in the N attribute fields, the target attribute field comprises a plurality of attribute bytes, the attribute values represented by the attribute bytes belong to the same attribute type, and N is a positive integer less than or equal to M.
Optionally, the extracting, performed by the processor 701, the attribute value of the image to be retrieved and the confidence level of the attribute value include:
and extracting the attribute value of the image to be retrieved and the confidence coefficient of the attribute value through a pre-trained neural network.
Optionally, the retrieving, performed by the processor 701, the attribute field in the attribute field partition corresponding to the attribute field in the image library to obtain an image retrieval result includes:
and searching the N attribute fields in N attribute field partitions in the image library respectively to obtain N attribute field search results, and determining N image search results which have an index relationship with the N attribute field search results in the image library, wherein the N attribute field partitions correspond to the N attribute fields respectively.
Optionally, the image library further stores feature values of the images;
the extracting, performed by the processor 701, the attribute value of the image to be retrieved and the confidence level of the attribute value include:
extracting a characteristic value and an attribute value of an image to be retrieved and a confidence coefficient of the attribute value;
the processor 701 is further configured to:
and searching the characteristic value of the image to be searched in the N image searching results to obtain a characteristic value searching result.
Optionally, each attribute field in the attribute fields of the image to be retrieved is further used for representing a version number;
each attribute field in the image library is also used to represent a version number.
Optionally, before the extracting the attribute value of the image to be retrieved, the processor 701 is further configured to:
extracting attribute values of a plurality of images;
compressing the attribute values of the plurality of images to obtain attribute fields of the plurality of images;
and partitioning according to the attribute type of the attribute field to obtain a plurality of attribute field partitions, storing the attribute field partitions in the image library, and establishing an index relationship between each attribute field and the image.
It should be noted that the electronic device may be an image retrieval device, for example: and the computer, the server, the mobile phone and other devices can perform image retrieval.
The community management device provided in the embodiment of the present invention can implement each implementation manner in the method embodiments of fig. 1 and fig. 2, and has corresponding beneficial effects, and for avoiding repetition, details are not repeated here.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the embodiment of the image retrieval method provided in the embodiment of the present invention, and can achieve the same technical effect, and in order to avoid repetition, the computer program is not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (10)

1. An image retrieval method, comprising:
extracting attribute values of an image to be retrieved;
compressing the attribute value of the image to be retrieved to obtain an attribute field of the image to be retrieved;
and searching the attribute fields in attribute field partitions corresponding to the attribute fields in an image library to obtain an image search result, wherein the image library comprises a plurality of attribute field partitions, the attribute fields in each attribute field partition belong to the same attribute type, and each attribute field has an index relationship with the image in the image library.
2. The method of claim 1, wherein an attribute field within the image library is used to represent an attribute value and a confidence level for that attribute value;
the extracting of the attribute value of the image to be retrieved comprises the following steps:
extracting an attribute value of an image to be retrieved and a confidence coefficient of the attribute value;
compressing the attribute value of the image to be retrieved to obtain the attribute field of the image to be retrieved, including:
and compressing the attribute value of the image to be retrieved and the confidence coefficient of the attribute value to obtain an attribute field of the image to be detected, wherein the attribute field is used for representing the attribute value and the confidence coefficient of the attribute value.
3. The method of claim 2, wherein the image to be retrieved comprises M attribute values, M being an integer greater than or equal to 1;
compressing the attribute value of the image to be retrieved and the confidence coefficient of the attribute value to obtain the attribute field of the image to be detected, including:
compressing the M attribute values of the image to be retrieved and the confidence degrees of the M attribute values to obtain N attribute fields, wherein the N attribute fields at least comprise M attribute bytes, each attribute byte represents one attribute value and the confidence degree of the attribute value, a target attribute field exists in the N attribute fields, the target attribute field comprises a plurality of attribute bytes, the attribute values represented by the attribute bytes belong to the same attribute type, and N is a positive integer less than or equal to M.
4. The method of claim 2, wherein the extracting of the attribute value of the image to be retrieved and the confidence level of the attribute value comprises:
and extracting the attribute value of the image to be retrieved and the confidence coefficient of the attribute value through a pre-trained neural network.
5. The method according to any one of claims 2 to 4, wherein the retrieving the attribute field in an attribute field partition corresponding to the attribute field in an image library to obtain an image retrieval result comprises:
and searching the N attribute fields in N attribute field partitions in the image library respectively to obtain N attribute field search results, and determining N image search results which have an index relationship with the N attribute field search results in the image library, wherein the N attribute field partitions correspond to the N attribute fields respectively.
6. The method of claim 5, wherein the image library further stores feature values of images;
the extracting of the attribute value of the image to be retrieved and the confidence of the attribute value includes:
extracting a characteristic value and an attribute value of an image to be retrieved and a confidence coefficient of the attribute value;
the method further comprises the following steps:
and searching the characteristic value of the image to be searched in the N image searching results to obtain a characteristic value searching result.
7. The method according to any one of claims 1-4, wherein before extracting the attribute values of the image to be retrieved, the method further comprises:
extracting attribute values of a plurality of images;
compressing the attribute values of the plurality of images to obtain attribute fields of the plurality of images;
and partitioning according to the attribute type of the attribute field to obtain a plurality of attribute field partitions, storing the attribute field partitions in the image library, and establishing an index relationship between each attribute field and the image.
8. An image retrieval apparatus, comprising:
the first extraction module is used for extracting the attribute value of the image to be retrieved;
the first compression module is used for compressing the attribute value of the image to be retrieved to obtain an attribute field of the image to be detected;
and the first retrieval module is used for retrieving the attribute fields in attribute field partitions corresponding to the attribute fields in an image library to obtain an image retrieval result, wherein the image library comprises a plurality of attribute field partitions, the attribute fields in each attribute field partition belong to the same attribute type, and each attribute field has an index relationship with the image in the image library.
9. An electronic device, comprising: memory, processor and computer program stored on the memory and executable on the processor, the processor implementing the steps in the image retrieval method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, carries out the steps in the image retrieval method according to any one of claims 1 to 7.
CN201811034090.0A 2018-09-05 2018-09-05 Image retrieval method and device, electronic equipment and computer-readable storage medium Pending CN110879846A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811034090.0A CN110879846A (en) 2018-09-05 2018-09-05 Image retrieval method and device, electronic equipment and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811034090.0A CN110879846A (en) 2018-09-05 2018-09-05 Image retrieval method and device, electronic equipment and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN110879846A true CN110879846A (en) 2020-03-13

Family

ID=69728429

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811034090.0A Pending CN110879846A (en) 2018-09-05 2018-09-05 Image retrieval method and device, electronic equipment and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN110879846A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104094255A (en) * 2011-11-16 2014-10-08 英特尔公司 Method and apparatus for searching an image, and computer-readable recording medium for executing the method
CN104933154A (en) * 2015-06-25 2015-09-23 北京邮电大学 Method for quickly searching image according to content based on distributed network
CN105426850A (en) * 2015-11-23 2016-03-23 深圳市商汤科技有限公司 Human face identification based related information pushing device and method
CN106933867A (en) * 2015-12-30 2017-07-07 杭州华为企业通信技术有限公司 A kind of image inquiry method and device
CN108108657A (en) * 2017-11-16 2018-06-01 浙江工业大学 A kind of amendment local sensitivity Hash vehicle retrieval method based on multitask deep learning

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104094255A (en) * 2011-11-16 2014-10-08 英特尔公司 Method and apparatus for searching an image, and computer-readable recording medium for executing the method
CN104933154A (en) * 2015-06-25 2015-09-23 北京邮电大学 Method for quickly searching image according to content based on distributed network
CN105426850A (en) * 2015-11-23 2016-03-23 深圳市商汤科技有限公司 Human face identification based related information pushing device and method
CN106933867A (en) * 2015-12-30 2017-07-07 杭州华为企业通信技术有限公司 A kind of image inquiry method and device
CN108108657A (en) * 2017-11-16 2018-06-01 浙江工业大学 A kind of amendment local sensitivity Hash vehicle retrieval method based on multitask deep learning

Similar Documents

Publication Publication Date Title
US10755086B2 (en) Picture ranking method, and terminal
CN111310074B (en) Method and device for optimizing labels of interest points, electronic equipment and computer readable medium
CN110796088A (en) Video similarity determination method and device
CN111177436B (en) Face feature retrieval method, device and equipment
CN113705596A (en) Image recognition method and device, computer equipment and storage medium
CN111125408A (en) Search method and device based on feature extraction, computer equipment and storage medium
CN114299363A (en) Training method of image processing model, image classification method and device
CN110083731B (en) Image retrieval method, device, computer equipment and storage medium
CN110162769B (en) Text theme output method and device, storage medium and electronic device
CN110209895B (en) Vector retrieval method, device and equipment
CN115578765A (en) Target identification method, device, system and computer readable storage medium
CN110879846A (en) Image retrieval method and device, electronic equipment and computer-readable storage medium
CN114333039B (en) Method, device and medium for clustering human images
CN111767419A (en) Picture searching method, device, equipment and computer readable storage medium
CN115082999A (en) Group photo image person analysis method and device, computer equipment and storage medium
CN113127665A (en) Information pushing method based on artificial intelligence and artificial intelligence cloud platform
CN114494809A (en) Feature extraction model optimization method and device and electronic equipment
CN113011301A (en) Living body identification method and device and electronic equipment
CN112149566A (en) Image processing method and device, electronic equipment and storage medium
CN113065025A (en) Video duplicate checking method, device, equipment and storage medium
CN117235137B (en) Professional information query method and device based on vector database
CN111625672B (en) Image processing method, image processing device, computer equipment and storage medium
CN110874419B (en) Quick retrieval technology for face database
CN113782033B (en) Voiceprint recognition method, voiceprint recognition device, voiceprint recognition equipment and storage medium
CN116244455A (en) Image retrieval method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200313

RJ01 Rejection of invention patent application after publication