Small sample image classification ensemble method based on genetic programming

CN118552768BActive Publication Date: 2026-09-22SHANDONG UNIV OF FINANCE & ECONOMICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410560822.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-08
Publication Date
2026-09-22
Estimated Expiration
2044-05-08

AI Technical Summary

Technical Problem

在训练数据量有限的情况下,这些方法不容易获得良好的泛化性能

Benefits of technology

[0052](1)本发明提出的一种基于遗传规划的小样本图像分类集成方法,设计多树模型,利用AdaBoost的思想构建集成模型,可有效的利用多个基础学习器的结果,实现了从少量的训练实例中学习到信息丰富、具有判别性的图像特征,达到较高的分类精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552768B_ABST
    Figure CN118552768B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, and provides a small sample image classification integrated method based on genetic programming, which comprises the following steps: S1, obtaining an image to be classified; S2, randomly generating a population of genetic programming individuals in the first generation; S3, respectively designing a multi-tree model used by each genetic programming individual, including a tree structure, a function set and a terminal set, and evolving each tree according to the multi-tree model; S4, giving different weights to the evolved multi-trees of the genetic programming individuals by using the idea of AdaBoost, and then constructing an integrated model; and S5, outputting a predicted class label by using weighted majority voting. Through the technical scheme of the application, the multi-tree model is designed, three or more trees are used, different weights are given by using the idea of AdaBoost, and then the integrated model is constructed, information-rich and discriminative image features are learned from a small amount of training instances, and therefore high classification precision is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and more specifically, to a small-sample image classification ensemble method based on genetic programming. Background Technology

[0002] Image classification is a fundamental component of computer vision, applied in areas such as face recognition, scene analysis, autonomous vehicles, and medical diagnosis. The goal of image classification is to allow computers to analyze and categorize images based on their content. However, due to the high variability between images and the high dimensionality of image data, the performance of existing image classification methods still falls short of application requirements. Furthermore, in some computer vision applications, collecting large numbers of labeled instances is difficult and expensive, making it even more challenging to achieve good generalization performance.

[0003] Genetic programming is a feature learning method in image classification, typically using tree representations and iteratively finding the optimal program / individual / solution based on Darwin's principle of natural selection. Learning informational features using genetic programming usually involves multiple levels of transformations, including linear and non-linear transformations within the genetic programming tree. Genetic programming offers flexible representations of variable length, powerful global search capabilities, and good interpretability, and has been applied to solve image classification tasks.

[0004] However, most genetic programming-based image classification methods typically use genetically programmed individuals to build classifiers or rely on predefined classification algorithms such as support vector machines and K-nearest neighbors for classification. With limited training data, these methods do not easily achieve good generalization performance. Furthermore, most genetic programming algorithms for image classification evolve a single tree from a single individual (by default, this is called single-tree genetic programming), which is very difficult to construct multiple base learners using single-tree genetic programming, and the limited training data further increases the difficulty. Summary of the Invention

[0005] The present invention aims to solve at least one of the technical problems existing in the prior art or related art.

[0006] Therefore, the purpose of this invention is to provide a small-sample image classification ensemble method based on genetic programming. It designs a multi-tree model with three or more trees, uses the AdaBoost concept to assign different weights, and then constructs an ensemble model. This method learns information-rich and discriminative image features from a small number of training instances, thereby achieving high classification accuracy.

[0007] To achieve the above objectives, the first aspect of the present invention provides a small-sample image classification ensemble method based on genetic programming, comprising the following steps:

[0008] S1, Obtain the image to be classified;

[0009] S2, in the first generation, randomly generates a population of genetically programmed individuals;

[0010] S3, design a multi-tree model for each genetically engineered individual, including tree structure, function set and terminal set, and evolve each tree according to the multi-tree model;

[0011] S4 uses the AdaBoost concept to assign different weights to multiple trees of genetically programmed individuals in the evolutionary process, thereby constructing an ensemble model;

[0012] S5 uses weighted majority voting to output the predicted class label.

[0013] Preferably, step S4 involves assigning different weights to the multiple trees of the evolved genetically programmed individuals using the AdaBoost approach, thereby constructing an ensemble model. This specifically includes the following steps:

[0014] S41, each genetically programmed individual constructs an ensemble, which is assigned different weights using the idea of ​​AdaBoost;

[0015] S42, calculate and evaluate to determine the fitness value of each genetically programmed individual in the population;

[0016] S43 uses an actuarial operator to replicate the genetically programmed individual with the highest fitness value from the current generation to the next generation;

[0017] S44, based on tournament selection, selects genetically engineered individuals with high fitness values, and generates the next generation of genetically engineered individuals through random exponential crossover and random exponential mutation genetic operators;

