CN111079790B - Image classification method for constructing class center - Google Patents

Image classification method for constructing class center Download PDF

Info

Publication number
CN111079790B
CN111079790B CN201911129753.1A CN201911129753A CN111079790B CN 111079790 B CN111079790 B CN 111079790B CN 201911129753 A CN201911129753 A CN 201911129753A CN 111079790 B CN111079790 B CN 111079790B
Authority
CN
China
Prior art keywords
image
center
class
vectors
vector
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.)
Active
Application number
CN201911129753.1A
Other languages
Chinese (zh)
Other versions
CN111079790A (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.)
Shenzhen International Graduate School of Tsinghua University
Original Assignee
Shenzhen International Graduate School of Tsinghua 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 Shenzhen International Graduate School of Tsinghua University filed Critical Shenzhen International Graduate School of Tsinghua University
Priority to CN201911129753.1A priority Critical patent/CN111079790B/en
Publication of CN111079790A publication Critical patent/CN111079790A/en
Application granted granted Critical
Publication of CN111079790B publication Critical patent/CN111079790B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computational Linguistics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Image Analysis (AREA)

Abstract

An image classification method for constructing a class center, comprising: extracting image feature vectors, and constructing category center vectors in a feature space; taking Euclidean distance between the image feature vector and the category center vector as a classification basis to classify the image features; calculating the dispersion degree of different categories according to the Euclidean distance between every two category center vectors; and calculating a loss function of the network according to the classification result and the dispersion degree of different categories, and learning the network parameters and the center vector by using the loss function. The image classification method has the characteristic of controlling the distances between the classes, and the method controls the distances between the classes by directly constructing the class center, so that the distribution of the image features is more beneficial to classification, and a better classification effect is obtained. Compared with the prior art, the method can lead the characteristics extracted by the network to have better intra-class and inter-class distribution characteristics.

Description

