WO2020182019A1 - 图像检索方法、装置、设备及计算机可读存储介质 - Google Patents

图像检索方法、装置、设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2020182019A1
WO2020182019A1 PCT/CN2020/077586 CN2020077586W WO2020182019A1 WO 2020182019 A1 WO2020182019 A1 WO 2020182019A1 CN 2020077586 W CN2020077586 W CN 2020077586W WO 2020182019 A1 WO2020182019 A1 WO 2020182019A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
hash
images
hash code
retrieved
Prior art date
Application number
PCT/CN2020/077586
Other languages
English (en)
French (fr)
Inventor
张莉
陆鋆
周伟达
王邦军
章晓芳
屈蕴茜
赵雷
Original Assignee
苏州大学
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 苏州大学 filed Critical 苏州大学
Publication of WO2020182019A1 publication Critical patent/WO2020182019A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the embodiments of the present invention relate to the field of image processing technology, and in particular, to an image retrieval method, device, device, and computer-readable storage medium.
  • the binary code obtained by this training has such a problem: the hash codes of the same image are too consistent, so the same image is almost indistinguishable, and it is impossible to distinguish the image that is more similar to the retrieved image. In other words, the related technology cannot Search for images of the same category.
  • the embodiments of the present disclosure provide an image retrieval method, device, equipment, and computer-readable storage medium, which implement accurate retrieval of images of the same category.
  • the embodiments of the present invention provide the following technical solutions:
  • One aspect of the embodiments of the present invention provides an image retrieval method, including:
  • the deep hash mapping model takes an image pair in the image database as input, and uses the distance between the hash code pairs obtained by mapping the image pair, the label category, and the feature similarity of the image pair as The loss value is obtained by optimizing the loss value training by using a machine learning optimization algorithm; the label category is used to identify the similarity of the two images in the image pair; The image is obtained after being mapped by the deep hash mapping model.
  • the training process of the deep hash mapping model includes:
  • Loss is the loss value
  • the i-th image and the j-th image form the image pair
  • n is the total number of images in the image database
  • S i,j is the i-th image and the j-th image
  • o i is the hash code of the i-th image
  • o j is the hash code of the j-th image
  • 2 is the distance between the hash code pairs
  • is a hyperparameter
  • y i,j are label categories
  • y i,j 1 means that the i-th image and the j-th image are the same category of images
  • y i,j 0 means the i-th image and the j-th image
  • the images are of different categories.
  • the depth feature similarity value of the i-th image and the j-th image may be obtained from a pre-calculated similarity matrix, and the similarity matrix calculation process is:
  • the convolutional neural network is obtained by deep learning and training using images in the image database.
  • the calculation process of the depth feature similarity value of the i-th image and the j-th image is:
  • f i is the depth feature vector of the i-th image
  • f j is the depth feature vector of the j-th image
  • ⁇ and ⁇ are hyperparameters.
  • the convolutional neural network model is a VGG-16 network model.
  • the process of generating the hash encoding library is:
  • the m-th code of the i-th image in the image database As follows:
  • I the output of the m-th bit of the i-th image in the hash coding layer
  • is the threshold
  • the search for a target image whose Hamming distance difference from the hash code to be retrieved meets a preset condition in a pre-built hash code library is:
  • an image retrieval device including:
  • the model training module is used to take the image pairs in the image database as input, the distance between the hash code pairs obtained by the image pair mapping, the label category, and the feature similarity of the image pairs as the loss value, using machine learning
  • the optimization algorithm optimizes the loss value to train a deep hash mapping model; the tag category is used to identify the similarity of two images in the image pair;
  • a hash code generation module configured to map the image to be retrieved into the hash code to be retrieved by using the deep hash mapping model
  • the image retrieval module is used to search for a target image whose Hamming distance difference with the hash code to be retrieved meets a preset condition in the pre-built hash code library, as the retrieval of the image to be retrieved in the image database Result;
  • the hash encoding library is obtained by mapping each image in the image database by the deep hash mapping model.
  • An embodiment of the present invention also provides an image retrieval device, including a processor, which is configured to implement the steps of the image retrieval method described in any preceding item when executing a computer program stored in a memory.
  • the embodiment of the present invention finally provides a computer-readable storage medium, the computer-readable storage medium stores an image retrieval program, and when the image retrieval program is executed by a processor, the image retrieval method as described in any of the preceding items is implemented A step of.
  • the advantage of the technical solution provided by this application is that the similarity between the images in the image data is considered when training the hash mapping model.
  • the more similar the images the smaller the Hamming distance between the hash codes obtained by the mapping.
  • the more dissimilar between the two the larger the Hamming distance between the hash codes obtained by the mapping, and the Hamming distance between the hash codes obtained by the mapping of similar images is determined according to the similarity between the images, which effectively solves the correlation
  • the same type of image hash code is too consistent, which leads to the problem that the same type of image cannot be retrieved, thereby achieving accurate retrieval of the same type of image.
  • the embodiments of the present invention also provide corresponding implementation devices, equipment, and computer-readable storage media for the image retrieval method, which further makes the method more practical.
  • the devices, equipment, and computer-readable storage media have corresponding advantage.
  • FIG. 1 is a schematic flowchart of an image retrieval method provided by an embodiment of the present invention
  • Fig. 2 is a schematic diagram showing a generation process of a deep hash mapping model according to an exemplary embodiment of the present disclosure
  • Fig. 3 is a schematic diagram showing a VGG-16 network structure according to an exemplary embodiment of the present disclosure
  • Fig. 4 is a schematic diagram showing another VGG-16 network structure according to an exemplary embodiment of the present disclosure.
  • Fig. 5 is a schematic diagram showing a process of generating a similarity matrix according to an exemplary embodiment of the present disclosure
  • Fig. 6 is a schematic diagram showing the binary code distribution of the technical solution of the present application according to an exemplary embodiment of the present disclosure
  • Fig. 7 is a schematic diagram showing a binary code distribution of related technologies according to an exemplary embodiment of the present disclosure
  • FIG. 8 is a structural diagram of a specific implementation manner of an image retrieval device provided by an embodiment of the present invention.
  • FIG. 1 is a schematic flowchart of an image retrieval method provided by an embodiment of the present invention.
  • the embodiment of the present invention may include the following content:
  • S101 Preliminarily take the image pairs in the image database as input, use the distance between the hash code pairs obtained by the image pair mapping, the label category and the feature similarity of the image pairs as the loss value, and use the machine learning optimization algorithm to optimize the loss value for training Get the deep hash mapping model.
  • mapping model For hash mapping, and then learn the parameter weights of the convolutional network structure based on the image database and the image similarity matrix, so as to complete the construction of the deep hash mapping model based on image similarity, deep hash
  • the training process of the mapping model can be described as follows, please refer to Figure 2:
  • the convolutional neural network model with the fully connected layer as the hash coding layer is used as the network structure of the deep hash mapping model.
  • the convolutional neural network structure can adopt any convolutional neural network structure, such as the VGG shown in Figure 3. -16 network model, VGG-16 network model improves the final performance of the entire convolutional neural network by increasing the network depth. Of course, it can also be other convolutional network structures, which does not constitute the realization of this application. You can add a fully connected layer before the last layer of the convolutional neural network. The number of nodes is the length of the hash code. As the hash code layer, the generation process of the hash code layer can be found in any related technology. The realization process of, I will not repeat it here.
  • the image database is a database for searching similar or identical images with the image to be retrieved, and the database contains a large number of images.
  • the comparison of image similarity can be added to make the Hamming distance between the hash codes obtained from different types of image mappings as large as possible; the hash codes obtained from the same type of image mapping
  • the Hamming distance between the images is determined according to the similarity between the images. The specific expression is that the more similar the images are, the smaller the Hamming distance between the mapped hash codes; the less similar the images, the hash codes obtained by the mapping The Hamming distance between them is slightly larger.
  • a random image pair in the image database can be used as the input of the network structure. Any two images in the image database randomly form an image pair, and each image pair has a label category. The label category is used to identify the image pair. The similarity of the two images. If the two images are images of the same category, the label category of the image pair is similar; if the two images are not images of the same category, the label category of the image pair is not similar.
  • any convolutional neural network model can be used.
  • the VGG-16 network shown in Figure 4 as the network structure.
  • the features obtained through the convolutional layer and the pooling layer are generally relatively different. High dimensionality, so the feature vector value output by the fully connected layer is usually selected as the depth feature, and the output of the fc7 layer in Figure 4 is the depth feature.
  • a corresponding similarity matrix can be generated for the image database in advance, and the similarity value of the image pair can be directly obtained from the similarity matrix.
  • the depth feature similarity value of the i-th image and the j-th image can be obtained from the pre-calculated similarity matrix.
  • the similarity matrix calculation process can be:
  • the pre-built convolutional neural network model is used to extract the depth features of each image in the image database to generate a set of depth feature vectors.
  • the convolutional neural network can be obtained by using image training in the image database based on deep learning. In order to improve the accuracy of extracting the depth features of the image, the convolutional neural network model of image training in the image database can be used.
  • the feature vector extracted from the i-th image is denoted as f i .
  • the depth feature vector of the image in the image database set X constitutes the depth
  • the distance between the two depth feature vectors in the depth feature vector set is calculated separately as the similarity value of the two images.
  • the Euclidean distance between the two vectors in the depth feature vector set can be calculated separately to generate the image database.
  • Similarity matrix the similarity matrix can be as shown in Figure 5.
  • the depth feature similarity value of the i-th image and the j-th image can be calculated using the following formula:
  • f i is the depth feature vector of the i-th image
  • f j is the depth feature vector of the j-th image
  • ⁇ and ⁇ are hyperparameters.
  • the loss value of the deep hash map model can be determined by the category, similarity and binarization constraints of the image pairs input to the network structure.
  • the following formula can be used as the loss value of the network structure:
  • Loss is the loss value
  • the i-th image and the j-th image form an image pair
  • n is the total number of images in the image database
  • S i,j is the depth feature similarity between the i-th image and the j-th image
  • O i is the hash code of the i-th image
  • o j is the hash code of the j-th image
  • 2 is the distance between the hash code pairs
  • is the hyperparameter
  • y i,j are label categories
  • y i,j 1 indicates that the i-th image and the j-th image are images of the same category
  • y i,j 0 indicates that the i-th image and the j-th image are images of different categories.
  • stochastic gradient descent can be used to optimize the loss value to train the network structure to obtain the model weight, so as to complete the training of the deep hash mapping model.
  • other optimization algorithms can also be used, which is not limited in this application.
  • the output of the deep hash mapping model in the hash coding layer can be used To indicate that it is mapped to a hash code by setting a threshold.
  • S102 Use a deep hash mapping model to map the image to be retrieved into a hash code to be retrieved.
  • S103 Search for a target image whose Hamming distance difference with the hash code to be retrieved meets a preset condition in a pre-built hash code library, as a retrieval result of the image to be retrieved in the image database.
  • the hash code library corresponds to the image database.
  • Each hash code contained in the hash code library uniquely corresponds to an image in the image database.
  • Each image in the image database is input to the deep hash mapping model, and the threshold is set , Map the output of the hash coding layer of the deep hash mapping model to the corresponding hash code, and then generate a hash code library according to the hash code of each image.
  • the m-th code of the i-th image in the image database It can be as follows:
  • I the output of the m-th bit of the i-th image in the hash coding layer
  • is the threshold
  • Searching for an image similar to the image to be retrieved in the image database can be determined according to the Hamming distance between the hash code of the image to be retrieved and the hash code of each image in the image database.
  • the distance difference, the number of target images output and the total number of images in the image database are used to set the preset conditions.
  • the Hamming distance from the hash code to be retrieved can be found in the hash code library
  • the value of T can be determined by the total number of images in the image database and the actual needs of the user, which does not affect the implementation of this application.
  • T 2
  • calculate the Hamming distance difference between the hash code to be retrieved and the hash code of each image in the image database then select the smallest difference and the second smallest difference from 10 Hamming distance differences The image corresponding to the value.
  • the T images can be sorted according to the difference between the Hamming distance and the hash code to be retrieved from small to large, and then the sorted T images can be output.
  • the T images can also be sorted according to the difference between the Hamming distance and the hash code to be retrieved from large to small, which does not affect the realization of this application.
  • the similarity between the images in the image data is considered when training the hash mapping model.
  • the more similar the images the smaller the Hamming distance between the hash codes obtained by the mapping.
  • the more dissimilar the images the larger the Hamming distance between the hash codes obtained by the mapping, which prompts the Hamming distance between the hash codes obtained by the mapping of similar images to be determined according to the similarity between the images, which effectively solves the problem.
  • the same type of image hash codes are too consistent, resulting in the problem that the same type of image cannot be retrieved, thereby realizing the accurate retrieval of the same type of image.
  • the CIFAR-10 data set is used as an image database for testing.
  • the CIFAR-10 data set contains a total of 60,000 32*32*3 color images in 10 categories, which can include the following:
  • the convolutional neural network structure CNN 1 is slightly modified for the data set CIFAR-10.
  • the fully connected layer is composed of 2 layers, and fc6 is the feature extraction layer.
  • the feature extraction layer fc6 here is composed of 512 nodes, so the dimension of the feature vector f i is (1,512), and the dimension of the feature vector set F is (50000,512).
  • the i-th row and the j-th column represent the distance value S i,j between the feature vectors f i and f j corresponding to the image pair (x i , x j ).
  • the deep hash mapping model based on image similarity is denoted as CNN hash .
  • a random image pair (x i , x j ) is used as the input of CNN hash , and the output of the hash coding layer is (f i , f j ).
  • the loss function is determined by three factors: (1) category y i,j ; (2) similarity Si ,j ; (3) binarization constraint. Therefore, for database X with a total of n, the total loss is:
  • the model weight w of the CNN hash is obtained by minimizing Loss by gradient descent, and the trained CNN hash is expressed as w-CNN hash .
  • the image x i is used as the input of the deep hash mapping model w-CNN hash of this application, and the output o i is obtained.
  • the image database X is mapped by w-CNN hash to obtain a hash code library, denoted as H.
  • the embodiment of the present invention effectively solves the problem of excessively consistent hash codes of images of the same category in related technologies, thereby realizing accurate retrieval of images of the same category.
  • the retrieval accuracy rate Precision can be used as an evaluation criterion to measure the retrieval effect of the image retrieval algorithm on a retrieved image.
  • Precison s calculation method is:
  • Rel(i) indicates whether the image to be retrieved is similar to the i-th image in the image database. If they are similar, the value is 1, and if they are not, the value is 0.
  • the average retrieval accuracy MRP of all retrieved images can be used to measure the retrieval performance of different methods.
  • the MRP of the deep hash mapping model based on image similarity is 83.42%, and the MRP of related technologies is 81.78%. It can be seen that the deep hash mapping model based on image similarity has good retrieval accuracy.
  • Figure 6 shows the binary code distribution obtained by mapping CIFAR-10 on the deep hash mapping model based on image similarity, with a total of 320 types;
  • Figure 7 shows the image database obtained after mapping There are 89 kinds of binary code distribution. It can be seen that the hash codes obtained by the deep hash mapping model based on image similarity are diverse, and it can better prevent the hash codes of similar images from being too consistent, so similar images are almost indistinguishable.
  • the embodiment of the present invention also provides a corresponding implementation device for the image retrieval method, which further makes the method more practical.
  • the image retrieval device provided by the embodiment of the present invention will be introduced below.
  • the image retrieval device described below and the image retrieval method described above may correspond to each other for reference.
  • FIG. 8 is a structural diagram of an image retrieval device according to an embodiment of the present invention in a specific implementation manner.
  • the device may include:
  • the model training module 801 is used to take the image pairs in the image database as input, the distance between the hash code pairs obtained by the image pair mapping, the label category and the feature similarity of the image pairs as the loss value, and the optimization algorithm is optimized by machine learning
  • the loss value is used to train the deep hash mapping model
  • the label category is used to identify the similarity of the two images in the image pair.
  • the hash code generation module 802 is configured to map the image to be retrieved into the hash code to be retrieved by using the deep hash mapping model.
  • the image retrieval module 803 is used to find a target image whose Hamming distance difference with the hash code to be retrieved meets preset conditions in the pre-built hash code library, as the retrieval result of the image to be retrieved in the image database;
  • the Greek code library is obtained by mapping each image in the image database through a deep hash mapping model.
  • the model training module 801 may also be used to use a convolutional neural network model with a fully connected layer as a hash coding layer as the network structure of the deep hash mapping model;
  • Loss is the loss value
  • the i-th image and the j-th image form an image pair
  • n is the total number of images in the image database
  • S i,j is the depth feature similarity between the i-th image and the j-th image
  • O i is the hash code of the i-th image
  • o j is the hash code of the j-th image
  • 2 is the distance between the hash code pairs
  • is the hyperparameter
  • y i,j are label categories
  • y i,j 1 indicates that the i-th image and the j-th image are images of the same category
  • y i,j 0 indicates that the i-th image and the j-th image are images of different categories.
  • the model training module 801 may also be used to extract the depth features of each image in the image database using a pre-built convolutional neural network model to generate a set of depth feature vectors;
  • the convolutional neural network is based on deep learning and the use of image training in the image database.
  • the model training module 801 can also be used to calculate the depth feature similarity value of the i-th image and the j-th image by using the following formula:
  • f i is the depth feature vector of the i-th image
  • f j is the depth feature vector of the j-th image
  • ⁇ and ⁇ are hyperparameters.
  • the image retrieval module 803 may also search the hash code library for the smallest Hamming distance value from the hash code to be retrieved. T images; sort the T images according to the Hamming distance from the hash code to be retrieved from small to large; output the sorted T images.
  • each functional module of the image retrieval device in the embodiment of the present invention can be implemented according to the method in the above method embodiment, and the specific implementation process can refer to the related description of the above method embodiment, and will not be repeated here.
  • the embodiment of the present invention effectively solves the problem of excessively consistent hash codes of images of the same category in related technologies, thereby realizing accurate retrieval of images of the same category.
  • the embodiment of the present invention also provides an image retrieval device, which may specifically include:
  • Memory used to store computer programs
  • the processor is configured to execute a computer program to implement the steps of the image retrieval method described in any of the above embodiments.
  • each functional module of the image retrieval device in the embodiment of the present invention can be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process can refer to the relevant description of the foregoing method embodiment, and will not be repeated here.
  • the embodiment of the present invention effectively solves the problem of excessively consistent hash codes of images of the same category in related technologies, thereby realizing accurate retrieval of images of the same category.
  • the embodiment of the present invention also provides a computer-readable storage medium that stores an image retrieval program, and when the image retrieval program is executed by a processor, the steps of the image retrieval method described in any of the above embodiments are the same.
  • each functional module of the computer-readable storage medium in the embodiment of the present invention can be specifically implemented according to the method in the above method embodiment, and the specific implementation process can refer to the related description of the above method embodiment, and will not be repeated here.
  • the embodiment of the present invention effectively solves the problem of excessively consistent hash codes of images of the same category in related technologies, thereby realizing accurate retrieval of images of the same category.
  • the steps of the method or algorithm described in the embodiments disclosed in this document can be directly implemented by hardware, a software module executed by a processor, or a combination of the two.
  • the software module can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or all areas in the technical field. Any other known storage medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Library & Information Science (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Image Analysis (AREA)

Abstract

一种图像检索方法、装置、设备及计算机可读存储介质。其中,方法包括以图像数据库中的图像对为输入,以图像对映射得到的哈希编码对间的距离、标签类别和图像对的特征相似度为损失值,采用机器学习优化算法优化损失值以训练得到深度哈希映射模型(S101);将待检索图像利用深度哈希映射模型映射为待检索哈希编码(S102);在预先构建的哈希编码库中查找与待检索哈希编码的汉明距离差值满足预设条件的目标图像,作为待检索图像在图像数据库的检索结果进行输出,哈希编码库为将图像数据库中每张图像经深度哈希映射模型映射后所得(S103)。该方法有效地解决了相关技术中同一类别图像哈希编码过于一致的问题,从而实现了同一类别图像的准确检索。

Description

图像检索方法、装置、设备及计算机可读存储介质
本申请要求于2019年3月8日提交至中国专利局、申请号为201910175051.0、发明名称为“图像检索方法、装置、设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明实施例涉及图像处理技术领域,特别是涉及一种图像检索方法、装置、设备及计算机可读存储介质。
背景技术
近些年来,随着互联网的进一步普及和大数据技术的深入应用,每天都会有数以亿计的图像产生。图像数据资源的集中和规模的增大使得现有技术越来越难以满足用户图像检索的需求。因此,如何有效地描述图像的特征信息,采用何种数据结构进行高效索引和快速相似性检索等问题成为了这个方向的研究热点。
面对大规模的图像数据,鉴于二进制编码具有易于比较与存储的性质,可以极大的提升相似性检索的速度并节省更多的计算机资源,故在进行图像检索时一般将图像映射成二进制编码。
深度学习的出现推动了计算机视觉的发展,也为学习哈希映射方法提供了更有效的工具。相关技术用神经网络模型映射哈希编码,然利用图像的方式训练深度学习模型,通过损失函数来约束该模型参数,取得了较为不错的结果。
但是,该训练得到的二进制编码存在这样的问题:同类图像的哈希编码过于一致,因而同类图像近乎毫无区分度,无法辨别出与检索图像较为相似的图像,也就是说,相关技术无法对同一类别图像进行检索。
发明内容
本公开实施例提供了一种图像检索方法、装置、设备及计算机可读存储介质,实现了同一类别图像的准确检索。
为解决上述技术问题,本发明实施例提供以下技术方案:
本发明实施例一方面提供了一种图像检索方法,包括:
利用预先构建的深度哈希映射模型将待检索图像映射为待检索哈希编码;
在预先构建的哈希编码库中查找与所述待检索哈希编码的汉明距离差值满足预设条件的目标图像,以作为所述待检索图像在图像数据库的检索结果;
其中,所述深度哈希映射模型为以所述图像数据库中的图像对为输入,以所述图像对映射得到的哈希编码对间的距离、标签类别和所述图像对的特征相似度为损失值,采用机器学习优化算法优化所述损失值训练所得;所述标签类别用于标识所述图像对中两张图像的相似性;所述哈希编码库为将所述图像数据库中每张图像经所述深度哈希映射模型映射后所得。
可选的,所述深度哈希映射模型的训练过程包括:
将全连接层为哈希编码层的卷积神经网络模型作为所述深度哈希映射模型的网络结构;
以所述图像数据库中的图像对作为所述网络结构的输入,以下述公式作为所述网络结构的损失值,采用随机梯度下降优化所述损失值训练所述网络结构:
Figure PCTCN2020077586-appb-000001
式中,Loss为所述损失值,第i张图像与第j张图像组成所述图像对,n为所述图像数据库中图像总个数,S i,j为第i张图像与第j张图像的深度特征相似度,o i为第i张图像的哈希编码,o j为第j张图像的哈希编码,||o i-o j|| 2为的哈希编码对间的距离,α为超参数,y i,j为标签类别,y i,j=1表示第i张图像与第j张图像为同一类别图像,y i,j=0表示第i张图像与第j张图像为不同类别图像。
可选的,第i张图像与第j张图像的深度特征相似度值可从预先计算得到的相似度矩阵获取,所述相似度矩阵计算过程为:
利用预先构建的卷积神经网络模型提取所述图像数据库中各图像的深度特征,生成深度特征向量集合;
分别计算所述深度特征向量集合中两两向量之间的欧氏距离,生成所述图像数据库的相似度矩阵;
其中,所述卷积神经网络为基于深度学习利用所述图像数据库中图像训练所得。
可选的,所述第i张图像与第j张图像的深度特征相似度值的计算过程为:
利用下述公式计算第i张图像与第j张图像的深度特征相似度值:
Figure PCTCN2020077586-appb-000002
式中,f i为第i张图像的深度特征向量,f j为第j张图像的深度特征向量,y i,j=1表示第i张图像与第j张图像为同一类别图像,y i,j=0表示第i张图像与第j张图像为不同类别图像,α、β为超参数。
可选的,所述卷积神经网络模型为VGG-16网络模型。
可选的,所述哈希编码库的生成过程为:
将所述图像数据库中的每张图像输入至所述深度哈希映射模型,通过设置阈值,将所述深度哈希映射模型的哈希编码层的输出映射为哈希编码;
根据每张图像的哈希编码生成所述哈希编码库;
其中,所述图像数据库的第i张图像的第m位编码
Figure PCTCN2020077586-appb-000003
如下式:
Figure PCTCN2020077586-appb-000004
式中,
Figure PCTCN2020077586-appb-000005
为第i张图像的第m位在哈希编码层的输出,θ为所述阈值。
可选的,所述在预先构建的哈希编码库中查找与所述待检索哈希编码的汉明距离差值满足预设条件的目标图像为:
在所述哈希编码库中查找与所述待检索哈希编码的汉明距离值最小的 前T张图像;
按照与所述待检索哈希编码的汉明距离差值从小到大对T张图像进行排序;
输出排序后的T张图像。
本发明实施例另一方面提供了一种图像检索装置,包括:
模型训练模块,用于以图像数据库中的图像对为输入,以所述图像对映射得到的哈希编码对间的距离、标签类别和所述图像对的特征相似度为损失值,采用机器学习优化算法优化所述损失值以训练得到深度哈希映射模型;所述标签类别用于标识所述图像对中两张图像的相似性;
哈希编码生成模块,用于利用所述深度哈希映射模型将待检索图像映射为待检索哈希编码;
图像检索模块,用于在预先构建的哈希编码库中查找与所述待检索哈希编码的汉明距离差值满足预设条件的目标图像,以作为所述待检索图像在图像数据库的检索结果;所述哈希编码库为将所述图像数据库中每张图像经所述深度哈希映射模型映射后所得。
本发明实施例还提供了一种图像检索设备,包括处理器,所述处理器用于执行存储器中存储的计算机程序时实现如前任一项所述图像检索方法的步骤。
本发明实施例最后还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有图像检索程序,所述图像检索程序被处理器执行时实现如前任一项所述图像检索方法的步骤。
本申请提供的技术方案的优点在于,在训练哈希映射模型时考虑图像数据中各图像之间相似度,图像间越相似,映射得到的哈希编码之间的汉明距离就越小,图像间越不相似,映射得到的哈希编码之间的汉明距离就稍大,促使同类图像映射得到的哈希编码之间的汉明距离根据图像间的相似度来决定,有效地解决了相关技术中同一类别图像哈希编码过于一致导致同类图像无法检索的问题,从而实现了同一类别图像的准确检索。
此外,本发明实施例还针对图像检索方法提供了相应的实现装置、设备及计算机可读存储介质,进一步使得所述方法更具有实用性,所述装置、 设备及计算机可读存储介质具有相应的优点。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本公开。
附图说明
为了更清楚的说明本发明实施例或相关技术的技术方案,下面将对实施例或相关技术描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的一种图像检索方法的流程示意图;
图2为本公开根据一示例性实施例示出的一种深度哈希映射模型的生成过程示意图;
图3为本公开根据一示例性实施例示出的一种VGG-16网络结构示意图;
图4为本公开根据一示例性实施例示出的另一种VGG-16网络结构示意图;
图5为本公开根据一示例性实施例示出的相似性矩阵的生成过程示意图;
图6为本公开根据一示例性实施例示出的本申请技术方案的二进制编码分布示意图;
图7为本公开根据一示例性实施例示出的相关技术的二进制编码分布示意图;
图8为本发明实施例提供的图像检索装置的一种具体实施方式结构图。
具体实施方式
为了使本技术领域的人员更好地理解本发明方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本 领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”“第四”等是用于区别不同的对象,而不是用于描述特定的顺序。此外术语“包括”和“具有”以及他们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、***、产品或设备没有限定于已列出的步骤或单元,而是可包括没有列出的步骤或单元。
在介绍了本发明实施例的技术方案后,下面详细的说明本申请的各种非限制性实施方式。
首先参见图1,图1为本发明实施例提供的一种图像检索方法的流程示意图,本发明实施例可包括以下内容:
S101:预先以图像数据库中的图像对为输入,以图像对映射得到的哈希编码对间的距离、标签类别和图像对的特征相似度为损失值,采用机器学习优化算法优化损失值以训练得到深度哈希映射模型。
首先构建卷积神经网络结构用于哈希映射,然后基于图像数据库和图像相似度矩阵学习得到该卷积网络结构的参数权重,从而完成基于图像相似度的深度哈希映射模型构建,深度哈希映射模型的训练过程可如下所述,请参阅图2所示:
将全连接层为哈希编码层的卷积神经网络模型作为深度哈希映射模型的网络结构,卷积神经网络结构可采用任何一种卷积神经网络结构,例如可为图3所示的VGG-16网络模型,VGG-16网络模型通过增加网络深度提高了整个卷积神经网络的最终性能。当然,也可为其他卷积网络结构,这均不影像本申请的实现。可通过在卷积神经网络的最后一层前添加一层全连接层,结点数即为哈希编码长度,作为哈希编码层,哈希编码层的生成过程可参阅任何一种相关技术中记载的实现过程,此处,便不再赘述。
图像数据库为待检索图像检索与其相似或相同图像的数据库,该数据库包含大量图像。
在训练深度哈希映射模型的时,可加入图像相似度的比较,使得不同类别图像映射得到的哈希编码之间的汉明距离要尽可能的大;同一类别图 像映射得到的哈希编码之间的汉明距离根据图像间的相似度来决定,具体表达为图像间越相似,映射得到的哈希编码之间的汉明距离就越小;图像间越不相似,映射得到的哈希编码之间的汉明距离就稍大。
鉴于此,可以图像数据库中的随机的一个图像对作为网络结构的输入,图像数据库中任何两张图像随机构成一个图像对,且每个图像对具有标签类别,标签类别用于标识构成图像对的这两张图像的相似性,若这两张图像为同一类别的图像,则图像对的标签类别为相似;若这两张图像不为同一类别的图像,则图像对的标签类别为不相似。举例来说,图像数据库中的图像表示为集合X={x 1,x 2,…,x n},也就是图像数据库中共有n张图像,第i张图像和第j张图像构成的图像对可表示为(x i,x j),用符号y i,j来表示该图像的标签,y i,j=1表示这两张图像相似,y i,j=0表示这两张图像不相似。
提取每张图像的深度特征,可根据构成图像对的两张图像的深度特征来判断两张图像是否具有相似性。在提取图像的深度特征时,可采用任何一种卷积神经网络模型,例如可参阅图4所示的VGG-16网络作为的网络结构,通过卷积层和池化层获取的特征一般有较高的维度,因此通常选取全连接层输出的特征向量值作为深度特征,图4中fc7层的输出则为深度特征。
在一种具体的实施方式中,可预先为图像数据库生成相应的相似性矩阵,图像对的相似度值可直接从该相似度矩阵中获取。相似性矩阵的生成过程可参阅图5所示,第i张图像与第j张图像的深度特征相似度值可从预先计算得到的相似度矩阵获取,相似度矩阵计算过程可为:
利用预先构建的卷积神经网络模型提取图像数据库中各图像的深度特征,生成深度特征向量集合。卷积神经网络可为基于深度学习利用图像数据库中图像训练所得,为了提高准确率提取图像的深度特征,可利用图像数据库中的图像训练的卷积神经网络模型。用训练好的卷积神经网络模型为图像数据库集合X中的每张图像提取深度特征,第i张图像提取得到的特征向量记为f i,图像数据库集合X中图像的深度特征向量构成了深度特征向量集合,可表示为F={f 1,f 2,…,f n}。
分别计算深度特征向量集合中两两深度特征向量之间的距离,以作为 两张图像的相似度值,例如可分别计算深度特征向量集合中两两向量之间的欧氏距离,生成图像数据库的相似度矩阵,相似度矩阵可如图5所示的矩阵。
第i张图像与第j张图像的深度特征相似度值可利用下述公式进行计算:
Figure PCTCN2020077586-appb-000006
式中,f i为第i张图像的深度特征向量,f j为第j张图像的深度特征向量,y i,j=1表示第i张图像与第j张图像为同一类别图像,y i,j=0表示第i张图像与第j张图像为不同类别图像,α、β为超参数。
深度哈希映射模型的损失值可由输入网络结构的图像对的类别、相似度及二进制化约束来决定,对于共有n张图像的图像数据库,可以下述公式作为该网络结构的损失值:
Figure PCTCN2020077586-appb-000007
式中,Loss为损失值,第i张图像与第j张图像组成图像对,n为图像数据库中图像总个数,S i,j为第i张图像与第j张图像的深度特征相似度,o i为第i张图像的哈希编码,o j为第j张图像的哈希编码,||o i-o j|| 2为的哈希编码对间的距离,α为超参数,y i,j为标签类别,y i,j=1表示第i张图像与第j张图像为同一类别图像,y i,j=0表示第i张图像与第j张图像为不同类别图像。
然后可采用随机梯度下降优化损失值训练该网络结构得到模型权重,以完成深度哈希映射模型的训练。当然,也可采用其他优化算法,本申请对此不做任何限定。
深度哈希映射模型在哈希编码层的输出可采用
Figure PCTCN2020077586-appb-000008
来表示,通过设置阈值将其映射成哈希编码。
S102:利用深度哈希映射模型将待检索图像映射为待检索哈希编码。
将待检索图像输入至深度哈希映射模型,将该模型的哈希编码层输出基于阈值映射为待检索图像的哈希编码,即待检索哈希编码。
S103:在预先构建的哈希编码库中查找与待检索哈希编码的汉明距离差值满足预设条件的目标图像,以作为待检索图像在图像数据库的检索结果。
哈希编码库与图像数据库相对应,哈希编码库包含的每个哈希编码与图像数据库中的图像唯一相对应,将图像数据库中的每张图像输入至深度哈希映射模型,通过设置阈值,将深度哈希映射模型的哈希编码层的输出映射为相应的哈希编码,然后根据每张图像的哈希编码生成哈希编码库。图像数据库的第i张图像的第m位编码
Figure PCTCN2020077586-appb-000009
可如下式:
Figure PCTCN2020077586-appb-000010
式中,
Figure PCTCN2020077586-appb-000011
为第i张图像的第m位在哈希编码层的输出,θ为阈值。
在图像数据库中检索与待检索图像相似的图像,也即目标图像,可根据待检索图像的哈希编码与图像数据库中各图像的哈希编码之间的汉明距离来决定,可根据汉明距离差值、目标图像输出的张数和图像数据库总图像数目来设置预设条件,例如在一种具体的实施方式中,可在哈希编码库中查找与待检索哈希编码的汉明距离值最小的前T张图像,T值的大小可由图像数据库中图像数量总数和用户实际需求相确定,这均不影响本申请的实现。举例来说,T为2,计算待检索哈希编码依次与图像数据库中各图像的哈希编码的汉明距离差值,那么从10个汉明距离差值中选取最小差值和次小差值对应的图像。
为了方便相似图像的输出,可按照与待检索哈希编码的汉明距离的差值从小到大对T张图像进行排序,然后输出排序后的T张图像。当然也可按照与待检索哈希编码的汉明距离的差值从大到小对T张图像进行排序,这均不影像本申请的实现。
在本发明实施例提供的技术方案中,在训练哈希映射模型时考虑图像数据中各图像之间相似度,图像间越相似,映射得到的哈希编码之间的汉明距离就越小,图像间越不相似,映射得到的哈希编码之间的汉明距离就 稍大,促使同类图像映射得到的哈希编码之间的汉明距离根据图像间的相似度来决定,有效地解决了相关技术中同一类别图像哈希编码过于一致导致同类图像无法检索的问题,从而实现了同一类别图像的准确检索。
为了便于本领域技术人员更加清楚明白本申请技术方案,本申请还提供了一个示意性例子,以CIFAR-10数据集作为图像数据库进行了测试。CIFAR-10数据集中共包含60000张32*32*3的彩色图像,共有10个类别,可包括下述内容:
图像数据库中的图像表示为集合X={x 1,x 2,…,x n},共有n张图像,此处取CIFAR-10的前50000张作为训练集,因而n=50000。将图像随机两张组成一对,第i张图像和第j张图像构成的图像对表示为(x i,x j),用符号y i,j来表示该图像的标签,y i,j=1表示这两张图像相似,y i,j=0表示这两张图像不相似。
如图2所示,本例中针对数据集CIFAR-10对卷积神经网络结构CNN 1稍作修改,全连接层由2层构成,其中fc6为特征提取层。用图像数据库集合X作为训练集训练CNN 1,使得训练后的CNN 1提取出的特征能更好的表示图像。
用训练好的CNN 1为数据库集合X中的每张图像提取深度特征,第i张图像提取得到的特征向量记为f i,因而数据库集合X每张图像的特征向量构成的集合表示为F={f 1,f 2,…,f n}。如图2所示,此处特征提取层fc6由512个结点构成,因而特征向量f i的维度为(1,512),特征向量集合F的维度为(50000,512)。
计算特征向量集合F中两两向量之间的距离,得到图像间相似度矩阵,记为S。对于图像间相似度矩阵S,第i行、第j列表示的是:图像对(x i,x j)对应的特征向量f i和f j之间的距离值S i,j
此处,对于CIFAR-10数据集,设定参数β=30、α=30。
基于图像相似性的深度哈希映射模型表示为CNN hash。此例中,哈希编码层的结点个数k=12,因此哈希编码的位数也为12位。故而,图像x i在哈 希编码层的输出为
Figure PCTCN2020077586-appb-000012
来表示。
以随机图像对(x i,x j)作为CNN hash的输入,哈希编码层的输出为(f i,f j)。如图2所示,损失函数由3种因素决定:(1)类别y i,j;(2)相似度S i,j;(3)二进制化约束。因此,对于总数为n的数据库X,其总的损失值为:
Figure PCTCN2020077586-appb-000013
在图像数据库X上,通过梯度下降最小化Loss得到CNN hash的模型权重w,将训练好的CNN hash表示为w-CNN hash。此处,随机梯度下降的学习率可设置为lr=0.00001。
图像x i作为本申请深度哈希映射模型w-CNN hash的输入,得到输出o i,本例阈值θ=0将其映射成哈希编码,哈希编码表示为
Figure PCTCN2020077586-appb-000014
Figure PCTCN2020077586-appb-000015
来表示第i张图像的第m位编码,其中:
Figure PCTCN2020077586-appb-000016
因而,图像数据库X经w-CNN hash映射后得到哈希编码库,表示为H。
对于待检索图像x query,从图像数据库X中检索出最相似的前T张图像。
用本发明模型w-CNN hash将待检索图像x query映射成哈希编码h query
在哈希编码库H中查找汉明距离最小的前T张图像。
将这T张图像按照与x query的汉明距离从小到大重新排序。
将重新排序后的T张图像作为检索结果返回。
由上可知,本发明实施例有效地解决了相关技术中同一类别图像哈希编码过于一致的问题,从而实现了同一类别图像的准确检索。
进一步地,为了证实本申请提供的技术方案可实现对同一类别图像的准确检索,可用检索准确率Precison作为评估标准来衡量图像检索算法在一张检索图像的检索效果。Precison的计算方法为:
Figure PCTCN2020077586-appb-000017
Rel(i)表示待检索图像和图像数据库中的第i张图像是否相似,如果相似则值为1,不相似则值为0。对于检索图像集X test,可用所有检索图像的平均检索准确率MRP来衡量不同方法的检索性能。
通过实验,基于图像相似度的深度哈希映射模型的MRP为83.42%,相关技术的MRP为81.78%。由此可见,基于图像相似度的深度哈希映射模型有不错的检索准确率。如图6和7所示,图6为表示CIFAR-10在基于图像相似度的深度哈希映射模型上映射得到的二进制编码分布,共有320种;图7所示为图像数据库经映射后得到的二进制编码分布,共有89种。由此可见,基于图像相似度的深度哈希映射模型映射得到的哈希编码具有多样性,能较好的决绝同类图像的哈希编码过于一致,因而同类图像近乎毫无区分度的问题。
本发明实施例还针对图像检索方法提供了相应的实现装置,进一步使得所述方法更具有实用性。下面对本发明实施例提供的图像检索装置进行介绍,下文描述的图像检索装置与上文描述的图像检索方法可相互对应参照。
参见图8,图8为本发明实施例提供的图像检索装置在一种具体实施方式下的结构图,该装置可包括:
模型训练模块801,用于以图像数据库中的图像对为输入,以图像对映射得到的哈希编码对间的距离、标签类别和图像对的特征相似度为损失值,采用机器学习优化算法优化损失值以训练得到深度哈希映射模型;标签类别用于标识图像对中两张图像的相似性。
哈希编码生成模块802,用于利用深度哈希映射模型将待检索图像映射为待检索哈希编码。
图像检索模块803,用于在预先构建的哈希编码库中查找与待检索哈希编码的汉明距离差值满足预设条件的目标图像,以作为待检索图像在图像数据库的检索结果;哈希编码库为将图像数据库中每张图像经深度哈希映射模型映射后所得。
可选的,在本实施例的一些实施方式中,所述模型训练模块801还可用于将全连接层为哈希编码层的卷积神经网络模型作为深度哈希映射模型的网络结构;
以图像数据库中的图像对作为网络结构的输入,以下述公式作为网络结构的损失值,采用随机梯度下降优化损失值训练网络结构:
Figure PCTCN2020077586-appb-000018
式中,Loss为损失值,第i张图像与第j张图像组成图像对,n为图像数据库中图像总个数,S i,j为第i张图像与第j张图像的深度特征相似度,o i为第i张图像的哈希编码,o j为第j张图像的哈希编码,||o i-o j|| 2为的哈希编码对间的距离,α为超参数,y i,j为标签类别,y i,j=1表示第i张图像与第j张图像为同一类别图像,y i,j=0表示第i张图像与第j张图像为不同类别图像。
在本发明实施例的其他一些实施方式中,所述模型训练模块801还可用于利用预先构建的卷积神经网络模型提取图像数据库中各图像的深度特征,生成深度特征向量集合;
分别计算深度特征向量集合中两两向量之间的欧氏距离,生成图像数据库的相似度矩阵;
其中,卷积神经网络为基于深度学习利用图像数据库中图像训练所得。
在本发明实施例的另外一些实施方式中,所述模型训练模块801还可用于利用下述公式计算第i张图像与第j张图像的深度特征相似度值:
Figure PCTCN2020077586-appb-000019
式中,f i为第i张图像的深度特征向量,f j为第j张图像的深度特征向量,y i,j=1表示第i张图像与第j张图像为同一类别图像,y i,j=0表示第i张图像与第j张图像为不同类别图像,α、β为超参数。
可选的,在本实施例的另一些实施方式中,所述图像检索模块803例 如还可以由于在所述哈希编码库中查找与所述待检索哈希编码的汉明距离值最小的前T张图像;按照与所述待检索哈希编码的汉明距离从小到大对T张图像进行排序;输出排序后的T张图像。
本发明实施例所述图像检索装置的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。
由上可知,本发明实施例有效地解决了相关技术中同一类别图像哈希编码过于一致的问题,从而实现了同一类别图像的准确检索。
本发明实施例还提供了一种图像检索设备,具体可包括:
存储器,用于存储计算机程序;
处理器,用于执行计算机程序以实现如上任意一实施例所述图像检索方法的步骤。
本发明实施例所述图像检索设备的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。
由上可知,本发明实施例有效地解决了相关技术中同一类别图像哈希编码过于一致的问题,从而实现了同一类别图像的准确检索。
本发明实施例还提供了一种计算机可读存储介质,存储有图像检索程序,所述图像检索程序被处理器执行时如上任意一实施例所述图像检索方法的步骤。
本发明实施例所述计算机可读存储介质的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。
由上可知,本发明实施例有效地解决了相关技术中同一类别图像哈希编码过于一致的问题,从而实现了同一类别图像的准确检索。
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见 即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。
以上对本发明所提供的一种图像检索方法、装置、设备及计算机可读存储介质进行了详细介绍。本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。

Claims (10)

  1. 一种图像检索方法,其特征在于,包括:
    利用预先构建的深度哈希映射模型将待检索图像映射为待检索哈希编码;
    在预先构建的哈希编码库中查找与所述待检索哈希编码的汉明距离差值满足预设条件的目标图像,以作为所述待检索图像在图像数据库的检索结果;
    其中,所述深度哈希映射模型为以所述图像数据库中的图像对为输入,以所述图像对映射得到的哈希编码对间的距离、标签类别和所述图像对的特征相似度为损失值,采用机器学习优化算法优化所述损失值训练所得;所述标签类别用于标识所述图像对中两张图像的相似性;所述哈希编码库为将所述图像数据库中每张图像经所述深度哈希映射模型映射后所得。
  2. 根据权利要求1所述的图像检索方法,其特征在于,所述深度哈希映射模型的训练过程包括:
    将全连接层为哈希编码层的卷积神经网络模型作为所述深度哈希映射模型的网络结构;
    以所述图像数据库中的图像对作为所述网络结构的输入,以下述公式作为所述网络结构的损失值,采用随机梯度下降优化所述损失值训练所述网络结构:
    Figure PCTCN2020077586-appb-100001
    式中,Loss为所述损失值,第i张图像与第j张图像组成所述图像对,n为所述图像数据库中图像总个数,S i,j为第i张图像与第j张图像的深度特征相似度,o i为第i张图像的哈希编码,o j为第j张图像的哈希编码,||o i-o j|| 2为的哈希编码对间的距离,α为超参数,y i,j为标签类别,y i,j=1表示第i张图像与第j张图像为同一类别图像,y i,j=0表示第i张图像与第j张图像为不同类别图像。
  3. 根据权利要求2所述的图像检索方法,其特征在于,第i张图像与第j张图像的深度特征相似度值可从预先计算得到的相似度矩阵获取,所 述相似度矩阵计算过程为:
    利用预先构建的卷积神经网络模型提取所述图像数据库中各图像的深度特征,生成深度特征向量集合;
    分别计算所述深度特征向量集合中两两向量之间的欧氏距离,生成所述图像数据库的相似度矩阵;
    其中,所述卷积神经网络为基于深度学习利用所述图像数据库中图像训练所得。
  4. 根据权利要求2所述的图像检索方法,其特征在于,所述第i张图像与第j张图像的深度特征相似度值的计算过程为:
    利用下述公式计算第i张图像与第j张图像的深度特征相似度值:
    Figure PCTCN2020077586-appb-100002
    式中,f i为第i张图像的深度特征向量,f j为第j张图像的深度特征向量,y i,j=1表示第i张图像与第j张图像为同一类别图像,y i,j=0表示第i张图像与第j张图像为不同类别图像,α、β为超参数。
  5. 根据权利要求3所述的图像检索方法,其特征在于,所述卷积神经网络模型为VGG-16网络模型。
  6. 根据权利要求1至5任意一项所述的图像检索方法,其特征在于,所述哈希编码库的生成过程为:
    将所述图像数据库中的每张图像输入至所述深度哈希映射模型,通过设置阈值,将所述深度哈希映射模型的哈希编码层的输出映射为哈希编码;
    根据每张图像的哈希编码生成所述哈希编码库;
    其中,所述图像数据库的第i张图像的第m位编码
    Figure PCTCN2020077586-appb-100003
    如下式:
    Figure PCTCN2020077586-appb-100004
    式中,
    Figure PCTCN2020077586-appb-100005
    为第i张图像的第m位在哈希编码层的输出,θ为所述阈值。
  7. 根据权利要求1至5任意一项所述的图像检索方法,其特征在于,所述在预先构建的哈希编码库中查找与所述待检索哈希编码的汉明距离差 值满足预设条件的目标图像为:
    在所述哈希编码库中查找与所述待检索哈希编码的汉明距离值最小的前T张图像;
    按照与所述待检索哈希编码的汉明距离差值从小到大对T张图像进行排序;
    输出排序后的T张图像。
  8. 一种图像检索装置,其特征在于,包括:
    模型训练模块,用于以图像数据库中的图像对为输入,以所述图像对映射得到的哈希编码对间的距离、标签类别和所述图像对的特征相似度为损失值,采用机器学习优化算法优化所述损失值以训练得到深度哈希映射模型;所述标签类别用于标识所述图像对中两张图像的相似性;
    哈希编码生成模块,用于利用所述深度哈希映射模型将待检索图像映射为待检索哈希编码;
    图像检索模块,用于在预先构建的哈希编码库中查找与所述待检索哈希编码的汉明距离差值满足预设条件的目标图像,以作为所述待检索图像在图像数据库的检索结果;所述哈希编码库为将所述图像数据库中每张图像经所述深度哈希映射模型映射后所得。
  9. 一种图像检索设备,其特征在于,包括处理器,所述处理器用于执行存储器中存储的计算机程序时实现如权利要求1至7任一项所述图像检索方法的步骤。
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有图像检索程序,所述图像检索程序被处理器执行时实现如权利要求1至7任一项所述图像检索方法的步骤。
PCT/CN2020/077586 2019-03-08 2020-03-03 图像检索方法、装置、设备及计算机可读存储介质 WO2020182019A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910175051.0A CN109918532B (zh) 2019-03-08 2019-03-08 图像检索方法、装置、设备及计算机可读存储介质
CN201910175051.0 2019-03-08

Publications (1)

Publication Number Publication Date
WO2020182019A1 true WO2020182019A1 (zh) 2020-09-17

Family

ID=66963962

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/077586 WO2020182019A1 (zh) 2019-03-08 2020-03-03 图像检索方法、装置、设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN109918532B (zh)
WO (1) WO2020182019A1 (zh)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112231514A (zh) * 2020-10-19 2021-01-15 腾讯科技(深圳)有限公司 一种数据去重方法、装置及存储介质和服务器
CN112256895A (zh) * 2020-10-16 2021-01-22 江南大学 一种基于多任务学习的织物图像检索方法
CN112270760A (zh) * 2020-11-03 2021-01-26 北京百度网讯科技有限公司 一种定位方法、装置、电子设备及存储介质
CN112307248A (zh) * 2020-11-26 2021-02-02 国网电子商务有限公司 一种图像检索方法及装置
CN112527855A (zh) * 2020-09-23 2021-03-19 碧桂园生活服务集团股份有限公司 一种人脸向量快速比对技术
CN112766288A (zh) * 2021-03-03 2021-05-07 重庆赛迪奇智人工智能科技有限公司 图像处理模型构建方法、装置、电子设备和可读存储介质
CN112801867A (zh) * 2020-12-30 2021-05-14 杭州趣链科技有限公司 基于区块链的卫星遥感图像拼接方法、装置及设备
CN112907712A (zh) * 2021-01-22 2021-06-04 杭州电子科技大学 一种基于多视图散列增强哈希的三维模型特征表示方法
CN112966755A (zh) * 2021-03-10 2021-06-15 深圳市固电电子有限公司 电感缺陷检测方法、设备及可读存储介质
CN113239226A (zh) * 2021-06-01 2021-08-10 平安科技(深圳)有限公司 一种图像检索方法、装置、设备及存储介质
CN113270199A (zh) * 2021-04-30 2021-08-17 贵州师范大学 医学跨模态多尺度融合类别指导哈希方法及其***
CN113344826A (zh) * 2021-07-06 2021-09-03 北京锐安科技有限公司 图像处理方法、装置、电子设备及存储介质
CN113542750A (zh) * 2021-05-27 2021-10-22 绍兴市北大信息技术科创中心 采用两套及两套以上哈希表进行搜索的数据编码方法
CN113536012A (zh) * 2021-05-26 2021-10-22 浙江大华技术股份有限公司 图像检索方法、装置、电子设备、计算机可读存储介质
CN113688261A (zh) * 2021-08-25 2021-11-23 深圳极视角科技有限公司 图像数据清理方法、装置、电子设备及可读存储介质
CN114547354A (zh) * 2022-02-15 2022-05-27 华南师范大学 一种基于函数自适应映射的深度哈希方法
CN114780763A (zh) * 2022-03-28 2022-07-22 东南大学 一种用于室内设计家具模型的高效检索方法
CN115964527A (zh) * 2023-01-05 2023-04-14 北京东方通网信科技有限公司 一种用于单标签图像检索的标签表征构建方法

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918532B (zh) * 2019-03-08 2023-08-18 苏州大学 图像检索方法、装置、设备及计算机可读存储介质
CN111079828B (zh) * 2019-12-13 2023-10-20 北京因特睿软件有限公司 基于神经网络的图像聚类的方法、装置与存储介质
CN111325322A (zh) * 2020-02-12 2020-06-23 深圳壹账通智能科技有限公司 基于隐私保护的深度学习方法、***、服务器及存储介质
CN111581421B (zh) * 2020-04-30 2024-06-04 京东方科技集团股份有限公司 图像检索方法、图像检索装置及图像检索***
CN111626408B (zh) * 2020-05-22 2021-08-06 深圳前海微众银行股份有限公司 哈希编码方法、装置、设备及可读存储介质
CN111612080B (zh) * 2020-05-22 2021-11-09 深圳前海微众银行股份有限公司 模型解释方法、设备及可读存储介质
CN111813975A (zh) * 2020-07-09 2020-10-23 国网电子商务有限公司 一种图像检索方法、装置及电子设备
CN111967609B (zh) * 2020-08-14 2021-08-06 深圳前海微众银行股份有限公司 模型参数验证方法、设备及可读存储介质
CN112131421B (zh) * 2020-09-23 2023-09-15 平安科技(深圳)有限公司 医学图像分类方法、装置、设备及存储介质
CN112132099A (zh) * 2020-09-30 2020-12-25 腾讯科技(深圳)有限公司 身份识别方法、掌纹关键点检测模型训练方法和装置
CN112215302A (zh) * 2020-10-30 2021-01-12 Oppo广东移动通信有限公司 图像的标识方法、标识装置及终端设备
CN112561053B (zh) * 2020-11-10 2023-09-08 北京百度网讯科技有限公司 图像处理方法、预训练模型的训练方法、装置和电子设备
CN112182262B (zh) * 2020-11-30 2021-03-19 江西师范大学 一种基于特征分类的图像查询方法
CN112925940B (zh) * 2021-03-04 2022-07-01 浙江中设天合科技有限公司 一种相似图像检索方法、装置、计算机设备及存储介质
CN113094531B (zh) * 2021-03-22 2022-05-20 华中科技大学 一种存内图像检索方法及检索***
CN113111953B (zh) * 2021-04-20 2022-08-26 深圳吉祥星科技股份有限公司 一种投影画质处理装置
CN113326393B (zh) * 2021-05-31 2023-04-07 深圳前瞻资讯股份有限公司 一种基于深度哈希特征和异构并行处理的图像检索方法
CN113177130B (zh) * 2021-06-09 2022-04-08 山东科技大学 基于二值语义嵌入的图像检索和识别方法和装置
CN113918753B (zh) * 2021-07-23 2024-05-28 腾讯科技(深圳)有限公司 基于人工智能的图像检索方法及相关设备
CN114446407A (zh) * 2022-03-03 2022-05-06 冰洲石生物科技(上海)有限公司 化学反应的反应模板提取方法、***、介质及电子设备
CN117156138B (zh) * 2023-10-31 2024-02-09 季华实验室 图像的不定长深度哈希编码方法、装置、设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160267637A1 (en) * 2015-03-12 2016-09-15 Yahoo! Inc. System and method for improved server performance for a deep feature based coarse-to-fine fast search
CN108399211A (zh) * 2018-02-02 2018-08-14 清华大学 基于二值特征的大规模图像检索算法
CN108427738A (zh) * 2018-03-01 2018-08-21 中山大学 一种基于深度学习的快速图像检索方法
CN108491528A (zh) * 2018-03-28 2018-09-04 苏州大学 一种图像检索方法、***及装置
CN108932314A (zh) * 2018-06-21 2018-12-04 南京农业大学 一种基于深度哈希学习的菊花图像内容检索方法
CN109918532A (zh) * 2019-03-08 2019-06-21 苏州大学 图像检索方法、装置、设备及计算机可读存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104834748B (zh) * 2015-05-25 2018-08-03 中国科学院自动化研究所 一种利用基于深度语义排序哈希编码的图像检索方法
CN107423306B (zh) * 2016-05-24 2021-01-29 华为技术有限公司 一种图像检索方法及装置
CN106407352B (zh) * 2016-09-06 2019-09-10 广东顺德中山大学卡内基梅隆大学国际联合研究院 基于深度学习的交通图像检索方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160267637A1 (en) * 2015-03-12 2016-09-15 Yahoo! Inc. System and method for improved server performance for a deep feature based coarse-to-fine fast search
CN108399211A (zh) * 2018-02-02 2018-08-14 清华大学 基于二值特征的大规模图像检索算法
CN108427738A (zh) * 2018-03-01 2018-08-21 中山大学 一种基于深度学习的快速图像检索方法
CN108491528A (zh) * 2018-03-28 2018-09-04 苏州大学 一种图像检索方法、***及装置
CN108932314A (zh) * 2018-06-21 2018-12-04 南京农业大学 一种基于深度哈希学习的菊花图像内容检索方法
CN109918532A (zh) * 2019-03-08 2019-06-21 苏州大学 图像检索方法、装置、设备及计算机可读存储介质

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LIU, YE ET AL.: "FP-CNNH: A Fast Image Hashing Algorithm Based on Deep Convolutional Neural Network", COMPUTER SCIENCE, vol. 43, no. 9, 30 September 2016 (2016-09-30), DOI: 20200514181417A *
XIA, RONGKAI ET AL.: "Supervised Hashing for Image Retrieval via Image Representation Learning", PROCEEDINGS OF THE TWENTY-EIGHTH AAAI CONFERENCE ON ARTIFICIAL INTELLIGENCE, 31 December 2014 (2014-12-31), XP055732264, DOI: 20200514181528A *

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527855A (zh) * 2020-09-23 2021-03-19 碧桂园生活服务集团股份有限公司 一种人脸向量快速比对技术
CN112527855B (zh) * 2020-09-23 2024-05-03 广东协城信息科技有限公司 一种人脸向量快速比对技术
CN112256895A (zh) * 2020-10-16 2021-01-22 江南大学 一种基于多任务学习的织物图像检索方法
CN112231514A (zh) * 2020-10-19 2021-01-15 腾讯科技(深圳)有限公司 一种数据去重方法、装置及存储介质和服务器
CN112231514B (zh) * 2020-10-19 2024-01-05 腾讯科技(深圳)有限公司 一种数据去重方法、装置及存储介质和服务器
CN112270760B (zh) * 2020-11-03 2023-07-25 北京百度网讯科技有限公司 一种定位方法、装置、电子设备及存储介质
CN112270760A (zh) * 2020-11-03 2021-01-26 北京百度网讯科技有限公司 一种定位方法、装置、电子设备及存储介质
CN112307248A (zh) * 2020-11-26 2021-02-02 国网电子商务有限公司 一种图像检索方法及装置
CN112307248B (zh) * 2020-11-26 2023-11-03 国网数字科技控股有限公司 一种图像检索方法及装置
CN112801867A (zh) * 2020-12-30 2021-05-14 杭州趣链科技有限公司 基于区块链的卫星遥感图像拼接方法、装置及设备
CN112801867B (zh) * 2020-12-30 2023-10-31 杭州趣链科技有限公司 基于区块链的卫星遥感图像拼接方法、装置及设备
CN112907712A (zh) * 2021-01-22 2021-06-04 杭州电子科技大学 一种基于多视图散列增强哈希的三维模型特征表示方法
CN112766288A (zh) * 2021-03-03 2021-05-07 重庆赛迪奇智人工智能科技有限公司 图像处理模型构建方法、装置、电子设备和可读存储介质
CN112766288B (zh) * 2021-03-03 2024-01-23 重庆赛迪奇智人工智能科技有限公司 图像处理模型构建方法、装置、电子设备和可读存储介质
CN112966755A (zh) * 2021-03-10 2021-06-15 深圳市固电电子有限公司 电感缺陷检测方法、设备及可读存储介质
CN113270199B (zh) * 2021-04-30 2024-04-26 贵州师范大学 医学跨模态多尺度融合类别指导哈希方法及其***
CN113270199A (zh) * 2021-04-30 2021-08-17 贵州师范大学 医学跨模态多尺度融合类别指导哈希方法及其***
CN113536012A (zh) * 2021-05-26 2021-10-22 浙江大华技术股份有限公司 图像检索方法、装置、电子设备、计算机可读存储介质
CN113542750A (zh) * 2021-05-27 2021-10-22 绍兴市北大信息技术科创中心 采用两套及两套以上哈希表进行搜索的数据编码方法
CN113239226A (zh) * 2021-06-01 2021-08-10 平安科技(深圳)有限公司 一种图像检索方法、装置、设备及存储介质
CN113344826A (zh) * 2021-07-06 2021-09-03 北京锐安科技有限公司 图像处理方法、装置、电子设备及存储介质
CN113344826B (zh) * 2021-07-06 2023-12-19 北京锐安科技有限公司 图像处理方法、装置、电子设备及存储介质
CN113688261B (zh) * 2021-08-25 2023-10-13 山东极视角科技股份有限公司 图像数据清理方法、装置、电子设备及可读存储介质
CN113688261A (zh) * 2021-08-25 2021-11-23 深圳极视角科技有限公司 图像数据清理方法、装置、电子设备及可读存储介质
CN114547354A (zh) * 2022-02-15 2022-05-27 华南师范大学 一种基于函数自适应映射的深度哈希方法
CN114780763A (zh) * 2022-03-28 2022-07-22 东南大学 一种用于室内设计家具模型的高效检索方法
CN115964527B (zh) * 2023-01-05 2023-09-26 北京东方通网信科技有限公司 一种用于单标签图像检索的标签表征构建方法
CN115964527A (zh) * 2023-01-05 2023-04-14 北京东方通网信科技有限公司 一种用于单标签图像检索的标签表征构建方法

Also Published As

Publication number Publication date
CN109918532A (zh) 2019-06-21
CN109918532B (zh) 2023-08-18

Similar Documents

Publication Publication Date Title
WO2020182019A1 (zh) 图像检索方法、装置、设备及计算机可读存储介质
CN109885692B (zh) 知识数据存储方法、装置、计算机设备和存储介质
US11048966B2 (en) Method and device for comparing similarities of high dimensional features of images
CN109376222B (zh) 问答匹配度计算方法、问答自动匹配方法及装置
CN107463658B (zh) 文本分类方法及装置
CN111444320A (zh) 文本检索方法、装置、计算机设备和存储介质
CN110647904B (zh) 一种基于无标记数据迁移的跨模态检索方法及***
CN112800292B (zh) 一种基于模态特定和共享特征学习的跨模态检索方法
CN109829065B (zh) 图像检索方法、装置、设备及计算机可读存储介质
CN109388634B (zh) 地址信息的处理方法、终端设备及计算机可读存储介质
CN111666427A (zh) 一种实体关系联合抽取方法、装置、设备及介质
CN112819023A (zh) 样本集的获取方法、装置、计算机设备和存储介质
JP6004015B2 (ja) 学習方法、情報処理装置および学習プログラム
CN109885180B (zh) 纠错方法和装置、计算机可读介质
CN110866102A (zh) 检索处理方法
CN111950280A (zh) 地址匹配方法及装置
CN111241310A (zh) 一种深度跨模态哈希检索方法、设备及介质
CN108470025A (zh) 局部话题概率生成正则化自编码文本嵌入表示方法
CN106570196B (zh) 视频节目的搜索方法和装置
CN113918807A (zh) 数据推荐方法、装置、计算设备及计算机可读存储介质
CN112182144B (zh) 搜索词标准化方法、计算设备和计算机可读存储介质
WO2023155304A1 (zh) 关键词推荐模型训练方法、推荐方法和装置、设备、介质
WO2022188080A1 (zh) 图像分类网络模型训练方法、图像分类方法及相关设备
CN112214511A (zh) 一种基于wtp-wcd算法的api推荐方法
CN111984812A (zh) 一种特征提取模型生成方法、图像检索方法、装置及设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20769845

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20769845

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20769845

Country of ref document: EP

Kind code of ref document: A1