Small sample image classification method based on hierarchical learning genetic programming algorithm

By using a hierarchical learning genetic programming algorithm, combined with parallel exploration and development of an integrated genetic programming module, the problems of large search space and weak generalization ability in low-quality and few-sample image classification are solved, achieving efficient image classification results.

CN119942198BActive Publication Date: 2025-11-21GUANGXI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510014560.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-11-21
Estimated Expiration
2045-01-06

AI Technical Summary

Technical Problem

Existing image classification methods based on genetic programming algorithms perform poorly when dealing with low-quality and few-sample images. They have large search spaces and are prone to getting trapped in local optima, and their generalization ability is weak, resulting in insufficient classification performance.

Method used

A hierarchical learning genetic programming algorithm is adopted. Image preprocessing and feature extraction are performed by exploring the genetic programming PEGP module in parallel to build a feature storage table. The integrated genetic programming DEGP module is combined with feature blocks under a newly defined program structure, and the classification effect is optimized by using an ensemble strategy based on individual difference values.

Benefits of technology

With a limited number of training samples, the search space is significantly reduced, improving the accuracy and generalization ability of image classification and ensuring high performance in complex and changing image scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119942198B_ABST
    Figure CN119942198B_ABST
Patent Text Reader

Abstract

A small sample image classification method based on hierarchical learning genetic programming algorithm, comprising the steps of: 1: constructing a small sample image classification system based on hierarchical learning genetic programming algorithm; 2: the image acquisition module acquires the image data set and divides it into a training set and a test set; 3: the PEGP module acquires the training set and performs image preprocessing and feature extraction operations on it to construct a feature storage table; 4: the DEGP module takes the features in the feature storage table as the terminal input, constructs an integrated solution, and optimizes the final classification effect through an integrated strategy based on individual difference values; 5: use the test set as the input of the image classification solution, output the predicted class label of the test set, and evaluate the performance of the image classification solution according to the actual label of the test set; 6: take the image data to be classified as the input of the image classification solution and output the image classification result. Effect: good classification effect can be achieved under the condition of limited sample quantity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image classification technology, and in particular to a small-sample image classification method based on a hierarchical learning genetic programming algorithm. Background Technology

[0002] Image classification involves automatically assigning images to predefined categories. When image quality is high and the sample size is sufficient, this task is typically completed efficiently and accurately. However, in practical applications, a common problem is the low quality and insufficient quantity of samples, making the accurate classification of low-quality and few-sample images a challenging task. Genetic programming (GP) algorithms can model solutions to various application problems as individuals in a population and automatically evolve suitable solutions. Currently, GP algorithms have been proven effective in solving image classification problems. However, current GP-based methods have limitations in program structure, especially in handling low-quality and few-sample images. The large solution space of GP algorithms makes them prone to getting trapped in local optima, but this problem has often not been fully explored and studied. Furthermore, the optimal individuals generated by GP algorithms may be overfitted to the training data, leading to poor performance on new or unknown data.

[0003] The drawbacks of existing technologies are that current image classification methods based on genetic programming algorithms integrate all image processing steps into their program structure, resulting in a complex program structure and a large search space. Since genetic programming has relatively weak search capabilities, this severely impacts algorithm performance. Furthermore, existing research is primarily designed for scenarios with sufficient sample size; therefore, when training data is limited, the performance of existing algorithms is typically insufficient. Summary of the Invention

[0004] This invention provides a small-sample image classification method based on a hierarchical learning genetic programming algorithm, which can achieve good classification results when the number of samples is limited.

[0005] To achieve the above objectives, this invention provides a few-sample image classification method based on a hierarchical learning genetic programming algorithm, which, crucially, includes the following steps:

[0006] Step 1: Construct a few-sample image classification system based on hierarchical learning genetic programming algorithm. The few-sample image classification system is equipped with an image acquisition module, which is connected to a hierarchical evolutionary learning framework. The hierarchical evolutionary learning framework is equipped with a first-layer parallel exploratory genetic programming (PEGP) module and a second-layer development and integration genetic programming (DEGP) module.

[0007] Step 2: The image acquisition module acquires the image dataset and divides the image dataset into a training set and a test set;

[0008] Step 3: The parallel exploratory genetic programming PEGP module acquires training set data and performs image preprocessing and feature extraction operations on the training set data to construct a feature storage table. Then, the feature storage table is passed to the integrated genetic programming DEGP module.

[0009] Step 4: The developed and integrated genetic programming DEGP module takes the features in the feature storage table as terminal input, further constructs an integrated solution, and finally optimizes the final classification effect through an integration strategy based on individual difference values, thereby outputting a high-performance image classification solution;

[0010] Step 5: Use the test set as input to the image classification solution, then output the predicted class labels of the test set, and finally evaluate the performance of the image classification solution based on the actual labels of the test set.

[0011] Step 6: The image acquisition module acquires the image data to be classified, uses the image data to be classified as input to the image classification solution, and outputs the image classification result.

[0012] Through the above design, this invention adopts a hierarchical evolutionary learning framework, which aims to reduce the search space and efficiently find classification solutions.

[0013] In the first layer, a parallel exploratory genetic programming (PEGP) layer is defined. This layer focuses on image preprocessing and feature extraction to construct a feature storage table. By exploring diverse and efficient feature building blocks in parallel, this layer improves the combined generation efficiency of preprocessing and feature extraction in the GP algorithm and ultimately outputs diverse feature blocks as input for the second stage.

[0014] The second layer develops an integrated genetic programming (DEGP) algorithm. Based on a feature store table, it combines feature blocks within the search space under the guidance of a newly defined program structure to generate an integrated solution. This hierarchical learning framework significantly reduces the search space of the GP algorithm, ensuring that the final solution captures key feature information and maintains high performance even with limited training samples.