Image classification method for constructing class center
Technical Field
The invention relates to the field of computer vision and image processing, in particular to an image classification method.
Background
Image classification is a traditional computer vision problem, and refers to inputting a picture into a computer, and the computer identifies the category of objects in the picture, for example, whether a cat or a dog is identified in the picture. The problem of image classification has many applications in practical scenarios, such as face recognition used in the entrance/exit customs, and it is required to recognize whether the face in the camera and the face picture in the database belong to the same person.
Before deep learning is applied to image classification, conventional image recognition adopts a pattern recognition method, and mainly comprises three parts of image feature acquisition, classifier training and image prediction. The acquisition of the image features represents that the image features which can be used for a classifier are obtained from the image, and the common image features are in the form of high-dimensional vectors; the input of the classifier is image characteristics, the output is the classifying effect, the classifier contains unknown trainable parameters, the parameters of the classifier can be continuously optimized by utilizing a training set, the training set comprises labels of each image, namely the types of objects in the pictures, and the training process can enable the classifier to learn classifying priori information in the training set; after the classifier is trained, a picture of an unknown label can be input, and the class of the picture is output through calculation of the classifier.
Along with development of hardware resources and research of algorithm theory, deep learning is applied to related problems of computer images in a large number, image features are extracted by adopting a multi-layer convolutional neural network method, and the multi-layer convolutional network contains a large number of trainable parameters which are trained by means of training sets. After extracting the features, the image needs to be classified by using a classifier, the image features are classified by using a full-connection layer and a softmax function in deep learning, and the probability that the features belong to each class can be calculated. Training of the network requires a loss function, the cross entropy loss function being most commonly used in classification problems.
Features extracted by a common deep learning image classification method are separable in a high-dimensional space, but the situation that the intra-class distance is larger than the inter-class distance possibly occurs, and when two unknown classified pictures are given to judge whether the two unknown classified pictures belong to the same class, an effective judging threshold cannot be selected. The existing method adopts a full connection layer for classification, and essentially depends on the mode and angle characteristics of the characteristics in a high-dimensional space. Similarly, euclidean distances may be used as a basis for classification in a high dimensional space, and a loss function of the network is calculated based on the Euclidean distances.
The foregoing background is only for the purpose of facilitating an understanding of the inventive concepts and technical aspects of the invention and is not necessarily prior art to the present application, but is not intended to be used to evaluate the novelty and creativity of the present application in the event that no clear evidence indicates that such is already disclosed at the filing date of the present application.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a deep learning image classification method based on a construction type center.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
a deep learning image classification method based on a construction category center comprises the following steps:
1) Inputting a training image, extracting feature vectors of the image by using a multi-layer convolutional neural network, wherein the feature vectors of the image are high-dimensional vectors distributed in a high-dimensional feature space, and meanwhile, constructing center vectors of different categories in the feature space, wherein the center vectors are consistent with the feature vector dimensions of the image;
2) Calculating Euclidean distances between the feature vector of the image and the center vectors of different categories, and taking the category of the center vector with the smallest distance as the category of the feature vector of the image;
3) Calculating the dispersion degree of the feature vector distribution of the images of different categories according to the Euclidean distance between the center vectors of each category;
4) Calculating probability scores of the images belonging to each class according to Euclidean distances between the feature vectors of the images and the center vectors of the classes, and introducing allowance parameters in the probability score calculation to control the intra-class distances;
5) And calculating a network loss function, and updating the values of the network weights and the center vectors of the categories by using a method of inverse gradient propagation.
Further:
in the step 1), the constructed class center vector is a trainable parameter, the class center vector is initialized by using a random initialization method, the value of the class center vector is updated by using a gradient back propagation method in the step 4), the number of classified classes is assumed to be m, and all the center vectors are expressed as c i ,i=1,2,…,m。
In the step 2), the feature vector of the image is represented as f, and the distance between the feature vector of the image and the class center vector of the i-th class is L i I=1, 2, …, m, find the minimum distance L k I.e.
Figure SMS_1
Figure SMS_2
The category of the image feature is judged as the kth category. In the step 3), it is assumed that the center vectors of different classes are c i I=1, 2, …, m, and the Euclidean distance between the center vectors of different categories is calculated and expressed as D ij Where i, j=1, 2, …, m and i+.j, for D ij Averaging all or part of the elements of (a) gives the degree of dispersion of the different classes.
In the step 3), the method of D ij Is to average the euclidean distance between each class of center vectors and its nearest center vector.
In the step 4), the distance L between the characteristic vector f of the image and the center vector of different categories is utilized i The probability score is calculated by i=1, 2, …, m, and the specific method is as follows: firstly normalizing all the distances to obtain the relative distance
Figure SMS_3
R i The larger the distance between the feature vector of the image and the center vector of the i-th class is; introducing a margin in calculating a probability score in order to constrain the intra-class distance; assuming that the true label of the feature vector of the image is the kth class, calculating the probability score of the feature vector of the image belonging to the kth class as follows:
Figure SMS_4
the probability score of a feature vector of an image belonging to other categories is expressed as:
Figure SMS_5
wherein the probability score P i The smaller the probability that the feature vector representing the image belongs to the i-th class is, the larger the m represents the margin.
m is greater than 1.
The steps are as follows5) In which the calculation of the Loss function comprises two parts, namely the classification Loss of image features 1 And degree of dispersion Loss of various centers 2 The two loss functions use the super-parameter lambda to adjust the weights of different constraints, i.e. the final training loss is:
Loss=Loss 1 +λLoss 2 (3)
loss of classification Loss 1 The computation is performed using cross entropy.
After the Loss function Loss is obtained, the values of the network weights and the center points are updated by using a gradient back propagation method.
A computer readable storage medium storing a computer program which when executed by a processor implements the image classification method.
The invention has the following beneficial effects:
the invention provides an image classification method for constructing a class center, wherein image features are extracted, and the class center is constructed in a feature space; taking Euclidean distance between the image features and the class center as the classifying basis of the image features to classify the image features; calculating the dispersion degree of different categories according to the Euclidean distance between every two center vectors; and calculating a loss function of the network according to the classification result and the dispersion degree of different categories, and learning the network parameters and the center vector by using the loss function. The image classification method has the characteristic of controlling the distances between the classes, and the method controls the distances between the classes by directly constructing the class center, so that the distribution of the image features is more beneficial to classification, and a better classification effect is obtained. Compared with the prior art, the method can lead the characteristics extracted by the network to have better intra-class and inter-class distribution characteristics. Compared with a classification network of full-connection layer plus softmax operation, the center point thought and Euclidean distance calculation provided by the invention can directly control the distribution condition of the feature vectors of different categories in a high-dimensional space, so that not only can the feature vector of each category be ensured to be close to the center of the category as much as possible, but also the feature vectors of different categories can be kept away as much as possible. The method of the invention has very visual geometric interpretation, and is different from the full-connection layer and softmax method in that the geometric interpretation of the full-connection layer and softmax method is vector angle characteristic of high-dimensional space, the invention is Euclidean distance characteristic of high-dimensional space, and a trainable class center point is introduced. The loss function obtains a very good classifying effect on the task of image classification, and better intra-class and inter-class feature distribution characteristics can be obtained by adjusting the super parameters in the method.
Drawings
Fig. 1 is a basic flow of an image classification method according to an embodiment of the present invention.
FIG. 2 is a schematic diagram of a first degree of dispersion according to an embodiment of the present invention.
FIG. 3 is a second degree of dispersion of an embodiment of the present invention.
FIG. 4 is a diagram illustrating two-class no-margin parameters according to an embodiment of the present invention.
FIG. 5 is a diagram illustrating the classification of the residual parameters according to the embodiment of the present invention.
Detailed Description
The following describes embodiments of the present invention in detail. It should be emphasized that the following description is merely exemplary in nature and is in no way intended to limit the scope of the invention or its applications.
Referring to fig. 1 to 5, in one embodiment, a deep learning image classification method based on a build category center includes the steps of:
step 1), constructing a deep learning model, inputting a training image, extracting feature vectors of the image by using a multi-layer convolutional neural network, wherein the feature vectors of the image are high-dimensional vectors distributed in a high-dimensional feature space, and meanwhile, constructing center vectors of different types in the feature space, wherein the center vectors are consistent with the feature vector dimensions of the image;
step 2), calculating Euclidean distances between the feature vector of the image and the center vectors of different categories, and taking the category of the center vector with the smallest distance as the category of the feature vector of the image;
step 3), calculating the dispersion degree of the feature vector distribution of the images of different categories according to the Euclidean distance between the center vectors of each category;
step 4), calculating probability scores of the images belonging to each class according to Euclidean distances between the feature vectors of the images and the center vectors of the classes, and introducing margin parameters in the probability score calculation to control the intra-class distances;
step 5), calculating a network loss function, and learning network parameters and center vectors by using the loss function.
The image features extracted in the step 1) are high-dimensional vectors, the high-dimensional vectors are distributed in a high-dimensional feature space, a central feature vector is built for each category in the feature space, and the dimensions of the central feature vector are consistent with those of the image feature vector. Specifically, the constructed class center vector is a trainable parameter, the class center vector is initialized by using a random initialization method, the value of the class center vector is updated by using a gradient back propagation method in the step 4), the number of class classes is assumed to be m, and all the center vectors are expressed as c i ,i=1,2,…,m。
In the step 2), the Euclidean distance between the feature vector of the image and the center vector of each category is calculated, and the image is classified into the category of the center vector with the smallest Euclidean distance with the feature of the image. Representing the feature vector of the image as f, and the distance between the feature vector of the image and the class center vector of the i-th class is
Figure SMS_6
Figure SMS_7
The degree of feature vector dispersion of the same class. There are two ways of expressing the degree of dispersion, the first being to average the euclidean distance between the center vectors by two and the second being to average the euclidean distance between each class of center vectors and its nearest center vector.
Specifically, assume that the center vector of the different class is c i I=1, 2, …, m, and the Euclidean distance between the center vectors of different categories is calculated and expressed as D ij Where i, j=1, 2, …, m and i+.j, for D ij All or part of the element(s) of (a) is flattenedAnd obtaining the dispersion degree of different categories. In one embodiment, for D ij May be averaging the euclidean distance between each class of center vectors and its nearest center vector.
In the step 4), the probability score of the image belonging to each class is calculated according to the Euclidean distance between the image characteristics and the center of each class. In the calculation process of the probability score, in order to make the intra-class distance as small as possible, a margin parameter is introduced, so that the Euclidean distance between the image feature and the center of the correct class is ensured to be far smaller than the Euclidean distance between the image feature and the center of the wrong class.
In a preferred embodiment, the distance L between the feature vector f of the image and the center vector of the different classes is used i The probability score is calculated by i=1, 2, …, m, and the specific method is as follows: firstly normalizing all the distances to obtain the relative distance
Figure SMS_8
R i The larger the distance between the feature vector of the image and the center vector of the i-th class is; in order to restrict the intra-class distance, the method for classifying the image features by using the softmax function is improved, and a margin is introduced when a probability score is calculated; assuming that the true label of the feature vector of the image is the kth class, calculating the probability score of the feature vector of the image belonging to the kth class by using the method of the application is as follows:
Figure SMS_9
the probability score of a feature vector of an image belonging to other categories is expressed as:
Figure SMS_10
wherein the probability score P i The smaller the probability that the feature vector representing the image belongs to the i-th class is, the larger the m represents the margin. Preferably, m is greater than 1 in order to increase the intra-class distance constraint.
In the step 5), the loss function of the network is calculated on the basis of the image classification probability scores and the dispersion degrees of different categories, the calculated loss function comprises two parts, namely classification constraint and dispersion degree constraint, the classification constraint can be calculated by using cross entropy loss, the dispersion degree constraint can be expressed by different category dispersion degrees, and different weights are distributed between the two constraints through a weight coefficient. The network weights and center vectors are then updated using a back propagation method.
Specifically, the calculation of the Loss function includes two parts, namely, the classification Loss of image features 1 And degree of dispersion Loss of various centers 2 The two loss functions use the super-parameter lambda to adjust the weights of different constraints, i.e. the final training loss is:
Loss=Loss 1 +λLoss 2 (3)。
in a preferred embodiment, after the Loss function Loss is obtained, the values of the network weights and center points are updated using a gradient back-propagation method.
In some embodiments, the present invention provides an image classification method for constructing a class center, which mainly includes: extracting image features and constructing a category center in a feature space; the Euclidean distance between the image features and the class center is used as the classifying basis of the image features to classify the image features; calculating the dispersion degree of different categories according to the Euclidean distance between every two center vectors; and calculating a loss function of the network according to the classification result and the dispersion degree of different categories, and learning the network parameters and the center vector by using the loss function.
In some embodiments, the present invention generally comprises the steps of: the first step, a feature extraction network is constructed, abstract features of an input image are extracted by using a multi-layer convolution network, high-dimensional feature vectors which can be used for classification are obtained, and center vectors of different classes are constructed in a feature space; and a second step of: judging feature categories, calculating Euclidean distance between the image feature vectors and each type of center vector, wherein the center vector category with the smallest distance is used as the category of the image features; and a third step of: calculating the dispersion degree of the feature distribution of different categories according to the Euclidean distance between the category center vectors; fourth step: calculating probability scores of the image features belonging to each class, and introducing margin parameters to control intra-class distances; fifth step: and calculating a network loss function, and updating the values of the network weight and the center vector by using a method of inverse gradient propagation. In these embodiments, the intra-class and inter-class distances of image features are controlled by the margin and the degree of dispersion using Euclidean distance calculation loss functions.
The first step specifically comprises the following steps: features of the input image are extracted using a multi-layer convolution, the image features being high-dimensional vectors distributed in feature space. And constructing center vectors of different categories in the feature space, wherein the dimension of the center vector is consistent with the feature vector of the image.
The second step specifically comprises: the Euclidean distance between the image feature and the class center vector is calculated, and the feature is classified into the class of the center vector with the smallest Euclidean distance.
The third step specifically comprises: and calculating Euclidean distance between class center vectors to represent the dispersion degree of the feature vectors of different classes. There are two ways of expressing the degree of dispersion, the first being to average the euclidean distance between the center vectors by two and the second being to average the euclidean distance between each class of center vectors and its nearest center vector.
The fourth step specifically comprises: and calculating the probability score of the image belonging to each class according to the Euclidean distance between the image characteristics and the center of each class. In the calculation process of the probability score, in order to make the intra-class distance as small as possible, a margin parameter is introduced, so that the Euclidean distance between the image feature and the center of the correct class is ensured to be far smaller than the Euclidean distance between the image feature and the center of the wrong class.
The fifth step specifically includes: and calculating a loss function of the network on the basis of the dispersion degree of different categories and the image classification probability score, wherein the loss function comprises two parts of dispersion degree constraint and classification constraint, the classification constraint is calculated by using cross entropy loss, the dispersion degree constraint is expressed by the dispersion degree of different categories, and different weights are distributed between the two constraints through a weight coefficient. The network weights and center vectors are updated using a back propagation method.
As will be described in further detail below.
The center vector construction is that as shown in fig. 1, the flow of the image classification task comprises two parts of feature extraction and classification by using features, the feature extraction of the image depends on a convolutional neural network, the input is a picture to be classified, and a high-dimensional vector is obtained after a plurality of convolutional layers, namely, the image features in fig. 1. Assuming that the dimension of the image feature is 1×n and the number of categories is m, in the feature space
Figure SMS_11
Building m eigenvectors c i I=1, 2, …, m, expressed as center vectors of different categories, and the values of the center vectors are randomly initialized with gaussian distribution or uniform distribution.
Degree of dispersion: to ensure the classification effect, it is necessary to ensure that the features of different classes are as far apart as possible, and the inter-class distance of the image features is controlled by controlling the distance between the centers of the different classes in the present application. Let all class centers be c i There are two specific implementations of i=1, 2, …, m to calculate the degree of dispersion for different categories. The first method is as shown in FIG. 2, wherein small dots in the figure represent the distribution of category centers, euclidean distances between each center and other center points are calculated, euclidean distances between a center point 1 and other center points are drawn in FIG. 2, and corresponding Euclidean distances are calculated for other points similarly, so that each point has m-1 Euclidean distances, m points are shared, m (m-1) distances are shared, and the distances are expressed as D ij Where i, j=1, 2, …, m and i+.j, the average of all euclidean distances is taken as the degree of dispersion of all center points, i.e.
Figure SMS_12
The visual understanding is that the Euclidean distance between every two central points is calculated, dis avg The larger the center points are, the farther the center points are from each other as a whole, the larger the dispersion degree is, and the inter-class distances of the image features are larger. The method has the disadvantages that the training process is to make Dis avg As large as possible, but possibly with all centersCenters of points that are farther apart from each other are farther apart, while centers that are closer together are relatively unchanged and may even be closer together, which is detrimental to the final sorting effect. Therefore, the present application proposes a second method for calculating the degree of dispersion, as shown in fig. 3, each small dot still represents the center of each category, the number on the dot is the number of the center point, for the center c i Still calculate c i Distance from all other center points, but only to its nearest center point, e.g. center point c in FIG. 3 3 Point 1 of the remaining points and nearest point D is reserved 31 Similarly, find all +.>
Figure SMS_13
i=1, 2, …, m, where k i The value of (2) satisfies->
Figure SMS_14
The lines in fig. 3 represent all +.>
Figure SMS_15
For->
Figure SMS_16
Averaging gives the degree of dispersion, expressed as +.>
Figure SMS_17
Compared with the first, the second method only considers the distance between the relatively nearer points, and can lead the two points with smaller distances to be continuously far away in the training process, so as to avoid the situation that the distance between the two points is too small.
Classification probability: the abstract feature f of the image is obtained through a feature extraction network, and the center vector of the ith class is c i The Euclidean distance of the image features and each center vector is calculated and denoted as L i I=1, 2, …, m, i.e. the euclidean distance of the image feature vector and the center of the i-th class. Classifying images into categories of the closest central point to their features, i.e. finding L i Minimum value L in i=1, 2, …, m k The image is classified into the kth class. To limit the range of values for the distance, it is normalized to obtain the relative distance, i.e
Figure SMS_18
Figure SMS_19
i=1,2,…,m,R i The smaller the value the smaller the distance between the feature and the i-th center, the more likely the image feature is to belong to the i-th class.
Consider the case of only two classes, the relative distance being R 1 And R is 2 Satisfy R 1 +R 2 When R is =1 1 <R 2 When the image is classified into class 1, when R 1 >R 2 The image is classified into class 2, so the classification plane is R 1 =R 2 As shown in fig. 4, the cross-hatched area indicates R classified as class 1 =0.5 1 Is a vertical hatched area representing R classified as class 2 1 Is a range of values. At R 1 Regions around =0.5, possibly classified as class 1 or class 2, may have a small fluctuation that may cause classification to be less stable, thus taking into account the addition margin.
Likewise, the two classification problems are obtained, and two relative distances R are obtained 1 And R is 2 Then, the remaining parameter m is used to calculate the classification condition, when mR 1 <R 2 When the image is classified into class 1, when R 1 >mR 2 When the image is classified into the 2 nd class, the classification surface is calculated as
Figure SMS_20
When the value of m is greater than 1, there is a certain margin between the classifying planes, as in the classifying case of m=3 shown in fig. 5, when the horizontal line shadow region and the vertical line shadow region are respectively R classified into 1 st and 2 nd classes 1 The range of values, the hatched area in the middle, is the margin. After adding the margin, compared to the method without margin, R 1 The image cannot be classified in the region around 0.5 because the relative distance at this time cannot be classified reliably, and correct classification can be performed only when the relative distance is sufficiently reliable.
In a general classification task, a cross entropy calculation loss function is used, a probability score of each class of the image needs to be expressed, and the probability score of each class of the image is as follows:
Figure SMS_21
satisfy the following requirements
Figure SMS_22
But P is i Probability of not being direct, P i The smaller the probability that the image belongs to the i-th class is, the greater. When m is>1, intra-class constraint can be increased, so that image features of the same class are gathered as much as possible, a certain margin is reserved on a classification surface, and the learned image features are more reliable in classification.
Loss function: the loss function comprises two parts of classification loss and dispersion degree. After obtaining the probability score of each class of image features, calculating the classification loss by using cross entropy, namely assuming that the image label is the kth class, wherein the probability score of the image belonging to the kth class is P k The classification loss is expressed as
Loss 1 =log P k (5)
The smaller the probability score for the correct classification, the smaller the penalty value, so the network parameters are optimized towards a smaller probability score for the correct classification.
The degree of dispersion of the known class centers can be expressed as Dis avg Or Dis min The dispersion degree and the Euclidean distance belong to the same order of magnitude, in order to ensure the rapid convergence of the network in the early stage of training and the small gradient in the later stage of training, ensure the stable convergence of the network, a logarithmic function is added on the basis of the Euclidean distance, namely, the loss function of the dispersion degree is expressed as
Loss 2 =-log Dis (6)
Wherein Dis may be SDis avg Or Dis min The smaller the value of the loss function, the smaller the gradient value, when Dis is larger.
The weights of the two loss functions are adjusted by a parameter lambda, the final loss function being expressed as
Loss=Loss 1 +λLoss 2 (7)
And then, optimizing the values of the network weight and the center vector by using a gradient back propagation method, so that the loss value is continuously reduced, correspondingly, the classification accuracy is continuously improved, and the distribution of the image features meets the requirements of smaller intra-class distance and larger inter-class distance.
The foregoing is a further detailed description of the invention in connection with specific/preferred embodiments, and it is not intended that the invention be limited to such description. It will be apparent to those skilled in the art that several alternatives or modifications can be made to the described embodiments without departing from the spirit of the invention, and these alternatives or modifications should be considered to be within the scope of the invention. In the description of the present specification, reference to the terms "one embodiment," "some embodiments," "preferred embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.