[0018] S45, calculate and evaluate to determine the fitness value of each genetically programmed individual in the next generation population;

[0019] S46: Determine if the predefined conditions are met. If yes, stop evolution and output the genetically engineered individual with the highest fitness value. If not, continue executing S43 to S46.

[0020] Preferably, in step S41, each genetically engineered individual constructs an ensemble, assigning different weights using the AdaBoost concept, specifically including the following steps:

[0021] S411, Given a training set D containing n instances,

[0022] D=(x1, y1), (x2, y2),..., (x n y n ), x i Let y represent the i-th training instance. iThis represents the corresponding class label, where i = {1, 2, ..., n};

[0023] S412, input n instances into multiple trees of the genetic programming individual, the multiple trees being 3, 4, 5...j trees;

[0024] S413, return the probabilities (p1, p2, ... pn) of n instances belonging to different classes from the root nodes of multiple trees. j ), where p1, p2...p j It is a vector of size equal to the number of training instances;

[0025] S414, calculate p1, p2...p respectively. j The index of the maximum value of each element in the tree is used to determine the predicted class label of n instances of these trees;

[0026] S415 uses the idea of ​​AdaBoost to calculate the weight of each tree.

[0027] Preferably, step S42, calculating and evaluating the fitness value of each genetically programmed individual in the population, specifically includes the following steps:

[0028] S421, Input a set of training data into genetically engineered individuals and convert it into features;

[0029] S422, use the min-max normalization method to normalize the transformed features;

[0030] S423, normalized features and class labels are input into a linear support vector machine, and hierarchical K-fold cross-validation is used to train and evaluate each genetically engineered individual;

[0031] S424, the training set is divided into K folds. In each iteration, K-1 folds, called the evaluation training set, are used to train the base learners and form a weighted set. The remaining folds, called the evaluation test set, are used to test the built ensemble. This is repeated K times, where each fold is used only once as the evaluation test set.

[0032] S425 determines the fitness value of each genetically engineered individual by averaging the accuracy across K evaluation test sets.

[0033] Preferably, in step S2, the population size of the genetically programmed individuals is set to 100, the number of iterations is set to 50, the depth range of the first-generation tree is [4,8], the maximum depth of the tree is maintained at 8 throughout the evolution process, and the number of trees in each genetically programmed individual is 3.

[0034] Preferably, in step S3, each tree structure consists of multiple layers with different functions, including a region selection layer, an image preprocessing layer, a feature extraction layer, a feature connection layer, and a classification layer. Each layer performs the image classification sub-task in a certain order. These sub-tasks are integrated into a single tree using strongly typed genetic programming.

[0035] The region detection layer and image preprocessing layer are flexible and can appear arbitrarily in the genetic programming tree structure; the region detection layer and image preprocessing layer are optional; the tree structure takes the original image as input and outputs the probability of different categories of the image.

[0036] Preferably, in step S3, the function set includes: region selection function, image preprocessing function, feature extraction function, feature connection function, and classification function;

[0037] The region selection functions Region_S and Region_R can automatically identify square and rectangular regions in an image. The inputs to these two functions are the original image, the coordinates (X and Y) of the top-left corner of the detected region, the side length of the detected square region, or the width and height of the detected rectangular region, respectively. The output is the detected region. The region selection functions detect salient regions of appropriate size in the image.

[0038] Image preprocessing functions preprocess the original image / region, including the Med function for calculating the median, the Mean function for calculating the median, the Max function for calculating the maximum value, the Min function for calculating the minimum value, a Gau Gaussian filter for removing noise such as salt-and-pepper noise and Gaussian noise with a kernel size of 3*3, GauD for the derivative of Gaussian noise, Sqrt for calculating the square root of each pixel value in the image / region, ReLU for rectified linear units, LBP_P, HOG_P, and Gab for generating images / regions with useful features using LB, HOG, and Gabor methods; LoG1 and LoG2 are Laplacian functions of Gaussian filters with a standard deviation of 1 or 2; and W_add and W_sub functions will overlap with them at the top left corner and divide them into equal sizes.

[0039] Feature extraction functions are used to capture various image features, including but not limited to shape and edge features. Feature extraction functions include: Prewitt, PrewittX, PrewittY, Sobel, SobelX, and SobelY, which detect edge features in images from different directions; uLBP is a commonly used texture descriptor; SIFT and HOG functions capture the shape features of objects in images; Hist extracts histogram features containing valuable information; DIF is a method for extracting features from images based on the mean and standard deviation of four lines and six regions.

[0040] The feature concatenation function automatically connects two, three, or four feature vectors. The feature vectors are obtained by the feature extraction layer, and the feature concatenation layer takes the multiple feature vectors obtained by the feature extraction layer as input and outputs a single feature vector.