[0015] Furthermore, given that the GP method has weak generalization ability when dealing with few-sample image classification tasks, an ensemble strategy based on individual difference values ​​is proposed to improve classification performance.

[0016] Preferably, in step 1, the parallel exploration genetic programming PEGP module is configured with three different types of feature exploration blocks in parallel. The three feature exploration blocks are a first feature exploration block, a second feature exploration block, and a third feature exploration block. The program structure, function set, and terminal set of the first feature exploration block, the second feature exploration block, and the third feature exploration block are respectively set. The first feature exploration block, the second feature exploration block, and the third feature exploration block generate feature building blocks with three different evolutionary directions in parallel.

[0017] To ensure that the generated feature building blocks are effective and diverse, the first-layer PEGP algorithm must be configured with feature building blocks in three different evolutionary directions, each with a new program structure, function set, and terminal set.

[0018] The parallel exploratory genetic programming (PEGP) module employs three different program structures to generate the population, each generating individuals representing a different type of feature building block. At the end of the evolutionary learning process, the algorithm outputs multiple high-quality individuals, which are defined as different feature building blocks based on the type of features they represent.

[0019] Preferably, the first feature exploration block adopts the linear genetic programming (LGP) algorithm that focuses on local features. The program structure of the first feature exploration block includes a region extraction layer, a first image filtering layer, a first feature extraction layer, and a first feature concatenation layer.

[0020] The second feature exploration block uses the syntax-guided genetic programming (GGP) algorithm that focuses on global features. The program structure of the second feature exploration block includes a second image filtering layer and a second feature extraction layer.

[0021] The third feature exploration block employs the Cartesian Genetic Programming (CGP) algorithm, which focuses on concatenated features. The program structure of the third feature exploration block includes a third image filtering layer, a max pooling layer, a third feature extraction layer, and a second feature concatenation layer.

[0022] The parallel exploratory genetic programming PEGP module employs the LGP algorithm, which focuses on local features, the GGP algorithm, which focuses on global features, and the CGP algorithm, which focuses on concatenated features, to evolve different types of feature building blocks.

[0023] To ensure the effectiveness of local feature extraction, the LGP algorithm incorporates a region extraction layer, a filtering layer, a feature extraction layer, and a feature concatenation layer. The region extraction layer selects a valid region, while the image filtering layer filters the extracted region. The feature extraction layer uses existing feature extraction methods to extract features from the image. The feature concatenation layer concatenates the outputs of the feature extraction layers. This program structure ensures that the evolved individuals focus on different features within a single region or the same features across multiple regions.

[0024] The GGP algorithm comprises an image filtering layer and a feature extraction layer. The image filtering layer contains multiple types of filtering functions with consistent input and output, and the generated individuals may undergo multiple filtering processes. The feature extraction layer extracts features from either the filtered or original image. The GGP algorithm's program structure guides individuals towards a combination of multiple filtering processes and global feature searches.

[0025] The CGP algorithm adds a max pooling layer and a feature construction layer to the GGP algorithm. The pooling layer is designed to reduce the time cost of subsequent steps. The feature concatenation layer is designed as a flexible layer, which concatenates different types of global features. The program structure designed for the CGP algorithm will bias the learning of individual components towards concatenating different global features.

[0026] Preferably, in step 3, the parallel exploratory genetic programming PEGP module constructs a feature storage table, including the following steps:

[0027] Step A1: Population initialization: The feature exploration block acquires training set data and initializes the population according to the predetermined program structure, function set and terminal set; each individual in the population can be regarded as a feature extraction algorithm.

[0028] Step A2: Evaluate individual fitness: Each individual in the population extracts features from the training set, and then inputs the extracted features into a support vector machine (SVM). The SVM outputs the predicted class label, and then the classification accuracy is used to evaluate the individual to obtain the fitness value of the corresponding individual.

[0029] The formula for calculating classification accuracy is as follows:

[0030]

[0031] Where, N correct N represents the number of correctly predicted instances. total The total number of instances is represented by Fitness, which represents the fitness value of an individual.

[0032] In this process, k-fold cross-validation was used to reduce the possibility of overfitting. Furthermore, to ensure the sufficiency of cross-validation, the value of k was set to be the smaller of the number of training samples n for each class and 10.

[0033] Step A3: Elite Operation: Use an elite strategy to select the best individuals in the population and directly replicate them into the next generation of the population;

[0034] Step A4: Selection operation: Select a certain number of individuals from the population using tournament selection, with each individual having an equal probability of being selected; based on the fitness value of each individual, select the individual with the best fitness value and perform crossover and mutation operations to generate new individuals;

[0035] Step A5: Repeat steps A2-A4 until the maximum number of iterations is reached, then proceed to step A6;

[0036] Step A6: Select the top 50% of individuals in the last generation population as feature building blocks;

[0037] Step A7: Use the feature building blocks to extract the corresponding features from the training set, number them, and store them in the feature storage table as input for the second layer of learning.

[0038] The parallel exploratory genetic programming (PEGP) module takes the training dataset as input and generates initial populations in parallel based on three different program structures, function sets, and terminal sets. These populations then evolve in parallel, with each evolved population outputting building blocks with specific characteristics. These building blocks are subsequently stored and used as input for the second layer of learning, ensuring that the developed integrated genetic programming (DEGP) module has sufficient diversity of features for selection and optimization.

[0039] Preferably, the integrated genetic programming DEGP module has a new program structure, function set, and terminal set. The program structure of the integrated genetic programming DEGP module includes a feature construction layer, a classification layer, and a combination layer.

