CN111881312A - Image data set classification and division method - Google Patents
Image data set classification and division method Download PDFInfo
- Publication number
- CN111881312A CN111881312A CN202010722578.3A CN202010722578A CN111881312A CN 111881312 A CN111881312 A CN 111881312A CN 202010722578 A CN202010722578 A CN 202010722578A CN 111881312 A CN111881312 A CN 111881312A
- Authority
- CN
- China
- Prior art keywords
- image data
- hash
- data set
- vector
- feature
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/55—Clustering; Classification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/16—Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Physics (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Mathematical Analysis (AREA)
- Computational Mathematics (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Biophysics (AREA)
- Molecular Biology (AREA)
- General Health & Medical Sciences (AREA)
- Evolutionary Computation (AREA)
- Multimedia (AREA)
- Computational Linguistics (AREA)
- Biomedical Technology (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Algebra (AREA)
- Image Analysis (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a method for classifying and dividing an image data set, which comprises the following steps: building a pre-training model, generating a projection matrix group R, zooming the image data of the picture, and importing the image data into the pre-training model; performing feature extraction on picture image data through a pre-training model to generate a feature vector x with a certain dimensionality; performing L2 regularization on each generated feature vector x, and scaling the feature vectors into unit vectors in a high-dimensional spherical space; for each projection matrix Ri, calculating the matrix to obtain a result vector, and taking an index corresponding to the maximum value in the result vector as a hash value hi of the characteristic vector; and combining all the calculated matrix hash values hi to obtain a group of hash values, taking the group of hash values as the hashes of the image characteristic quantities, and dividing the images with the same hash values into one class. By the scheme, the image features can be effectively extracted, the image data set is accurately divided, and the probability of Hash collision is reduced.
Description
Technical Field
The invention relates to the field of deep learning image data set classification processing, in particular to an image data set classification dividing method.
Background
With the development of multimedia technology, image classification has become the key point of research in the field of computer vision, image classification is to divide images into different preset categories according to certain attributes of the images, how to effectively express the images is the key point for improving the accuracy of image classification, and the problem of selecting and extracting features is the difficult problem existing in image classification at present. With the rapid development of mobile internet, human society has entered the big data era. Although some features of the images can be extracted through traditional feature learning such as SIFT and HOG, and a good effect is achieved in image classification, the artificial feature design method has certain defects. The existing image classification technology is not accurate enough in dividing an image data set, and when a Hash algorithm is used for processing image data, the probability of Hash collision cannot be effectively reduced.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide the image data set classification and division method, which can effectively extract image features, accurately divide the image data set and reduce the probability of Hash collision.
The purpose of the invention is realized by the following technical scheme:
a method for classifying and dividing an image data set comprises the following steps:
s1, building a pre-training model, randomly generating a projection matrix group R, zooming the image data of the pictures without the classification marks, and importing the image data into the pre-training model;
s2, performing feature extraction on the imported image data without the classified pictures through a pre-training model to generate a feature vector x with a certain dimensionality;
s3, performing L2 regularization on each generated feature vector x by using a regularization formula, and scaling the feature vectors into unit vectors in a high-dimensional spherical space;
s4, for each projection matrix Ri, calculating the matrix by using a Hash function calculation formula to obtain a result vector, and taking an index corresponding to the maximum value in the result vector as a Hash value hi of the feature vector;
s5, all the hash values hi calculated by the projection matrix group R in step S4 are combined to obtain a group of hash values and the group of hash values is used as a hash of the image feature quantity, and at this time, the images having the same hash value are classified into one type.
Specifically, the size of the projection matrix set in step S1 is 2048 × B, where B is the set hash bucket size.
Specifically, the pre-training model in step S1 is a ResNet50 model.
Specifically, the size of the scaled picture image data in step S1 is 224 × 224.
Specifically, the regularization formula in step S3 is:
wherein x isiRepresenting the ith feature in the x vector.
Specifically, the hash function calculation formula in step S4 is as follows: hi ═ argmax (x × R)i)。
Specifically, the hash of the image feature vector in step S5 is represented as: hash ═ h0,h1,h2,...]。
The invention has the beneficial effects that: by the scheme, the image features can be effectively extracted, the image data set is accurately divided, and the probability of Hash collision is reduced.
Drawings
FIG. 1 is a flow chart of the method of the present invention.
FIG. 2 is a diagram of a pre-trained model architecture of the present invention.
FIG. 3 is a schematic diagram of the image feature vector classification process according to the present invention.
Detailed Description
In order to more clearly understand the technical features, objects, and effects of the present invention, embodiments of the present invention will now be described with reference to the accompanying drawings.
The image data set is classified and divided, and the classification result is that each unit belongs to a certain class, but the classification result is not allowed to belong to the class or belong to another class or is omitted. Such as classifying images as people, cats, dogs, tables, etc., the images in each class belong strictly to the class and not to the other classes, and the sum of the number of images in all classes is equal to the sum of the overall images.
In this embodiment, the present invention provides a method for classifying and dividing an image data set, mainly for an image without a classification mark, as shown in fig. 1, the method includes the following steps:
And 2, performing feature extraction on the imported image data of the non-classified pictures through a pre-training model to generate a 2048-dimensional feature vector x.
And 3, performing L2 regularization on each generated feature vector x by using a regularization formula, and scaling the feature vectors into unit vectors in a high-dimensional spherical space. Wherein the regularization formula is shown as follows:
wherein x isiRepresenting the ith feature in the x vector.
Step 5, combining all the hash values hi calculated by the projection matrix set R in step S4 to obtain a set of hash values, which are expressed as: hash ═ h0,h1,h2,...]At this time, the images having the same hash value are classified into one class.
In this embodiment, image features are extracted mainly by a pre-trained ResNet50 model, and ResNet50 is a neural network formed by stacking a series of convolutional layers, and its structure is shown in fig. 2. Each layer other than the layer [3x3maxpool,64] representing the maximum pooling layer represents one convolutional layer, and the convolutional layer represented by [7x7,64/2] represents a convolutional layer having a convolutional kernel size of 7x7, a channel number of 64, and a step size of 2, and the remaining layers have a step size of 1, and have a total of 50 layers, unless otherwise specified.
For each picture, before input, the picture is scaled to 224x224, and after feature extraction, a feature vector of 2048 dimensions is generated.
Then, for each feature vector x, using L2 regularization, after L2 regularization, the feature vector will be scaled to a unit vector in the high-dimensional spherical space.
Then, a projection matrix with a size of 2048xB is randomly generated, where B is the size of the set hash bucket. The projection matrix is globally unique, then matrix multiplication is carried out on the eigenvector and the matrix to obtain a 1xB result vector, and finally the index corresponding to the maximum numerical value in the result vector is taken as the hash value of the eigenvector.
In order to reduce the probability of hash collision, multiple projection matrices may be used for projection to obtain a set of hash values, and the eigenvectors that hold the same hash will be classified into a class, and the classification process is shown in fig. 3. By the image data dividing method, the image characteristics can be effectively extracted, the image data set can be accurately divided, and the probability of Hash collision is reduced.
The foregoing shows and describes the general principles and broad features of the present invention and advantages thereof. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are described in the specification and illustrated only to illustrate the principle of the present invention, but that various changes and modifications may be made therein without departing from the spirit and scope of the present invention, which fall within the scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.
Claims (7)
1. A method for classifying and partitioning an image data set, the method comprising the steps of:
s1, building a pre-training model, randomly generating a projection matrix group R, zooming the image data of the pictures without the classification marks, and importing the image data into the pre-training model;
s2, performing feature extraction on the imported image data without the classified pictures through a pre-training model to generate a feature vector x with a certain dimensionality;
s3, performing L2 regularization on each generated feature vector x by using a regularization formula, and scaling the feature vectors into unit vectors in a high-dimensional spherical space;
s4, for each projection matrix Ri, calculating the matrix by using a Hash function calculation formula to obtain a result vector, and taking an index corresponding to the maximum value in the result vector as a Hash value hi of the feature vector;
s5, all the hash values hi calculated by the projection matrix group R in step S4 are combined to obtain a group of hash values and the group of hash values is used as a hash of the image feature quantity, and at this time, the images having the same hash value are classified into one type.
2. The method for classifying and dividing an image data set according to claim 1, wherein the size of the projection matrix set in step S1 is 2048 × B, where B is the set hash bucket size.
3. The method as claimed in claim 1, wherein the pre-training model in step S1 is ResNet50 model.
4. The method for classifying and dividing an image data set according to claim 1, wherein the size of the scaled image data in step S1 is 224x 224.
6. The method for classifying and dividing an image data set according to claim 1, wherein the hash function in step S4 is calculated by the formula: hi ═ argmax (x × R)i)。
7. The method for classifying and dividing an image data set according to claim 1, wherein the hash of the image feature vector in step S5 is represented as: hash ═ h0,h1,h2,...]。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010722578.3A CN111881312B (en) | 2020-07-24 | 2020-07-24 | Image data set classification and division method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010722578.3A CN111881312B (en) | 2020-07-24 | 2020-07-24 | Image data set classification and division method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111881312A true CN111881312A (en) | 2020-11-03 |
CN111881312B CN111881312B (en) | 2022-07-05 |
Family
ID=73200251
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010722578.3A Active CN111881312B (en) | 2020-07-24 | 2020-07-24 | Image data set classification and division method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111881312B (en) |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2483851A1 (en) * | 2009-09-29 | 2012-08-08 | NEC Europe Ltd. | Method and system for probabilistic processing of data |
CN104182538A (en) * | 2014-09-01 | 2014-12-03 | 西安电子科技大学 | Semi-supervised hash based image retrieval method |
EP3035250A2 (en) * | 2014-12-19 | 2016-06-22 | Google, Inc. | Large-scale classification in neural networks using hashing |
CN106777038A (en) * | 2016-12-09 | 2017-05-31 | 厦门大学 | A kind of ultralow complexity image search method for retaining Hash based on sequence |
CN106815362A (en) * | 2017-01-22 | 2017-06-09 | 福州大学 | One kind is based on KPCA multilist thumbnail Hash search methods |
CN107180079A (en) * | 2017-04-28 | 2017-09-19 | 华南理工大学 | The image search method of index is combined with Hash based on convolutional neural networks and tree |
CN108108657A (en) * | 2017-11-16 | 2018-06-01 | 浙江工业大学 | A kind of amendment local sensitivity Hash vehicle retrieval method based on multitask deep learning |
CN108805157A (en) * | 2018-04-11 | 2018-11-13 | 南京理工大学 | Classifying Method in Remote Sensing Image based on the random supervision discrete type Hash in part |
CN109284411A (en) * | 2017-07-19 | 2019-01-29 | 哈尔滨工业大学深圳研究生院 | One kind being based on having supervision hypergraph discretized image binary-coding method |
CN110188227A (en) * | 2019-05-05 | 2019-08-30 | 华南理工大学 | A kind of hashing image search method based on deep learning and low-rank matrix optimization |
CN111177432A (en) * | 2019-12-23 | 2020-05-19 | 北京航空航天大学 | Large-scale image retrieval method based on hierarchical depth hash |
-
2020
- 2020-07-24 CN CN202010722578.3A patent/CN111881312B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2483851A1 (en) * | 2009-09-29 | 2012-08-08 | NEC Europe Ltd. | Method and system for probabilistic processing of data |
CN104182538A (en) * | 2014-09-01 | 2014-12-03 | 西安电子科技大学 | Semi-supervised hash based image retrieval method |
EP3035250A2 (en) * | 2014-12-19 | 2016-06-22 | Google, Inc. | Large-scale classification in neural networks using hashing |
CN106777038A (en) * | 2016-12-09 | 2017-05-31 | 厦门大学 | A kind of ultralow complexity image search method for retaining Hash based on sequence |
CN106815362A (en) * | 2017-01-22 | 2017-06-09 | 福州大学 | One kind is based on KPCA multilist thumbnail Hash search methods |
CN107180079A (en) * | 2017-04-28 | 2017-09-19 | 华南理工大学 | The image search method of index is combined with Hash based on convolutional neural networks and tree |
CN109284411A (en) * | 2017-07-19 | 2019-01-29 | 哈尔滨工业大学深圳研究生院 | One kind being based on having supervision hypergraph discretized image binary-coding method |
CN108108657A (en) * | 2017-11-16 | 2018-06-01 | 浙江工业大学 | A kind of amendment local sensitivity Hash vehicle retrieval method based on multitask deep learning |
CN108805157A (en) * | 2018-04-11 | 2018-11-13 | 南京理工大学 | Classifying Method in Remote Sensing Image based on the random supervision discrete type Hash in part |
CN110188227A (en) * | 2019-05-05 | 2019-08-30 | 华南理工大学 | A kind of hashing image search method based on deep learning and low-rank matrix optimization |
CN111177432A (en) * | 2019-12-23 | 2020-05-19 | 北京航空航天大学 | Large-scale image retrieval method based on hierarchical depth hash |
Non-Patent Citations (4)
Title |
---|
GARFIELDER007: "局部敏感哈希Locality Sensitive Hashing(LSH)之随机投影法", 《HTTPS://WWW.CNBLOGS.COM/GARFIELDER007/P/5479401.HTML》 * |
SAEHOON KIM: "ilinear Random Projections for Locality-Sensitive Binary Codes", 《2015 IEEE CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION (CVPR)》 * |
王标: "用于大规模图像检索的哈希编码方法的研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
高新: "基于哈希算法的大规模图像最近邻检索算法研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Also Published As
Publication number | Publication date |
---|---|
CN111881312B (en) | 2022-07-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107330127B (en) | Similar text detection method based on text picture retrieval | |
CN108038122B (en) | Trademark image retrieval method | |
CN108875076B (en) | Rapid trademark image retrieval method based on Attention mechanism and convolutional neural network | |
Liao et al. | An image retrieval method for binary images based on DBN and softmax classifier | |
CN110222218B (en) | Image retrieval method based on multi-scale NetVLAD and depth hash | |
CN111340123A (en) | Image score label prediction method based on deep convolutional neural network | |
CN109063719B (en) | Image classification method combining structure similarity and class information | |
CN111898703B (en) | Multi-label video classification method, model training method, device and medium | |
WO2019137185A1 (en) | Image screening method and apparatus, storage medium and computer device | |
CN110175221B (en) | Junk short message identification method by combining word vector with machine learning | |
WO2023206944A1 (en) | Semantic segmentation method and apparatus, computer device, and storage medium | |
CN106997379B (en) | Method for merging similar texts based on click volumes of image texts | |
CN114064948A (en) | Hash image retrieval method and device based on generalized average pooling strategy | |
CN110008365B (en) | Image processing method, device and equipment and readable storage medium | |
US20230072445A1 (en) | Self-supervised video representation learning by exploring spatiotemporal continuity | |
CN108304588B (en) | Image retrieval method and system based on k neighbor and fuzzy pattern recognition | |
WO2024088269A1 (en) | Character recognition method and apparatus, and electronic device and storage medium | |
CN113553326A (en) | Spreadsheet data processing method, device, computer equipment and storage medium | |
CN110210572B (en) | Image classification method, device, storage medium and equipment | |
CN111881312B (en) | Image data set classification and division method | |
Shamsi et al. | A short-term learning approach based on similarity refinement in content-based image retrieval | |
CN106529601A (en) | Image classification prediction method based on multi-task learning in sparse subspace | |
CN116861022A (en) | Image retrieval method based on combination of deep convolutional neural network and local sensitive hash algorithm | |
CN116167014A (en) | Multi-mode associated emotion recognition method and system based on vision and voice | |
CN114168770A (en) | Deep learning-based method and device for searching images by images |
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 |