Specific class depth convolution feature selection method for image classification
Using an improved genetic algorithm to extract deep features from multiple CNN models, select feature subsets and perform image classification, it solves the problems of redundant information and performance degradation in deep convolutional features, and improves the effect and efficiency of image classification.
Patent Information
- Application Number
- CN202310214801.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-08
- Publication Date
- 2024-09-10
AI Technical Summary
In the existing technology, deep convolutional features (DCF) have problems with redundant information and performance degradation caused by high-dimensional features in image classification, and there is a lack of effective feature selection methods.
An improved genetic algorithm is used to extract deep features from five pre-trained CNN models, a specific feature subset is selected for each class through the class separability measure, and the prediction label is determined based on the feature subset for the final classification decision.
Through feature subset selection, the feature dimension is reduced and the effect of image classification is improved. The class separability measure is used to improve the accuracy and efficiency of feature selection.
Smart Images

Figure CN118628780A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a class-specific deep convolution feature selection method for image classification. Background Art
[0002] In the field of computer vision image representation, it is crucial to represent images effectively. Common image representation methods include deep convolutional feature (DCF) and manual feature methods. Many existing studies have shown that DCF can improve the effects of image classification, target detection, visual tracking, etc. compared with manual feature methods. However, DCF always has high-dimensional features (about 1000 or more), which contain a lot of redundant information. High-dimensional features may bring the risk of high-dimensionality problems and may cause performance degradation in practical applications. At present, most research works directly use DCF or use very simple manual feature dimensionality reduction methods. Therefore, it is necessary to develop a specific algorithm to select effective features from it. At present, there are few related research works. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a method for selecting deep convolutional features of a specific class for image classification in view of the deficiencies of the above-mentioned prior art, so as to realize the selection of deep convolutional features of a specific class.
[0004] To solve the above technical problems, the technical solution adopted by the present invention is: a class-specific deep convolutional feature selection method for image classification, first extracting DCFs from five pre-trained CNN models; splicing the extracted DCFs to obtain a high-dimensional deep feature vector; selecting a specific feature subset for each class from the high-dimensional deep feature vector through an improved genetic algorithm, determining a prediction label based on each feature subset, and considering all prediction labels to make a final classification decision.
[0005] The improved genetic algorithm has two population generation operators, namely, operator 1 and operator 2, both of which are mutation operators. First, a feature vector composed of 1 and 0 is initialized to represent a population. Then, the fitness score of each individual is calculated according to the data distribution and its corresponding selection features for evaluation. Then, the fitness scores of the current individuals are sorted in descending order. Then, the current number of iterations is compared with the given maximum number of iterations. If the algorithm has executed the given maximum number of times, the individual with the highest fitness score is output. If not, a random number in the range of
[01] is generated. If the random number is greater than 0.5, two new individuals are generated by operator 1. Operator 2 generates two new individuals, which are added to the current population, and the evaluation, sorting and decision-making processes are repeated.
[0006] The improved genetic algorithm specifically includes the following three stages:
[0007] (1) Population initialization stage;
[0008] In population initialization, for each individual, first define a column vector From [1, 2, ..., D] T Randomly select a subset Finally, we get the initialization individual p(s) = 1, where the number of 1s is , 0 The initial population is n′ represents the size of the initial population; in this population, all individuals and There are the same number of 1s, but the positions of the 1s are different in each individual;
[0009] (2) Evaluation phase;
[0010] The fitness score of each individual is evaluated by an algorithm based on class separability, where class separability is the probability of and within the class Ratio of variances
[0011] When selecting a specific subset of features for each image classification, the training dataset X is split into two parts: the current class and the remaining samples Use Euclidean distance to calculate the distance between classes and within the class Variance, defined as: Where A = [α j ] is a matrix, α j is the jth th elements, μ represents the average value of A, and |A| represents the size of matrix A; in the calculation and The matrix A represents X′ j as well as and I th Class and remaining samples after applying dimensionality reduction (individual p j ), No. j th Individual in i th The fitness score in the class is
[0012] (3) The operator generates new individuals;
[0013] The mutation operator changes the same number of 1(s) and 0(s) simultaneously. In the first case, the two parents with the highest scores are selected separately to generate two new children. For each parent element, a pair of l and 0 is randomly located and changed to 0 and 1. In operator 2, two new individuals are obtained by changing the parent element with the highest score twice. At each stage of change, two pairs of 1 and 0 are randomly located at the parent node, and the child node is born by reversing these two pairs of 1 and 0.
[0014] The beneficial effect of adopting the above technical solution is that: the present invention provides a specific class deep convolution feature selection method for image classification, which utilizes class separability measurement (Class-separability) and modifies the genetic algorithm (Genetic Algorithm) to select a specific feature subset (Feature Subset) for each class (Class), determines a prediction label based on each feature subset, and considers all prediction labels to make a final decision. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A flowchart of a method for selecting deep convolutional features for a specific class of image classification provided by an embodiment of the present invention;
[0016] Figure 2 A schematic diagram of the structure of image classification based on CS-DCFS provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0017] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0018] In this embodiment, a class-specific deep convolution feature selection method for image classification is provided, such as Figure 1As shown in the figure, first, DCFs are extracted from five pre-trained CNN models; the extracted DCFs are concatenated to obtain a high-dimensional deep feature vector; a specific feature subset is selected for each class from the high-dimensional deep feature vector through an improved genetic algorithm, a prediction label is determined based on each feature subset, and the final decision is made considering all the prediction labels. Class-Specific Deep Convolutional Feature Selection (CS-DCFS) uses the class-separability metric (Class-separability) to select a specific feature subset for each class (Class) through an improved genetic algorithm (Genetic Algorithm), a prediction label is determined based on each feature subset, and the final decision is made considering all the prediction labels.
[0019] The improved genetic algorithm includes two population generation operators - operator 1 and operator 2, both of which are mutation operators; first, a feature vector composed of 1 and 0 is initialized to represent a population, and then the fitness score of each individual is calculated according to the data distribution and its corresponding selection characteristics for evaluation; then, according to the fitness score of the current individual, it is sorted in descending order; then, the current number of iterations is compared with the given maximum number of iterations; if the algorithm has executed the given maximum number of times, the individual with the highest fitness score is output; if not, a random number in the range of
[01] is generated, and if the random number is greater than 0.5, two new individuals are generated by operator 1; operator 2 generates two new individuals, adds them to the current population, and repeats the evaluation, sorting and decision-making processes.
[0020] The improved genetic algorithm specifically includes the following three stages:
[0021] (1) Population initialization stage;
[0022] In the population initialization algorithm, for each individual, first define a column vector From [1, 2, ..., D] T Randomly select a subset Finally, we get the initialization individual p(s) = 1, where the number of 1s is , 0 The initial population is n′ represents the size of the initial population; in this population, all individuals and There are the same number of 1s, but the positions of the 1s are different in each individual;
[0023] (2) Evaluation phase;
[0024] Class separability is an important and useful criterion for measuring the difference in data distribution. The fitness score of each individual is evaluated by an algorithm based on class separability, which is the difference between classes. and within the class Ratio of variances
[0025] When selecting a specific subset of features for each image classification, the training dataset X is split into two parts: the current class and the remaining samples In this embodiment, the Euclidean distance is used to calculate the distance between classes. and within the class Variance, defined as: Where A = [α j ] is a matrix, α j is the jth th elements, μ represents the average value of A, and |A| represents the size of matrix A; in the calculation and The matrix A represents X′ j as well as and I th Class and remaining samples after applying dimensionality reduction (individual p j ), No. j th Individual in i th The fitness score in the class is
[0026] (3) The operator generates new individuals;
[0027] In traditional genetic algorithms, the mutation operator changes a value at a random position in an individual. In this paper, we want to keep the number of 1s unchanged. Therefore, the mutation operator changes the same number of 1(s) and 0(s) at the same time. Figure 2 An example of a single mutation operator is described. In the first case, the two parents with the highest scores are selected separately to generate two new children; for each parent element, a pair of 1 and 0 is randomly located and changed to 0 and 1; in operator 2, two new individuals are obtained by changing the parent element with the highest score twice; at each stage of change, two pairs of 1 and 0 are randomly located at the parent node, and the child node is born by reversing these two pairs of 1 and 0;
[0028] In this embodiment, the process of image classification based on CS-DCFS is as follows: Figure 2As shown in the figure, the solid rectangles represent data, while the processors are represented by blank rectangles. Image classification based on CS-DCFS is mainly divided into three stages: (1) multiple advanced CNN model feature extraction (represented in blue), (2) CS-DCFS (represented in green), and (3) the orange part performs the main voting for the predicted labels of all categories.
[0029] In the first stage, DCFs are extracted from each pre-trained CNN model. In this process, the image is first resized to the input size of the model. Then the processed image is input to the pre-trained CNN model to generate a feature vector. In the pre-trained CNN model, DCFs is the activation function of the last layer before the SoftMax layer, so that the feature dimensions extracted from these CNN models are different. th The pre-trained CNN model outputs a dimension d i The feature vectors (fi), i = 1, 2, ..., K, are then concatenated into a high-dimensional vector in, This embodiment uses five advanced CNN models, namely InceptionV3, DenseNet-201, MobileNetV2, InceptionResNetV2 and Xception, all of which have been trained on the ImageNet dataset.
[0030] The feature vector (F) generated in the first stage contains both useful information and redundant information of the image representation; the second stage uses CS-DCSFS for dimensionality reduction; since each image classification has a specific feature subset, the feature vector is used to represent an image, C is the number of image categories, is the dimension of the selected features,
[0031] In the third stage, based on the C feature vectors, a simple and conventional classification algorithm (k-NN with k=1) is used to output C predicted labels; therefore, one sample has C predicted labels; the final predicted label of the test sample y is determined by the predicted label that appears the most times among the C predicted labels, defined as where f j Indicates the jth th The output prediction label for the selected feature subset of the class, m(f j , i) is a matching function of two integer values, For example, for 5 image categories, the predicted label of a test sample image is [1, 1, 3, 5, 1], then the category of the test sample image is classified as 1.
[0032] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the claims of the present invention.
Claims
1. A class-specific deep convolutional feature selection method for image classification, characterized by: Extract DCFs from five pre-trained CNN models; The extracted DCFs are concatenated to obtain a high-dimensional deep feature vector; A specific feature subset is selected for each class from the high-dimensional deep feature vector by an improved genetic algorithm; A predicted label is determined based on each feature subset, and all predicted labels are considered to make the final classification decision.
2. The method for selecting a specific class of deep convolutional features for image classification according to claim 1, characterized in that: The improved genetic algorithm has two population generation operators, operator 1 and operator 2, both of which are mutation operators; first, a feature vector composed of 1 and 0 is initialized to represent a population, and then the fitness score of each individual is calculated and evaluated according to the data distribution and its corresponding selection characteristics; then, the fitness scores of the current individuals are sorted in descending order according to their fitness scores; then, the current number of iterations is compared with the given maximum number of iterations; If the algorithm has been executed for the given maximum number of times, the individual with the highest fitness score is output; if not, a random number in the range [0 1] is generated. If the random number is greater than 0.5, two new individuals are generated by operator 1; Operator 2 generates two new individuals, adds them to the current population, and repeats the evaluation, sorting, and decision-making processes.
3. The method for selecting a specific class of deep convolutional features for image classification according to claim 2, characterized in that: The improved genetic algorithm specifically includes the following three stages: (1) Population initialization stage; In population initialization, for each individual, first define a column vector From [1,2,…,D] T Randomly select a subset Finally, we get the initialization individual p(s) = 1, where the number of 1s is , 0 The initial population is n′ represents the size of the initial population; in this population, all individuals and There are the same number of 1s, but the positions of the 1s are different in each individual; (2) Evaluation phase; The fitness score of each individual is evaluated by an algorithm based on class separability, where class separability is the probability of and within the class Ratio of variances When selecting a specific subset of features for each image classification, the training dataset X is split into two parts: the current class and the remaining samples Use Euclidean distance to calculate the distance between classes and within the class Variance, defined as: Where A = [α j ] is a matrix, α j is the jth th elements, μ represents the average value of A, and |A| represents the size of matrix A; in the calculation and The matrix A represents X′ j as well as X′ i,j and I th The data of the class and the remaining samples after applying dimensionality reduction, the jth th Individual in i th The fitness score in the class is (3) The operator generates new individuals; The mutation operator changes the same number of 1(s) and 0(s) simultaneously. In the first case, the two parents with the highest scores are selected separately to generate two new children. For each parent element, a pair of 1 and 0 is randomly located and changed to 0 and 1. In operator 2, two new individuals are obtained by changing the parent element with the highest score twice. At each stage of change, two pairs of 1 and 0 are randomly located at the parent node, and the child node is born by reversing these two pairs of 1 and 0.
Citation Information
Patent Citations
Medical image grading system and method based on deep convolutional neural network
CN107704886A
Screening method for filter class algorithm
CN110070146A
Foundation meteorological cloud picture classification method based on cross validation deep CNN feature integration
CN111310820A
Image classification method and electronic device
CN115761315A
Image processing apparatus and method
US20190147225A1