[0040] The feature construction layer is used to take at least two features from the feature storage table as input and return a concatenated feature, or construct a new feature based on parameters;

[0041] The classification layer is used to take the output features of the feature construction layer as input and output the predicted class label;

[0042] The combined layer is used to take at least two sets of predicted class labels output by the classification layer as input, and perform voting or weighting to output a new predicted class label.

[0043] The program structure, function set, and terminal set of the genetic programming DEGP module developed and integrated have been completely redesigned to optimize the integration process; guided by the newly defined program structure, terminal set, and function set, the final solution for the image classification task is developed through an evolutionary learning process.

[0044] Preferably, in step 4, the developed integrated genetic programming DEGP module further constructs an integrated solution, including the following steps:

[0045] (1) Population evolution learning

[0046] Step B1: Population initialization: The developed and integrated genetic programming DEGP module obtains the features in the feature storage table and initializes the population according to the new program structure, function set and terminal set; each individual in the population is mapped to a classification scheme and output as a predicted class label.

[0047] Step B2: Evaluate individual fitness: Each individual in the population extracts features from the feature storage table and outputs a predicted class label, and then evaluates the individual's fitness value;

[0048] Step B3: Elite Operation: Use an elite strategy to select the best individuals in the population and directly replicate them into the next generation of the population;

[0049] Step B4: Selection operation: A certain number of individuals are selected from the population using the tournament selection method. Based on the fitness value of each individual, the individual with the best fitness value is selected for crossover and mutation operations to generate new individuals.

[0050] Step B5: Repeat steps B2-B4 until the preset iteration limit is reached, then proceed to step B6;

[0051] (2) Integration strategy based on individual differences

[0052] Step B6: Select the best performing individual in the last generation of the population as the benchmark, calculate the difference value of other individuals in the population, and evaluate the characteristic differences between the best individual and other individuals in the population based on the calculated difference value.

[0053] The expression for calculating the difference value is as follows:

[0054] D(best,i)=∣S best ∪S i |-|S best ∩S i |

[0055] Among them, S best D represents the number of feature labels of the best individual in the population, and S represents the difference value. iThis indicates the number of feature tags of other individuals in the population;

[0056] Step B7: Select the difference value S best The seven largest individuals are ensembled through voting to obtain the image classification solution.

[0057] The developed and integrated genetic programming DEGP module follows a new program structure, function set, and terminal set. It selects features from a feature store as terminal inputs to DEGP and generates an initial population accordingly. The population undergoes refined evolutionary learning through genetic operators until a predetermined termination condition is met. Through this process, DEGP not only improves the effectiveness of individual features but also enhances the broad applicability and robustness of the solution. Finally, the algorithm selects and integrates multiple high-quality individuals based on their differences. This difference-based integration strategy optimizes the final classification performance, resulting in a high-performance image classification solution. This process ensures that the classification model can effectively handle various complex and changing image scenarios in practical applications.

[0058] Preferably, the image classification solution includes seven individuals with voting integration. In step 6, the seven individuals perform image classification prediction on the image data to be classified, output predicted class labels respectively, and select the predicted class label with the highest cumulative value as the image classification result for output.

[0059] In the integrated genetic programming DEGP module, the population undergoes an evolutionary learning process to continuously optimize each individual until a preset iteration limit is reached. Finally, a set of individuals is returned, each mapped to a classification scheme and output as a predicted class label. Integrating diverse and effective individuals improves classification accuracy and reduces the possibility of overfitting.

[0060] Therefore, this invention proposes an ensemble strategy based on individual difference values, which aims to integrate the outputs of various individuals to achieve better classification results. This method selects the seven individuals with the largest difference values ​​for voting ensemble, and aggregates the outputs of multiple individuals to ensure that the final prediction does not depend on a single scheme, thereby effectively improving classification accuracy and generalization ability.

[0061] The beneficial effects of this invention are as follows: This invention adopts a hierarchical evolutionary learning framework, which aims to reduce the search space and efficiently find classification solutions.

[0062] In the first layer, a parallel exploratory genetic programming (PEGP) layer is defined. This layer focuses on image preprocessing and feature extraction to construct a feature storage table. By exploring diverse and efficient feature building blocks in parallel, this layer improves the combined generation efficiency of preprocessing and feature extraction in the GP algorithm and ultimately outputs diverse feature blocks as input for the second stage.

[0063] The second layer develops an integrated genetic programming (DEGP) algorithm. Based on a feature store table, it combines feature blocks within the search space under the guidance of a newly defined program structure to generate an integrated solution. This hierarchical learning framework significantly reduces the search space of the GP algorithm, ensuring that the final solution captures key feature information and maintains high performance even with limited training samples.

[0064] Furthermore, given that the GP method has weak generalization ability when dealing with few-sample image classification tasks, an ensemble strategy based on individual difference values ​​is proposed to improve classification performance. Attached Figure Description

[0065] Figure 1 This is a flowchart illustrating the application of the HLGP algorithm to image classification.

[0066] Figure 2 A flowchart illustrating the process of generating feature building blocks for the PEGP algorithm;

[0067] Figure 3 A flowchart illustrating the process of generating a classification solution for the DEGP algorithm;

[0068] Figure 4 Example graph of individuals generated by the DEGP algorithm;

[0069] Figure 5 This is a comparison chart of the classification accuracy of the HLGP algorithm and its three sub-algorithms. Detailed Implementation

[0070] The present invention will be further described in detail below with reference to the accompanying drawings and specific examples. The following embodiments or drawings are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0071] like Figure 1 As shown: A few-sample image classification method based on hierarchical learning genetic programming algorithm, including the following steps:

[0072] Step 1: Construct a few-sample image classification system based on hierarchical learning genetic programming algorithm. The few-sample image classification system is equipped with an image acquisition module, which is connected to a hierarchical evolutionary learning framework. The hierarchical evolutionary learning framework is equipped with a first-layer parallel exploratory genetic programming (PEGP) module and a second-layer development and integration genetic programming (DEGP) module.

[0073] Step 2: The image acquisition module acquires the image dataset and divides the image dataset into a training set and a test set;

[0074] Step 3: The parallel exploratory genetic programming PEGP module acquires training set data and performs image preprocessing and feature extraction operations on the training set data to construct a feature storage table. Then, the feature storage table is passed to the integrated genetic programming DEGP module.

[0075] The feature storage table stores the local and global features of the corresponding image data.

[0076] Step 4: The developed and integrated genetic programming DEGP module takes the features in the feature storage table as terminal input, further constructs an integrated solution, and finally optimizes the final classification effect through an integration strategy based on individual difference values, thereby outputting a high-performance image classification solution;

[0077] Step 5: Use the test set as input to the image classification solution, then output the predicted class labels of the test set, and finally evaluate the performance of the image classification solution based on the actual labels of the test set.

[0078] Step 6: The image acquisition module acquires the image data to be classified, uses the image data to be classified as input to the image classification solution, and outputs the image classification result.

[0079] In step 1, the parallel exploration genetic programming PEGP module is configured with three different types of feature exploration blocks in parallel. The three feature exploration blocks are a first feature exploration block, a second feature exploration block, and a third feature exploration block. The program structure, function set, and terminal set of the first feature exploration block, the second feature exploration block, and the third feature exploration block are set respectively. The first feature exploration block, the second feature exploration block, and the third feature exploration block generate feature building blocks with three different evolutionary directions in parallel.

[0080] The first feature exploration block uses the linear genetic programming (LGP) algorithm that focuses on local features. The program structure of the first feature exploration block includes a region extraction layer, a first image filtering layer, a first feature extraction layer, and a first feature concatenation layer.

[0081] The function set of the first feature exploration block is shown in Table 1:

[0082] Table 1

[0083]

[0084] The second feature exploration block uses the syntax-guided genetic programming (GGP) algorithm that focuses on global features. The program structure of the second feature exploration block includes a second image filtering layer and a second feature extraction layer.

[0085] The function set of the second feature exploration block is shown in Table 2:

[0086] Table 2

[0087]

[0088] The third feature exploration block employs the Cartesian Genetic Programming (CGP) algorithm, which focuses on concatenated features. The program structure of the third feature exploration block includes a third image filtering layer, a max pooling layer, a third feature extraction layer, and a second feature concatenation layer.

[0089] The function set of the third feature exploration block is shown in Table 3:

[0090] Table 3

[0091]

[0092]

[0093] The terminal set of the parallel exploratory genetic programming (PEGP) module includes the training set, as well as the parameters required for the functions in the linear genetic programming (LGP) algorithm, syntax-guided genetic programming (GGP) algorithm, and Cartesian genetic programming (CGP) algorithm. The specific required parameters are shown in Table 4.

[0094] Table 4

[0095]

[0096] like Figure 2 As shown: In step 3, the parallel exploratory genetic programming PEGP module constructs a feature storage table, including the following steps:

[0097] Step A1: Population initialization: The feature exploration block acquires training set data and initializes the population according to the predetermined program structure, function set and terminal set; each individual in the population can be regarded as a feature extraction algorithm.

[0098] Step A2: Evaluate individual fitness: Each individual in the population extracts features from the training set, and then inputs the extracted features into a support vector machine (SVM). The SVM outputs the predicted class label, and then the classification accuracy is used to evaluate the individual to obtain the fitness value of the corresponding individual.

[0099] The formula for calculating classification accuracy is as follows:

[0100]

[0101] Where, N correct N represents the number of correctly predicted instances. total The total number of instances is represented by Fitness, which represents the fitness value of an individual.

[0102] In this process, k-fold cross-validation was used to reduce the possibility of overfitting. Furthermore, to ensure the sufficiency of cross-validation, the value of k was set to be the smaller of the number of training samples n for each class and 10.

[0103] Step A3: Elite Operation: Use an elite strategy to select the best individuals in the population and directly replicate them into the next generation of the population;

[0104] Step A4: Selection operation: Select a certain number of individuals from the population using tournament selection, with each individual having an equal probability of being selected; based on the fitness value of each individual, select the individual with the best fitness value and perform crossover and mutation operations to generate new individuals;

[0105] Step A5: Repeat steps A2-A4 until the maximum number of iterations is reached, then proceed to step A6;

[0106] Step A6: Select the top 50% of individuals in the last generation population as feature building blocks;

[0107] Step A7: Use the feature building blocks to extract the corresponding features from the training set, number them, and store them in the feature storage table as input for the second layer of learning.

[0108] The developed and integrated genetic programming DEGP module has a new program structure, function set and terminal set. The program structure of the developed and integrated genetic programming DEGP module includes a feature construction layer, a classification layer and a combination layer.

[0109] The feature construction layer is used to take at least two features from the feature storage table as input and return a concatenated feature, or construct a new feature based on parameters;

[0110] The classification layer is used to take the output features of the feature construction layer as input and output the predicted class label;

[0111] The combined layer is used to take at least two sets of predicted class labels output by the classification layer as input, and perform voting or weighting to output a new predicted class label.

[0112] The function set of the integrated genetic programming DEGP module is shown in Table 5:

[0113] Table 5

