CN104331717B - The image classification method that a kind of integration characteristics dictionary structure is encoded with visual signature - Google Patents
The image classification method that a kind of integration characteristics dictionary structure is encoded with visual signature Download PDFInfo
- Publication number
- CN104331717B CN104331717B CN201410693888.1A CN201410693888A CN104331717B CN 104331717 B CN104331717 B CN 104331717B CN 201410693888 A CN201410693888 A CN 201410693888A CN 104331717 B CN104331717 B CN 104331717B
- Authority
- CN
- China
- Prior art keywords
- image
- visual
- visual signature
- feature
- dictionary
- 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.)
- Expired - Fee Related
Links
- 230000000007 visual effect Effects 0.000 title claims abstract description 155
- 238000000034 method Methods 0.000 title claims abstract description 31
- 230000010354 integration Effects 0.000 title claims 2
- 238000012549 training Methods 0.000 claims abstract description 10
- 239000013598 vector Substances 0.000 claims description 33
- 239000011159 matrix material Substances 0.000 claims description 11
- 238000005070 sampling Methods 0.000 claims description 9
- 238000013145 classification model Methods 0.000 claims description 6
- 239000000284 extract Substances 0.000 claims description 6
- 238000012360 testing method Methods 0.000 claims description 6
- UELITFHSCLAHKR-UHFFFAOYSA-N acibenzolar-S-methyl Chemical compound CSC(=O)C1=CC=CC2=C1SN=N2 UELITFHSCLAHKR-UHFFFAOYSA-N 0.000 claims 1
- HUTDUHSNJYTCAR-UHFFFAOYSA-N ancymidol Chemical compound C1=CC(OC)=CC=C1C(O)(C=1C=NC=NC=1)C1CC1 HUTDUHSNJYTCAR-UHFFFAOYSA-N 0.000 claims 1
- 239000000203 mixture Substances 0.000 claims 1
- 238000000605 extraction Methods 0.000 abstract description 7
- 230000008569 process Effects 0.000 abstract description 5
- 230000004927 fusion Effects 0.000 abstract description 4
- 238000005516 engineering process Methods 0.000 description 8
- 238000011160 research Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 3
- 238000012706 support-vector machine Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000009499 grossing Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000007619 statistical method Methods 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000001174 ascending effect Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000000969 carrier Substances 0.000 description 1
- 238000007418 data mining Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000003203 everyday effect Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
- G06V30/19—Recognition using electronic means
- G06V30/192—Recognition using electronic means using simultaneous comparisons or correlations of the image signals with a plurality of references
- G06V30/194—References adjustable by an adaptive method, e.g. learning
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
Abstract
本发明公开了一种整合特征字典结构与视觉特征编码的图像分类方法,包含如下步骤:视觉特征提取;特征字典学习;视觉特征编码;特征编码的空间汇合;训练与分类。本发明能获取更为准确的图像特征表示,提升图像分类的准确率。此外,通过将特征字典中的结构信息整合到视觉特征编码过程,得到更有判别性的图像特征表示,因此使得对图像的分类更加有效。本发明实现了高效、准确的图像分类,因此具有较高的使用价值。
The invention discloses an image classification method integrating feature dictionary structure and visual feature coding, which comprises the following steps: visual feature extraction; feature dictionary learning; visual feature coding; spatial fusion of feature coding; training and classification. The invention can obtain more accurate image feature representation and improve the accuracy of image classification. Furthermore, by integrating the structural information in the feature dictionary into the visual feature encoding process, a more discriminative representation of image features is obtained, thus enabling more efficient classification of images. The invention realizes efficient and accurate image classification, and thus has high use value.
Description
技术领域technical field
本发明涉及图像分类领域,特别是基于码书模型(Bag-of-Words,BoW)的一种整合特征字典结构与视觉特征编码的图像分类方法The present invention relates to the field of image classification, especially an image classification method based on a codebook model (Bag-of-Words, BoW) that integrates feature dictionary structure and visual feature encoding
背景技术Background technique
随着信息技术的不断飞速发展,各个领域每天都在以惊人的速度产生各种类型的数据,包括文字、图像、视频、音乐等。在丰富多彩的数据信息中,图像因其表现直观生动、内容丰富、信息量大,以及存储与传输方便,备受青睐,并已经成为二十一世纪最重要的信息载体之一。特别是随着照相机、手机、平板等具有拍照功能的移动设备的日益普及,以及社交网络的兴起,人们获取图像的方式越来越多,也进一步促使图像数据急剧增长,快速准确地查找所需图像和高效地管理却因此变得越来越困难。人们迫切希望计算机能帮助人类,对互联网中海量图像所蕴含的语义进行分析,并充分理解图像所表达的内容,从而更有效地对图像进行管理、分类标注,或检索感兴趣的图像。With the continuous rapid development of information technology, various fields are generating various types of data at an alarming rate every day, including text, images, videos, music, etc. Among the rich and colorful data information, images are popular because of their intuitive and vivid performance, rich content, large amount of information, and convenient storage and transmission, and have become one of the most important information carriers in the 21st century. Especially with the increasing popularity of mobile devices with camera functions such as cameras, mobile phones, and tablets, and the rise of social networks, people have more and more ways to obtain images, which further promotes the rapid growth of image data, and quickly and accurately find the required information. Images and efficient management therefore become more and more difficult. People urgently hope that computers can help humans analyze the semantics contained in the massive images on the Internet, and fully understand the content expressed by the images, so as to manage, classify and label images more effectively, or retrieve images of interest.
图像分类作为计算机理解图像最主要的基础技术之一,已经受到了学术界和工业界各研究机构的广泛研究,并在国内外各权威期刊和重要学术会议上作为重要主题,是计算机视觉领域一个极重要的研究课题。图像分类是指按照一定的分类准则将图像智能化地分到一组已有定义类别中的过程,包括物体识别、场景语义分类、行为识别等。图像分类已经成为研究图像语义理解的重要技术手段。科学研究人员已经渐渐意识到以上问题的重要性并不断深入分析。近几年,码书模型为图像高层语义表示带来新的启发,以码书模型为关键技术的图像分类已取得了一定成果,但是仍有许多研究点尚未涉及,仍有巨大的突破空间。基于码书模型的图像分类方法的研究,已经成为当前人工智能、计算机视觉、机器学习和数据挖掘等诸多交叉领域中前沿性的热点,对积极推进社会信息化起到重要作用。在创造了无可替代的社会价值的同时,该领域仍有许多关键技术问题尚未解决,仍有许多功能实现需要进一步完善,因此,如何利用码书模型,更有效地理解和描述图像高层语义,以更灵活地实现图像分类的研究,具有深远的意义。Image classification, as one of the most important basic technologies for computer understanding of images, has been widely studied by various research institutions in academia and industry, and has been used as an important topic in authoritative journals and important academic conferences at home and abroad. It is an important topic in the field of computer vision. very important research topic. Image classification refers to the process of intelligently classifying images into a set of defined categories according to certain classification criteria, including object recognition, scene semantic classification, behavior recognition, etc. Image classification has become an important technical means to study image semantic understanding. Scientific researchers have gradually realized the importance of the above problems and continue to analyze them in depth. In recent years, the codebook model has brought new inspiration to the high-level semantic representation of images. Image classification with the codebook model as the key technology has achieved certain results, but there are still many research points that have not been covered, and there is still huge room for breakthroughs. The research on the image classification method based on the codebook model has become a cutting-edge hotspot in many intersecting fields such as artificial intelligence, computer vision, machine learning and data mining, and plays an important role in actively promoting social informatization. While creating irreplaceable social value, there are still many key technical issues in this field that have not been resolved, and there are still many functions that need to be further improved. Therefore, how to use the codebook model to understand and describe the high-level semantics of images more effectively, The research of realizing image classification more flexibly has far-reaching significance.
发明内容Contents of the invention
发明目的:本发明所要解决的技术问题是针对现有技术的不足,提供一种整合特征字典结构与视觉特征编码的图像分类方法,利用特征字典中视觉单词的分布信息辅助视觉特征编码,以使编码结果更具有判别性,从而提高图像分类的准确率。Purpose of the invention: the technical problem to be solved by this invention is to provide a kind of image classification method integrating feature dictionary structure and visual feature coding, and use the distribution information of visual words in the feature dictionary to assist visual feature coding, so as to make The encoding result is more discriminative, thus improving the accuracy of image classification.
为了解决上述技术问题,本发明公开了一种整合特征字典结构与视觉特征编码的图像分类方法,包含如下步骤:In order to solve the above-mentioned technical problems, the present invention discloses an image classification method integrating feature dictionary structure and visual feature coding, which includes the following steps:
步骤1,提取图像的视觉特征:对每幅图像进行局部采样,得到一组区域块,提取每块区域的视觉特征,得到每幅图像对应的视觉特征集合,称所有图像的视觉特征集合的整体为所有图像的视觉特征集,记为集合X;Step 1, extract the visual features of the image: perform local sampling on each image to obtain a set of area blocks, extract the visual features of each area, and obtain the set of visual features corresponding to each image, which is called the overall set of visual features of all images is the visual feature set of all images, denoted as set X;
步骤2,特征字典学习:以集合X为输入,使用特征字典学习方法,得到由一组具有代表性的视觉单词组成的特征字典;Step 2, feature dictionary learning: take the set X as input, and use the feature dictionary learning method to obtain a feature dictionary composed of a group of representative visual words;
步骤3,视觉特征编码:将每幅图像的每个视觉特征表示成视觉单词的线性组合,每个视觉单词对应一个系数,称这组系数为视觉特征的编码;Step 3, visual feature coding: express each visual feature of each image as a linear combination of visual words, each visual word corresponds to a coefficient, and this group of coefficients is called the coding of visual features;
步骤4,视觉特征编码的空间汇合:以每幅图像的所有视觉特征的编码为输入,使用统计方法,将每幅图像表示为一个向量,该向量就是对应图像的图像特征表示;Step 4, spatial fusion of visual feature encoding: take the encoding of all visual features of each image as input, and use statistical methods to represent each image as a vector, which is the image feature representation of the corresponding image;
步骤5,将步骤4得到的每幅图像的编码作为输入,使用分类模型进行训练和分类,得到分类结果。In step 5, the encoding of each image obtained in step 4 is used as an input, and the classification model is used for training and classification to obtain a classification result.
步骤1具体包括如下步骤:Step 1 specifically includes the following steps:
对每幅图像I进行局部采样,采用等步长的方式做密集采样,得到若干大小相同的区域块,对每个区域块提取一个视觉特征,使用视觉特征提取方法得到表示该局部块一个视觉特征,视觉特征提取方法包括:方向梯度直方图(Histogram of Oriented Gradient,HOG),尺度不变特征变换(Scale-invariant feature transform,SIFT)等。得到图像I的视觉特征集合LFSI,最终得到所有图像的视觉特征集合的整体X=[x1,x2,…,xN]∈Rd×N,其中,d表示视觉特征的维度,其大小由视觉特征提取技术决定,N表示所有图像的视觉特征的总数,xi表示第i个视觉特征,i取值1~N。Local sampling is performed on each image I, and dense sampling is performed by means of equal steps to obtain several regional blocks of the same size, and a visual feature is extracted for each regional block, and a visual feature representing the local block is obtained by using the visual feature extraction method , Visual feature extraction methods include: Histogram of Oriented Gradient (HOG), Scale-invariant feature transform (Scale-invariant feature transform, SIFT) and so on. Get the visual feature set LFS I of the image I, and finally get the overall X=[x 1 ,x 2 ,…,x N ]∈R d×N of the visual feature set of all images, where d represents the dimension of the visual feature, and its The size is determined by the visual feature extraction technology, N represents the total number of visual features of all images, x i represents the i-th visual feature, and i takes a value from 1 to N.
步骤2具体包括如下步骤:Step 2 specifically includes the following steps:
以集合X为输入,使用特征字典学习方法,得到一组具有代表性的视觉单词组成的特征字典,将该特征字典记为:B=[b1,b2,…,bM]∈Rd×M,其中M为视觉单词的个数;bj是一个维度d的列向量,表示第j个视觉单词,j取值1~M。常用的特征字典学习方法包括:k-means,K-SVD等。Take the set X as input, and use the feature dictionary learning method to obtain a feature dictionary composed of a group of representative visual words. The feature dictionary is recorded as: B=[b 1 ,b 2 ,…,b M ]∈R d ×M , where M is the number of visual words; b j is a column vector of dimension d, representing the jth visual word, and j takes a value from 1 to M. Commonly used feature dictionary learning methods include: k-means, K-SVD, etc.
步骤3具体包括如下步骤:Step 3 specifically includes the following steps:
本步骤逐一对集合X中的每个视觉特征编码,对于视觉特征xi,其编码过程如下:In this step, each visual feature in the set X is encoded one by one. For the visual feature x i , the encoding process is as follows:
首先,从特征字典B中选出xi的p个最近邻的视觉单词,即与视觉特征xi的距离最小的p个视觉单词,记这p个视觉单词组成的特征字典为Bi,p取值1~M,i取值1~N,。First, select the p nearest neighbor visual words of x i from the feature dictionary B, that is, the p visual words with the smallest distance to the visual feature x i , record the feature dictionary composed of these p visual words as B i , p The value is 1~M, and i takes the value 1~N.
其次,求出特征字典Bi中各视觉单词之间的距离所表示的矩阵Di和计算视觉特征xi到特征字典Bi的各视觉单词的距离表示的列向量di,i取值1~N。矩阵Di的第m行s列的元素为Bi中对应视觉单词之间的距离,m,s=1,2,…,p;di的第n个分量din表示视觉特征xi与Bi中第n个视觉单词之间的距离,n=1,2,…,p。距离计算公式为:σ是一个平滑参数,控制权重的下降速度,σ>0。dist(xi,Bi)=[dist(xi,bi1),dist(xi,bi2),…,dist(xi,bip)]T,bil表示Bi的第l个视觉单词,l=1,2,…,p;每个分量表示视觉特征xi与视觉单词bil之间的距离;max(dist(xi,Bi))表示向量dist(xi,Bi)的最大分量,从而使di中分量的值域为(0,1]。在计算一个视觉单词与其他视觉单词之间的距离时,也使用同样的策略。为加快Di的求解速度,一次性求出B中各视觉单词之间的距离表示的矩阵D。则Di就是D的子矩阵,通过直接索引D即可获得不同的Di,i=1,2,…,N。Secondly, obtain the matrix D i represented by the distance between the visual words in the feature dictionary B i and the column vector d i represented by the distance between the visual feature x i and the visual words in the feature dictionary B i , i takes the value 1 ~N. The elements of the mth row and s column of the matrix D i are the distances between the corresponding visual words in B i , m, s=1, 2,..., p; the nth component d in of d i represents the visual feature x i and The distance between the nth visual word in Bi, n =1,2,...,p. The distance calculation formula is: σ is a smoothing parameter that controls the descending speed of the weight, σ>0. dist( xi ,B i )=[dist( xi ,b i1 ),dist( xi ,b i2 ),…,dist( xi ,b ip )] T , b il represents the lth vision of Bi words, l=1,2,…,p; each component Indicates the distance between the visual feature x i and the visual word b il ; max(dist( xi ,B i )) indicates the maximum component of the vector dist( xi ,B i ), so that the value range of the component in d i is (0,1]. When calculating the distance between a visual word and other visual words, the same strategy is used. In order to speed up the solution of D i , the distance between each visual word in B is calculated at one time. Matrix D. Then D i is a sub-matrix of D, and different D i can be obtained by directly indexing D, i=1, 2,...,N.
第三,以xi,di,Di,Bi和两个参数λ和β为输入,λ,β≥0,最小化下式,得到xi在Bi上的编码 Third, take x i , d i , D i , B i and two parameters λ and β as input, λ, β≥0, minimize the following formula to get the encoding of xi on B i
约束条件: Restrictions:
其中表示点积,即两个向量对应的分量相乘得到一个新向量;求解得到xi在这p个视觉单词的编码结果 in Represents the dot product, that is, the components corresponding to the two vectors are multiplied to obtain a new vector; solve to obtain the encoding result of xi in the p visual words
最后,对编码中的分量排序,得到k个最大的编码系数及其对应的k个视觉单词构成的特征字典k=1,2,…,p,则视觉特征xi的编码zi是一个M维的向量,向量中与对应的分量为其余分量都置为0。Finally, to encode The components in are sorted to get the k largest coding coefficients and its corresponding feature dictionary composed of k visual words k=1,2,...,p, then the coding z i of the visual feature x i is an M-dimensional vector, and the vector is the same as The corresponding components are The rest of the components are set to 0.
步骤5具体包括如下步骤:Step 5 specifically includes the following steps:
考虑每幅图像中的各视觉特征的空间统计信息,用三层的空间金字塔匹配模型(Spatial Pyramid Matching,SPM),将一幅图像I的所有视觉特征的编码作为输入,结合最大汇合技术,则该空间金字塔输出一个维度为(20+22+24)*M的向量,该向量即为I的图像特征表示。Consider the spatial statistical information of each visual feature in each image, use a three-layer spatial pyramid matching model (Spatial Pyramid Matching, SPM), take the encoding of all visual features of an image I as input, and combine the maximum convergence technology, then The spatial pyramid outputs a vector with a dimension of (2 0 +2 2 +2 4 )*M, which is the image feature representation of I.
步骤6具体包括如下步骤:Step 6 specifically includes the following steps:
在得到各图像的图像特征表示之后,就可以将它们用于训练和分类。将所有图像的图像特征表示所构成的集合分为训练集和测试集两部分,训练集用于训练分类模型,用训练好的模型对测试集分类。通常选用支持向量机(Support Vector Machine,SVM)作为分类器模型。After obtaining image feature representations for each image, they can be used for training and classification. The set formed by the image feature representation of all images is divided into two parts: training set and test set. The training set is used to train the classification model, and the trained model is used to classify the test set. Usually support vector machine (Support Vector Machine, SVM) is used as the classifier model.
本发明针对图像分类领域中的图像视觉特征编码方法,本发明具有如下特征:1)本发明在对视觉特征编码时,不仅考虑了视觉特征和视觉单词之间的关系,还考虑了视觉单词之间关系对视觉特征编码的影响;2)本发明求得的视觉特征编码是一个解析解,不需要迭代优化函数,因此本发明所述的视觉特征编码方法是快速的。The present invention is aimed at the image visual feature encoding method in the field of image classification. The present invention has the following characteristics: 1) when the present invention encodes visual features, it not only considers the relationship between visual features and visual words, but also considers the relationship between visual words. 2) the visual feature coding obtained by the present invention is an analytical solution, and does not need an iterative optimization function, so the visual feature coding method of the present invention is fast.
有益效果:本发明充分考虑了特征字典中视觉单词的分布这一结构信息,将该信息用于视觉特征的编码,使得视觉特征的编码更能反映特征字典中的视觉单词的分布。因此,图像的图像特征表示具有很强的判别性,从而提升图像分类的准确率。Beneficial effects: the present invention fully considers the structural information of the distribution of visual words in the feature dictionary, and uses this information for coding of visual features, so that the coding of visual features can better reflect the distribution of visual words in the feature dictionary. Therefore, the image feature representation of the image is highly discriminative, thereby improving the accuracy of image classification.
附图说明Description of drawings
下面结合附图和具体实施方式对本发明做更进一步的具体说明,本发明的上述和/或其他方面的优点将会变得更加清楚。The advantages of the above and/or other aspects of the present invention will become clearer as the present invention will be further described in detail in conjunction with the accompanying drawings and specific embodiments.
图1为本发明流程图。Fig. 1 is the flow chart of the present invention.
图2为视觉特征提取示意图Figure 2 is a schematic diagram of visual feature extraction
图3为对一个视觉特征编码的流程图Figure 3 is a flow chart of encoding a visual feature
图4为三层空间金字塔结构示意图。Fig. 4 is a schematic diagram of a three-layer space pyramid structure.
具体实施方式detailed description
如图1所示,本发明公开了一种整合特征字典结构与视觉特征编码的图像分类方法,包含如下步骤:As shown in Figure 1, the present invention discloses an image classification method integrating feature dictionary structure and visual feature coding, which includes the following steps:
步骤1,提取图像的视觉特征:对每幅图像进行局部采样,得到一组区域块,提取每块区域的视觉特征,得到每幅图像对应的视觉特征集合,将所有图像的视觉特征集合的整体记为集合X;Step 1, extract the visual features of the image: perform local sampling on each image to obtain a set of area blocks, extract the visual features of each area, obtain the visual feature set corresponding to each image, and combine the visual feature sets of all images as a whole denoted as set X;
步骤2,特征字典学习:以集合X为输入,使用特征字典学习方法,得到由一组具有代表性的视觉单词组成的特征字典;Step 2, feature dictionary learning: take the set X as input, and use the feature dictionary learning method to obtain a feature dictionary composed of a group of representative visual words;
步骤3,视觉特征编码:将每幅图像视觉特征表示成视觉单词的线性组合,每个视觉单词对应一个系数,得到视觉特征编码集合;Step 3, visual feature encoding: express the visual features of each image as a linear combination of visual words, each visual word corresponds to a coefficient, and obtain a visual feature encoding set;
步骤4,视觉特征编码的空间汇合:以每幅图像的所有视觉特的编码为输入,使用统计方法,将每幅图像表示为一个向量,该向量就是对应图像的图像特征表示;Step 4, spatial fusion of visual feature encoding: take all visual feature encodings of each image as input, and use statistical methods to represent each image as a vector, which is the image feature representation of the corresponding image;
步骤5,将步骤4得到的每幅图像的编码作为输入,使用分类模型进行训练和分类,得到分类结果。In step 5, the encoding of each image obtained in step 4 is used as an input, and the classification model is used for training and classification to obtain a classification result.
1、步骤1包括如下步骤:1. Step 1 includes the following steps:
如图2所示,对于一幅图像I,通常采用等步长密集采样的方式从I抽取若干大小相等的区域块,并对每个区域块提取一个视觉特征,这里的视觉特征是一个d维向量。常用的视觉特征提取方法包括:方向梯度直方图(Histogram of Oriented Gradient,HOG),尺度不变特征变换(Scale-invariant feature transform,SIFT)等。最终得到所有图像的视觉特征集合的整体X=[x1,x2,…,xN]∈Rd×N,其中,d表示视觉特征的维度,N表示所有图像的视觉特征的总数,xi表示第i个视觉特征,i取值1~N。X被用于步骤2作为输入,以学习得到特征字典。As shown in Figure 2, for an image I, a number of equal-sized regional blocks are usually extracted from I by means of equal-step dense sampling, and a visual feature is extracted for each regional block, where the visual feature is a d-dimensional vector. Commonly used visual feature extraction methods include: Histogram of Oriented Gradient (HOG), Scale-invariant feature transform (SIFT), etc. Finally, the overall X=[x 1 ,x 2 ,…,x N ]∈R d×N of the visual feature set of all images is obtained, where d represents the dimension of visual features, N represents the total number of visual features of all images, x i represents the i-th visual feature, and i takes a value from 1 to N. X is used as input in step 2 to learn a feature dictionary.
2、步骤2包括如下步骤:2. Step 2 includes the following steps:
在本步骤以集合X为输入,使用特征字典学习方法得到M个d维的视觉单词构成的特征字典B=[b1,b2,…,bM]∈Rd×M,其中M为视觉单词的个数;bj是一个维度d的列向量,表示第j个视觉单词,j取值1~M。以k-means方法为例,使用k-means将集合X聚为M个类,每个类中心就是一个视觉单词。In this step, the set X is used as input, and the feature dictionary B=[b 1 ,b 2 ,…,b M ]∈R d×M composed of M d-dimensional visual words is obtained by using the feature dictionary learning method, where M is the visual The number of words; b j is a column vector of dimension d, representing the jth visual word, and j takes a value from 1 to M. Taking the k-means method as an example, use k-means to cluster the set X into M classes, and the center of each class is a visual word.
3、步骤3包括如下步骤:3. Step 3 includes the following steps:
本步骤逐一对集合X中的每个视觉特征编码。This step encodes each visual feature in the set X one by one.
如图3所示的流程图描述了一个视觉特征的编码过程,针对视觉特征xi,选取视觉特征xi的由步骤2得到的特征字典B中的p个最近邻的视觉单词,即与视觉特征xi的距离最小的p个视觉单词,p取值1~M,记这p个视觉单词组成的特征字典为Bi,i取值1~N,求出特征字典Bi中各视觉单词之间的距离所表示的矩阵Di,矩阵Di的第m行s列的元素为Bi中对应视觉单词之间的距离,m,s=1,2,…,p,再计算视觉特征xi到特征字典Bi的各视觉单词的距离表示的列向量di,di的第n个分量din表示视觉特征xi与Bi中第n个视觉单词之间的距离,n=1,2,…,p;以xi,di,Di,Bi和两个参数λ与β为输入,λ,β≥0,最小化下式,得到xi在Bi上的编码 The flow chart shown in Figure 3 describes a visual feature encoding process. For the visual feature x i , select the p nearest neighbor visual words in the feature dictionary B obtained in step 2 of the visual feature x i , that is, The p visual words with the smallest distance between features x i , p takes a value of 1 to M, and the feature dictionary composed of these p visual words is B i , i takes a value of 1 to N, and finds each visual word in the feature dictionary B i The matrix D i represented by the distance between, the element of the mth row s column of the matrix D i is the distance between the corresponding visual words in B i , m, s=1,2,...,p, and then calculate the visual features The column vector d i represented by the distance between x i and each visual word in the feature dictionary B i , the nth component d in of d i represents the distance between the visual feature x i and the nth visual word in B i , n= 1,2,...,p; take x i , d i , D i , B i and two parameters λ and β as input, λ, β≥0, minimize the following formula to get the encoding of xi on B i
约束条件: Restrictions:
其中表示点积,即两个向量对应的分量相乘得到一个新向量;求解得到xi在这p个视觉单词的编码结果最后对编码中的分量排序,得到k个最大的编码系数及其对应的k个视觉单词k=1,2,…,p,则xi的编码zi是一个M维的向量,向量中与对应的分量为其余分量都置为0。in Represents the dot product, that is, the components corresponding to the two vectors are multiplied to obtain a new vector; solve to obtain the encoding result of xi in the p visual words final pair encoding The components in are sorted to get the k largest coding coefficients and its corresponding k visual words k=1,2,...,p, then the encoding z i of x i is an M-dimensional vector, in which the The corresponding components are The rest of the components are set to 0.
视觉特征xi在B上的具体编码方法如下:The specific encoding method of visual feature x i on B is as follows:
输入:图像视觉特征xi,特征字典B=[b1,b2,…,bM]∈Rd×M,M为B中的视觉单词数以及xi在B上的编码的维度。xi的最近邻单词个数p,参数k,λ和β。Input: image visual feature xi , feature dictionary B=[b 1 ,b 2 ,…,b M ]∈R d×M , M is the number of visual words in B and the dimension of encoding of xi on B. The number p of nearest neighbor words of x i , parameters k, λ and β.
编码过程:Encoding process:
1)计算视觉特征xi与所有视觉单词的距离所表示的M维的向量d′i;1) Calculate the M-dimensional vector d′ i represented by the distance between the visual feature x i and all visual words;
2)对d′′中分量按升序排序,并选出p个距离最小的视觉单词构成的集合Bi,及对应的距离di;2) Sort the components in d′ ′ in ascending order, and select a set B i composed of p visual words with the smallest distance, and the corresponding distance d i ;
3)求出Bi中各视觉单词之间的距离所表示的矩阵Di;3) Find the matrix D i represented by the distance between each visual word in B i ;
4)根据如下式子求出编码 4) Calculate the code according to the following formula
Ψ=(xi1T-Bi)T(xi1T-Bi)Ψ=(x i 1 T -B i ) T (x i 1 T -B i )
Θ=Ψ+λ*diag2(di)+βDi Θ=Ψ+λ*diag 2 (d i )+βD i
α=-(1TΘ-11)α=-(1 T Θ -1 1)
其中diag(di)表示对角向量是di的对角矩阵。此处1表示分量全为1的列向量;where diag(d i ) means that the diagonal vector is the diagonal matrix of di. Here 1 means a column vector whose components are all 1;
5)对中的分量按降序排序,得到k个最大的编码系数及其对应的k个视觉单词构成的特征字典则xi的编码zi是一个M维的向量,向量中与对应的分量为其余分量都置为0。使用式子zi=(1Tzi)-1zi归一化zi;5) yes The components in are sorted in descending order to get the k largest coding coefficients and its corresponding feature dictionary composed of k visual words Then the encoding z i of x i is an M-dimensional vector, and the vector is the same as The corresponding components are The rest of the components are set to 0. Normalize z i using the formula z i =(1 T z i ) -1 z i ;
输出:视觉特征xi的编码zi。Output: Encoding zi of visual feature xi .
4、步骤4包括如下步骤:4. Step 4 includes the following steps:
如图4所示为一个三层的空间金字塔匹配模型,在得到一幅图像的所有视觉特征编码后,采用空间金字塔匹配模型(Spatial Pyramid Matching,SPM),结合最大汇合(MaxPooling)这一空间汇合技术,以一幅图像的所有视觉特征编码为输入,得到一个向量,该向量就是这幅图像的图像特征表示。具体操作为:以图像中心为原点,使用不同尺度,递归地划分为若干子区域,例如图4中使用三层的空间金字塔匹配模型,一共有20+22+24=21个子区域。对于第a个区域,a取值1~21,使用最大汇合技术得到该区域的编码该式子表示这个图像子区域一共有t个视觉特征;at表示该区域的第h个视觉特征的编码,h取值1~t;z′a是一个维度和zah相同的列向量,即其维度为M,它的第q个分量是矩阵的对应行的最大值,即q取值1~M。进一步将z′q归一化,例如使用2范数归一化得z′q=z′q/||z′q||2。最后将各子区域的编码依次拼接,得到该图像的图像特征表示。As shown in Figure 4, it is a three-layer spatial pyramid matching model. After obtaining all the visual feature encodings of an image, the spatial pyramid matching model (Spatial Pyramid Matching, SPM) is used, combined with the spatial convergence of MaxPooling. The technology uses all the visual feature codes of an image as input to obtain a vector, which is the image feature representation of the image. The specific operation is: take the center of the image as the origin, use different scales, and recursively divide it into several sub-regions. For example, in Figure 4, a three-layer spatial pyramid matching model is used, and there are a total of 2 0 +2 2 +2 4 =21 sub-regions. For the a-th area, a takes the value of 1 to 21, and the code of this area is obtained by using the maximum convergence technique This formula indicates that there are t visual features in this image sub-region; a t represents the encoding of the h-th visual feature in this region, and h takes a value from 1 to t; z′ a is a column vector with the same dimension as z ah , That is, its dimension is M, and its qth component is a matrix The maximum value of the corresponding row of q takes a value from 1 to M. Further normalize z' q , for example, use 2-norm normalization to get z' q = z' q /||z' q || 2 . Finally, the codes of each sub-region are sequentially spliced to obtain the image feature representation of the image.
5、步骤5包括如下步骤:5. Step 5 includes the following steps:
在得到所有图像的图像特征表示后,用作为训练集的图像的图像特征表示训练SVM分类模型,再使用训练好的SVM模型对用作测试集的图像的图像特征表示分类。After obtaining the image feature representations of all images, use the image feature representations of the images in the training set to train the SVM classification model, and then use the trained SVM model to classify the image feature representations of the images in the test set.
实施例1Example 1
本实施例包括以下部分:This embodiment includes the following parts:
1、首先将图像缩小到不超过300×300的尺寸,并转化为灰度图,然后采用密集采样策略,从图像中抽取16×16像素的图像块,每隔6像素抽取一次,对每个图像块提取一个SIFT特征。因此一幅图像可能包含成百上千个特征,取决于提取特征时的图像块大小和间隔大小。1. First reduce the image to a size of no more than 300×300, and convert it into a grayscale image, and then use a dense sampling strategy to extract image blocks of 16×16 pixels from the image, every 6 pixels, for each Image patches extract a SIFT feature. Therefore, an image may contain hundreds or thousands of features, depending on the image block size and spacing when extracting features.
2、首先使用k-均值(k-means)将所有图像视觉特征聚为M个簇,每个簇中心就代表一个视觉单词。设定最近邻视觉单词个数p,密集近邻视觉单词个数k,距离平滑参数σ,正则化参数λ和β。对每个视觉特征编码。2. First use k-means to gather all image visual features into M clusters, and the center of each cluster represents a visual word. Set the number of nearest neighbor visual words p, the number of dense nearest neighbor visual words k, the distance smoothing parameter σ, and the regularization parameters λ and β. Encode each visual feature.
3、使用空间金子匹配模型和最大汇合技术,将每幅图像的所有视觉特征编码汇合为一个向量作为该图像的图像特征表示。并使用支持向量机模型对图像进行训练和分类。3. Use the spatial golden matching model and the maximum fusion technology to combine all the visual feature codes of each image into a vector as the image feature representation of the image. And use a support vector machine model to train and classify the images.
实施例2Example 2
对图像提取维度为128的视觉特征,特征字典的大小及视觉单词的的数量设置为1024。分别将p和k设置为10和5。其它的参数设置还包括:λ=10-4,β=10-4。使用3层的空间金子塔匹配及最大汇合技术。得到每个图像的21504维的图像特征表示。使用作为训练集的图像的图像特征表示训练SVM分类模型,并用训练好的模型对作为测试集的图像的图像特征表示分类,得到最终的分类结果。For the image extraction dimension of 128 visual features, the size of the feature dictionary and the number of visual words are set to 1024. Set p and k to 10 and 5, respectively. Other parameter settings also include: λ=10 -4 , β=10 -4 . Use 3 layers of spatial pyramid matching and maximum convergence technology. A 21504-dimensional image feature representation is obtained for each image. Use the image feature representation of the image as the training set to train the SVM classification model, and use the trained model to classify the image feature representation of the image as the test set to obtain the final classification result.
本发明提供了一种整合特征字典结构与视觉特征编码的图像分类方法,具体实现该技术方案的方法和途径很多,以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。本实施例中未明确的各组成部分均可用现有技术加以实现。The present invention provides an image classification method that integrates feature dictionary structure and visual feature coding. There are many methods and approaches to realize this technical solution. The above description is only a preferred embodiment of the present invention. Those of ordinary skill may make some improvements and modifications without departing from the principle of the present invention, and these improvements and modifications shall also be regarded as the protection scope of the present invention. All components that are not specified in this embodiment can be realized by existing technologies.
Claims (3)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410693888.1A CN104331717B (en) | 2014-11-26 | 2014-11-26 | The image classification method that a kind of integration characteristics dictionary structure is encoded with visual signature |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410693888.1A CN104331717B (en) | 2014-11-26 | 2014-11-26 | The image classification method that a kind of integration characteristics dictionary structure is encoded with visual signature |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104331717A CN104331717A (en) | 2015-02-04 |
CN104331717B true CN104331717B (en) | 2017-10-17 |
Family
ID=52406438
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410693888.1A Expired - Fee Related CN104331717B (en) | 2014-11-26 | 2014-11-26 | The image classification method that a kind of integration characteristics dictionary structure is encoded with visual signature |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104331717B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105224942B (en) * | 2015-07-09 | 2020-02-04 | 华南农业大学 | RGB-D image classification method and system |
CN105224619B (en) * | 2015-09-18 | 2018-06-05 | 中国科学院计算技术研究所 | A kind of spatial relationship matching process and system suitable for video/image local feature |
CN105808757B (en) * | 2016-03-15 | 2018-12-25 | 浙江大学 | The Chinese herbal medicine picture retrieval method of BOW model based on multi-feature fusion |
CN110598776A (en) * | 2019-09-03 | 2019-12-20 | 成都信息工程大学 | Image classification method based on intra-class visual mode sharing |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103646256A (en) * | 2013-12-17 | 2014-03-19 | 上海电机学院 | Image characteristic sparse reconstruction based image classification method |
CN103699436A (en) * | 2013-12-30 | 2014-04-02 | 西北工业大学 | Image coding method based on local linear constraint and global structural information |
-
2014
- 2014-11-26 CN CN201410693888.1A patent/CN104331717B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103646256A (en) * | 2013-12-17 | 2014-03-19 | 上海电机学院 | Image characteristic sparse reconstruction based image classification method |
CN103699436A (en) * | 2013-12-30 | 2014-04-02 | 西北工业大学 | Image coding method based on local linear constraint and global structural information |
Non-Patent Citations (2)
Title |
---|
Locality-constrained Linear Coding for Image Classfication;Jinjun Wang 等;《Computer Vision and Pattem Recognition》;IEEE;20101231;第3360-3367页 * |
Structurally Enhanced Incremental Neural Learning for Image Classification with Subgraph Extraction;Yu-Bin Yang 等;《International Journal of Neural Systems》;20140812;第24卷(第7期);第1450024-1 - 1450024-13页 * |
Also Published As
Publication number | Publication date |
---|---|
CN104331717A (en) | 2015-02-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Zhang et al. | Vector of locally and adaptively aggregated descriptors for image feature representation | |
Li et al. | Comparison of feature learning methods for human activity recognition using wearable sensors | |
CN110059198B (en) | A Discrete Hash Retrieval Method for Cross-modal Data Based on Similarity Preservation | |
Jiang et al. | A survey on artificial intelligence in Chinese sign language recognition | |
Zeng et al. | Deep convolutional neural networks for annotating gene expression patterns in the mouse brain | |
CN106980683B (en) | Blog text abstract generating method based on deep learning | |
CN107622104B (en) | A method and system for text image recognition and annotation | |
Liu et al. | Multimodal video classification with stacked contractive autoencoders | |
Avila et al. | Pooling in image representation: The visual codeword point of view | |
CN105184303B (en) | An Image Annotation Method Based on Multimodal Deep Learning | |
US20160140425A1 (en) | Method and apparatus for image classification with joint feature adaptation and classifier learning | |
CN107644235A (en) | Automatic image annotation method based on semi-supervised learning | |
CN104992184A (en) | Multiclass image classification method based on semi-supervised extreme learning machine | |
CN114638960A (en) | Model training method, image description generation method and device, equipment, medium | |
CN107133640A (en) | Image classification method based on topography's block description and Fei Sheer vectors | |
Abdul-Rashid et al. | Shrec’18 track: 2d image-based 3d scene retrieval | |
CN104331717B (en) | The image classification method that a kind of integration characteristics dictionary structure is encoded with visual signature | |
Li et al. | Learning hierarchical video representation for action recognition | |
CN105389588A (en) | Multi-semantic-codebook-based image feature representation method | |
Peng et al. | Deep boosting: joint feature selection and analysis dictionary learning in hierarchy | |
CN114780767A (en) | A large-scale image retrieval method and system based on deep convolutional neural network | |
CN103473275A (en) | Automatic image labeling method and automatic image labeling system by means of multi-feature fusion | |
Hu et al. | Action recognition using multiple pooling strategies of CNN features | |
Long et al. | Image classification based on improved VLAD | |
Pang et al. | A Short Video Classification Framework Based on Cross-Modal Fusion |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20171017 |