[0041] The classification functions include four classification algorithms / functions: RF, ERF, SVM, and LR. Each algorithm / function takes concatenated features and corresponding parameters as input and returns the probability of different classes.

[0042] Preferably, in step S3, the terminal set includes: function parameters and the original image, serving as the terminals of the genetic programming tree;

[0043] The image terminal refers to the original image, which is a two-dimensional array where pixel values ​​are normalized to be within the interval [0, 1].

[0044] Function parameters only appear as leaf nodes / terminals in the genetic programming tree when the corresponding function is used;

[0045] X and Y represent the coordinates of the top-left corner of the detected image region, generated in [0,W-3] and [0,H-3] respectively, where W is the image width and H is the image height;

[0046] height and width represent the height and width of the detected region within the rectangular area, with values ​​ranging from [3,H] and [3,W].

[0047] length represents the size of the detected area in the square region, and its value ranges from [3, min(H, W)].

[0048] For information region detection, the minimum size is 3*3; σ represents the standard deviation of the Gaussian filter; the direction of the Gabor filter is defined by θ, and its value range is... Step size is ω1 and ω2 are the parameters of W_add and W_sub; 10 c C is the penalty term for SVM and LR, with a value range of [2,5]; Tree_N is the number of trees in RF and ERF, with a value range of [50,500] and a step size of 10; Tree_D is the maximum depth of RF and ERF trees, with a range of [10,100] and a step size of 10.

[0049] The second aspect of the present invention provides a computer device including a processor, which executes a computer program stored in a memory to implement the steps of the genetic programming-based small-sample image classification ensemble method as described in any of the first aspects of the present invention.

[0050] The third aspect of the present invention provides a computer-readable storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the steps of the genetic programming-based small sample image classification ensemble method proposed in any of the first aspects of the present invention.

[0051] The small-sample image classification ensemble method based on genetic programming proposed in this invention has the following beneficial technical effects:

[0052] (1) The present invention proposes a small sample image classification ensemble method based on genetic programming. It designs a multi-tree model and uses the idea of ​​AdaBoost to build an ensemble model. It can effectively utilize the results of multiple basic learners and learn information-rich and discriminative image features from a small number of training instances, thereby achieving high classification accuracy.

[0053] (2) The small sample image classification ensemble method proposed in this invention uses a multi-tree model design, including tree structure, function set and terminal set, so that each basic learner extracts discriminative features through layer-by-layer transformation (such as image preprocessing layer and feature extraction layer) and selects a classification algorithm, such as support vector machine or logistic regression, to ensure the diversity and accuracy of the basic learners, thereby improving the generalization ability of the ensemble model.

[0054] (3) The present invention proposes a small sample image classification ensemble method based on genetic programming, which designs a multi-tree model, etc. Compared with a single-tree model, it can explore the search space more fully, find a better solution with rich features, and improve classification performance.

[0055] (4) The small sample image classification integration method based on genetic programming proposed in this invention has the advantages of simple implementation, low cost, high classification accuracy and few adjustable parameters.

[0056] (5) The present invention proposes a small sample image classification ensemble method based on genetic programming, which represents the model as a symbolic expression / tree, and has high readability and interpretability.

[0057] (6) The multi-tree genetic programming method proposed in this invention fully searches the representation features of face images, texture images, and scene images, making full use of limited data and providing a solution for classification tasks with small samples.

[0058] Additional aspects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description or may be learned by practice of the invention. Attached Figure Description

[0059] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0060] Figure 1 A flowchart illustrating a small-sample image classification ensemble method based on genetic programming according to an embodiment of the present invention is shown. Detailed Implementation

[0061] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0062] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0063] The following is combined with Figure 1 A specific description is provided of a small-sample image classification ensemble method based on genetic programming according to an embodiment of the present invention.

[0064] A small-sample image classification ensemble method based on genetic programming according to an embodiment of the present invention includes the following steps:

[0065] S1, Obtain the image to be classified;

[0066] S2, in the first generation, randomly generates a population of genetically programmed individuals;

[0067] S3, design a multi-tree model for each genetically engineered individual, including tree structure, function set and terminal set, and evolve each tree according to the multi-tree model;

[0068] S4 uses the AdaBoost concept to assign different weights to multiple trees of genetically programmed individuals in the evolutionary process, thereby constructing an ensemble model;

[0069] S5 uses weighted majority voting to output the predicted class label.

[0070] In this embodiment, the idea of ​​AdaBoost is used to assign different weights to multiple trees of each genetically programmed individual in the evolution, thereby constructing an ensemble model. Weighted majority voting is used to output the predicted class label, so that information-rich and discriminative image features can be learned from a small number of training instances, achieving high classification accuracy.

