CN110134803A - Image data method for quickly retrieving based on Hash study - Google Patents

Image data method for quickly retrieving based on Hash study Download PDF

Info

Publication number
CN110134803A
CN110134803A CN201910415146.5A CN201910415146A CN110134803A CN 110134803 A CN110134803 A CN 110134803A CN 201910415146 A CN201910415146 A CN 201910415146A CN 110134803 A CN110134803 A CN 110134803A
Authority
CN
China
Prior art keywords
hash
query
image
sample
hash codes
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.)
Granted
Application number
CN201910415146.5A
Other languages
Chinese (zh)
Other versions
CN110134803B (en
Inventor
王红滨
纪斯佳
张毅
周连科
王念滨
童鹏鹏
崔琎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Harbin Engineering University
Original Assignee
Harbin Engineering University
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 Harbin Engineering University filed Critical Harbin Engineering University
Priority to CN201910415146.5A priority Critical patent/CN110134803B/en
Publication of CN110134803A publication Critical patent/CN110134803A/en
Application granted granted Critical
Publication of CN110134803B publication Critical patent/CN110134803B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/51Indexing; Data structures therefor; Storage structures
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Library & Information Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Based on the image data method for quickly retrieving of Hash study, it is related to image data method for quickly retrieving, belongs to data retrieval technology field.In order to solve the problems, such as that existing model can make model deviation occur in training stage negative feedback process in Hash codes generation phase using multiple relaxation.Depth Hash model of the invention includes five convolution-pond layer, two full articulamentums, characteristic layer, Hash layer and output layer;And be trained based on triple constraint, after obtaining trained depth Hash model, using depth Hash model foundation sample database, sample database is made of image pattern and corresponding Hash codes;For query image, the Hash codes of query image are generated using trained depth Hash model;It is retrieved using the Hash codes and image pattern library of query image.The present invention is suitable for image data retrieval.

Description

Image data method for quickly retrieving based on Hash study
Technical field
The present invention relates to image data method for quickly retrieving, belong to data retrieval technology field.
Background technique
The fast development of internet in recent years, high dimensional data show exponential form development, how using these data at For the focus of every profession and trade.Researchers propose many methods to large-scale data retrieval in time in the past, and hash method has Its efficient storage and computational efficiency and be widely used (LI WuJun, ZHOU ZhiHua. big data Hash study: status With trend [J] Science Bulletin, 2015,60 (Z1): 485-490.).Traditional hash method includes that local sensitivity Hash and spectrum are breathed out It is uncommon, certain achievement is obtained on image retrieval, but there are still a distances away from practical application.The quick hair of deep learning Exhibition promotes the progress of hash method, combines convolutional neural networks to propose convolution mind for the first time by Pan Yan and Yan Shuicheng within 2014 Through network Hash model (Convolutional Neural Network Hashing, CNNH) (R.Xia, Y.Pan, H.Lai, et al.Supervised hashing for image retrieval via image representation Learning [C] .AAAI Conference on Artificial Intelligence, 2014.), compare more traditional Hash Method achieves better effect.CNNH is divided into two stages and is trained to Hash codes, and the first step is by similar matrix S points Solution, whether the sample image of each of matrix S element representation element row and column is similar, each row of matrix H is The approximate Hash codes of training data.The characteristics of image that image in model shows in the training process cannot react on Hash The generation of code, can not Hamming distance between dynamic regulation Hash codes, the advantages of also can not just using convolutional neural networks Cause the hash function suboptimum learnt.On this basis, Li W J, Wang S, Kang W C et al. is in " Feature Learning based Deep Supervised Hashing with Pairwise Labels " in propose depth nerve Network Hash model (Deep Neural Network Hashing, DNNH), H.Liu, R.Wang, S.Shan et al. exist Depth is proposed in " Deep Supervised Hashing for Fast Image Retrieval " supervision Hash model (Deep Supervised Hashing, DSH).Two kinds of models overcome CNNH spy using model end to end in itself The problem of sign is extracted and Hash coding separates, allowable loss function is for generating Hash codes from different perspectives.But both moulds Type is carrying out Hash codes generation phase using repeatedly relaxation, and model can be made deviation occur in training stage negative feedback process, caused It is not accurate enough that image data retrieval is carried out using the trained model of generation.
Summary of the invention
The present invention can make model in the training stage to solve existing model in Hash codes generation phase using multiple relaxation There is the problem of deviation in negative feedback process, provides the image data method for quickly retrieving based on Hash study.
Image data method for quickly retrieving of the present invention based on Hash study, comprising the following steps:
Step 1 establishes depth Hash model:
Depth Hash model includes five convolution-pond layer, two full articulamentums, characteristic layer, Hash layer and output layer;
Step 2, training depth Hash model:
Training data is a series of data set { (p with label1, w1), (p2, w2), (p3, w3) ... (pn, wn), Middle piFor sample image, wiIt is the label of correspondence image sample;
Input is triple label { pi, pj, pk, wherein piAnd pjFor same category, piAnd pkIt is mutually similar to be different classes of Similarity distance between not is less than the similitude between different classes of;
After obtaining trained depth Hash model, using depth Hash model foundation sample database, sample database is by image sample This and corresponding Hash codes are constituted;
Step 3 is directed to query image, and the Hash codes of query image are generated using trained depth Hash model;
Step 4 is retrieved using the Hash codes and image pattern library of query image.
Further, the process that the Hash codes using query image are retrieved with image pattern library includes following Step:
If Hash codes corresponding to image are p in sample databasei={ hI, 1, hI, 2, hI, 3..., hI, m, query image is corresponding Hash codes are pquery={ hQuery, 1, hQuery, 2, hQuery, 3..., hQuery, m, then in Hamming space, the ε neighbour of query image It is expressed as NN (pquery, ε)=p | | | pquery-pi||2< ε };
Pass through | pquery-pi||2< ε obtains ε neighbour's set p of query sample;
Count the bit S of " 0 " or " 1 " large percentage in each in all Hash codes in K-NN search sample set p ={ S1,S2,S3,…,Sm},Si∈{0,1};
Count the probability P (S in K-NN search sample set p in all Hash codes in each bit for " 0 "0) ={ P (S1,0),P(S2,0),P(S3,0),…,P(Sm,0), wherein P (Si,0)∈[0,1];
P(Si,0)=∑ (Si=0, NN (pquery,ε))/count(NN(pquery, ε)), count is to meet certain in Hash codes It is the quantity of " 0 " in a bit;
Count the probability P (S in K-NN search sample set p in all Hash codes in each bit for " 1 "1) ={ P (S1,1),P(S2,1),P(S3,1),…,P(Sm,1), wherein P (Si,1)∈[0,1];
P(Si,1)=∑ (Si=1, NN (pquery,ε))/count(NN(pquery, ε)), count is to meet certain in Hash codes It is the quantity of " 1 " in a bit;
Pass through ωi=1+max (P (Si,0),P(Si,1))/m determines everybody weight ω={ ω of Hash codes12, ω3,…,ωm};
Then Hash codes p corresponding to image in everybody weight computing sample database of Hash codes is utilizediWith query image pair The Hash codes p answeredqueryWeighting Hamming distanceBy weighting Hamming distance From the image inquired in database and sequence for determining query image.
Further, ε=2 in the ε neighbour.
Further, the Hash code length that the characteristic layer length is 4 times.
Further, the Hash layer is used to constraint as constraint condition, and what which inputted is the feature of characteristic layer Vector, i.e. input are the { p to constrainti,pj,wij};wijThe sample for indicating that two feature vectors represent when=1 is similar, wij The sample for indicating that two feature vectors represent when=0 is inhomogeneous;It is F by the feature vector that characteristic layer generatesi, Fj∈Rd, Being mapped to output on hash space is bi, bj ∈ { -1,1 }m, then distH(bi,bj) Hamming space between bi and bj;Damage It is as follows to lose function:
The feature vector of sample image passes through tanh function before generating Hash codes after by Hash layer, last Hash codes are by being only final b after slack variableiAnd bj, the value before carrying out relaxation is uiAnd uj, ui, uj∈Rm; Variable u before relaxation is used in the calculating of loss functioniAnd ujInstead of Hash codes biAnd bj, loss function are as follows:
In formula, m is the length of Hash codes, and α is preference norm weight.
Further, on-line training, creation are carried out using small-scale data during the trained depth Hash model Small-scale triple is to follow following rule: (1) the selection sample number of different labels is determined from small lot, selection is minimum Exemplar number;(2) a certain label is shuffled at random, selects the anchor p of i and i+1 as triple in sampleiWith Positive example pj;(3) other exemplars i is randomly choosed as triple piNegative example pk;(4) whole labels and whole are recycled Sample generates containing anchor, positive example and bears exemplary random combine.
Present invention feature the most prominent and significant beneficial effect are:
The present invention verifies depth proposed by the present invention by the comparative experiments of completion depth Hash network structure and shuffle algorithm There is degree Hash network structure preferable superiority and shuffle algorithm to have more preferably for the image retrieval based on Hash codes Visual effect.Usually all it is to compare similitude by comparing Hamming distance mode in the research of previous hash function, works as number According to it is larger when Hamming distance discrimination can be insufficient, the present invention, as indexing, further discriminates between identical Hamming by Hash codes The similarity returned the result apart from size, obtains that similarity is higher to be returned the result.Our experiments show that the present invention is based on Hash The method of study compares other methods better performance on CIFAR-10 and NUS-WIDE.
Detailed description of the invention
Fig. 1 is depth Hash network structure;
Fig. 2 is the different classifications schematic diagram of the Sino-Kazakhstan uncommon code of neighbouring set;
Fig. 3 is CIFAR-10 comparative result figure;
Fig. 4 is NUS-WIDE comparative result figure;
Fig. 5 is visualized experiment result;
Fig. 6 is to reset Algorithm Demo experimental result;
Fig. 7 is 24bit accuracy rate.
Specific embodiment
Specific embodiment 1:
The image data method for quickly retrieving based on Hash study of present embodiment, specifically includes the following steps:
1, depth Hash model is established:
Depth Hash model includes five convolution-pond layer, two full articulamentums, characteristic layer, Hash layer and output layer;It is special Levy the feature vector of layer output certain length;Then feature vector is mapped to Hash codes by Hash layer.Model structure such as Fig. 1 It is shown, shown in design parameter table 1.
1 model parameter of table
In structure each full articulamentum by 500 × 1 neuron of single layer and activation primitive form.Wherein full articulamentum is made With being each feature for connecting intermediate features layer, the relationship between extraction feature corresponds to Hash codes difference by Hash layer Bit on, so that different sample images be made to generate the biggish Hash codes of Hamming distance.
2, training depth Hash model:
Training data is a series of data set { (p with label1, w1), (p2, w2), (p3, w3) ... (pn, wn), Middle piSample image, wiIt is the label of correspondence image sample;
Triple label { pi, pj, pkIndicate ternary constraint, relationship is closed between representative sample, under a certain kind measurement piAnd pjDistance be less than piAnd pkThe distance between;It is more preferable that ternary constrains in classifying quality in hands-on of the invention, for The adaptability of model is also more preferable.Input is triple label { pi, pj, pk, wherein piAnd pjFor same category, piAnd pkFor not Generic, the similarity distance between the same category is less than the similitude between different classes of;
In general it can select to carry out all training datas whole combinations, but the training effectiveness of model is very inefficient, Furthermore error sample can mislead the generation of model in training sample.To ensure that model can quickly converge on ternary constraint condition, The present invention carries out high-volume on-line training using small-scale data, 40 small-scale sample images is such as chosen every time, to these samples This establishes triple, this kind of method advantage is that the Sample Refreshment model parameter of each batch can be used, and prevents model Over-fitting.Creating small-scale triple is to follow following rule: (1) the selection sample of different labels is determined from small lot Number, selects least exemplar number;(2) a certain label is shuffled at random, selects i in sample and i+1 as ternary The anchor p of groupiWith positive example pj;(3) other exemplars i is randomly choosed as triple piNegative example pk;(4) circulation is whole Label and whole samples, generate containing anchor, positive example and bear exemplary random combine.Under the aid of the rule, sample ensure that Being evenly distributed for notebook data, increases randomness.
Characteristic layer: the condition of convergence of depth Hash network is that training data in the feature vector that characteristic layer exports meets ternary Group constraint condition, what which can make model extracts more expressive feature.Triple constraint is applied to spy It is exactly to be less than the Euclidean distance between the feature vector of similar sample between foreign peoples's sample that sign, which is extracted, and formula is as follows:
In formulaIndicate anchor sample,Indicate positive example sample,Indicate that negative example sample, f are the mappings by learning to obtain Sample (is mapped to feature vector from sample image) by function, and threshold indicates specific threshold for controlling positive negative sample Distance, | | | | indicate the Euclidean distance between feature vector.In formula, error when meeting inter- object distance less than between class distance It is 0, indicates to be indicated using "+" in formula there are error when being unsatisfactory for.
It is got over hour in the value of training stage threshold, loss function LosstripletBe easier to be intended to 0, anchor with just The distance between example will not be too close, and distance again will not be too far between anchor and negative example, but the model at this time obtained is more difficult Convergence.Make model further the distance between anchor and positive example when threshold is larger, zooms out between anchor and negative example Distance, so that the loss function Loss of modeltripletBe maintained at a biggish value, thus reasonable threshold value for The training of model seems particularly critical.Depth Hash network has used ternary loss function to be constrained in characteristic layer, that is, passes through Minimize LosstripleT carries out negative sense feedback network, and parameter obtains the feature with more expression power in regulating networks.
Hash layer: using to constraint in Hash layer as constraint condition, and what which inputted is the feature vector of characteristic layer, I.e. input is the { p to constrainti,pj,wij};wijThe sample for indicating that two feature vectors represent when=1 is similar, wijWhen=0 The sample for indicating that two feature vectors represent is inhomogeneous.The feature vector F generated by characteristic layeri, Fj∈Rd, it is mapped to Kazakhstan Uncommon spatially output is bi, bj ∈ { -1,1 }m, then distH(bi,bj) Hamming space between bi and bj;Loss function is such as Under:
Wherein, m is the length of Hash codes;
Loss function can be controlled between zero and one in loss function divided by m, and it is unrelated with Hash length.If not yet Have divided by m, will cause that Hash code length is longer, and loss will be bigger, result can be made more accurate in this way.
Work as wijWhen=1, to LosspairDerivation can minimize b when doing gradient declineiAnd bjBetween Hamming distance, with drop Low LosspairValue, work as wijWhen=0, the Hamming distance between bi and bj will increase.Use the loss function as constraint condition When, keep Hamming distance between generic sample Hash codes generated closer, the Chinese between different classes of the generated Hash codes of sample Prescribed distance is compared farther out, is optimal by the Hash codes that this kind of method obtains.
Dist in formulaH(bi, bj) function is discretization, since its gradient can not lead problem, conventional method can not be passed through Stochastic gradient descent is carried out, that is, can not carry out reversely adjusting model parameter.For solve loss function can not derivation ask The advantages of topic, the feature vector of sample image pass through tanh function after by Hash layer before generating Hash codes, tanh It is to be compressed in real number value between (- 1,1), it is larger for gradient value when being worth around 0, value can be made to be distributed in -1 and 1 as far as possible Around, be conducive to the generation of Hash codes.Known by the process, last Hash codes are final by being only after slack variable biAnd bj, so the value before carrying out relaxation is uiAnd uj, ui, uj∈Rm.In order to make function can during being trained It leads, variable u before relaxation is used in the calculating of loss functioniAnd ujInstead of Hash codes biAnd bj, to prevent model from training Occur the generalization ability that over-fitting improves model in journey, increases regular terms after loss function.It is used during hands-on Loss function are as follows:
α is preference norm weight in formula, and as α → 0, model is easy to appear over-fitting, as α → ∞, model meeting There is poor fitting, so suitable α value is equally most important for the training of model.
After obtaining trained depth Hash model, using depth Hash model foundation sample database, sample database is by image sample This and corresponding Hash codes are constituted;
3, it is directed to query image, the Hash codes of query image are generated using trained depth Hash model;
4, it is retrieved using the Hash codes of query image and image pattern library.
Specific embodiment 2:
Described in present embodiment using the process that the Hash codes of query image and image pattern library are retrieved include with Lower step:
The hash function that depth Hash model obtains can make each sample image in sample database have unique Hash Code { h1,h2,…,hm},hi∈{0,1}.Hamming when wanting the similar image of retrieval and inquisition sample q, with image in sample database Distance calculation formula are as follows:
In formula, distH(hi, hj) it is Hamming distance, m is the length of Hash codes.It is able to know that by formula, Hash codes In each effect it is all identical, and carry out Hash codes generating process in, each Hash codes is all single feature or more The combination of a feature shows, can be ignored when being retrieved using Hamming distance.Other than it can not carry out performance characteristic, In the retrieval for carrying out image, the search result of identical Hamming distance, which can not carry out further division, keeps search result not quasi- enough Really.Therefore, the present invention is that each Hash codes assigns its specific feature weight ωi, used when carrying out Hamming distance calculating Weighting Hamming distance is calculated, and retrieval can be made to return the result with the similarity between refined queries sample and sample database data There is higher similarity with query sample.In the present embodiment, its specific power can be assigned for each of Hash codes Value, it is assumed that in certain a kind of Sino-Kazakhstan everybody weight of code of wishing for ω={ ω123,…,ωm, then it is fixed to weight Hamming distance Justice is as follows:
The discreteness of Hamming distance is compared, weighting Hamming distance has smaller similarity measurement granularity, can be further Divide the similitude between identical Hamming distance.The method of weighting for weighting Hamming distance is numerous, and the present invention proposes that one kind is completely new and adds Power method describes in the follow-up process for each weight of Hash codes in detail to the design of weight.
If Hash codes corresponding to image are p in sample databasei={ hI, 1, hI, 2, hI, 3..., hI, m, query image is corresponding Hash codes are pquery={ hQuery, 1, hQuery, 2, hQuery, 3..., hQuery, m, then in Hamming space, the ε neighbour of query image It is expressed as
NN(pquery, ε)=p | | | pquery-pi||2< ε }
Hamming distance is simple and highly efficient for image retrieval, so to retain when being designed Hamming distance weight It is simple and efficient.It is that Hamming is being weighted based on ε neighbour in Hamming space for feature weight proposed by the invention Distance first passes through Hamming distance and retrieves ε neighbour sample set p before calculating, in set p the Hash codes of all samples with look into The Hamming distance ask between the Hash codes of sample is both less than ε, but Hash codes are different in the set, as shown in Figure 2.Such as What determines the weight of different bit Hash codes, first counts samples all in set p, counts each bit The probability of upper " 0 " and " 1 ", then using the mode of probability in the calculating query sample and sample database on the sample set Weight Hamming distance.
In all Hash codes generated for the set sample data, if P (" 1 ")iIt is " 1 " for Hash codes ith bit position Probability, if P (" 0 ")iIt is the probability of " 0 " for Hash codes ith bit position, then has following relationship:
P("1")i+P("0")i=1
Know that feature is assembled more obvious in sample set p by the relationship, most of Hash codes in sample are a certain It can be partial to determination on position.Such as sample cat is with " ear " when mainly being differentiated, when cat class data have ear in sample database Can show in a certain bits of coded when feature has high consistency.When carrying out weight design, which compares other positions It is more important.When carrying out each weight computing of Hash codes, weight is updated according to its " significance level ".
The calculating process of weight ω is as follows.
(2) process effect is in order to embody bit feature expressive forces.Separation for a certain bit in all Hash codes Degree is bigger, illustrates that the bit feature expressive force is stronger.Such as now with 10 length be 12 Hash codes, for all Hash First of code, has 9 ' 1 ' and 1 ' 0 ', second has 5 ' 1 ' and 5 ' 0 ', then the weight of first Hash codes is just Second can be higher than.
By the calculating process of weight ω it is found that weight, which mainly spends differentiation, has identical Hamming distance sample, fundamentally Remain the relationship between Hamming distance and similitude.It is as follows for the relationship between Hamming distance and weighting Hamming distance:
In formula,To weight Hamming distance, weighting Hamming distance is not destroying Hamming distance high efficiency On the basis of further refined divide rule, overcome to a certain extent with same distance sequence the problem of.
Embodiment
Utilize CIFAR-10 (A.Krizhevsky, G.Hinton.Learning Multiple Layers of Features from Tiny Images [J] .2012.) and NUS-WIDE (Zhang P, Zhang W, Li W J, et Al.Supervised hashing with latent factor models [M] .2014.) data set tested, guarantees Effective reliability of Experimental comparison.Experiment extracts 600 image patterns as experiment from one kind every in CIFAR-10 data set Data, wherein 500 image patterns are as training data, other 100 image patterns are as test data.Due to NUS- WIDE data set is multi-tag data set, thinks that they are similar samples if two sample images have a same label Data.In an experiment, using with other same calculation method, take it is preceding 5000 return sample average mAP as last Correlation data.By result as can be seen that FastH, CNNH, NINH conventional method that compares in conjunction with deep neural network have Better accuracy.In CNNH, the Hash codes by deep neural network for fitting compare other Hash learning methods Obtained Hash codes are suboptimums.By comparative experiments it can be seen that the depth hash method that this project proposes has preferably Experiment effect, with the increase of Hash code length, the module mAP of data is higher and higher.As shown in table 2, the present invention is mentioned Depth Hash model out compares other methods, increases to a certain extent.The traditional hash method of comparison, such as LSH, It is obvious that SH, ITQ promote effect.Compare other Hash learning methods, such as FastH, CNNH and NINH are in CIFAR-10 data It is all promoted on collection and NUS-WIDE data set, demonstrates Optimality of the depth Hash model of the present invention on Hash coding Energy.
Table 2 data set retrieval accuracy (mAP) Comparative result
As can be seen from Table 2, the depth Hash network model experimental result comparison that this project is proposed, CIFAR-10 data It concentrates promotion more obvious, promotes respectively 3.8%, 3.5%, 5.0% and 5.1% promotion in different bit Hash codes.? Different bit Hash codes promotions are 5%, 6.8%, 5.4% and 6.8% respectively in NUS-WIDE data set.Pass through comparative experiments It is found that the Hash codes in the different length of different data collection suffer from a degree of raising.
Feature extraction extracts the feature of image using ternary loss function, and the length for extracting feature in this experiment is same Sample is the key factor for influencing Hash codes and generating, and characteristic length is shorter to be easy over-fitting, longer characteristic length meeting in Hash layer Interference characteristic is extracted, the generation of Hash codes is influenced.The value of optimal characteristic layer length in order to obtain, by comparing different spies Levy influence of the length for final mAP result.The train length chosen in an experiment by with the Hash code length that ultimately generates It is associated, chooses " L ", " 2*L ", " 3*L ", " 4*L " and " 5*L " length respectively in an experiment and be compared, it is " L " therein It is the length for ultimately generating Hash codes, the broken line in comparison diagram respectively represents the Hash codes result of different length.
The line chart (Fig. 3 and Fig. 4) of two datasets is analyzed, it, can when characteristic layer length is 1 times of Hash codes Hash codes are obtained directly to pass through processing in the layer, but result is general.With the increase of characteristic layer length, when characteristic layer length When for 4 times of Hash code length, effect is preferable, and when being increased, partial data mAP, which will appear, slightly declines.So logical Crossing test is optimal characteristic layer length in this experiment.
Image retrieval is mainly carried out by CIFAR-10 data set in visualized experiment, which is single label data collection And the information that each sample image includes is less, can be more accurate represent certain a kind of feature, retrieval is returned As a result there is more intuitive display.Experimental principle is to return and the smallest TOP-K sample of sample retrieval Hash codes Hamming distance This return, from every a line, first is sample retrieval, returns to most similar 10 sample graphs between Hamming distance and sample retrieval Picture.As can be seen that the feature of depth Hash model extraction is different classes of compared with that can show from the sample image that retrieval returns, Generate Hash progress image retrieval based on depth Hash network model has preferably accurately from the perspective of objective classification Degree, but it is general from the similarity between the result and sample retrieval that subjective angle analysis returns, and retrieval image is partial to manage By upper similar sample, as shown in Figure 5.
In this experiment mainly for contrast verification depth Hash returns the result rearrangement, pass through the depth based on triple first Hash network model is spent for its corresponding Hash codes of CIFAR-10 data set generation, is then reset using based on feature weight Algorithm returns to search result.In this experiment exist a key parameter ε, in Hamming space distance be less than ε's as a result, Here be arranged ε=2, indicate with Hamming distance less than 2 in the range of using based on feature weight shuffle algorithm to return the result into Rearrangement returns.As shown, the result after being reset with visual angle analysis has more obvious phase with sample retrieval Same feature, it is more reasonable as returning the result.The algorithm have the characteristics that it is obvious be to discriminate between with Hamming distance and Hash codes not With return the result, so from return the result it can be seen that reset after returning the result with also non-rearranged result have it is identical Return the result.By comparing the TOP-K result that directly returns of Hamming distance and being returned the result after resetting, at first 10 The quantity of similar sample increases in returning the result, while increasing that is to say, accuracy rate is illustrated.Comparing result it can be found that There is better similarity on subjective vision, as shown in Figure 6.
After carrying out subjective determination, the accuracy rate of different K values in TOP-K returned the result would also vary from, By the accuracy rate of Experimental comparison's different K values, rule can be summed up.The K value result of TOP-K is smaller, and accuracy rate is got over after rearrangement Height, with gradually increasing for K value, exact value and the preceding exact value gap of rearrangement are progressively smaller until identical after rearrangement.From another party Face demonstrate based on quantization Hash shuffle algorithm can distinguish with identical Hash codes return the result it is similar to sample retrieval Degree comparison, accuracy rate variation are as shown in Figure 7.
By completing the comparative experiments of depth Hash network structure and shuffle algorithm, depth Hash proposed by the present invention is verified There is network structure preferable superiority and shuffle algorithm to have better vision for the image retrieval based on Hash codes Effect.Usually all it is to compare similitude by comparing Hamming distance mode in the research of previous hash function, works as data scale Hamming distance discrimination can be insufficient when larger, and the present invention, as indexing, it is big to further discriminate between identical Hamming distance by Hash codes The small similarity returned the result, obtains that similarity is higher to be returned the result.

Claims (6)

1. the image data method for quickly retrieving based on Hash study, which comprises the following steps:
Step 1 establishes depth Hash model:
Depth Hash model includes five convolution-pond layer, two full articulamentums, characteristic layer, Hash layer and output layer;
Step 2, training depth Hash model:
Training data is a series of data set { (p with label1, w1), (p2, w2), (p3, w3) ... (pn, wn), wherein pi For sample image, wiIt is the label of correspondence image sample;
Input is triple label { pi, pj, pk, wherein piAnd pjFor same category, piAnd pkTo be different classes of, the same category it Between similarity distance be less than it is different classes of between similitude;
After obtaining trained depth Hash model, using depth Hash model foundation sample database, sample database by image pattern and Corresponding Hash codes are constituted;
Step 3 is directed to query image, and the Hash codes of query image are generated using trained depth Hash model;
Step 4 is retrieved using the Hash codes and image pattern library of query image.
2. the image data method for quickly retrieving according to claim 1 based on Hash study, which is characterized in that the benefit The process retrieved with the Hash codes of query image and image pattern library the following steps are included:
If Hash codes corresponding to image are p in sample databasei={ hI, 1, hI, 2, hI, 3..., hI, m, the corresponding Hash of query image Code is pquery={ hQuery, 1, hQuery, 2, hQuery, 3..., hQuery, m, then in Hamming space, the ε neighbour of query image is indicated For NN (pquery, ε)=p | | | pquery-pi||2< ε };
Pass through | pquery-pi||2< ε obtains ε neighbour's set p of query sample;
Count the bit S={ S of " 0 " or " 1 " large percentage in each in all Hash codes in K-NN search sample set p1, S2,S3,…,Sm},Si∈{0,1};
Count the probability P (S in K-NN search sample set p in all Hash codes in each bit for " 0 "0)={ P (S1,0),P(S2,0),P(S3,0),…,P(Sm,0), wherein P (Si,0)∈[0,1];
P(Si,0)=∑ (Si=0, NN (pquery,ε))/count(NN(pquery, ε)), count is to meet some in Hash codes to compare It is the quantity of " 0 " in special position;
Count the probability P (S in K-NN search sample set p in all Hash codes in each bit for " 1 "1)={ P (S1,1),P(S2,1),P(S3,1),…,P(Sm,1), wherein P (Si,1)∈[0,1];
P(Si,1)=∑ (Si=1, NN (pquery,ε))/count(NN(pquery, ε)), count is to meet some in Hash codes to compare It is the quantity of " 1 " in special position;
Pass through ωi=1+max (P (Si,0),P(Si,1))/m determines everybody weight ω={ ω of Hash codes123,…, ωm};
Then Hash codes p corresponding to image in everybody weight computing sample database of Hash codes is utilizediKazakhstan corresponding with query image Uncommon code pqueryWeighting Hamming distanceIt is determined by weighting Hamming distance The image inquired in database and sequence of query image.
3. the image data method for quickly retrieving according to claim 2 based on Hash study, which is characterized in that the ε is close ε=2 in neighbour.
4. the image data method for quickly retrieving according to claim 3 based on Hash study, which is characterized in that the feature The Hash code length that layer length is 4 times.
5. according to claim 1,2, the 3 or 4 image data method for quickly retrieving based on Hash study, which is characterized in that The Hash layer is used to constraint as constraint condition, and what which inputted is the feature vector of characteristic layer, i.e., input is to about { the p of beami,pj,wij};wijThe sample for indicating that two feature vectors represent when=1 is similar, wijTwo features are indicated when=0 The sample that vector represents is inhomogeneous;It is F by the feature vector that characteristic layer generatesi, Fj∈Rd, it is mapped to defeated on hash space It is out bi, bj ∈ { -1,1 }m, then distH(bi,bj) Hamming space between bi and bj;Loss function is as follows:
The feature vector of sample image passes through tanh function, last Hash after by Hash layer before generating Hash codes Code is by being only final b after slack variableiAnd bj, the value before carrying out relaxation is uiAnd uj, ui, uj∈Rm;It is damaging It loses in the calculating of function using variable u before relaxationiAnd ujInstead of Hash codes biAnd bj, loss function are as follows:
In formula, m is the length of Hash codes, and α is preference norm weight.
6. the image data method for quickly retrieving according to claim 5 based on Hash study, which is characterized in that the training During depth Hash model using small-scale data carry out on-line training, create small-scale triple be follow it is following Rule: (1) it from small lot determines the selection sample number of different labels, selects least exemplar number;(2) by a certain label into Row is shuffled at random, selects the anchor p of i and i+1 as triple in sampleiWith positive example pj;(3) other label samples are randomly choosed This i is used as triple piNegative example pk;(4) whole labels and whole samples are recycled, generates and contains anchor, positive example and negative example Random combine.
CN201910415146.5A 2019-05-17 2019-05-17 Image data quick retrieval method based on Hash learning Expired - Fee Related CN110134803B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910415146.5A CN110134803B (en) 2019-05-17 2019-05-17 Image data quick retrieval method based on Hash learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910415146.5A CN110134803B (en) 2019-05-17 2019-05-17 Image data quick retrieval method based on Hash learning

Publications (2)

Publication Number Publication Date
CN110134803A true CN110134803A (en) 2019-08-16
CN110134803B CN110134803B (en) 2020-12-11

Family

ID=67571194

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910415146.5A Expired - Fee Related CN110134803B (en) 2019-05-17 2019-05-17 Image data quick retrieval method based on Hash learning

Country Status (1)

Country Link
CN (1) CN110134803B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111522903A (en) * 2020-04-01 2020-08-11 济南浪潮高新科技投资发展有限公司 Deep hash retrieval method, equipment and medium
CN111626408A (en) * 2020-05-22 2020-09-04 深圳前海微众银行股份有限公司 Hash coding method, device and equipment and readable storage medium
CN112800260A (en) * 2021-04-09 2021-05-14 北京邮电大学 Multi-label image retrieval method and device based on deep hash energy model
CN113127661A (en) * 2021-04-06 2021-07-16 中国科学院计算技术研究所 Multi-supervision medical image retrieval method and system based on cyclic query expansion
CN113190699A (en) * 2021-05-14 2021-07-30 华中科技大学 Remote sensing image retrieval method and device based on category-level semantic hash
WO2021233182A1 (en) * 2020-05-22 2021-11-25 深圳前海微众银行股份有限公司 Merkle tree updating method, apparatus and device, and readable storage medium

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7702673B2 (en) * 2004-10-01 2010-04-20 Ricoh Co., Ltd. System and methods for creation and use of a mixed media environment
US7991778B2 (en) * 2005-08-23 2011-08-02 Ricoh Co., Ltd. Triggering actions with captured input in a mixed media environment
CN103646080A (en) * 2013-12-12 2014-03-19 北京京东尚科信息技术有限公司 Microblog duplication-eliminating method and system based on reverse-order index
US8838591B2 (en) * 2005-08-23 2014-09-16 Ricoh Co., Ltd. Embedding hot spots in electronic documents
CN104317902A (en) * 2014-10-24 2015-01-28 西安电子科技大学 Image retrieval method based on local locality preserving iterative quantization hash
CN104978729A (en) * 2014-04-08 2015-10-14 华中科技大学 Image hashing method based on data sensing
CN105469096A (en) * 2015-11-18 2016-04-06 南京大学 Feature bag image retrieval method based on Hash binary code
CN105512273A (en) * 2015-12-03 2016-04-20 中山大学 Image retrieval method based on variable-length depth hash learning
CN106355608A (en) * 2016-09-09 2017-01-25 南京信息工程大学 Stereoscopic matching method on basis of variable-weight cost computation and S-census transformation
CN106484782A (en) * 2016-09-18 2017-03-08 重庆邮电大学 A kind of large-scale medical image retrieval based on the study of multinuclear Hash
CN106682233A (en) * 2017-01-16 2017-05-17 华侨大学 Method for Hash image retrieval based on deep learning and local feature fusion
CN106777388A (en) * 2017-02-20 2017-05-31 华南理工大学 A kind of multilist hashing image search method of dual compensation
JP2018028899A (en) * 2016-08-19 2018-02-22 三菱電機株式会社 Image registration method and system
US20180210896A1 (en) * 2015-07-22 2018-07-26 Hangzhou Hikvision Digital Technology Co., Ltd. Method and device for searching a target in an image
CN109472282A (en) * 2018-09-10 2019-03-15 中山大学 A kind of depth image hash method based on few training sample

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7702673B2 (en) * 2004-10-01 2010-04-20 Ricoh Co., Ltd. System and methods for creation and use of a mixed media environment
US7991778B2 (en) * 2005-08-23 2011-08-02 Ricoh Co., Ltd. Triggering actions with captured input in a mixed media environment
US8838591B2 (en) * 2005-08-23 2014-09-16 Ricoh Co., Ltd. Embedding hot spots in electronic documents
CN103646080A (en) * 2013-12-12 2014-03-19 北京京东尚科信息技术有限公司 Microblog duplication-eliminating method and system based on reverse-order index
CN104978729A (en) * 2014-04-08 2015-10-14 华中科技大学 Image hashing method based on data sensing
CN104317902A (en) * 2014-10-24 2015-01-28 西安电子科技大学 Image retrieval method based on local locality preserving iterative quantization hash
US20180210896A1 (en) * 2015-07-22 2018-07-26 Hangzhou Hikvision Digital Technology Co., Ltd. Method and device for searching a target in an image
CN105469096A (en) * 2015-11-18 2016-04-06 南京大学 Feature bag image retrieval method based on Hash binary code
CN105512273A (en) * 2015-12-03 2016-04-20 中山大学 Image retrieval method based on variable-length depth hash learning
US20180276528A1 (en) * 2015-12-03 2018-09-27 Sun Yat-Sen University Image Retrieval Method Based on Variable-Length Deep Hash Learning
JP2018028899A (en) * 2016-08-19 2018-02-22 三菱電機株式会社 Image registration method and system
CN106355608A (en) * 2016-09-09 2017-01-25 南京信息工程大学 Stereoscopic matching method on basis of variable-weight cost computation and S-census transformation
CN106484782A (en) * 2016-09-18 2017-03-08 重庆邮电大学 A kind of large-scale medical image retrieval based on the study of multinuclear Hash
CN106682233A (en) * 2017-01-16 2017-05-17 华侨大学 Method for Hash image retrieval based on deep learning and local feature fusion
CN106777388A (en) * 2017-02-20 2017-05-31 华南理工大学 A kind of multilist hashing image search method of dual compensation
CN109472282A (en) * 2018-09-10 2019-03-15 中山大学 A kind of depth image hash method based on few training sample

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
周佺: ""基于深度哈希学习的大规模图像检索技术研究"", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111522903A (en) * 2020-04-01 2020-08-11 济南浪潮高新科技投资发展有限公司 Deep hash retrieval method, equipment and medium
CN111626408A (en) * 2020-05-22 2020-09-04 深圳前海微众银行股份有限公司 Hash coding method, device and equipment and readable storage medium
CN111626408B (en) * 2020-05-22 2021-08-06 深圳前海微众银行股份有限公司 Hash coding method, device and equipment and readable storage medium
WO2021233182A1 (en) * 2020-05-22 2021-11-25 深圳前海微众银行股份有限公司 Merkle tree updating method, apparatus and device, and readable storage medium
CN113127661A (en) * 2021-04-06 2021-07-16 中国科学院计算技术研究所 Multi-supervision medical image retrieval method and system based on cyclic query expansion
CN113127661B (en) * 2021-04-06 2023-09-12 中国科学院计算技术研究所 Multi-supervision medical image retrieval method and system based on cyclic query expansion
CN112800260A (en) * 2021-04-09 2021-05-14 北京邮电大学 Multi-label image retrieval method and device based on deep hash energy model
CN113190699A (en) * 2021-05-14 2021-07-30 华中科技大学 Remote sensing image retrieval method and device based on category-level semantic hash

Also Published As

Publication number Publication date
CN110134803B (en) 2020-12-11

Similar Documents

Publication Publication Date Title
CN110134803A (en) Image data method for quickly retrieving based on Hash study
CN111814706B (en) Face recognition and attribute classification method based on multitask convolutional neural network
CN108427921A (en) A kind of face identification method based on convolutional neural networks
CN111723786B (en) Method and device for detecting wearing of safety helmet based on single model prediction
WO2020114118A1 (en) Facial attribute identification method and device, storage medium and processor
CN111753189A (en) Common characterization learning method for few-sample cross-modal Hash retrieval
CN110348416A (en) Multi-task face recognition method based on multi-scale feature fusion convolutional neural network
Bu Human motion gesture recognition algorithm in video based on convolutional neural features of training images
CN109886334A (en) A kind of shared nearest neighbor density peak clustering method of secret protection
CN109165639A (en) A kind of finger vein identification method, device and equipment
CN110633634A (en) Face type classification method, system and computer readable storage medium for traditional Chinese medicine constitution
Cui et al. Measuring dataset granularity
CN112183652A (en) Edge end bias detection method under federated machine learning environment
Weiwei Classification of sport actions using principal component analysis and random forest based on three-dimensional data
Adeniyi et al. Comparison of the performance of machine learning techniques in the prediction of employee
Yang et al. Sampling agnostic feature representation for long-term person re-identification
Zhou et al. Moving towards centers: Re-ranking with attention and memory for re-identification
CN113469288A (en) High-risk personnel early warning method integrating multiple machine learning algorithms
KR102021138B1 (en) Method and program of malicious domain classification based on artificial intelligence
Wang et al. Interpret neural networks by extracting critical subnetworks
CN116822577A (en) Data generation system, method, medium and equipment
Kumar et al. Predictive analytics on gender classification using machine learning
Assiroj et al. Measuring memetic algorithm performance on image fingerprints dataset
CN115310606A (en) Deep learning model depolarization method and device based on data set sensitive attribute reconstruction
Adeniyi et al. Comparative analysis of machine learning techniques for the prediction of employee performance

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
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: 20201211

Termination date: 20210517