WO2018103179A1 - 一种基于稀疏表示的近似重复图像检测方法 - Google Patents
一种基于稀疏表示的近似重复图像检测方法 Download PDFInfo
- Publication number
- WO2018103179A1 WO2018103179A1 PCT/CN2017/070197 CN2017070197W WO2018103179A1 WO 2018103179 A1 WO2018103179 A1 WO 2018103179A1 CN 2017070197 W CN2017070197 W CN 2017070197W WO 2018103179 A1 WO2018103179 A1 WO 2018103179A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- natural number
- equal
- images
- sparse
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
- G06F18/232—Non-hierarchical techniques
- G06F18/2321—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
- G06F18/23213—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/46—Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
- G06V10/462—Salient features, e.g. scale invariant feature transforms [SIFT]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/513—Sparse representations
Definitions
- the invention belongs to the field of image approximate repeat detection, and relates to a parallel approximation image repeating detection method based on sparse representation, which can efficiently and accurately extract an approximate repeated image set for a massive image set.
- the approximate repeated image is obtained by some approximate original image transformation by some approximate repeated image.
- the transformation of the approximate repeated image can be generated, including translation, scaling, selection, image color change, adding text, format change, resolution change, etc. Wait.
- Near-repeated image detection refers to finding a near-repeated image of the image in the data set or extracting a subset of all near-repeated images in the data set for a given query image.
- most of the near-repetitive image detection uses the Bag-of-words and LSH methods to build the system.
- the Bag-of-words model maps the local features of each image to a visual word frequency histogram vector using the trained dictionary.
- the image representation model method based on Bag-of-words generally consists of three parts: 1) extracting local features of the image; 2) constructing a visual dictionary by clustering the local features of the image set; 3) mapping the local vector of each image to one Word frequency histogram.
- LSH Locality-Sensitive Hashing
- LSH is a stochastic method for indexing high-dimensional data. It approximates linear search in high-dimensional data space and returns approximate nearest neighbor data of query data at a certain accuracy. Its basic The idea is to map the input data points to each bucket through a set of hash functions, and ensure that the data points of the neighbors are mapped to the same bucket with a large probability, and the data points that are far apart are mapped to the same with a small probability.
- an object of the present invention is to provide a distributed image approximate repeat set extraction system and method based on sparse representation for a large-scale image set. This method can not only improve the efficiency of processing large-scale image sets, but also can effectively improve the accuracy of detection results compared with traditional methods.
- j is a natural number greater than or equal to 1, and i ⁇ j; g' i and g' j respectively represent IDF weighted sparse coding of images I i and I j ;
- the acquiring the IDF weighted sparse coding g' of all the images in the image set I includes the following steps:
- the IDF weighted sparse coding g' of the image is extracted according to each cluster center weight in E.
- the parallelizing the extracted image local features is to extract SIFT features of all images of the image set I.
- the standard size gray image set is segmented to each cluster node, and the SIFT features of each image are extracted in parallel.
- the SIFT features of all images are represented as S, where Sa a ⁇ S, S a represents a vector, and a is greater than or equal to 1
- the natural number, the SIFT feature of the I- th image is F i , where F ib ⁇ F i , F ib represents a vector, and b is a natural number greater than or equal to 1.
- step (11) Calculate the Euclidean distance mean of the new cluster center A d and the cluster center A d-1 of the previous cycle, and if the Euclidean distance average value is >0.05, jump back to step (11) to execute;
- the Euclidean distance mean ⁇ 0.05, the new cluster center A d is output as the feature dictionary E of the image set I, where E k ⁇ E,k is a natural number greater than or equal to 1, and E k is a vector, and the feature dictionary E is Cluster the center for images.
- the calculating the weight of each cluster center in E is: adopting Calculate the weight of each cluster center in E, where: D is the total number of all SIFT features in S, and D is a natural number greater than or equal to 1. Represents the total number of all SIFT features attributed to the E k center.
- Extracting the maximum value of k c ib is, sparse coding obtain an image of the image I i g i, where g ik ⁇ g i;
- the image sparse coding g i is subjected to inverse visual word frequency weighted normalization to obtain IDF weighted sparse coding g'.
- the present invention runs the KMeans algorithm in the MapReduce parallel mode to learn the complete dictionary features online, so as to extract the global feature structure as much as possible, so that the atomic combination with the most representative ability can be found from the overcomplete dictionary to represent the image features.
- the online dictionary learning terminates the MapReduce Jop every time and judges the termination according to the set threshold.
- the present invention introduces a sparse representation theory and reconstructs by searching a dictionary set and K codewords that are nearest to the feature, which is reconstructed by using multiple codewords compared to the vector quantization of the original BOW. It can have smaller reconstruction error, and it can achieve local smooth sparsity by selecting local neighbors. At the same time, this method has faster implementation method with traditional sparse representation method and does not require excessive solution optimization process.
- the invention weights the image sparse representation vector by statistical global reverse word frequency IDF, so that the representation is stronger, and the weight of the less representative codeword in the sparse coding is reduced, and the representation is higher.
- the weight of the codeword makes it more sparse, so that the high-characterization features of similar images have higher probability of being the same or similar;
- the present invention hashes to the candidate similar set by extracting the high-characteristic features in the sparse representation, and simultaneously performs matching by calculating the similarity of the two Jaccard indexes in each hash bucket, which can obtain similar image pairs simply and efficiently.
- this method can make full use of the characteristics of sparse representation and the Mapreduce model for parallel computing, greatly improving the matching efficiency and accuracy of large-scale image data sets;
- the HADOOP-based distributed storage system HDFS and the parallel computing model MapReduce distributed image near-repetitive detection system the existing image near-repetition detection system generally supports only a single-node detection framework, but with the mobile Internet Development, image data grows exponentially, in the past The system simply cannot satisfy the storage and operations on such a large amount of data.
- the invention not only has high scalability for massive data, but also greatly improves the calculation efficiency of near-repetition detection.
- FIG. 1 is a schematic structural diagram of an approximate repeated image detecting method based on a sparse representation according to the present invention
- FIG. 2 is a flowchart of implementing a MapReduce-based parallel KMeans algorithm according to the present invention
- FIG. 3 is a flowchart of implementing an image sparse coding algorithm based on local priority search according to the present invention
- FIG. 4 is a flowchart of implementing a parallel similar set detection algorithm based on MapReduce and significant dimensional features according to the present invention
- FIG. 5 is a clustering result obtained by different methods for five keywords in Embodiment 2;
- FIG. 5 is a clustering result obtained by different methods for five keywords in Embodiment 2;
- Fig. 6 is a clustering result of the second embodiment.
- an approximate repeated image detection method based on sparse representation includes a feature extraction module, a feature dictionary construction module, an image sparse coding representation module, a similar image matching filtering module, and a near Repeat the image pair module.
- the feature extraction module is configured to parallelize all original local image features in the image collection;
- the feature dictionary construction module is configured to construct the original feature dictionary set by using the parallel K-Means online dictionary learning algorithm for the image features extracted by the feature extraction module.
- the image sparse coding representation module is used to map the original local features of each image into a sparse vector to represent each image by using the constructed dictionary set and the sparse coding method;
- the similarity map matching filtering module is used for parallel computing.
- the similarity of the filtered image pairs and the output similarity is greater than An image pair of a certain threshold;
- the near-repeated image pairing module is used to merge all similar image pairs output by the similarity map matching filter module into a near-repeated image set.
- the detection method includes the following steps:
- I (I 1 , I 2 , ..., I i , ..., I w , ..., I z , ..., I R ) the size of each image I i Standardization, for example, set to standardization (128*128, 256*256 or 512*512) size
- the image selected in the present invention is uniformly standardized to a size of 256*256, and then grayscale processing is performed to obtain a standard-sized grayscale image set.
- Step 2 Download the ImageBundle file from HDFS.
- Hadoop will split the ImageBundle file into the Map function of different nodes according to the number of nodes in the cluster.
- the Map function obtains the key-value pair form of the image, and extracts each image set based on the public SIFT algorithm.
- a plurality of SIFT feature vectors of an image, a sequence of SIFT feature vectors constituting an image, and SIFT features of all images are represented as S, where S a ⁇ S, S a represents a vector, a is a natural number greater than or equal to 1, and the i i image
- the SIFT feature is F i , where F ib ⁇ F i , F ib represents a vector, b is a natural number greater than or equal to 1, and each image in the image set is stored as a ⁇ key:image ID,value:Fi> key-value pair On HDFS;
- Step 3 to calculate Euclidean distance S a cluster center of A d, as the value S a, S a to the Euclidean nearest cluster center as a key value A q;
- a dk ⁇ A d, d is greater than or equal
- a non-negative integer of 0, k is a natural number greater than or equal to 1, and
- a dk represents a vector;
- k SIFT features randomly selected from S are used as the initial k cluster centers to form an initial cluster center set A 0 , A 0k ⁇ A 0 ; output as a key value pair ⁇ key:A q , value:S a >.
- Step 5 Calculate the Euclidean distance mean of the new cluster center A d and the cluster center A d-1 of the previous cycle. If the Euclidean distance average is >0.05, jump back to step 3; if the Euclidean The distance average value ⁇ 0.05, the new cluster center A d is output as the feature dictionary E of the image set I, where E k ⁇ E, k is a natural number greater than or equal to 1, E k is a vector, and the feature dictionary E is an image. Cluster center.
- Step 6 adopt Computation of the E of each cluster center weighting, wherein: D is the total number of SIFT features of the S, D is a natural number 1, if S a Euclidean distance to E K minimum, i.e. S a attributable to E K Center, Represents the total number of all SIFT features attributed to the E k center.
- E k a natural number greater than or equal to 1
- f is a natural number greater than or equal to 1
- g is a natural number greater than or equal to 1, g>f;
- Extracting the maximum value of k c ib is, sparse coding obtain an image of the image I i g i, where g ik ⁇ g i;
- the image sparse coding g i is subjected to inverse visual word frequency weighted normalization to obtain IDF weighted sparse coding g', where g i ' ⁇ g'.
- Step 10 extracting a non-zero element in the IDF weighted sparse coding g i ' of the image I i ; g ik ⁇ ⁇ g i ', k is a natural number greater than or equal to 1, and a non-zero element in g i ' is (g iu ′ ,...,g iv '), let m be a non-zero element, m be a natural number greater than or equal to 1, m ⁇ k, g iu ′ ⁇ 0, g iv ′ ⁇ 0, u is a natural number greater than or equal to 1, v is greater than or equal to 1 natural number, k>v>u;
- Step 11 create k groups, named as: among them, Empty matrix
- Step 12 using the matrix transformation of (Formula 1), hashing the IDF weighted sparse coding g i ' of the image I i into the m groups corresponding to the subscripts (u, . . . , v) of the non-zero elements;
- Step 13 using Calculating the similarity Y of each pair of images ⁇ I i , I j > IDF weighted sparse coding in each of the m groups obtained in the step (3), if the Y is greater than 0.7, the images ⁇ I i , I j > are similar images Correct;
- j is a natural number greater than or equal to 1, and i ⁇ j; g' i and g' j respectively represent IDF weighted sparse coding of images I i and I j ;
- Step 14 combining the similar image pairs having the same image in the results obtained in step 13 to generate a similarity A subset of images.
- a Baidu image search engine is used to retrieve images of 30 famous scenic spots or buildings (for example, Egypt Eiffel Tower, White House, Big Wild Goose Pagoda, etc.), and manually select clear and accurate images from each type. 100 images, consisting of 3,000 near-repeated images, and randomly selecting 17,000 photos from the public dataset Flickr-100M (source: http://webscope.sandbox.yahoo.com) as interference items, together with near-repetition image composition experiments Image dataset with a total of 20,000 images.
- the Hadoop 2.4.0 version was selected as the experimental platform, and a total of 10 node computers constitute the Hadoop cluster of this embodiment. Since Hadoop does not support the reading and processing of image data itself, we have customized two types based on Hadoop's Java open source framework: ImageBundle and ImageWritable. Similar to Hadoop's own SequenceFile, ImageBundle combines a large number of image format files into one large file and serializes them in HDFS in the form of a fixed key-value pair ⁇ key:imageID,value:imageWritable>. Custom ImageWritable inherits from Hadoop's Writable for encoding and decoding ImageBundles. Inheritance and Writable's two key functions, encoder() and decoder(), are used to decode the image's binary file into a key-value pair form and encode the key-value pair into a binary format. The following are the experimental steps:
- the image is standardized to have a size of 256*256.
- ImageBundle for 20,000 images to encode the image as a key-value pair and store it in the ImageBundle file and upload it to HDFS.
- the image extracted in this embodiment is a SIFT feature, and the SIFT feature is a local feature of the image, and each feature includes an indefinite number of features, and each SIFT feature is 128-dimensional.
- the image feature SequenceFile file generated in step 3 is parallelized by Kmeasn clustering.
- the clustering center K 512
- the loop termination condition is 0.01
- This step will generate 512 cluster centers as visual dictionaries, each cluster center being a 128-dimensional vector as a visual word.
- FIG. 5 shows nine images randomly extracted from clustering results obtained from different methods of five keywords (Flower, Iphone, Colosseum, Elephant, Cosmopolitan), and F value is F1-measure index.
- the comparison methods are Partition min-Hash algorithm (PmH), Geometric min-Hash algorithm (GmH), min-hash method (mH), standard LSH algorithm (st.LSH) and Bag-of-Visual-Words-based tree. Search algorithm (baseline).
- Experimental Results Figure 6 shows the results of clustering 17,000 Flickr photos by this method. Cluster size is the number of photos of the corresponding cluster set.
Landscapes
- Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Artificial Intelligence (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Probability & Statistics with Applications (AREA)
- Image Analysis (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种基于稀疏表示的近似重复图像检测方法,该方法基于hadoop分布式计算框架提出,该检测方法包括如下步骤,先获取图像集I,其中所有图像的稀疏编码为g';提取g'中非零元素,将图像I
i的稀疏编码gi'散列到非零元素的下标对应的组中,计算每个Reduce函数中每对图像< I
w, I
z>稀疏编码的相似度Y,若Y大于0.7,则输出相似图像对< I
w, I
z>;将具有图像I
w的相似图像对合并,生成相似图像子集。上述技术方案通过并行化的计算方式大大提高了针对大规模数据集的KMeans聚类算法的计算效率,并引入稀疏表示理论,具有更快的实现方法,不需要过多的求解优化过程。
Description
本发明属于图像近似重复检测领域,涉及一种基于稀疏表示的并行化的图像近似重复检测方法,可以高效并准确的对海量图像集提取近似重复图像集合。
随着移动互联网和数码相机的发展,人们越来越多的将拍摄的多媒体数据分享到互联网上,由于拍摄者的位置、拍摄的对象、角度的相同,从而导致了互联网上出现了大量的相似的图片。通过提取这些相似图像集不仅可以对图像检索结果进行去重过滤,同时在许多图像处理领域如图像聚类、图像识别、图像分类等也是重要一步。
通常近似重复图像是由某幅原图像通过某些近似重复图像变换得到的,一般可以产生近似重复图像的变换包括平移、缩放、选择、图像色调的变化、添加文字、格式变化、分辨率变化等等。而近重复图像检测是指给定查询图像,在数据集中找到与此图像的近重复图像,或是提取出数据集中所有近重复图像子集。目前,大多数的近重复图像检测是采用Bag-of-words和LSH方法构建系统。Bag-of-words模型是将每幅图像的局部特征利用训练好的字典映射为一个视觉词频直方图向量。基于Bag-of-words的图像表示模型方法一般包括3部分:1)提取图像的局部特征;2)通过聚类图像集的局部特征,构建视觉字典;3)映射每幅图的局部向量为一个词频直方图。LSH(Locality-Sensitive Hashing)是一种对高维数据建立索引的随机方法,以一定的查找准确率为代价,在高维数据空间中进行近似线性的查找,返回查询数据的近似最近邻数据。它的基本
思想是通过一组哈希函数将输入数据点映射到各个桶中,并保证近邻的数据点以较大的概率映射到同一个桶中,相距较远的数据点以较小的概率映射到同一个桶中,这样一个查询数据点所在桶中的其它数据点就可以被看做是这个查询数据的近邻点。然而由于BOW模型对于局部特征过于严格的界定和LSH以准确度换效率的特性往往导致检测的结果无法让人满意。此外,已有的近重复图像检测系统一般是采用单节点进行运算,随着数据量爆炸式的增长,单节点系统已经远远不能满足目前的应用需要。因此,多节点的并行计算就成为了必然选择,在众多的分布式框架中,以HADOOP系统最为稳定和高效。
发明内容
针对上述现有技术中存在的问题,本发明的目的在于,提出一种针对大规模图像集的基于稀疏表示的分布式图像近似重复集提取系统及方法。该方法不仅能够提升处理大规模图像集的效率,并且与传统方法相比可以有效的提高检测结果的正确率。
为了实现上述任务,本发明采用以下技术方案:
一种基于稀疏表示的近似重复图像检测方法,该方法基于hadoop分布式计算框架提出,该检测方法包括如下步骤,获取图像集I中所有图像的IDF加权稀疏编码g′,其中I=(I1,I2,...,Ii,...,Iw,…,Iz,…,IR),Ii的IDF加权稀疏编码为gi′,gi′∈g′,i为大于等于1的自然数,w为大于i的自然数,z为大于w的自然数,R为大于z的自然数,其特征在于,方法还包括:
(1)提取图像Ii的IDF加权稀疏编码gi′中的非零元素;gik′∈gi′,k为大于等于1的自然数,gi′内的非零元素为(giu′,...,giv′),设非零元素为m个,m为大于等于1的自然数,m≤k,giu′≠0,giv′≠0,u为大于等于1的自然数,v大于
等于1的自然数,k>v>u;
(3)利用(式1)的矩阵变换,将图像Ii的IDF加权稀疏编码gi′分别散列到非零元素的下标(u,...,v)对应的m个组里;
其中,j为大于等于1的自然数,且i≠j;g'i和g'j分别表示图像Ii和Ij的IDF加权稀疏编码;
(5)将步骤(4)所得结果中具有相同图像的相似图像对合并,生成相似图像子集。
进一步地,所述获取图像集I中所有图像的IDF加权稀疏编码g′,包括以下步骤:
并行化提取每副图像的局部特征,得到图像集I中所有图像的局部特征S;
提取图像聚类中心,得到特征字典E;
计算E中每个聚类中心权重;
根据E中每个聚类中心权重,提取图像的IDF加权稀疏编码g′。
进一步地,所述并行化提取图像局部特征为提取图像集I所有图像的SIFT特征。
进一步地,所述提取所有图像的SIFT特征,具体步骤为:
将图像集I中每副图像Ii的大小标准化并灰度处理,得到标准大小的灰度图像集;其中,I=(I1,I2,...,Ii,...,Iw,…,Iz,…,IR);
将标准大小的灰度图像集分割给各集群结点,并行化提取每个图像的SIFT特征,所有图像的SIFT特征表示为S,其中Sa∈S,Sa代表向量,a为大于等于1的自然数,第Ii个图像的SIFT特征为Fi,其中Fib∈Fi,Fib代表向量,b为大于等于1的自然数。
进一步地,所述提取图像聚类中心,具体步骤为:
(11)计算Sa到聚类中心Ad的欧式距离,将Sa作为value,将到Sa欧氏距离最近的聚类中心作为key值;Adk∈Ad,d为大于等于0的非负整数,k为大于等于1的自然数,Adk代表向量;从S中随机选取额的k个SIFT特征作为初始k个聚类中心,形成初始聚类中心集合A0,A0k∈A0;
(21)求取key值相同的Sa的平均值,d=d+1,将各平均值作为新的聚类中心Ad;
(31)计算新的聚类中心Ad与上一次循环的聚类中心Ad-1的欧氏距离均值,若该欧氏距离均值>0.05,则跳回至步骤(11)执行;若该欧氏距离均值<0.05,则新的聚类中心Ad作为图像集I的特征字典E输出,其中Ek∈E,k为大于等于1的自然数,Ek为向量,所述特征字典E即为图像聚类中心。
进一步地,所述提取IDF加权图像稀疏编码,具体步骤为:
分别计算图像Ii中每个特征向量Fib与特征字典E的欧氏距离h,其中Ek∈E,hk∈h=(h1,h2,...,),k为大于等于1的自然数,从E中选取hk最小的m个Ek,组成特征字典E′,E′=(Ef,...,Eg),其中E′中有m个向量,f为大于等于1的自然数,g为大于等于1的自然数,g>f;
利用Cib=(E′-1Fib
T)(E′-1Fib
T)T计算Fib与特征字典E′的平方差矩阵Cib;
提取cib中的k个最大值,得到图像Ii的图像稀疏编码gi,其中gik∈gi;
本发明的有益效果是:
(1)本发明通过MapReduce并行方式运行KMeans算法在线学习过完备字典特征,使其尽可能地提取全局特征结构,从而可以从过完备字典中找到具有最具表征能力的原子组合来表示图像特征。在线字典学习通过每次迭代MapReduce Jop,并根据设定阈值判断终止,这种并行化的计算方式大大提高了针对大规模数据集KMeans聚类算法的计算效率;
(2)本发明引入稀疏表示理论,并通过查找字典集中与表征特征最近邻的K个码字进行重构,这种重构方式跟原始BOW的向量量化相比,用多个码字重构能够具有更小的重构误差,通过选取局部近邻进行重构更能达到局部平滑稀疏性同时这种方式与传统稀疏表示方法具有更快的实现方法不需要过多的求解优化过程;
(3)本发明通过统计全局逆向视觉词频率IDF,对图像稀疏表示向量进行加权,使其表征性更强,同时降低稀疏编码中表征性较低的码字的权重,升高表征性较高的码字权重,使其稀疏性更强,从而使相似图像的高表征特征具有更高的概率相同或相似;
(4)本发明通过提取稀疏表示中高表征特征进行散列到候选相似集合,同时在每个散列桶中通过计算两两Jaccard index相似度进行匹配,该方法可以简单、高效的得到相似图像对,同时此方法可以充分利用稀疏表示的特点和Mapreduce模型进行并行计算,大幅度提升大规模图像数据集的匹配效率和准确度;
(5)本发明基于HADOOP的分布式存储系统HDFS和并行计算模型MapReduce的分布式图像近重复检测系统,已有的图像近重复检测系统一般是只支持单节点的检测框架,但随着移动互联网的发展,图像数据成指数级的增长,以往的
系统根本不能满足如此大的数据量上的存储和运算。通过本发明不但具有针对海量数据的高扩展性,同时可以大幅度提高近重复检测的计算效率。
图1所示为本发明基于稀疏表示的近似重复图像检测方法结构示意图;
图2为本发明实现基于MapReduce的并行KMeans算法流程图;
图3为本发明实现基于局部优先搜索的图像稀疏编码算法流程图;
图4为本发明实现基于MapReduce和显著维度特征的并行相似集合检测算法流程图;
图5为实施例2中分别对5个关键字从不同方法得到的聚类结果;
图6为实施例2的聚类结果。
以下给出本发明的具体实施例,需要说明的是本发明并不局限于以下具体实施例,凡在本申请技术方案基础上做的等同变换均落入本发明的保护范围。
实施例1
本方法基于hadoop分布式计算框架提出,图1中,一种基于稀疏表示的近似重复图像检测方法,其包括特征提取模块、特征字典构造模块,图像稀疏编码表示模块,相似图匹配过滤模块、近重复图像对合并模块。特征提取模块用于并行化提取图像集合中的所有原始局部图像特征;特征字典构造模块用于将特征提取模块提取到的图像特征采用并行K-Means在线字典学习算法构建原始特征字典集。所诉图像稀疏编码表示模块用于将每幅图像的原始局部特征利用所构造的字典集和稀疏编码方法映射为一个稀疏向量来表示每幅图像;所诉相似图匹配过滤模块用于并行化计算过滤后的图像对的相似度并输出相似度大于
某一阈值的图像对;所诉近重复图像对合并模块用于将相似图匹配过滤模块所输出的所有相似图像对进行合并成近重复图像集合。
该检测方法包括如下步骤:
步骤1,将图像集I,其中I=(I1,I2,...,Ii,...,Iw,…,Iz,…,IR)中每副图像Ii的大小标准化,比如设置成标准化(128*128、256*256或者512*512)大小,本发明中选用的图像统一标准化为大小为256*256,之后进行灰度处理,得到标准大小的灰度图像集,利用自定义imageWritable将图像进行序列化操作,输出图像的二进制数据流,并将所有图像以键值对形式<key:图像ID,value:imageWritable>压缩存储于自定义ImageBundle,最终上传至分布式存储框架HDFS上;
步骤2,从HDFS上下载ImageBundle文件,hadoop会自行根据集群内节点个数分割ImageBundle文件给不同节点的Map函数,Map函数获取图像的键值对形式,基于公开的SIFT算法提取出图像集中每个图像的多个SIFT特征向量,组成图像的SIFT特征向量序列,所有图像的SIFT特征表示为S,其中Sa∈S,Sa代表向量,a为大于等于1的自然数,第Ii个图像的SIFT特征为Fi,其中Fib∈Fi,Fib代表向量,b为大于等于1的自然数,并将图像集中每个图像分别以<key:图像ID,value:Fi>键值对形式存储在HDFS上;
步骤3,计算Sa到聚类中心Ad的欧式距离,将Sa作为value,将到Sa欧氏距离最近的聚类中心Aq作为key值;Adk∈Ad,d为大于等于0的非负整数,k为大于等于1的自然数,Adk代表向量;从S中随机选取额的k个SIFT特征作为初始k个聚类中心,形成初始聚类中心集合A0,A0k∈A0;以键值对<key:Aq,value:Sa>形式输出。
步骤4,求取key值相同的Sa的平均值,d=d+1,将各平均值作为新的聚类
中心Ad;
步骤5,计算新的聚类中心Ad与上一次循环的聚类中心Ad-1的欧氏距离均值,若该欧氏距离均值>0.05,则跳回至步骤3执行;若该欧氏距离均值<0.05,则新的聚类中心Ad作为图像集I的特征字典E输出,其中Ek∈E,k为大于等于1的自然数,Ek为向量,所述特征字典E即为图像聚类中心。
步骤8,分别计算图像Ii中每个特征向量Fib与特征字典E的欧氏距离h,其中Ek∈E,hk∈h=(h1,h2,...,),k为大于等于1的自然数,从E中选取hk最小的m个Ek,组成特征字典E′,E′=(Ef,...,Eg),其中E′中有m个向量,f为大于等于1的自然数,g为大于等于1的自然数,g>f;
利用Cib=(E′-1Fib
T)(E′-1Fib
T)T计算Fib与特征字典E′的平方差矩阵Cib;
提取cib中的k个最大值,得到图像Ii的图像稀疏编码gi,其中gik∈gi;
步骤10,提取图像Ii的IDF加权稀疏编码gi′中的非零元素;gik′∈gi′,k为大于等于1的自然数,gi′内的非零元素为(giu′,...,giv′),设非零元素为m
个,m为大于等于1的自然数,m≤k,giu′≠0,giv′≠0,u为大于等于1的自然数,v大于等于1的自然数,k>v>u;
步骤12,利用(式1)的矩阵变换,将图像Ii的IDF加权稀疏编码gi′分别散列到非零元素的下标(u,...,v)对应的m个组里;
其中,j为大于等于1的自然数,且i≠j;g'i和g'j分别表示图像Ii和Ij的IDF加权稀疏编码;
步骤14,将步骤13所得结果中具有相同图像的相似图像对合并,生成相似
图像子集。
实施例2
本实施例利用百度图片搜索引擎分别检索30个全球著名景点或建筑(例如:埃及埃菲尔铁塔、白宫、大雁塔等)的图片,并人工从对每个类型检索到的图像中挑选清晰、准确的100幅图像,组成3000幅近重复图像,同时从公开数据集Flickr-100M(来源:http://webscope.sandbox.yahoo.com)中随机选择17,000副照片作为干扰项,连同近重复图像组成实验的图像数据集,共20,000张图像。
选择Hadoop 2.4.0版本作为实验平台,共10个节点计算机构成本实施例的Hadoop集群。由于Hadoop自身并不支持图像数据的读取和处理,所以我们基于Hadoop的java开源框架自定义了两个类型:ImageBundle和ImageWritable。ImageBundle类似于Hadoop自带SequenceFile,它可以将大量的图像格式文件合并为一个大的文件,并以固定键值对形式<key:imageID,value:imageWritable>序列化存储于HDFS。自定义ImageWritable继承与Hadoop的Writable,用于对ImageBundle的编解码。继承与Writable的两个关键函数encoder()和decoder()分别用于将图像的二进制文件解码为为键值对形式和将键值对编码为二进制格式。下面为实验步骤:
1、对20,000张图像进行标准化的缩放并进行灰度化处理,本实施例中图像标准化后尺寸为256*256。
2、对20,000张图像利用ImageBundle将图像编码为键值对形式并统一存储于ImageBundle文件,上传至HDFS。
3、基于Mapreduce对步骤2上传的ImageBundle文件进行并行化特征提取,并以键值对<key:图像ID,value:图像特征>形式存储于SequenceFile文件并上
传至HDFS。本实施例中提取的图像为SIFT特征,SIFT特征为图像局部特征,每幅特征包含的特征数量不定,每个SIFT特征128维。
4、基于实施例1所述的MapReduce-Kmeans算法,对步骤3所生成的图像特征SequenceFile文件进行并行化Kmeasn聚类。本实施例中聚类中心K=512,循环终止条件为0.01,当两次循环生成的聚类中心的欧氏距离均值小于0.01时循环结束。本步骤将产生512个聚类中心作为视觉字典,每个聚类中心为128维向量作为视觉词。
5、基于实施例1所述步骤7,对步骤4产生的视觉字典中每个视觉词进行IDF权重评估。
6、从HDFS下载步骤3所生成的图像特征SequenceFile文件进行MapReduce并行化稀疏编码和相似度计算,其中Map函数利用实施例1所述步骤8,9对图像集进行稀疏编码并按实施例1步骤10散列给Reduce函数,Reduce函数接收从Map函数发送的稀疏编码后按照实施例1步骤11所述方法进行相似度计算并输出大于阈值的相似对。其中本实施例采用稀疏度L=10,每个图像的稀疏编码512维,相似度阈值为0.7。
7、对本实施例步骤6产生的相似图像对合并,最终输出近重复相似图像集。
通过对测试数据的实验结果表明,我们的算法可以在recall为0.86时Precision为0.9,总耗时3.24kilosecond。其中实验结果图5为分别对5个关键字(Flower,Iphone,Colosseum,Elephant,Cosmopolitan)从不同方法得到的聚类结果中随机抽样提取的9幅图像,F值为F1-measure指标。对比的方法分别为Partition min-Hash算法(PmH)、Geometric min-Hash算法(GmH)、min-hash方法(mH)、标准LSH算法(st.LSH)和基于Bag-of-Visual-Words的树查找算法
(baseline)。实验结果图6是本方法对17,000副Flickr照片聚类的结果,Cluster size为相应的聚类集合的照片数量。
Claims (7)
- 一种基于稀疏表示的近似重复图像检测方法,该方法基于hadoop分布式计算框架提出,该检测方法包括如下步骤,获取图像集I中所有图像的IDF加权稀疏编码g′,其中I=(I1,I2,...,Ii,...,Iw,…,Iz,…,IR),Ii的IDF加权稀疏编码为gi′,gi′∈g′,i为大于等于1的自然数,w为大于i的自然数,z为大于w的自然数,R为大于z的自然数,其特征在于,方法还包括:(1)提取图像Ii的IDF加权稀疏编码gi′中的非零元素;gik′∈gi′,k为大于等于1的自然数,gi′内的非零元素为(giu′,...,giv′),设非零元素为m个,m为大于等于1的自然数,m≤k,giu′≠0,giv′≠0,u为大于等于1的自然数,v大于等于1的自然数,k>v>u;(3)利用(式1)的矩阵变换,将图像Ii的IDF加权稀疏编码gi′分别散列到非零元素的下标(u,...,v)对应的m个组里;其中,j为大于等于1的自然数,且i≠j;g'i和g'j分别表示图像Ii和Ij的IDF加权稀疏编码;(5)将步骤(4)所得结果中具有相同图像的相似图像对合并,生成相似图像子集。
- 如权利要求1所述基于稀疏表示的近似重复图像检测方法,其特征在于,所述获取图像集I中所有图像的IDF加权稀疏编码g′,包括以下步骤:并行化提取每副图像的局部特征,得到图像集I中所有图像的局部特征S;提取图像聚类中心,得到特征字典E;计算E中每个聚类中心权重;根据E中每个聚类中心权重,提取图像的IDF加权稀疏编码g′。
- 如权利要求2所述基于稀疏表示的近似重复图像检测方法,其特征在于,所述并行化提取图像局部特征为提取图像集I所有图像的SIFT特征。
- 如权利要求3所述基于稀疏表示的近似重复图像检测方法,其特征在于,所述提取所有图像的SIFT特征,具体步骤为:将图像集I中每副图像Ii的大小标准化并灰度处理,得到标准大小的灰度图像集;其中,I=(I1,I2,...,Ii,...,Iw,…,Iz,…,IR);将标准大小的灰度图像集分割给各集群结点,并行化提取每个图像的SIFT 特征,所有图像的SIFT特征表示为S,其中Sa∈S,Sa代表向量,a为大于等于1的自然数,第Ii个图像的SIFT特征为Fi,其中Fib∈Fi,Fib代表向量,b为大于等于1的自然数。
- 如权利要求2所述基于稀疏表示的近似重复图像检测方法,其特征在于,所述提取图像聚类中心,具体步骤为:(11)计算Sa到聚类中心Ad的欧式距离,将Sa作为value,将到Sa欧氏距离最近的聚类中心作为key值;Adk∈Ad,d为大于等于0的非负整数,k为大于等于1的自然数,Adk代表向量;从S中随机选取额的k个SIFT特征作为初始k个聚类中心,形成初始聚类中心集合A0,A0k∈A0;(21)求取key值相同的Sa的平均值,d=d+1,将各平均值作为新的聚类中心Ad;(31)计算新的聚类中心Ad与上一次循环的聚类中心Ad-1的欧氏距离均值,若该欧氏距离均值>0.05,则跳回至步骤(11)执行;若该欧氏距离均值<0.05,则新的聚类中心Ad作为图像集I的特征字典E输出,其中Ek∈E,k为大于等于1的自然数,Ek为向量,所述特征字典E即为图像聚类中心。
- 如权利要求2所述基于稀疏表示的近似重复图像检测方法,其特征在于,所述提取IDF加权图像稀疏编码,具体步骤为:分别计算图像Ii中每个特征向量Fib与特征字典E的欧氏距离h,其中Ek∈E,hk∈h=(h1,h2,...,),k为大于等于1的自然数,从E中选取hk最小的m个Ek,组成特征字典E′,E′=(Ef,...,Eg),其中E′中有m个向量,f为大于等于1的自然数,g为大于等于1的自然数,g>f;利用Cib=(E′-1Fib T)(E′-1Fib T)T计算Fib与特征字典E′的平方差矩阵Cib;提取cib中的k个最大值,得到图像Ii的图像稀疏编码gi,其中gik∈gi;
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201611130891.8 | 2016-12-09 | ||
| CN201611130891.8A CN106599917A (zh) | 2016-12-09 | 2016-12-09 | 一种基于稀疏表示的近似图像重复检测方法 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2018103179A1 true WO2018103179A1 (zh) | 2018-06-14 |
Family
ID=58598522
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2017/070197 Ceased WO2018103179A1 (zh) | 2016-12-09 | 2017-01-05 | 一种基于稀疏表示的近似重复图像检测方法 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN106599917A (zh) |
| WO (1) | WO2018103179A1 (zh) |
Cited By (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109726724A (zh) * | 2018-12-21 | 2019-05-07 | 浙江农林大学暨阳学院 | 一种遮挡情况下水尺图像特征加权学习识别方法 |
| CN111080525A (zh) * | 2019-12-19 | 2020-04-28 | 成都海擎科技有限公司 | 一种基于sift特征的分布式图像和图元拼接方法 |
| CN112488221A (zh) * | 2020-12-07 | 2021-03-12 | 电子科技大学 | 一种基于动态刷新正样本图像库的道路路面异常检测方法 |
| CN113298012A (zh) * | 2021-06-07 | 2021-08-24 | 浙江工业大学 | 一种实现空间信号平移与缩放不变性的编码方法 |
| CN113554082A (zh) * | 2021-07-15 | 2021-10-26 | 广东工业大学 | 一种自加权融合局部和全局信息的多视图子空间聚类方法 |
| CN115984789A (zh) * | 2022-12-14 | 2023-04-18 | 北京百度网讯科技有限公司 | 车道线检测方法、装置、设备以及存储介质 |
| CN116543205A (zh) * | 2023-04-28 | 2023-08-04 | 江苏南大先腾信息产业股份有限公司 | 一种利用图片分类及相似对信息系统方案查重的方法 |
| CN116704438A (zh) * | 2023-06-13 | 2023-09-05 | 上海夏舜科技有限公司 | 一种基于无监督的人群计数方法 |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111125391B (zh) * | 2018-11-01 | 2024-06-07 | 北京市商汤科技开发有限公司 | 数据库更新方法和装置、电子设备、计算机存储介质 |
| CN110738260A (zh) * | 2019-10-16 | 2020-01-31 | 名创优品(横琴)企业管理有限公司 | 一种零售门店太空箱摆放检测方法、装置和设备 |
| CN111325245B (zh) * | 2020-02-05 | 2023-10-17 | 腾讯科技(深圳)有限公司 | 重复图像识别方法、装置、电子设备及计算机可读存储介质 |
| CN112699294B (zh) * | 2020-12-30 | 2025-03-14 | 深圳前海微众银行股份有限公司 | 软件头像管理方法、系统、设备及计算机存储介质 |
| CN115344532A (zh) * | 2022-08-18 | 2022-11-15 | 支付宝(杭州)信息技术有限公司 | 镜像查重字典的确定、镜像文件存储方法及装置 |
| CN121256424B (zh) * | 2025-12-04 | 2026-03-24 | 人工智能与数字经济广东省实验室(深圳) | 一种稀疏表示驱动的大规模数据集成聚类方法、系统、终端及存储介质 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104392250A (zh) * | 2014-11-21 | 2015-03-04 | 浪潮电子信息产业股份有限公司 | 一种基于MapReduce的图像分类方法 |
| CN104462199A (zh) * | 2014-10-31 | 2015-03-25 | 中国科学院自动化研究所 | 一种网络环境下的近似重复图像搜索方法 |
| CN104504406A (zh) * | 2014-12-04 | 2015-04-08 | 长安通信科技有限责任公司 | 一种快速高效的近似重复图像匹配方法 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103745465A (zh) * | 2014-01-02 | 2014-04-23 | 大连理工大学 | 一种稀疏编码背景建模方法 |
| CN104778476B (zh) * | 2015-04-10 | 2018-02-09 | 电子科技大学 | 一种图像分类方法 |
| CN106023098B (zh) * | 2016-05-12 | 2018-11-16 | 西安电子科技大学 | 基于张量结构多字典学习与稀疏编码的图像修补方法 |
-
2016
- 2016-12-09 CN CN201611130891.8A patent/CN106599917A/zh active Pending
-
2017
- 2017-01-05 WO PCT/CN2017/070197 patent/WO2018103179A1/zh not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104462199A (zh) * | 2014-10-31 | 2015-03-25 | 中国科学院自动化研究所 | 一种网络环境下的近似重复图像搜索方法 |
| CN104392250A (zh) * | 2014-11-21 | 2015-03-04 | 浪潮电子信息产业股份有限公司 | 一种基于MapReduce的图像分类方法 |
| CN104504406A (zh) * | 2014-12-04 | 2015-04-08 | 长安通信科技有限责任公司 | 一种快速高效的近似重复图像匹配方法 |
Cited By (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109726724A (zh) * | 2018-12-21 | 2019-05-07 | 浙江农林大学暨阳学院 | 一种遮挡情况下水尺图像特征加权学习识别方法 |
| CN109726724B (zh) * | 2018-12-21 | 2023-04-18 | 浙江农林大学暨阳学院 | 一种遮挡情况下水尺图像特征加权学习识别方法 |
| CN111080525A (zh) * | 2019-12-19 | 2020-04-28 | 成都海擎科技有限公司 | 一种基于sift特征的分布式图像和图元拼接方法 |
| CN112488221A (zh) * | 2020-12-07 | 2021-03-12 | 电子科技大学 | 一种基于动态刷新正样本图像库的道路路面异常检测方法 |
| CN112488221B (zh) * | 2020-12-07 | 2022-06-14 | 电子科技大学 | 一种基于动态刷新正样本图像库的道路路面异常检测方法 |
| CN113298012A (zh) * | 2021-06-07 | 2021-08-24 | 浙江工业大学 | 一种实现空间信号平移与缩放不变性的编码方法 |
| CN113554082A (zh) * | 2021-07-15 | 2021-10-26 | 广东工业大学 | 一种自加权融合局部和全局信息的多视图子空间聚类方法 |
| CN113554082B (zh) * | 2021-07-15 | 2023-11-21 | 广东工业大学 | 一种自加权融合局部和全局信息的多视图子空间聚类方法 |
| CN115984789A (zh) * | 2022-12-14 | 2023-04-18 | 北京百度网讯科技有限公司 | 车道线检测方法、装置、设备以及存储介质 |
| CN116543205A (zh) * | 2023-04-28 | 2023-08-04 | 江苏南大先腾信息产业股份有限公司 | 一种利用图片分类及相似对信息系统方案查重的方法 |
| CN116704438A (zh) * | 2023-06-13 | 2023-09-05 | 上海夏舜科技有限公司 | 一种基于无监督的人群计数方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106599917A (zh) | 2017-04-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2018103179A1 (zh) | 一种基于稀疏表示的近似重复图像检测方法 | |
| Zhou et al. | Graph convolutional network hashing | |
| JP5926291B2 (ja) | 類似画像を識別する方法および装置 | |
| Yan et al. | Supervised hash coding with deep neural network for environment perception of intelligent vehicles | |
| CN105469096B (zh) | 一种基于哈希二值编码的特征袋图像检索方法 | |
| Han et al. | Matchnet: Unifying feature and metric learning for patch-based matching | |
| CN110188827B (zh) | 一种基于卷积神经网络和递归自动编码器模型的场景识别方法 | |
| Van Der Maaten | Barnes-hut-sne | |
| CN105912611B (zh) | 一种基于cnn的快速图像检索方法 | |
| US20200104721A1 (en) | Neural network image search | |
| CN104392250A (zh) | 一种基于MapReduce的图像分类方法 | |
| Huang et al. | Object-location-aware hashing for multi-label image retrieval via automatic mask learning | |
| Huang et al. | Unconstrained multimodal multi-label learning | |
| CN104112018B (zh) | 一种大规模图像检索方法 | |
| Cheng et al. | Semi-supervised multi-graph hashing for scalable similarity search | |
| US11763136B2 (en) | Neural hashing for similarity search | |
| Wang et al. | Learning A deep l1 encoder for hashing | |
| CN110990596A (zh) | 一种基于自适应量化多模态哈希检索方法及系统 | |
| CN112488231B (zh) | 一种具有平衡相似性的余弦度量监督深度哈希算法 | |
| Ma et al. | Error correcting input and output hashing | |
| CN114996493A (zh) | 一种基于数据清除消冗的电力场景图像数据筛选方法 | |
| CN116069985A (zh) | 一种基于标签语义增强的鲁棒在线跨模态哈希检索方法 | |
| EP3115909A1 (en) | Method and apparatus for multimedia content indexing and retrieval based on product quantization | |
| CN113298234A (zh) | 一种生成多关系图中节点的表示向量的方法 | |
| Wu et al. | Structure similarity preservation learning for asymmetric image retrieval |
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: 17877705 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: 17877705 Country of ref document: EP Kind code of ref document: A1 |