[0071] Furthermore, in step S2, the population size of the genetically programmed individuals is set to 100, the number of iterations is set to 50, the depth range of the first-generation tree is [4,8], the maximum depth of the tree is maintained at 8 throughout the evolution process, and the number of trees in each genetically programmed individual is 3.

[0072] Further, in step S3, each tree structure consists of multiple layers with different functions; these layers perform image classification sub-tasks in a certain order, namely region selection, image preprocessing, feature extraction, feature connection, and classification; among them, the region detection layer and the image preprocessing layer are flexible, which allows them to appear arbitrarily in the genetic programming tree; in addition, the region detection layer and the image preprocessing layer are optional; these sub-tasks are integrated into a single tree by using strongly typed genetic programming. The tree structure takes the original image as input and outputs the probabilities of different categories of the image;

[0073] The function set includes region selection functions, image preprocessing functions, feature extraction functions, feature connection functions, and classification functions. The region selection functions Region_S and Region_R can automatically identify square and rectangular regions in an image. The inputs to these two functions are the original image, the coordinates (X and Y) of the top-left corner of the detected region, the side length of the detected square region, or the width and height of the detected rectangular region, respectively. The output is the detected region. The region selection functions detect appropriately sized salient regions in the image.

[0074] Image preprocessing functions preprocess the original image / region; Med, Mean, Max, Min, and Gau are median, mean, maximum, minimum, and Gaussian filters, respectively, which can remove different types of noise, such as salt-and-pepper noise and Gaussian noise, with a kernel size of 3*3; GauD is the derivative of Gaussian noise; Sqrt calculates the square root of each pixel value in the image / region; ReLU is the rectified linear unit; LBP_P, HOG_P, and Gab generate images / regions with useful features using LB, HOG, and Gabor methods; LoG1 and LoG2 are Laplacian functions of Gaussian filters with a standard deviation of 1 or 2; W_add and W_sub functions overlap them at the top left corner and divide them into equal sizes;

[0075] Feature extraction functions can capture various image features such as shape and edge features, including Prewitt, PrewittX, PrewittY, Sobel, SobelX, and SobelY, which can detect edge features in images from different directions; uLBP is a commonly used texture descriptor; SIFT and HOG functions capture the shape features of objects in images; Hist extracts histogram features containing valuable information; DIF is a method for extracting features from images based on the mean and standard deviation of four lines and six regions.

[0076] The feature connection layer takes multiple feature vectors obtained from the feature extraction layer as input and outputs a single feature vector; the feature connection function can automatically connect two, three, or four feature vectors.

[0077] The classification layer uses four classification algorithms / functions: RF, ERF, SVM, and LR. Each algorithm / function takes concatenated features and corresponding parameters as input and returns the probability of different classes.

[0078] The terminal set consists of: function parameters and the original image as terminals of the genetic programming tree; the image terminal refers to the original image, which is a two-dimensional array where pixel values ​​are normalized to the interval [0,1]; function parameters only appear as leaf nodes / terminals in the genetic programming tree when the corresponding function is used; X and Y represent the coordinates of the upper left corner of the detected image region, generated in [0,W-3] and [0,H-3] respectively, where W is the image width and H is the image height; height and width represent the height and width of the detected region in the rectangular region, with values ​​ranging from [3,H] and [3,W]; length represents the size of the detected region in the square region, with values ​​ranging from [3,min(H,W)]; for information region detection, the minimum size is required to be 3*3; σ represents the standard deviation of the Gaussian filter; the direction of the Gabor filter is defined by θ, with values ​​ranging from... Step size is ω1 and ω2 are the parameters of W_add and W_sub; 10 C C is the penalty term for SVM and LR, with a value range of [2,5]; Tree_N is the number of trees in RF and ERF, with a value range of [50,500] and a step size of 10; Tree_D is the maximum depth of the RF tree and ERF tree, with a range of [10,100] and a step size of 10; the system can automatically find the optimal values ​​for these parameters based on their value ranges.

[0079] Further, in step S4, the multiple trees of the evolved genetically programmed individuals are assigned different weights using the AdaBoost approach to construct an ensemble model. The specific steps are as follows:

[0080] S41: For each genetically engineered individual, an ensemble is constructed, and different weights are assigned using the AdaBoost concept. The specific steps are as follows:

[0081] Given a training set D containing n instances, D = (x1, y1), (x2, y2), ..., (x... n y n ), x i Let y represent the i-th training instance. i Let i represent the corresponding class label, where i = {1, 2, ..., n}; input n instances into three trees respectively; return the probabilities (p1, p2, p3) of n instances belonging to different classes from the root node of the three trees, where p1, p2, and p3 are vectors of size equal to the number of training instances; determine the predicted class labels of the n instances in these three trees by calculating the index of the maximum value of each element in p1, p2, and p3 respectively; use the idea of ​​AdaBoost to calculate the weights of these three trees to obtain good generalization performance.

[0082] S42: Calculate and evaluate the fitness value of each individual in the population. The specific steps are as follows:

[0083] An individual is fed a training set into a genetic programming individual and transformed into features. The transformed features are then normalized using a min-max normalization method. The normalized features and class labels are fed into a linear support vector machine, and hierarchical K-fold cross-validation is used to train and evaluate each genetic programming individual. The training set is divided into K folds. In each iteration, K-1 folds, called the evaluation training set, are used to train the base learners and form a weighted set. The remaining folds, called the evaluation test set, are used to test the constructed ensemble. This evaluation process is repeated K times, with each fold used only once as the evaluation test set. The fitness of each genetic programming individual is determined by averaging the accuracy across the K evaluation test sets.

[0084] S43: The genetically programmed individual with the highest fitness value is replicated to the next generation using an actuarial operator.

[0085] S44: Select genetically programmed individuals with high fitness values ​​through tournament selection, and generate the next generation of individuals through genetic operators such as random exponential crossover and random exponential mutation;

[0086] S45, calculate the fitness value of each genetically programmed individual in the next generation population;

[0087] S46: Determine if the predefined termination condition is met; if yes, stop evolution; otherwise, proceed to S43 to continue the search process.

[0088] like Figure 1As shown, a small-sample image classification ensemble method based on genetic programming according to an embodiment of the present invention includes the following steps:

[0089] S101, Input the original image.

[0090] S102, a population of randomly generated genetically programmed individuals.

[0091] S103, design a new multi-tree model representation (tree structure, function set, and terminal set) for each genetically programmed individual, and evolve each tree according to the new multi-tree model.

[0092] Specifically, each tree structure consists of multiple layers with different functions; these layers perform image classification sub-tasks in a specific order, namely region selection, image preprocessing, feature extraction, feature connection, and classification; the region detection layer and image preprocessing layer are flexible, allowing them to appear arbitrarily in the genetic programming tree; furthermore, the region detection layer and image preprocessing layer are optional; these sub-tasks are integrated into a single tree using strongly typed genetic programming. The tree structure takes the original image as input and outputs the probabilities of different categories of the image;

[0093] The function set includes region selection functions, image preprocessing functions, feature extraction functions, feature connection functions, and classification functions. The region selection functions Region_S and Region_R can automatically identify square and rectangular regions in an image. The inputs to these two functions are the original image, the coordinates (X and Y) of the top-left corner of the detected region, the side length of the detected square region, or the width and height of the detected rectangular region, respectively. The output is the detected region. The region selection functions detect appropriately sized salient regions in the image.

[0094] Image preprocessing functions preprocess the original image / region; Med, Mean, Max, Min, and Gau are median, mean, maximum, minimum, and Gaussian filters, respectively, which can remove different types of noise, such as salt-and-pepper noise and Gaussian noise, with a kernel size of 3*3; GauD is the derivative of Gaussian noise; Sqrt calculates the square root of each pixel value in the image / region; ReLU is the rectified linear unit; LBP_P, HOG_P, and Gab generate images / regions with useful features using LB, HOG, and Gabor methods; LoG1 and LoG2 are Laplacian functions of Gaussian filters with a standard deviation of 1 or 2; W_add and W_sub functions overlap them at the top left corner and divide them into equal sizes;

[0095] Feature extraction functions can capture various image features such as shape and edge features, including Prewitt, PrewittX, PrewittY, Sobel, SobelX, and SobelY, which can detect edge features in images from different directions; uLBP is a commonly used texture descriptor; SIFT and HOG functions capture the shape features of objects in images; Hist extracts histogram features containing valuable information; DIF is a method for extracting features from images based on the mean and standard deviation of four lines and six regions.

[0096] The feature connection layer takes multiple feature vectors obtained from the feature extraction layer as input and outputs a single feature vector; the feature connection function can automatically connect two, three, or four feature vectors.

[0097] The classification layer uses four classification algorithms / functions: RF, ERF, SVM, and LR. Each algorithm / function takes concatenated features and corresponding parameters as input and returns the probability of different classes.