Claims (7)

1. A deep learning image classification method based on a construction category center comprises the following steps:
1) Inputting a training image, extracting feature vectors of the image by using a multi-layer convolutional neural network, wherein the feature vectors of the image are high-dimensional vectors distributed in a high-dimensional feature space, and meanwhile, constructing center vectors of different categories in the feature space, wherein the center vectors are consistent with the feature vector dimensions of the image;
2) Calculating Euclidean distances between the feature vector of the image and the center vectors of different categories, and taking the category of the center vector with the smallest distance as the category of the feature vector of the image;
3) Calculating the dispersion degree of the feature vector distribution of the images of different categories according to the Euclidean distance between the center vectors of each category; assume that the center vectors of the different classes are c i I=1, 2, …, m, and the Euclidean distance between the center vectors of different categories is calculated and expressed as D ij Wherein i, j=1, 2, …, m and i+.j, averaging the Euclidean distance between each type of center vector and its nearest center vector, obtaining the dispersion degree of different types; wherein for center c i Calculate c i Distance from all other center points, but only the distance from its nearest center point is retained to find all
Figure QLYQS_1
i=1, 2, …, m, where k i The value of (2) satisfies->
Figure QLYQS_2
For->
Figure QLYQS_3
Averaging gives the degree of dispersion, expressed as +.>
Figure QLYQS_4
4) Calculating probability scores of the images belonging to each class according to Euclidean distances between the feature vectors of the images and the center vectors of the classes, and introducing allowance parameters in the probability score calculation to control the intra-class distances;
5) Calculating a network Loss function based on the image classification probability scores and the dispersion degrees of different classes, wherein the calculation of the Loss function comprises two parts, namely the classification Loss of the image features 1 And degree of dispersion Loss of various centers 2 And learning the network parameters and the center vectors of the categories by using the loss function.
2. The image classification method according to claim 1, wherein in the step 1), the constructed class center vector is a trainable parameter, the class center vector is initialized by a random initialization method, and in the step 4), the value of the class center vector is updated by a gradient back propagation method, and all the center vectors are expressed as c assuming that the number of classification classes is m i ,i=1,2,…,m。
3. The image classification method according to claim 1 or 2, wherein in the step 2), the image feature vector is represented as f, and the distance between the image feature vector and the center vector of the i-th class is L i I=1, 2, …, m, find the minimum distance L k I.e.
Figure QLYQS_5
The category of the image feature is judged as the kth category.
4. The image classification method according to any one of claims 1 to 2, wherein in the step 4), a distance L between a feature vector f of the image and a center vector of a different class is used i The probability score is calculated by i=1, 2, …, m, and the specific method is as follows: firstly normalizing all the distances to obtain the relative distance
Figure QLYQS_6
R i The larger the distance between the feature vector of the image and the center vector of the i-th class is; introducing a margin in calculating a probability score in order to constrain the intra-class distance; assuming that the true label of the feature vector of the image is the kth class, calculating the probability score of the feature vector of the image belonging to the kth class as follows:
Figure QLYQS_7
where e is a natural constant, and the probability score of the feature vector of the image belonging to other categories is expressed as:
Figure QLYQS_8
the smaller the probability score, the greater the probability that the feature vector representing the image belongs to the corresponding class, and m represents the margin.
5. The image classification method of claim 4, wherein m has a value greater than 1.
6. The image classification method according to any one of claims 1 to 2, characterized in that in step 5) the two loss functions use the super-parameter λ to adjust the weights of the different constraints, i.e. the final training loss is:
Loss=Loss 1 +λLoss 2 (3)
loss of classification Loss 1 Calculating by using cross entropy;
updating the values of the network weights and the center vectors of the categories by using a reverse gradient propagation method.
7. A computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the image classification method of any one of claims 1 to 6.
CN201911129753.1A 2019-11-18 2019-11-18 Image classification method for constructing class center Active CN111079790B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911129753.1A CN111079790B (en) 2019-11-18 2019-11-18 Image classification method for constructing class center

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911129753.1A CN111079790B (en) 2019-11-18 2019-11-18 Image classification method for constructing class center