[0114]

[0115] like Figure 3 As shown: In step 4, the developed integrated genetic programming DEGP module further constructs an integrated solution, including the following steps:

[0116] (1) Population evolution learning

[0117] Step B1: Population initialization: The developed and integrated genetic programming DEGP module obtains the features in the feature storage table and initializes the population according to the new program structure, function set and terminal set; each individual in the population is mapped to a classification scheme and output as a predicted class label.

[0118] Step B2: Evaluate individual fitness: Each individual in the population extracts features from the feature storage table and outputs a predicted class label, and then evaluates the individual's fitness value;

[0119] Step B3: Elite Operation: Use an elite strategy to select the best individuals in the population and directly replicate them into the next generation of the population;

[0120] Step B4: Selection operation: A certain number of individuals are selected from the population using the tournament selection method. Based on the fitness value of each individual, the individual with the best fitness value is selected for crossover and mutation operations to generate new individuals.

[0121] Step B5: Repeat steps B2-B4 until the preset iteration limit is reached, then proceed to step B6;

[0122] (2) Integration strategy based on individual differences

[0123] Step B6: Select the best performing individual in the last generation of the population as the benchmark, calculate the difference value of other individuals in the population, and evaluate the characteristic differences between the best individual and other individuals in the population based on the calculated difference value.

[0124] The method used to calculate the difference value is to statistically determine whether the feature types of the terminal nodes of these individuals are the same. These terminal nodes represent different features selected from the feature storage table. An individual's expression can be represented as a series of strings, where the terminals contain different feature vectors from the feature storage table. The expression of each individual is iterated through, and the number of occurrences S of different feature vectors is counted. i The expression for calculating the difference is as follows:

[0125] D(best,i)=∣S best ∪S i |-|S best ∩S i |

[0126] Among them, S best D represents the number of feature labels of the best individual in the population, and S represents the difference value. i This indicates the number of feature tags of other individuals in the population;

[0127] The characteristic differences between two individuals are determined by calculating the symmetric difference between them, which is the number of elements that exist only in one set. This calculation directly reflects the differences in feature selection between the two individuals. If the two individuals have exactly the same characteristics, the difference value will be zero; if they have no common characteristics, the difference value will be equal to the sum of the number of unique elements in both sets.

[0128] Step B7: Select the difference value S best The seven largest individuals are ensembled through voting to obtain the image classification solution.

[0129] The image classification solution comprises seven individuals with voting integration. In step 6, each of the seven individuals performs image classification prediction on the image data to be classified, outputs a predicted class label, and selects the predicted class label with the highest cumulative value as the image classification result for output.

[0130] Figure 4 This shows an example of an individual generated by the DEGP algorithm, from Figure 4 As can be seen, the DEGP algorithm randomly selects features from the feature storage table as its input for the second layer of evolutionary learning. For the DEGP algorithm, the output of the generated individuals is the predicted class label produced by the combined layer function, and the fitness function is also the classification accuracy calculated using k-fold cross-validation on the training set.

[0131] Next, specific experiments were conducted to further verify the classification performance of the present invention.

[0132] 1. Dataset

[0133] This embodiment evaluates the performance of a few-sample image classification method based on a hierarchical learning genetic programming algorithm on four different image datasets. CIFAR10 is a widely used object classification dataset containing 50,000 32×32 training images and 10,000 test images across 10 categories. Fashion_MNIST (FMNIST) is an image classification task divided into 10 fashion categories, consisting of 60,000 28×28 grayscale training images and 10,000 test images. SVHN is a digit classification dataset comprising 10 categories, consisting of 73,257 32×32 color training images and 26,032 test images. ORL is a face recognition dataset containing 40 different individuals, each with 10 different images, each 92x112 pixels. In this embodiment, the image size is set to 46×56.

[0134] To address the few-shot image classification problem, 10, 20, 40, and 80 images were randomly selected from the CIFAR10, FMNIST, and SVHN datasets for each class as training data. In the ORL dataset, 2, 3, 4, and 5 training images were used for each class, respectively. This design aims to explore and validate the performance of this invention under conditions of extremely limited training samples.

[0135] 2. Benchmark Method

[0136] To verify the performance of the hierarchical learning genetic programming (HLGP) algorithm on few-shot image classification problems, this embodiment compares it with several benchmark methods. The comparison methods include state-of-the-art genetic programming GP algorithms and state-of-the-art deep learning methods based on benchmark datasets.

[0137] (1) Image Classification Method Based on Genetic Programming (GP): Three GP-based methods are compared across all datasets to demonstrate the effectiveness of the proposed method. These methods are FGP (Genetic Programming Image Classification Method based on image-related operations and flexible procedural structures), FLGP (Genetic Programming Feature Learning Method based on image descriptions), and BERGP (Genetic Programming Image Classification Method based on block evolution and reuse). These three methods use different individual representations to automatically learn different types of features and / or evolve effective image classification ensembles, achieving satisfactory results on various image datasets. Furthermore, to demonstrate the effectiveness of hierarchical learning, the proposed method is compared with three first-layer learning-based genetic programming GP algorithms.

[0138] (2) Deep Learning Methods: At CIFAR10, FMNIST, and SVHN, the state-of-the-art methods are based on Convolutional Neural Networks (CNNs) and the deep residual network ResNet20, which is under investigation. The CNN models used are divided into three categories based on the complexity of their network architecture: low-complexity CNNs (CNN-lc), medium-complexity CNNs (CNN-mc), and high-complexity CNNs (CNN-hc). The differences in complexity mainly lie in the number of filters in the convolutional layers and the depth of the network layers. Furthermore, the performance of these three types of models at different dropout rates (0, 0.4, 0.7) was investigated to explore their effectiveness in preventing overfitting with limited samples.