[0098] The terminal set consists of: function parameters and the original image as terminals of the genetic programming tree; the image terminal refers to the original image, which is a two-dimensional array where pixel values ​​are normalized to the interval [0,1]; function parameters only appear as leaf nodes / terminals in the genetic programming tree when the corresponding function is used; X and Y represent the coordinates of the upper left corner of the detected image region, generated in [0,W-3] and [0,H-3] respectively, where W is the image width and H is the image height; height and width represent the height and width of the detected region in the rectangular region, with values ​​ranging from [3,H] and [3,W]; length represents the size of the detected region in the square region, with values ​​ranging from [3,min(H,W)]; for information region detection, the minimum size is required to be 3*3; σ represents the standard deviation of the Gaussian filter; the direction of the Gabor filter is defined by θ, with values ​​ranging from... Step size is ω1 and ω2 are the parameters of W_add and W_sub; 10 C C is the penalty term for SVM and LR, with a value range of [2,5]; Tree_N is the number of trees in RF and ERF, with a value range of [50,500] and a step size of 10; Tree_D is the maximum depth of the RF tree and ERF tree, with a range of [10,100] and a step size of 10; the system can automatically find the optimal values ​​for these parameters based on their value ranges.

[0099] S104 uses the concept of AdaBoost to assign different weights.

[0100] Specifically, taking three trees as an example, given a training set D containing n instances, D = (x1, y1), (x2, y2), ..., (x... n y n ), x i Let y represent the i-th training instance. i Let i represent the corresponding class label, where i = {1, 2, ..., n}; input n instances into three trees respectively; return the probabilities (p1, p2, p3) of n instances belonging to different classes from the root node of the three trees, where p1, p2, and p3 are vectors of size equal to the number of training instances; determine the predicted class labels of the n instances in these three trees by calculating the index of the maximum value of each element in p1, p2, and p3 respectively; use the idea of ​​AdaBoost to calculate the weights of these three trees to obtain good generalization performance.

[0101] S105, calculate the target fitness value for each individual.

[0102] Specifically, individuals input a training set into the genetic programming individual and transform it into features; then, the transformed features are normalized using a min-max normalization method; the normalized features and class labels are input into a linear support vector machine, and each genetic programming individual is trained and evaluated using hierarchical K-fold cross-validation; the training set is divided into K folds, and in each iteration, K-1 folds, called the evaluation training set, are used to train the base learners and form a weighted set, while the remaining folds, called the evaluation test set, are used to test the constructed ensemble; the above evaluation process is repeated K times, with each fold used only once as the evaluation test set; the fitness of each genetic programming individual is determined by averaging the accuracy across the K evaluation test sets.

[0103] S106 generates offspring through elite, selection, crossover, and mutation operations.

[0104] Specifically, the genetically engineered individual with the highest fitness value is copied from the first generation to the second generation using actuarial operators. Through tournament selection, genetically engineered individuals with higher fitness values ​​are selected. The next generation of individuals is generated through genetic operators such as random exponential crossover and random exponential mutation.

[0105] S107, calculate the target fitness value for each individual. It should be noted that this calculation is for the new generation of individuals.

[0106] S108, Determine if the predefined conditions are met?

[0107] If yes, proceed to step S109 and output the optimal individual. If no, continue to step S106.

[0108] The proposed genetic programming-based few-sample image classification ensemble method was used in conjunction with the traditional method HOG+RF, the convolutional neural network method MobileNetV3, and the genetic programming-based method FGP to solve eight classification problems: FEI_1, FEI_2, RaFD, Jaffe, FS, Outex, Aberdeen, and EYALE. Each classification problem was executed independently 30 times. The population size was set to 100 individuals, and the maximum number of iterations was set to 50. The performance index values ​​obtained each time were recorded. The average accuracy and standard deviation of the classification results are shown in Table 1.

[0109] Table 1. Comparison of classification accuracy results for FEI_1, FEI_2, RaFD, Jaffe, FS, Outex, Aberdeen, and EYALE classification problems.

[0110]

[0111] As shown in Table 1, the small-sample image classification ensemble method based on genetic programming proposed in this invention has significantly better average accuracy and standard deviation than traditional methods in most cases, demonstrating higher classification accuracy.

[0112] Compared to HOG+RF, the present invention significantly improves the average accuracy on these eight datasets, by 8%, 13.46%, 25.14%, 18.23%, 37.73%, 50.6%, 5.56%, and 46.12%, respectively. This demonstrates that the genetic programming-based few-sample image classification ensemble method proposed in this invention has the ability to automatically learn more useful features from a limited number of images.

[0113] Compared to MobileNetV3, the classification performance on RaFD is significantly better than that of this invention. However, the classification performance of this invention is significantly better on the other seven datasets, with average accuracy improvements of 7.67%, 7.53%, 12.7%, 17.22%, 2.62%, 10.5%, and 21.33%, respectively. Based on the classification results, in most cases, the convolutional neural network comparison method is significantly inferior to this invention in terms of performance. Convolutional neural networks typically involve a large number of parameters and require a large amount of training data to effectively train the model. In contrast, this invention has a relatively simple tree-based structure, using only a few functions representing the solution and terminals, and is able to learn useful features from a limited number of training instances.