Publications (2)

Publication Number Publication Date
CN111079790A CN111079790A (en) 2020-04-28
CN111079790B true CN111079790B (en) 2023-06-30

Family

ID=70311126

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911129753.1A Active CN111079790B (en) 2019-11-18 2019-11-18 Image classification method for constructing class center

Country Status (1)

Country Link
CN (1) CN111079790B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021214943A1 (en) * 2020-04-23 2021-10-28 日本電信電話株式会社 Parameter optimization method, non-temporary recording medium, feature amount extraction method, and parameter optimization device
CN112633407B (en) * 2020-12-31 2023-10-13 深圳云天励飞技术股份有限公司 Classification model training method and device, electronic equipment and storage medium
CN112836629B (en) * 2021-02-01 2024-03-08 清华大学深圳国际研究生院 Image classification method
CN116912920B (en) * 2023-09-12 2024-01-05 深圳须弥云图空间科技有限公司 Expression recognition method and device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110084318A (en) * 2019-05-07 2019-08-02 哈尔滨理工大学 A kind of image-recognizing method of combination convolutional neural networks and gradient boosted tree

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107067020B (en) * 2016-12-30 2019-11-15 腾讯科技(上海)有限公司 Image identification method and device
CN108235770B (en) * 2017-12-29 2021-10-19 达闼机器人有限公司 Image identification method and cloud system
CN108108807B (en) * 2017-12-29 2020-06-02 北京达佳互联信息技术有限公司 Learning type image processing method, system and server
CN108304859B (en) * 2017-12-29 2021-03-30 达闼科技(北京)有限公司 Image identification method and cloud system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110084318A (en) * 2019-05-07 2019-08-02 哈尔滨理工大学 A kind of image-recognizing method of combination convolutional neural networks and gradient boosted tree

