CN108984642A - A kind of PRINTED FABRIC image search method based on Hash coding - Google Patents

A kind of PRINTED FABRIC image search method based on Hash coding Download PDF

Info

Publication number
CN108984642A
CN108984642A CN201810651428.0A CN201810651428A CN108984642A CN 108984642 A CN108984642 A CN 108984642A CN 201810651428 A CN201810651428 A CN 201810651428A CN 108984642 A CN108984642 A CN 108984642A
Authority
CN
China
Prior art keywords
image
printed fabric
formula
hash
layer
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
CN201810651428.0A
Other languages
Chinese (zh)
Other versions
CN108984642B (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.)
Xi'an Huode Image Technology Co ltd
Original Assignee
Xian Polytechnic 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 Xian Polytechnic University filed Critical Xian Polytechnic University
Priority to CN201810651428.0A priority Critical patent/CN108984642B/en
Publication of CN108984642A publication Critical patent/CN108984642A/en
Application granted granted Critical
Publication of CN108984642B publication Critical patent/CN108984642B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses it is a kind of based on Hash coding PRINTED FABRIC image search method, specifically: firstly, carrying out Training on ImageNet data set, obtain AlexNet network, and modify;PRINTED FABRIC database is pre-processed, fine-tuning is carried out to modified AlexNet network later, the Hash binary-coding of every image is extracted later, the Hamming distance between query image and database images two-value Hash coding is calculated, image in the m pond most like with query image is obtained;Finally, the Euclidean distance in computing pool between fc7 layers of feature vector of m image and query image, extracts a few width images corresponding with minimum euclidean distance, the highest top k image of the similarity as to be retrieved.This method has the advantages that precision is high, retrieval rate is fast, committed memory is small.

Description