[0114] Compared to the genetic programming method FGP, this invention significantly improves classification accuracy in 5 comparisons, while maintaining similar accuracy in 3 comparisons. Improvements of 4.54%, 7.26%, 14.53%, 1.06%, and 1.26% are achieved in FEI_1, FEI_2, FS, Outex, and Aberdeen, respectively, demonstrating significantly better performance in most comparisons. This indicates the effectiveness of the genetic programming-based few-sample image classification ensemble method of this invention, through its multi-tree model and the use of AdaBoost to assign different weights, significantly improving classification accuracy.

[0115] The proposed genetic programming-based few-sample image classification ensemble method can learn discriminative and informative features from a small training set and use the constructed ensemble for classification, thereby achieving higher generalization performance compared to traditional methods. This method, through a multi-tree model design, combines feature transformations at multiple levels using various powerful image correlation operators within the tree structure. Even with a limited number of training images, it can learn informative features.

[0116] The proposed method for small-sample image classification based on genetic programming uses a multi-tree model ensemble method based on genetic programming to handle image classification tasks. It adopts the idea of ​​AdaBoost to estimate the weights of three or more trees and uses the results for classification. It uses a new multi-tree model representation to construct accurate and diverse base learners, which can learn information-rich features from small training sets, automatically select classification algorithms and perform classification, resulting in higher classification accuracy, fewer adjustable parameters, simpler implementation, and lower cost.

[0117] The steps in the method of this invention can be adjusted, combined, or deleted according to actual needs.

[0118] The units in the device of the present invention can be merged, divided, or deleted according to actual needs.

[0119] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.

[0120] In the description of this specification, the terms "one embodiment," "some embodiments," "specific embodiment," etc., refer to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0121] 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 small-sample image classification ensemble method based on genetic programming, characterized in that, Includes the following steps: S1, Obtain the image to be classified; S2, in the first generation, randomly generates a population of genetically programmed individuals; S3, design a multi-tree model for each genetically engineered individual, including tree structure, function set and terminal set, and evolve each tree according to the multi-tree model; S4 uses the AdaBoost concept to assign different weights to multiple trees of genetically programmed individuals in the evolutionary process, thereby constructing an ensemble model; S5 uses weighted majority voting to output the predicted class label; Step S4 involves assigning different weights to the multiple trees of the evolved genetically programmed individuals using the AdaBoost approach to construct an ensemble model. This step specifically includes the following steps: S41, each genetically programmed individual constructs an ensemble, which is assigned different weights using the idea of ​​AdaBoost; S42, calculate and evaluate to determine the fitness value of each genetically programmed individual in the population; S43 uses an actuarial operator to replicate the genetically programmed individual with the highest fitness value from the current generation to the next generation; S44, based on tournament selection, selects genetically engineered individuals with high fitness values, and generates the next generation of genetically engineered individuals through random exponential crossover and random exponential mutation genetic operators; S45, calculate and evaluate to determine the fitness value of each genetically programmed individual in the next generation population; S46: Determine if the predefined conditions are met. If yes, stop evolution and output the genetically engineered individual with the highest fitness value. If no, continue executing S43 to S46. In step S41, each genetically engineered individual constructs an ensemble, assigning different weights using the AdaBoost concept. This specifically includes the following steps: S411, Given a training set D containing n instances, , x i Indicates the first i One training instance, y i Indicates the corresponding class label, where ; S412, input n instances into multiple trees of the genetic programming individual, the multiple trees being 3, 4, 5...j trees; S413, Return the probability that n instances from the root node of multiple trees belong to different classes. ,in, p 1. p 2…… p j It is a vector of size equal to the number of training instances; S414, calculate respectively p 1. p 2…… p j The index of the maximum value of each element in the tree is used to determine the predicted class label of n instances of these trees; S415 uses the idea of ​​AdaBoost to calculate the weight of each tree.

2. The small-sample image classification ensemble method based on genetic programming according to claim 1, characterized in that, Step S42, calculate and evaluate the fitness value of each genetically programmed individual in the population, specifically including the following steps: S421, Input a set of training data into genetically engineered individuals and convert it into features; S422, use the min-max normalization method to normalize the transformed features; S423, normalized features and class labels are input into a linear support vector machine, and hierarchical K-fold cross-validation is used to train and evaluate each genetically engineered individual; S424, the training set is divided into K folds. In each iteration, K-1 folds, called the evaluation training set, are used to train the base learners and form a weighted set. The remaining folds, called the evaluation test set, are used to test the built ensemble. This is repeated K times, where each fold is used only once as the evaluation test set. S425 determines the fitness value of each genetically engineered individual by averaging the accuracy across K evaluation test sets.