[0139] 3. Parameter settings

[0140] To ensure the comparability of experimental results, the following settings were used for all algorithms in the comparison method based on genetic programming GP: maximum number of generations 50, population size 100, elite ratio 0.01, mutation rate 0.19, and crossover rate 0.8. Tournament selection was used with a size of 5. The minimum and maximum tree depths for FGP, FLGP, and BERGP were set to 2 and 8, respectively. For the HLGP algorithm, its first-layer evolutionary learning, including LGP, GGP, and CGP algorithms, had a population size of 250 and a maximum number of generations 10, designed to explore diverse solution sets; the second-layer evolutionary learning algorithm, DEGP, had a population size of 100 and a maximum number of generations 25 to accelerate convergence while maintaining the same number of evaluations as other GP algorithms. Each method used a different random seed and was run independently 30 times on each training set to evaluate its stability. Experimental results will report the mean accuracy and its standard deviation on the test set.

[0141] 4. Classification performance analysis

[0142] The HLGP algorithm was compared and analyzed with CNNs and ResNet-20 of different complexities and dropout rates, as well as other advanced GP-based image classification methods.

[0143] (1) Comparison with CNNs, ResNet-20 and BERGP algorithms: Considering that the BERGP method only provides average precision data and lacks detailed iterative data, this variant cannot be included in the subsequent rank-sum test. Therefore, it is reported together with the CNNs method. Tables 6 to 8 show the performance comparison results of the benchmark method and the HLGP algorithm.

[0144] Table 6 Performance comparison on the CIFAR-10 dataset

[0145]

[0146] On the CIFAR-10 dataset (Table 6), HLGP outperformed the benchmark method in 41 out of 44 comparisons, but lagged behind in the three comparisons on CIFAR10-10. CIFAR10, as a diverse small image dataset, presents a significant challenge to classification model performance due to its image resolution and sample size, especially with limited sample numbers. HLGP effectively addresses this challenge through a hierarchical learning strategy. This strategy explores and combines features at different levels, enabling the algorithm to find more effective discriminative features with less data, thereby improving classification accuracy. For example, in the smallest sample configuration of CIFAR10-10, HLGP achieved an accuracy of 30.7%, slightly higher than BERGP's 30.6%, and significantly better than ResNet-20's 23.3%. In the larger sample configuration of CIFAR10-80, HLGP's performance further improved to 51.1%, higher than BERGP's 49.7%. This performance improvement demonstrates HLGP's ability to effectively extract key features through a hierarchical learning strategy when dealing with a small number of samples. In particular, under low-sample conditions, compared with advanced CNN models and GP-based image classification methods, HLGP can better adapt to the limitations of sample quantity, achieving higher classification accuracy and better generalization performance.

[0147] Table 7 Performance comparison on the FMNIST dataset

[0148]

[0149] On the FMNIST dataset (Table 7), the HLGP algorithm outperformed various benchmark methods in 44 comparisons. Fashion-MNIST, a grayscale image dataset involving the classification of fashion items, presents significant challenges to classification algorithms, especially with limited sample sizes. HLGP effectively addresses these challenges through its unique hierarchical learning strategy. This strategy explores and integrates features at different levels, enabling the algorithm to find highly discriminative features even with limited data, thereby improving classification accuracy. For example, in the minimum sample configuration FMNIST-10, HLGP achieved an accuracy of 75.8%, surpassing not only most CNN models but also significantly outperforming BERGP's 72.1%. In the larger sample configuration FMNIST-80, HLGP's performance further improved to 85.8%, maintaining its lead over BERGP (83.4%). These results not only demonstrate HLGP's advantage in handling few-shot problems but also highlight the performance improvements it brings to diverse image datasets through its hierarchical learning framework.

[0150] Table 8 shows the performance comparison on the SVHN dataset.

[0151]

[0152] On the SVHN dataset (Table 8), the HLGP algorithm was compared with several benchmark methods, demonstrating significant performance advantages. The SVHN dataset is known for its extensive collection of street-view digit images; the diversity of digits and background noise in these images pose significant challenges to classification algorithms. The HLGP algorithm effectively improves its ability to process such complex images through feature exploration and combinatorial optimization. In the minimum sample size of SVHN-10, HLGP's performance was slightly lower than BERGP, achieving an accuracy of 59.2%, while BERGP achieved 60.2%. However, as the number of samples increases, HLGP's performance begins to surpass BERGP and other CNN-based methods. In the SVHN-20, SVHN-40, and SVHN-80 settings, HLGP achieved accuracies of 69.9%, 77.3%, and 78.2%, respectively, showing that its classification performance increases synchronously with the increase in the number of samples. Compared with CNN models, HLGP demonstrates its superiority; for example, in SVHN-80, the highest accuracy of CNN models was 74.6%, while HLGP reached 78.2%. This performance improvement is attributed to HLGP's use of an integration strategy based on individual differences, which significantly enhances its excellent generalization ability on diverse data.

[0153] (2) Comparison with GP-based methods: In the comparison with GP-based methods, the Wilcoxon rank-sum test with a 5% significance level was used to show the significance of performance improvement. This section focuses on GP method variants that provided complete data (including results for each iteration). The rank-sum test will help statistically verify the performance differences between variants, providing a scientific basis for the final method selection. The comparison with GP-based methods is shown in Table 9.

[0154] Table 9 shows the comparison results with GP-based methods on various datasets.

[0155]

[0156]