Also Published As

Publication number Publication date
CN111079790A (en) 2020-04-28

Similar Documents

Publication Publication Date Title
CN111079790B (en) Image classification method for constructing class center
CN111079639B (en) Method, device, equipment and storage medium for constructing garbage image classification model
CN109241817B (en) Crop image recognition method shot by unmanned aerial vehicle
CN108647583B (en) Face recognition algorithm training method based on multi-target learning
CN105488528B (en) Neural network image classification method based on improving expert inquiry method
CN111178208B (en) Pedestrian detection method, device and medium based on deep learning
KR101254177B1 (en) A system for real-time recognizing a face using radial basis function neural network algorithms
CN109977757B (en) Multi-modal head posture estimation method based on mixed depth regression network
KR101254181B1 (en) Face recognition method using data processing technologies based on hybrid approach and radial basis function neural networks
US20200218971A1 (en) Training of deep neural networks on the basis of distributions of paired similarity measures
CN109063719B (en) Image classification method combining structure similarity and class information
CN110516537B (en) Face age estimation method based on self-learning
US20210326661A1 (en) Determining an explanation of a classification
López-Rubio Probabilistic self-organizing maps for continuous data
CN111104831B (en) Visual tracking method, device, computer equipment and medium
US20220391611A1 (en) Non-linear latent to latent model for multi-attribute face editing
CN114283345A (en) Small sample city remote sensing image information extraction method based on meta-learning and attention
Majeed et al. Uncertain fuzzy self-organization based clustering: interval type-2 fuzzy approach to adaptive resonance theory
CN113705596A (en) Image recognition method and device, computer equipment and storage medium
KR101676101B1 (en) A Hybrid Method based on Dynamic Compensatory Fuzzy Neural Network Algorithm for Face Recognition
CN112836629B (en) Image classification method
CN109446368B (en) Bird retrieval method and system based on category information
Hu et al. An integrated classification model for incremental learning
Bailly et al. Boosting feature selection for neural network based regression
CN114549969A (en) Saliency detection method and system based on image information fusion

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