3. The small-sample image classification ensemble method based on genetic programming according to claim 1, characterized in that, In step S2, the population size of the genetically programmed individuals is set to 100, the number of iterations is set to 50, the depth range of the first generation tree is [4,8], the maximum depth of the tree is maintained at 8 throughout the evolution process, and the number of trees in each genetically programmed individual is 3.

4. The small-sample image classification ensemble method based on genetic programming according to claim 1, characterized in that, In step S3, each tree structure consists of multiple layers with different functions, including a region selection layer, an image preprocessing layer, a feature extraction layer, a feature connection layer, and a classification layer. Each layer performs the image classification sub-task in a certain order. These sub-tasks are integrated into a single tree using strongly typed genetic programming. The region detection layer and image preprocessing layer are flexible and can appear arbitrarily in the genetic programming tree structure; the region detection layer and image preprocessing layer are optional; the tree structure takes the original image as input and outputs the probability of different categories of the image.

5. The small-sample image classification ensemble method based on genetic programming according to claim 4, characterized in that, In step S3, the function set includes: region selection function, image preprocessing function, feature extraction function, feature connection function, and classification function; The region selection functions Region_S and Region_R can automatically identify square and rectangular regions in an image. The inputs to these two functions are the original image, the X and Y coordinates of the top left corner of the detected region, the side length of the detected square region, or the width and height of the detected rectangular region. The output is the detected region. The region selection functions detect salient regions of appropriate size in the image. Image preprocessing functions preprocess the original image / region, including the Med function for calculating the median, the Mean function for calculating the median, the Max function for calculating the maximum value, the Min function for calculating the minimum value, the Gau Gaussian filter for removing noise, the GauD derivative of Gaussian noise, the Sqrt function for calculating the square root of each pixel value in the image / region, ReLU for rectified linear units, LBP_P, HOG_P, and Gab for generating images / regions with useful features using LB, HOG, and Gabor methods; LoG1 and LoG2 are Laplacian functions of Gaussian filters with standard deviations of 1 or 2; and the W_add and W_sub functions will overlap with them at the top left corner and divide them into equal sizes. Feature extraction functions are used to capture various image features, including but not limited to shape and edge features. Feature extraction functions include: Prewitt, PrewittX, PrewittY, Sobel, SobelX, and SobelY, which detect edge features in images from different directions; uLBP is a commonly used texture descriptor; SIFT and HOG functions capture the shape features of objects in images; Hist extracts histogram features containing valuable information; DIF is a method for extracting features from images based on the mean and standard deviation of four lines and six regions. The feature concatenation function automatically connects two, three, or four feature vectors. The feature vectors are obtained by the feature extraction layer, and the feature concatenation layer takes the multiple feature vectors obtained by the feature extraction layer as input and outputs a single feature vector. The classification functions include four classification algorithms / functions: RF, ERF, SVM, and LR. Each algorithm / function takes concatenated features and corresponding parameters as input and returns the probability of different classes.

6. The small-sample image classification ensemble method based on genetic programming according to claim 5, characterized in that, In step S3, the terminal set includes: function parameters and the original image, which serve as the terminals of the genetic programming tree; The image terminal refers to the original image, which is a two-dimensional array where pixel values ​​are normalized to be within the interval [0,1]. Function parameters only appear as leaf nodes / terminals in the genetic programming tree when the corresponding function is used; X and Y represent the coordinates of the top-left corner of the detected image region, generated in [0,W-3] and [0,H-3] respectively, where W is the image width and H is the image height; height and width represent the height and width of the detected region within the rectangular area, with values ​​ranging from [3,H] and [3,W]. length represents the size of the detected area in the square region, and its value ranges from [3, min(H, W)]. For information region detection, the minimum size is 3*3; σ represents the standard deviation of the Gaussian filter; the direction of the Gabor filter is determined by... θ Defined, the range of values ​​is Step size is ; ω 1 and ω 2 is the parameter for W_add and W_sub; 10 c C is the penalty term for SVM and LR, with a value range of [2,5]; Tree_N is the number of trees in RF and ERF, with a value range of [50,500] and a step size of 10; Tree_D is the maximum depth of RF and ERF trees, with a range of [10,100] and a step size of 10.

7. A computer device comprising a processor for executing a computer program stored in a memory to implement the steps of the genetic programming-based small-sample image classification ensemble method according to any one of claims 1 to 6.

8. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the genetic programming-based small-sample image classification ensemble method according to any one of claims 1 to 6.