[0157] At a 5% significance level using the Wilcoxon rank-sum test, the average classification performance metrics of HLGP and GP-based image classification methods were statistically compared, and the results are summarized in Table 10. As shown in the table, in 80 performance comparisons, HLGP significantly outperformed the comparative methods in 78 comparisons and performed comparably to the comparative methods in 2 comparisons. This result clearly demonstrates that HLGP outperforms traditional methods on multiple datasets when dealing with image classification problems, highlighting its effectiveness and stability. This advantage is not only reflected in improved classification accuracy but also in its good generalization ability to datasets of different types and sizes.

[0158] Table 10 shows the statistical test of the average classification accuracy between the method and the GP-based method.

[0159]

[0160] Compared to the FGP algorithm, HLGP demonstrated superior performance in 14 comparisons, only lagging behind FGP in 2. HLGP outperformed FGP, particularly on complex datasets such as CIFAR10, FMNIST, and SVHN. This is primarily attributed to HLGP's two-layer learning framework, which not only increases the algorithm's flexibility but also improves the overall solution quality. In the first layer of HLGP's learning process, diverse feature building blocks are constructed to effectively capture feature information from the data. Then, in the second layer, these features are used to build an ensemble solution, further optimizing the classification results. The resulting solution significantly outperforms solutions generated by single-layer learning methods, which is the main reason why HLGP surpasses FGP on these datasets.

[0161] Compared to the FLGP algorithm, the HLGP algorithm demonstrated superior performance in 16 comparisons. FLGP's procedural structure focuses on simultaneously capturing both local and global image features, while HLGP effectively reduces the search space and optimizes the feature exploration process by applying LGP and GGP algorithms in parallel during the first layer of learning. This strategy allows HLGP to more accurately identify useful features when handling complex image classification tasks, thus significantly outperforming FLGP on various datasets and demonstrating its efficient feature learning and solution construction capabilities.

[0162] HLGP significantly outperformed LGP, GGP, and CGP in 48 comparisons. In the first layer of learning, LGP, GGP, and CGP independently extracted one class of features for image classification. This single feature extraction method performs poorly in most cases, especially in image classification tasks requiring complex feature fusion. Specifically, on most datasets, LGP, GGP, and CGP all outperformed FGP or FLGP. Through HLGP's second layer of evolutionary learning, these initially extracted features were further combined and optimized, significantly improving the final classification results. This result clearly demonstrates that the hierarchical learning structure employed by HLGP is effective in improving algorithm performance.

[0163] To further illustrate the effectiveness of the hierarchical learning approach designed in HLGP, it is necessary to compare the three sub-GP algorithms designed in the first layer with the overall HLGP algorithm. This comparison clearly demonstrates the improvements brought about by hierarchical learning, specifically as shown in... Figure 5 As shown.

[0164] from Figure 5 The statistical data shows that the three sub-GP algorithms designed in the first stage all achieved good results and each exhibited different classification outcomes. Nevertheless, HLGP, with its hierarchical learning architecture, significantly outperformed these three sub-algorithms in overall performance. The only exception was on the ORL dataset, where HLGP's performance improvement was not as significant as on other datasets. This may be because the classification task on the ORL dataset is relatively simple, while HLGP was primarily designed to handle more complex image classification tasks with limited sample sizes. In conclusion, hierarchical learning frameworks can significantly improve performance when dealing with complex and challenging classification tasks, such as few-shot image classification problems.

[0165] This invention focuses on solving the few-shot image classification problem and proposes a hierarchical learning-based genetic programming algorithm, HLGP. This method consists of two layers: the first layer primarily focuses on image preprocessing and feature extraction, aiming to construct an efficient feature storage table; the second layer selects high-quality features optimized through learning and develops ensemble solutions under the guidance of the program structure. The hierarchical learning framework successfully reduces the search space of the GP algorithm and generates excellent ensemble solutions. The proposed ensemble strategy based on individual difference values ​​performs secondary ensemble integration of multiple solutions by evaluating the differences between individuals. This method not only utilizes the uniqueness of each individual in the algorithm but also enhances the final classification performance by combining diverse solutions. Finally, after comparison with several state-of-the-art contrastive algorithms, experimental results show that, with a limited number of samples, the HLGP algorithm outperforms all the contrastive algorithms. These results demonstrate that HLGP is an efficient method for handling few-shot image classification problems, possessing the ability to achieve accurate classification in complex tasks.

[0166] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A few-sample image classification method based on hierarchical learning genetic programming algorithm, characterized in that, Includes the following steps: Step 1: Construct a few-sample image classification system based on hierarchical learning genetic programming algorithm. The few-sample image classification system is equipped with an image acquisition module, which is connected to a hierarchical evolutionary learning framework. The hierarchical evolutionary learning framework is equipped with a first-layer parallel exploratory genetic programming (PEGP) module and a second-layer development and integration genetic programming (DEGP) module. The parallel exploratory genetic programming PEGP module is configured with three different types of feature exploration blocks in parallel. The three feature exploration blocks are the first feature exploration block, the second feature exploration block, and the third feature exploration block. The program structure, function set, and terminal set of the first feature exploration block, the second feature exploration block, and the third feature exploration block are respectively set. The first feature exploration block, the second feature exploration block, and the third feature exploration block generate feature building blocks with three different evolutionary directions in parallel. Step 2: The image acquisition module acquires the image dataset and divides the image dataset into a training set and a test set; Step 3: The parallel exploratory genetic programming PEGP module acquires training set data and performs image preprocessing and feature extraction operations on the training set data to construct a feature storage table. Then, the feature storage table is passed to the integrated genetic programming DEGP module. Step 4: The developed and integrated genetic programming DEGP module takes the features in the feature storage table as terminal input, further constructs an integrated solution, and finally optimizes the final classification effect through an integration strategy based on individual difference values, thereby outputting a high-performance image classification solution; Step 5: Use the test set as input to the image classification solution, then output the predicted class labels of the test set, and finally evaluate the performance of the image classification solution based on the actual labels of the test set. Step 6: The image acquisition module acquires the image data to be classified, uses the image data to be classified as input to the image classification solution, and outputs the image classification result.