A kind of PRINTED FABRIC image search method based on Hash coding
Technical field
The invention belongs to computers and technical field of machine vision, and in particular to a kind of PRINTED FABRIC based on Hash coding Image search method.
Background technique
The basic resources that PRINTED FABRIC is produced as textile enterprise, in occupation of critical role in the development of textile industry. And the retrieval of PRINTED FABRIC image is also had a wide range of applications in the field, such as stock control, online choose, patterning design Deng.How to carry out efficiently quickly retrieval to image data to meet user demand is a urgent problem to be solved.Traditional Retrieval mode is substantially based on image bottom visual signature (such as color, shape, texture) and measures between two images Similitude, but these visual signatures coding is fixed, and is lacked learning ability, can not be described the high-layer semantic information of image well, Cause search result that cannot meet user demand well.
With the important breakthrough that deep learning is obtained in computer vision field, the image retrieval based on deep learning becomes The hot spot of many scholar's researchs, also achieves certain achievement.Comparing classical is exactly to utilize AlexNet network model extraction figure The fc7 of picture is complete, and articulamentum output feature is retrieved, and can obtain good precision.But the full articulamentum output of convolutional neural networks Data are 4096 dimensions, and calculation amount is larger for large-scale image data retrieval, and EMS memory occupation and time overhead are also to use Family is not acceptant.In recent years, binary system Hash causes extensively since its memory space is small and the fast advantage of matching speed Concern, the Hamming distance calculated between two low-dimensional Hash codings can greatly reduce calculating cost and time overhead.
Summary of the invention
The purpose of the present invention is to provide a kind of PRINTED FABRIC image search methods based on Hash coding, solve existing The problem of image retrieval accuracy rate is low present in search method, consuming time is long.
The technical scheme adopted by the invention is that a kind of PRINTED FABRIC image search method based on Hash coding, specifically It follows the steps below to implement:
Step 1, Training is carried out on ImageNet data set, obtains pre-training model, i.e. AlexNet network;
Step 2, PRINTED FABRIC database is established, and batch is pre-processed;
Step 3, it modifies to the AlexNet network obtained after step 1;
Step 4, the AlexNet network obtained after step 3 is carried out using the PRINTED FABRIC database established in step 2 fine-tuning;
Step 5, the Hash binary-coding of every image is extracted using the network model that fine-tuning in step 4 is obtained, The Hamming distance between query image and database images two-value Hash coding is calculated, is obtained and query image most like m Image in pond;
Step 6, the Euclidean distance in computing pool between fc7 layers of feature vector of m image and query image, by image data Image in library presses the ascending arrangement of Euclidean distance, extracts a few width images corresponding with minimum euclidean distance, as wants The highest top k image of the similarity of retrieval.
The features of the present invention also characterized in that
In step 1, AlexNet network, including five convolutional layers and three full articulamentums, the first convolutional layer Conv1, second Convolutional layer Conv2, third convolutional layer Conv3, Volume Four lamination Conv4 and the 5th convolutional layer Conv5, the 6th full articulamentum fc6, 7th full articulamentum fc7 and eight convergent points articulamentum fc8, and the first convolutional layer to the 5th convolutional layer directly successively cascades, the 6th Full articulamentum is directly successively cascaded to eight convergent points articulamentum, and the 6th full articulamentum is directly connected on the 5th convolutional layer;The first volume Lamination to the 5th convolutional layer is characterized extract layer, and the 6th full articulamentum to eight convergent points articulamentum is characterized fused layer and classification layer.
In step 2, PRINTED FABRIC database is established, and batch is pre-processed;It is specifically implemented according to the following steps:
Step 2.1, prepare the PRINTED FABRIC image library for retrieval, manual classification is carried out to images all in library;
Step 2.2, all PRINTED FABRIC images obtained through step 2.1 are divided into training set train and test set test Two parts, training set and test set include each class of image, then according to image generic to training set and survey Examination collection image plus corresponding label generate train.txt and test.txt label file, wherein train.txt and Test.txt file is the txt formatted file comprising all Image Names in training set train and test set test, file content For " XX/X, X " format, wherein XX/X indicates image name and format, the last one X is the corresponding label of image, since 0;
Step 2.3, after step 2.2, all images are uniformly zoomed into 256*256 pixel, and all images are converted For leveldb format;
Step 2.4, after step 2.3, the mean value of training set image is calculated, corresponding mean value file is generated, for subsequent Network model training and feature extraction;Mean value file can be obtained using the file compute_image_mean.exe that caffe is carried Out;
Wherein, mean value computation formula, as shown in formula (1):
In formula (1), xiFor the pixel value for inputting the i-th width image, m is number of training.
Step 3 specifically: in the last one full articulamentum fc8 and the full articulamentum fc7 of penultimate of AlexNet network Between Hash layer is added, activation primitive selects Sigmoid, and by the LRN local acknowledgement after the original bases of volume first and second Normalization is changed to BatchNorm batch and normalizes;
The normalized calculation formula of BatchNorm, as shown in formula (2):
In step 4, using the PRINTED FABRIC database established in step 2 to the AlexNet network obtained after step 3 into Row fine-tuning, is specifically implemented according to the following steps:
Step 4.1, modified AlexNet network model input data Source and mean value path mean_file are changed For file path obtained in step 2;
First convolutional layer, the second convolutional layer carry out convolution operation after be successively normalized, ReLU activation and pondization operate, Third convolutional layer and Volume Four lamination carry out ReLU activation operation after carrying out convolution operation, after the 5th convolutional layer carries out convolution operation Carry out ReLU activation and pondization operation, the last layer full articulamentum successively carried out after convolution operation Accuracy with Softmax-loss operation;
Wherein, the activation primitive that ReLU activation uses is f (x)=max (x, 0);
Pond method use max maximum pond method, calculation method, as shown in formula (3) and formula (4):
w1=(w0+2*pad-kernel_size)/stride+1 (3);
h1=(h0+2*pad-kernel_size)/stride+1 (4);
In formula (3) and formula (4), pad is that edge expansion is defaulted as the core size that 0, kernel_size is pond, is set as 3, step-length stride are 2;w0、h0For the characteristic pattern width and height of input, w1、h1It is then the width and height of Chi Huahou;
Step 4.2, the training parameter in solver.prototxt is modified, suitable basic learning rate is set, and selects NAG replaces SGD to carry out right value update;
Step 4.3, at random extract image 227*227 sub-block or mirror image be input to after step 4.1 obtain it is modified In AlexNet network, preceding 7 layers of weight of multiplexing AlexNet model is fine-tuning, obtains the 7th layer, the 8th layer and output Weight between layer.
Step 5 specifically: mean value is carried out to the image in the database established in step 2 and is pre-processed, using in step 4 The AlexNet network model that fine-tuning is obtained extracts the Hash binary-coding of every image, is stored in database profession, right In query image, mean value is first gone, two-value Hash coding is extracted in the same way later, calculates query image and database images Hamming distance between two-value Hash coding, carries out coarse search, obtains image in the m pond most like with query image;
Wherein, the calculation formula of Hamming distance, as shown in formula (5):
In formula (5), the Hash that x, y are n is encoded,For exclusive or.
Step 6 specifically: successively fc7 layers corresponding with query image extraction to image in m pond obtained in step 5 it is defeated Feature vector out, the Euclidean distance in computing pool between fc7 layers of feature vector of m image and query image, by image data base In image press the ascending arrangement of Euclidean distance, extract a few width images corresponding with minimum euclidean distance, as to examine The highest top k image of the similarity of rope;
Wherein, Euclidean distance calculation formula, as shown in formula (6):
Si=| | Vq-Vi P|| (6);
In formula (6), VqFor query image IqFeature vector, Vi PFor the feature vector of image in i-th of pond.
The invention has the advantages that
By modifying to convolutional neural networks, can learn simultaneously input picture fc7 layer feature and corresponding Kazakhstan Uncommon coding carries out top k result queries to query image using by the retrieval mode slightly to essence, solves and directly utilizes 4096 dimensions Feature vector carries out the big and time-consuming problem of traversal queries EMS memory occupation.
Detailed description of the invention
Fig. 1 is a kind of flow chart of the PRINTED FABRIC image search method based on Hash coding of the present invention;
Fig. 2 is a kind of AlexNet of PRINTED FABRIC image search method based on Hash coding of the present invention and Hash is added The structure chart of layer;
Fig. 3 is to be obtained in a kind of PRINTED FABRIC image search method based on Hash coding of the present invention using fine-tuning The model realization arrived is by slightly to smart grading search schematic diagram;
Fig. 4 be the present invention it is a kind of based on Hash coding PRINTED FABRIC image search method in PRINTED FABRIC data set 48 Position and 128 Hash encode lower 5 search result figure of top;
Fig. 5 is to be realized in a kind of PRINTED FABRIC image search method based on Hash coding of the present invention using distinct methods 5 search result figure of top;
Fig. 6 is a kind of 5 top on Network data set of the PRINTED FABRIC image search method based on Hash coding of the present invention Search result figure;
Fig. 7 be in a kind of PRINTED FABRIC image search method based on Hash coding of the present invention in the case where 128 Hash encode The retrieval precision curve graph of different hash algorithms.
Specific embodiment
The following describes the present invention in detail with reference to the accompanying drawings and specific embodiments.
A kind of PRINTED FABRIC image search method based on Hash coding of the present invention, as shown in Figure 1, specifically according to following step It is rapid to implement:
Step 1, Training is carried out on ImageNet data set, obtains pre-training model, i.e. AlexNet network;
Wherein, AlexNet network includes five convolutional layers and three full articulamentums, the first convolutional layer Conv1, the second convolution Layer Conv2, third convolutional layer Conv3, Volume Four lamination Conv4 and the 5th convolutional layer Conv5, the 6th full articulamentum fc6, the 7th Full articulamentum fc7 and eight convergent points articulamentum fc8, and the first convolutional layer to the 5th convolutional layer directly successively cascades, and the 6th connects entirely It connects layer and is directly successively cascaded to eight convergent points articulamentum, the 6th full articulamentum is directly connected on the 5th convolutional layer;First convolutional layer It is characterized extract layer to the 5th convolutional layer, the 6th full articulamentum to eight convergent points articulamentum is characterized fused layer and classification layer;
Step 2, PRINTED FABRIC database is established, and batch is pre-processed;It is specifically implemented according to the following steps:
Step 2.1, prepare the PRINTED FABRIC image library for retrieval, manual classification is carried out to images all in library;
Step 2.2, two portions training set train and test set test will be divided into through the PRINTED FABRIC image in step 2.1 Point, training set and test set include each class of image, then according to image generic to training set and test set Image generates train.txt and test.txt label file plus corresponding label, wherein train.txt and test.txt file For the txt formatted file comprising all Image Names in training set train and test set test, file content is " XX/X, X " lattice Formula, wherein XX/X indicates image name and format, the last one X is the corresponding label of image, since 0;Such as 00012.jpg 0,00236.jpg 1,00682.jpg 3 respectively indicates the image and belongs to the 1st class, the 2nd class, the 4th class;
Step 2.3, after step 2.2, all images are uniformly zoomed into 256*256 pixel, and all images are converted For leveldb format;
Step 2.4, after step 2.3, the mean value of training set image is calculated, corresponding mean value file is generated, for subsequent Network model training and feature extraction;Mean value file is obtained using the file compute_image_mean.exe that caffe is carried;
Wherein, mean value computation formula, as shown in formula (1):
In formula (1), xiFor the pixel value for inputting the i-th width image, m is number of training;
Step 3, it modifies to the AlexNet network obtained after step 1, specifically: in the last of AlexNet network Hash layer is added between one full articulamentum (fc8) and the full articulamentum of penultimate (fc7), activation primitive selects Sigmoid, And the LRN local acknowledgement normalization after the original bases of volume first and second is changed to BatchNorm batch and is normalized, to improve Network convergence, while the dependence of the regularization to other forms is eliminated, it effectively prevent " gradient disperse ", AlexNet network knot The network structure of Hash layer is added as shown in module 2 in Fig. 2 as shown in module 1 in Fig. 2 in structure;
What normalization BatchNorm was solved is that in the training process, the distribution of data changes situation;Its principle is in network Upper one layer is input to before next layer, and output is normalized, and makes mean value 0, variance 1, what concrete operations used Formula, as shown in formula (2):
Meanwhile BatchNorm layers in order not to destroying the feature that this layer learns, and has used transformation to reconstruct, introducing can learn Parameter γ, β, whenβ(i)=E [x(i)] when, this layer of feature learnt originally can be restored;
The process of BatchNorm method is:
Input: mini-batch: Β={ x of Values of x over a1...m, it can learning parameter γ, β
Output: { yi=BNγ,β(xi)}
It can obtain following data: training sample mean value:Training sample variance:Normalization:As a result:
Wherein, xiFor input sample;M is training sample sum;ε is denominator added value, prevents from occurring divided by when variance except 0 Operation, is defaulted as 1e-5;
Step 4, the AlexNet network obtained after step 3 is carried out using the PRINTED FABRIC database established in step 2 Fine-tuning is specifically implemented according to the following steps:
Step 4.1, modified AlexNet network model input data Source and mean value path mean_file are changed For file path obtained in step 2;
First convolutional layer, the second convolutional layer carry out convolution operation after be successively normalized, ReLU activation and pondization operate, Third convolutional layer and Volume Four lamination carry out ReLU activation operation after carrying out convolution operation, after the 5th convolutional layer carries out convolution operation Carry out ReLU activation and pondization operation, the last layer full articulamentum successively carried out after convolution operation Accuracy with Softmax-loss operation;
Wherein, the activation primitive that ReLU activation uses is f (x)=max (x, 0);
Pond method use max maximum pond method, calculation method, as shown in formula (3) and formula (4):
w1=(w0+2*pad-kernel_size)/stride+1 (3);
h1=(h0+2*pad-kernel_size)/stride+1 (4);
In formula (3) and formula (4), pad is that edge expansion is defaulted as the core size that 0, kernel_size is pond, is set as 3, step-length stride are 2;w0、h0For the characteristic pattern width and height of input, w1、h1It is then the width and height of Chi Huahou;
Step 4.2, the training parameter in solver.prototxt is modified, suitable basic learning rate is set, and selects NAG replaces SGD to carry out right value update;
Step 4.3, at random extract image 227*227 sub-block or mirror image be input to after step 4.1 obtain it is modified In AlexNet network, preceding 7 layers of weight of multiplexing AlexNet model is fine-tuning, obtains the 7th layer, the 8th layer and output Weight between layer;
Step 5, mean value is carried out to the image in the database established in step 2 to pre-process, utilize fine- in step 4 The network model that tuning is obtained extracts the Hash binary-coding of every image, is stored in database profession, for query image, first Mean value is gone, extracts two-value Hash coding in the same way later, query image is calculated and database images two-value Hash encodes Between Hamming distance, carry out coarse search, obtain image in the m pond most like with query image;
Wherein, Hamming distance corresponds to the number that value difference position is encoded on position between any two binary-coding, such as: It (00) is 1 with the Hamming distance of (01), the Hamming distance of (110) and (101) is 2;
The calculation formula of Hamming distance, as shown in formula (5):
In formula (5), the Hash that x, y are n is encoded,For exclusive or;
Step 6, successively fc7 layers of output feature corresponding with query image extraction to image in m pond obtained in step 5 Vector, the Euclidean distance in computing pool between fc7 layers of feature vector of m image and query image, by the figure in image data base As pressing the ascending arrangement of Euclidean distance, after sequence, a few width images corresponding with minimum euclidean distance are extracted, such as Fig. 3 institute Show, the highest top k image of the similarity as to be retrieved;Wherein, Euclidean distance calculation formula, as shown in formula (6):
Si=| | Vq-Vi P|| (6);
In formula (6), VqFor query image IqFeature vector, Vi PFor the feature vector of image in i-th of pond.
Hash layer is added in method of the invention in AlexNet network, be associated with by neuron fc7 layer 4096 tieed up it is defeated It is compressed into 01 binary set an of low-dimensional out, is searched in the database using two-value Hash coding later identical as query image Or image in similar pond, and the distance between 4096 dimensional feature vectors of image in query image and pond are calculated, after rearrangement To final search result.Compared with the conventional method, this to be encoded based on Hash by the image search method of essence, slightly there is essence The advantage that degree is high, retrieval rate is fast, committed memory is small;Meanwhile NAG and BatchNorm optimization algorithm is used in this method, While improving network convergence, " gradient disperse " can effectively prevent.
Embodiment
The present embodiment is to carry out experimental evaluation for PRINTED FABRIC data set, and wherein the fine-tuning stage uses data Collection includes 2640 images, is opened including training set 2400, test set 240 is opened.
Wherein, two query images respectively in the case where 48 and 128 Hash encode, tie by the retrieval of top 5 on PRINTED FABRIC data set Fruit sample, as shown in figure 4, learning that 128 Hash codes can be retrieved preferably on PRINTED FABRIC data set by experimental analysis With query image classification and semantic similar image, tested so present invention selection carries out experimental analysis in the case where 128 Hash encode Card;
The method of the present invention use the network model after fine-tuning extract fc7 layers of output feature vector (fc7 feature to Amount), 128 Hash codes and the 5 search result figure of top for individually extracting using AlexNet convolutional neural networks fc7 layers, such as Fig. 5 It is shown, retrieval mean accuracy (mAP) and F1-score of the above method on PRINTED FABRIC data set, as shown in table 1, In, mAP value calculating process is broadly divided into two steps, and the first step calculates Average Accuracy AP, it is assumed that returns to K phase by searching system Image is closed, position is respectively x1,x2,...,xk, then the Average Accuracy AP of single classificationiIt indicates are as follows:
Second step carries out arithmetic average to AP, and definition image category number is M, then mAP are as follows:
F1-score is the coordination average value of precision ratio P and recall ratio R, and F1 value is higher to illustrate comparison ideal, Calculation is as follows:
MAP and F1-score on 1 PRINTED FABRIC data set of table
It can be seen according to 5 result of top of above method retrieval and 1 data of table is utilized respectively to two images in Fig. 5 Out, the top k result images that method proposed by the present invention retrieves are more accurate, next is single use fc7 layers of output vector It is no doubt close with proposition method of the present invention to be used alone fc7 layers of feature vector search result, but calculates two images for search result Between 4096 dimensional feature vectors between Euclidean distance need time-consuming 153.72ms, and calculate between two 128 Hash encode Hamming distance only need 0.24ms, it is time-consuming that this is greatly saved retrieval in time, and can very great Cheng using Hash coding Memory consumption is reduced on degree.
The top 5 of flowers image return is retrieved on Network data set for the method for the present invention as a result, as shown in fig. 6, it is proved The method of the present invention can also reach retrieval effectiveness well on other data sets, have certain universality.
In order to assess the retrieval performance of proposition method of the present invention, and it is compared with existing hash algorithm, PRINTED FABRIC number According to average retrieval precision value (mAP) of the collection under different Hash number of encoding bits, as shown in table 2:
Average retrieval precision value of the 2 PRINTED FABRIC data set of table under different Hash number of encoding bits
As shown in Table 2, compared with several frequently seen hash algorithm, the method for the present invention is averagely examined on PRINTED FABRIC data set Suo Jingdu is optimal.
As shown in fig. 7, top k retrieval precision curve graph of the different hash algorithms on PRINTED FABRIC data set, wherein make It is encoded with 128 Hash, and calculates the similitude between image using Hamming distance, as shown in Figure 7, the method for the present invention is obviously excellent In other hash algorithms.

Claims (7)

1. a kind of PRINTED FABRIC image search method based on Hash coding, which is characterized in that be specifically implemented according to the following steps:
Step 1, Training is carried out on ImageNet data set, obtains pre-training model, i.e. AlexNet network;
Step 2, PRINTED FABRIC database is established, and batch is pre-processed;
Step 3, it modifies to the AlexNet network obtained after step 1;
Step 4, the AlexNet network obtained after step 3 is carried out using the PRINTED FABRIC database established in step 2 fine-tuning;
Step 5, the Hash binary-coding of every image is extracted using the network model that fine-tuning in step 4 is obtained, and is calculated Hamming distance between query image and database images two-value Hash coding, obtains in the m pond most like with query image Image;
Step 6, the Euclidean distance in computing pool between fc7 layers of feature vector of m image and query image, will be in image data base Image press the ascending arrangement of Euclidean distance, extract a few width images corresponding with minimum euclidean distance, as to retrieve The highest top k image of similarity.
2. a kind of PRINTED FABRIC image search method based on Hash coding according to claim 1, which is characterized in that institute It states in step 1, AlexNet network, including five convolutional layers and three full articulamentums, the first convolutional layer Conv1, the second convolutional layer Conv2, third convolutional layer Conv3, Volume Four lamination Conv4 and the 5th convolutional layer Conv5, the 6th full articulamentum fc6, the 7th are entirely Articulamentum fc7 and eight convergent points articulamentum fc8, and the first convolutional layer to the 5th convolutional layer directly successively cascades, the 6th full connection Layer is directly successively cascaded to eight convergent points articulamentum, and the 6th full articulamentum is directly connected on the 5th convolutional layer;First convolutional layer is extremely 5th convolutional layer is characterized extract layer, and the 6th full articulamentum to eight convergent points articulamentum is characterized fused layer and classification layer.
3. a kind of PRINTED FABRIC image search method based on Hash coding according to claim 1, which is characterized in that institute It states in step 2, establishes PRINTED FABRIC database, and batch is pre-processed;It is specifically implemented according to the following steps:
Step 2.1, prepare the PRINTED FABRIC image library for retrieval, manual classification is carried out to images all in library;
Step 2.2, all PRINTED FABRIC images obtained through step 2.1 are divided into training set train and test set test two A part, training set and test set include each class of image, then according to image generic to training set and test The image of collection generates train.txt and test.txt label file plus corresponding label, wherein train.txt and test.txt File be the txt formatted file comprising all Image Names in training set train and test set test, file content be " XX/X, X " format, wherein XX/X indicates image name and format, the last one X is the corresponding label of image, since 0;
Step 2.3, after step 2.2, all images are uniformly zoomed into 256*256 pixel, and all images are converted to Leveldb format;
Step 2.4, after step 2.3, the mean value of training set image is calculated, corresponding mean value file is generated, be used for subsequent network Model training and feature extraction;Mean value file can be obtained using the file compute_image_mean.exe that caffe is carried;
Wherein, mean value computation formula, as shown in formula (1):
In formula (1), xiFor the pixel value for inputting the i-th width image, m is number of training.
4. a kind of PRINTED FABRIC image search method based on Hash coding according to claim 1, which is characterized in that institute State step 3 specifically: add between the last one full articulamentum fc8 and the full articulamentum fc7 of penultimate of AlexNet network Enter Hash layer, activation primitive selects Sigmoid, and the LRN local acknowledgement after the original bases of volume first and second is normalized BatchNorm batch is changed to normalize;
The normalized calculation formula of BatchNorm, as shown in formula (2):
5. a kind of PRINTED FABRIC image search method based on Hash coding according to claim 1, which is characterized in that institute It states in step 4, the AlexNet network obtained after step 3 is carried out using the PRINTED FABRIC database established in step 2 Fine-tuning is specifically implemented according to the following steps:
Step 4.1, modified AlexNet network model input data Source and mean value path mean_file are changed to walk File path obtained in rapid 2;
It is successively normalized after first convolutional layer, the second convolutional layer progress convolution operation, ReLU activation and pondization operate, third Convolutional layer and Volume Four lamination carry out ReLU activation operation after carrying out convolution operation, and the 5th convolutional layer carries out after carrying out convolution operation ReLU activation and pondization operation, the full articulamentum of the last layer have successively carried out Accuracy and Softmax- after carrying out convolution operation Loss operation;
Wherein, the activation primitive that ReLU activation uses is f (x)=max (x, 0);
Pond method use max maximum pond method, calculation method, as shown in formula (3) and formula (4):
w1=(w0+2*pad-kernel_size)/stride+1 (3);
h1=(h0+2*pad-kernel_size)/stride+1 (4);
In formula (3) and formula (4), pad is that edge expansion is defaulted as the core size that 0, kernel_size is pond, is set as 3, step Long stride is 2;w0、h0For the characteristic pattern width and height of input, w1、h1It is then the width and height of Chi Huahou;
Step 4.2, the training parameter in solver.prototxt is modified, suitable basic learning rate is set, and selects NAG generation Right value update is carried out for SGD;
Step 4.3, at random extract image 227*227 sub-block or mirror image be input to after step 4.1 obtain it is modified In AlexNet network, preceding 7 layers of weight of multiplexing AlexNet model is fine-tuning, obtains the 7th layer, the 8th layer and output Weight between layer.
6. a kind of PRINTED FABRIC image search method based on Hash coding according to claim 1, which is characterized in that institute State step 5 specifically: mean value is carried out to the image in the database established in step 2 and is pre-processed, fine- in step 4 is utilized The AlexNet network model that tuning is obtained extracts the Hash binary-coding of every image, is stored in database profession, for inquiry Image first goes mean value, extracts two-value Hash coding in the same way later, calculates query image and database images two-value is breathed out Hamming distance between uncommon coding, carries out coarse search, obtains image in the m pond most like with query image;
Wherein, the calculation formula of Hamming distance, as shown in formula (5):
In formula (5), the Hash that x, y are n is encoded,For exclusive or.
7. a kind of PRINTED FABRIC image search method based on Hash coding according to claim 1, which is characterized in that institute State step 6 specifically: successively fc7 layers of output feature corresponding with query image extraction to image in m pond obtained in step 5 Vector, the Euclidean distance in computing pool between fc7 layers of feature vector of m image and query image, by the figure in image data base As pressing the ascending arrangement of Euclidean distance, a few width images corresponding with minimum euclidean distance, the phase as to be retrieved are extracted Like the highest top k image of degree;
Wherein, Euclidean distance calculation formula, as shown in formula (6):
Si=| | Vq-Vi P|| (6);
In formula (6), VqFor query image IqFeature vector, Vi PFor the feature vector of image in i-th of pond.
CN201810651428.0A 2018-06-22 2018-06-22 Printed fabric image retrieval method based on Hash coding Active CN108984642B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810651428.0A CN108984642B (en) 2018-06-22 2018-06-22 Printed fabric image retrieval method based on Hash coding

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810651428.0A CN108984642B (en) 2018-06-22 2018-06-22 Printed fabric image retrieval method based on Hash coding

Publications (2)

Publication Number Publication Date
CN108984642A true CN108984642A (en) 2018-12-11
CN108984642B CN108984642B (en) 2021-07-27

Family

ID=64538064

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810651428.0A Active CN108984642B (en) 2018-06-22 2018-06-22 Printed fabric image retrieval method based on Hash coding

Country Status (1)

Country Link
CN (1) CN108984642B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109740674A (en) * 2019-01-07 2019-05-10 京东方科技集团股份有限公司 A kind of image processing method, device, equipment and storage medium
CN109753582A (en) * 2018-12-27 2019-05-14 西北工业大学 The method of magnanimity photoelectricity ship images quick-searching based on Web and database
CN110069644A (en) * 2019-04-24 2019-07-30 南京邮电大学 A kind of compression domain large-scale image search method based on deep learning
CN110210567A (en) * 2019-06-06 2019-09-06 广州瑞智华创信息科技有限公司 A kind of image of clothing classification and search method and system based on convolutional neural networks
CN111177446A (en) * 2019-12-12 2020-05-19 苏州科技大学 Method for searching footprint image
CN111597367A (en) * 2020-05-18 2020-08-28 河北工业大学 Three-dimensional model retrieval method based on view and Hash algorithm
CN112150445A (en) * 2020-09-27 2020-12-29 西安工程大学 Yarn hairiness detection method based on Bayesian threshold
CN112256895A (en) * 2020-10-16 2021-01-22 江南大学 Fabric image retrieval method based on multi-task learning
CN112650877A (en) * 2021-01-20 2021-04-13 北京工业大学 High-definition remote sensing image fast retrieval method based on improved depth residual convolution neural network and depth hash

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170293838A1 (en) * 2016-04-06 2017-10-12 Nec Laboratories America, Inc. Deep high-order exemplar learning for hashing and fast information retrieval
CN107256246A (en) * 2017-06-06 2017-10-17 西安工程大学 PRINTED FABRIC image search method based on convolutional neural networks
CN107330074A (en) * 2017-06-30 2017-11-07 中国科学院计算技术研究所 The image search method encoded based on deep learning and Hash
CN107679250A (en) * 2017-11-01 2018-02-09 浙江工业大学 A kind of multitask layered image search method based on depth own coding convolutional neural networks
CN107943938A (en) * 2017-11-23 2018-04-20 清华大学 A kind of large-scale image similar to search method and system quantified based on depth product

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170293838A1 (en) * 2016-04-06 2017-10-12 Nec Laboratories America, Inc. Deep high-order exemplar learning for hashing and fast information retrieval
CN107256246A (en) * 2017-06-06 2017-10-17 西安工程大学 PRINTED FABRIC image search method based on convolutional neural networks
CN107330074A (en) * 2017-06-30 2017-11-07 中国科学院计算技术研究所 The image search method encoded based on deep learning and Hash
CN107679250A (en) * 2017-11-01 2018-02-09 浙江工业大学 A kind of multitask layered image search method based on depth own coding convolutional neural networks
CN107943938A (en) * 2017-11-23 2018-04-20 清华大学 A kind of large-scale image similar to search method and system quantified based on depth product

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HANJIANG LAI; YAN PAN; YE LIU; SHUICHENG YAN: ""Simultaneous Feature Learning and Hash Coding with Deep Neural Networks"", 《2015 IEEE CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION (CVPR)》 *
彭天强;栗芳: ""基于深度卷积神经网络和二进制哈希学习的图像检索方法"", 《电子与信息学报》 *

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109753582A (en) * 2018-12-27 2019-05-14 西北工业大学 The method of magnanimity photoelectricity ship images quick-searching based on Web and database
CN109740674A (en) * 2019-01-07 2019-05-10 京东方科技集团股份有限公司 A kind of image processing method, device, equipment and storage medium
CN109740674B (en) * 2019-01-07 2021-01-22 京东方科技集团股份有限公司 Image processing method, device, equipment and storage medium
CN110069644A (en) * 2019-04-24 2019-07-30 南京邮电大学 A kind of compression domain large-scale image search method based on deep learning
CN110069644B (en) * 2019-04-24 2023-06-06 南京邮电大学 Compressed domain large-scale image retrieval method based on deep learning
CN110210567A (en) * 2019-06-06 2019-09-06 广州瑞智华创信息科技有限公司 A kind of image of clothing classification and search method and system based on convolutional neural networks
CN111177446B (en) * 2019-12-12 2023-04-25 苏州科技大学 Method for searching footprint image
CN111177446A (en) * 2019-12-12 2020-05-19 苏州科技大学 Method for searching footprint image
CN111597367A (en) * 2020-05-18 2020-08-28 河北工业大学 Three-dimensional model retrieval method based on view and Hash algorithm
CN111597367B (en) * 2020-05-18 2023-11-24 河北工业大学 Three-dimensional model retrieval method based on view and hash algorithm
CN112150445A (en) * 2020-09-27 2020-12-29 西安工程大学 Yarn hairiness detection method based on Bayesian threshold
CN112150445B (en) * 2020-09-27 2023-12-15 西安工程大学 Yarn hairiness detection method based on Bayes threshold
CN112256895A (en) * 2020-10-16 2021-01-22 江南大学 Fabric image retrieval method based on multi-task learning
CN112650877A (en) * 2021-01-20 2021-04-13 北京工业大学 High-definition remote sensing image fast retrieval method based on improved depth residual convolution neural network and depth hash
CN112650877B (en) * 2021-01-20 2024-06-25 北京工业大学 High-definition remote sensing image quick retrieval method based on improved depth residual convolution neural network and depth hash

Also Published As

Publication number Publication date
CN108984642B (en) 2021-07-27

Similar Documents

Publication Publication Date Title
CN108984642A (en) A kind of PRINTED FABRIC image search method based on Hash coding
CN111198959B (en) Two-stage image retrieval method based on convolutional neural network
CN108038122B (en) Trademark image retrieval method
CN108280187B (en) Hierarchical image retrieval method based on depth features of convolutional neural network
CN104036012B (en) Dictionary learning, vision bag of words feature extracting method and searching system
CN108920720A (en) The large-scale image search method accelerated based on depth Hash and GPU
CN106126581A (en) Cartographical sketching image search method based on degree of depth study
CN108595636A (en) The image search method of cartographical sketching based on depth cross-module state correlation study
CN108875076B (en) Rapid trademark image retrieval method based on Attention mechanism and convolutional neural network
CN110929080B (en) Optical remote sensing image retrieval method based on attention and generation countermeasure network
CN107256246A (en) PRINTED FABRIC image search method based on convolutional neural networks
CN110059206A (en) A kind of extensive hashing image search method based on depth representative learning
CN103778227A (en) Method for screening useful images from retrieved images
CN108304573A (en) Target retrieval method based on convolutional neural networks and supervision core Hash
CN103714148B (en) SAR image search method based on sparse coding classification
CN110457514A (en) A kind of multi-tag image search method based on depth Hash
CN106557579A (en) A kind of vehicle model searching system and method based on convolutional neural networks
CN108491430A (en) It is a kind of based on the unsupervised Hash search method clustered to characteristic direction
CN113377981B (en) Large-scale logistics commodity image retrieval method based on multitask deep hash learning
Hu et al. Delving into deep representations for remote sensing image retrieval
CN109977250A (en) Merge the depth hashing image search method of semantic information and multistage similitude
CN107958067A (en) It is a kind of based on without mark Automatic Feature Extraction extensive electric business picture retrieval system
CN110598022B (en) Image retrieval system and method based on robust deep hash network
CN115222998B (en) Image classification method
CN113032613B (en) Three-dimensional model retrieval method based on interactive attention convolution neural network

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240410

Address after: 710000, No. 5, Door 2, 6th Floor, No. 6 Xinke Road, Xincheng District, Xi'an City, Shaanxi Province

Patentee after: Zhao Jin

Country or region after: China

Patentee after: Gao Yuan

Patentee after: Kang Xuejuan

Address before: 710048 No. 19 Jinhua South Road, Shaanxi, Xi'an

Patentee before: XI'AN POLYTECHNIC University

Country or region before: China

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240507

Address after: Room D902, 9th Floor, Building 3, Beilin Science and Technology Industrial Park, No. 33 Torch Road, Beilin District, Xi'an City, Shaanxi Province, 710000

Patentee after: XI'AN HUODE IMAGE TECHNOLOGY Co.,Ltd.

Country or region after: China

Address before: 710000, No. 5, Door 2, 6th Floor, No. 6 Xinke Road, Xincheng District, Xi'an City, Shaanxi Province

Patentee before: Zhao Jin

Country or region before: China

Patentee before: Gao Yuan

Patentee before: Kang Xuejuan