2. The few-sample image classification method based on hierarchical learning genetic programming algorithm according to claim 1, characterized in that: The first feature exploration block uses the linear genetic programming (LGP) algorithm that focuses on local features. The program structure of the first feature exploration block includes a region extraction layer, a first image filtering layer, a first feature extraction layer, and a first feature concatenation layer. The second feature exploration block uses the syntax-guided genetic programming (GGP) algorithm that focuses on global features. The program structure of the second feature exploration block includes a second image filtering layer and a second feature extraction layer. The third feature exploration block employs the Cartesian Genetic Programming (CGP) algorithm, which focuses on concatenated features. The program structure of the third feature exploration block includes a third image filtering layer, a max pooling layer, a third feature extraction layer, and a second feature concatenation layer.

3. The few-sample image classification method based on hierarchical learning genetic programming algorithm according to claim 2, characterized in that: The terminal set of the parallel exploratory genetic programming (PEGP) module includes the training set, as well as the parameters required for the functions in the linear genetic programming (LGP) algorithm, syntax-guided genetic programming (GGP) algorithm, and Cartesian genetic programming (CGP) algorithm.

4. The few-sample image classification method based on hierarchical learning genetic programming algorithm according to claim 1, characterized in that: In step 3, the parallel exploratory genetic programming PEGP module constructs a feature storage table, including the following steps: Step A1: Population initialization: The feature exploration block acquires training set data and initializes the population according to the predetermined program structure, function set, and terminal set; Step A2: Evaluate individual fitness: Each individual in the population extracts features from the training set, and then inputs the extracted features into a support vector machine (SVM). The SVM outputs the predicted class label, and then the classification accuracy is used to evaluate the individual to obtain the fitness value of the corresponding individual. The formula for calculating classification accuracy is as follows: Where, N correct N represents the number of correctly predicted instances. total The total number of instances is represented by Fitness, which represents the fitness value of an individual. Step A3: Elite Operation: Use an elite strategy to select the best individuals in the population and directly replicate them into the next generation of the population; Step A4: Selection operation: Select a certain number of individuals from the population using tournament selection, with each individual having an equal probability of being selected; based on the fitness value of each individual, select the individual with the best fitness value and perform crossover and mutation operations to generate new individuals; Step A5: Repeat steps A2-A4 until the maximum number of iterations is reached, then proceed to step A6; Step A6: Select the top 50% of individuals in the last generation population as feature building blocks; Step A7: Use the feature building blocks to extract the corresponding features from the training set, number them, and store them in the feature storage table as input for the second layer of learning.

5. The few-sample image classification method based on hierarchical learning genetic programming algorithm according to claim 1, characterized in that: The developed and integrated genetic programming DEGP module has a new program structure, function set and terminal set. The program structure of the developed and integrated genetic programming DEGP module includes a feature construction layer, a classification layer and a combination layer. The feature construction layer is used to take at least two features from the feature storage table as input and return a concatenated feature, or construct a new feature based on parameters; The classification layer is used to take the output features of the feature construction layer as input and output the predicted class label; The combined layer is used to take at least two sets of predicted class labels output by the classification layer as input, and perform voting or weighting to output a new predicted class label.

6. The few-sample image classification method based on hierarchical learning genetic programming algorithm according to claim 5, characterized in that: In step 4, the development of the integrated genetic programming DEGP module further constructs an integrated solution, including the following steps: (1) Population evolution learning Step B1: Population initialization: The developed and integrated genetic programming DEGP module obtains the features from the feature storage table and initializes the population according to the new program structure, function set, and terminal set; Step B2: Evaluate individual fitness: Each individual in the population extracts features from the feature storage table and outputs a predicted class label, and then evaluates the individual's fitness value; Step B3: Elite Operation: Use an elite strategy to select the best individuals in the population and directly replicate them into the next generation of the population; Step B4: Selection operation: A certain number of individuals are selected from the population using the tournament selection method. Based on the fitness value of each individual, the individual with the best fitness value is selected for crossover and mutation operations to generate new individuals. Step B5: Repeat steps B2-B4 until the preset iteration limit is reached, then proceed to step B6; (2) Integration strategy based on individual differences Step B6: Select the best performing individual in the last generation of the population as the benchmark, calculate the difference value of other individuals in the population, and evaluate the characteristic differences between the best individual and other individuals in the population based on the calculated difference value. The expression for calculating the difference value is as follows: D(best,i)=∣S best ∪S i ∣-∣S best ∩S i ∣ Among them, S best D represents the number of feature labels of the best individual in the population, and S represents the difference value. i This indicates the number of feature tags of other individuals in the population; Step B7: Select the difference value S best The seven largest individuals are ensembled through voting to obtain the image classification solution.

7. The few-sample image classification method based on hierarchical learning genetic programming algorithm according to claim 6, characterized in that: The image classification solution comprises seven individuals with voting integration. In step 6, each of the seven individuals performs image classification prediction on the image data to be classified, outputs a predicted class label, and selects the predicted class label with the highest cumulative value as the image classification result for output.

Citation Information

Patent Citations

  • Image classification method based on genetic algorithm and data set division

    CN114662593A

  • Small sample image classification integration method based on genetic programming

    CN118552768A