An SVM image classification method fusing relief F mechanism and meta-heuristic algorithm

CN122929288APending Publication Date: 2026-10-16YANGO UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611148611.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-30
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0004]本发明的目的在于提供一种融合ReliefF机制与元启发式算法的SVM图像分类方法,能够有效降低特征维度并提高分类性能,解决现有图像分类方法在面对高维特征数据时特征冗余较多、分类准确率与计算效率难以兼顾的问题

Benefits of technology

本发明提供的融合ReliefF机制与元启发式算法的SVM图像分类方法,结合ReliefF特征选择与二进制元启发式算法,实现了对高维图像特征的有效降维,在减少冗余特征的同时提升了SVM分类的准确率。通过多策略元启发式优化,在高维特征空间中快速收敛至最优特征子集,能够显著提高训练效率,减少计算开销,适用于大规模图像数据集。采用优化特征子集训练的SVM分类模型具备更强的泛化能力,对新图像具有更高的分类精度,同时能够降低过拟合风险,适合实际应用中的图像分类任务。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122929288A_ABST
    Figure CN122929288A_ABST
Patent Text Reader

Abstract

The application discloses a kind of SVM image classification methods of fusing ReliefF mechanism and meta-heuristic algorithm, belong to image classification technical field, including: extracting initial feature to input image, calculating feature weight using ReliefF mechanism, according to weight order filters out candidate feature subset to reduce data dimension, using binary coding converts feature selection problem into solution space search problem, after initialization population, iteration optimization is carried out by multi-strategy binary meta-heuristic algorithm, global exploration strategy is used in search early stage, local development strategy is used in search middle and late stage, dynamically balance search ability, the weighted sum of accuracy rate and feature compression rate of SVM classification model is used as comprehensive fitness value each iteration, feedback guide population update, after iteration termination, optimal feature subset is selected to train final SVM classification model to complete image classification prediction.The method can realize efficient feature selection and high-precision image classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an SVM image classification method that integrates the ReliefF mechanism and metaheuristic algorithms, belonging to the field of image classification technology. Background Technology

[0002] Image classification is an important research direction in computer vision, with wide applications in scenarios such as intelligent security, medical image analysis, industrial inspection, and agricultural remote sensing. With the continuous development of image acquisition technology and data scale, image data typically contains a large number of high-dimensional features, which can describe information such as texture, shape, color, and spatial structure of the image. Support Vector Machines (SVMs) are widely used in image classification tasks due to their good generalization ability and strong classification performance, achieving relatively accurate classification results even with limited sample conditions.

[0003] However, in practical applications, image feature extraction often results in a high-dimensional feature space containing a large amount of redundant information and noisy features. This not only increases model training time and computational cost but also easily leads to overfitting, thereby reducing classification accuracy. Currently common feature selection methods, such as the ReliefF feature selection algorithm or metaheuristic optimization-based feature selection algorithms, still have certain limitations in practical applications. For example, when using ReliefF alone for feature selection, it mainly relies on feature weights for ranking, making it difficult to fully consider the combination relationships between features and potentially missing feature combinations that play a crucial role in classification. Conversely, when using metaheuristic algorithms such as binary particle swarm optimization or differential evolution for feature selection, low search efficiency or getting trapped in local optima are common problems in high-dimensional feature spaces, and repeated training of the classification model is required, resulting in significant computational overhead. Summary of the Invention

[0004] The purpose of this invention is to provide an SVM image classification method that integrates the ReliefF mechanism and metaheuristic algorithm, which can effectively reduce feature dimensionality and improve classification performance, and solve the problems of existing image classification methods having too much feature redundancy and difficulty in balancing classification accuracy and computational efficiency when facing high-dimensional feature data.

[0005] To achieve the above objectives, the present invention provides the following technical solution: In a first aspect, the present invention provides an SVM image classification method that integrates the ReliefF mechanism and a metaheuristic algorithm, comprising: Obtain image samples to be classified and label them with category labels to form the original dataset. Extract the initial features of each image sample to form the original feature matrix. The original dataset is divided into a training set and a test set. Based on the category label and initial features of each image sample in the training set, the features in the original feature matrix are sorted in descending order according to the ReliefF weights, and a selection strategy is used to select a subset of candidate features. Each candidate feature in the candidate feature subset is assigned a binary bit to generate a binary string. A value of 1 indicates that the corresponding candidate feature is selected, and a value of 0 indicates that the corresponding candidate feature is not selected. The metaheuristic algorithm population is initialized, where each individual represents a binary string. Iterative search is started from the initialized population. The exploration weight and development weight are dynamically calculated based on the ratio of the current iteration number to the maximum iteration number. After each iteration, the updated individual is converted into an effective binary code through discretization mapping to generate a new generation of population. For each generation of the population, each binary code is decoded. Candidate features corresponding to the binary bits with a value of 1 are selected to train an SVM classification model. The classification accuracy of the SVM classification model is calculated. The feature compression ratio is calculated based on the number of selected candidate features. The comprehensive fitness value of the binary code is calculated based on the classification accuracy and the feature compression ratio. The comprehensive fitness value is fed back to the population update mechanism of the metaheuristic algorithm until the iteration termination condition is reached. The candidate features corresponding to the binary bits with a value of 1 in the binary code with the highest comprehensive fitness value are selected to train an SVM classification model. The trained SVM classification model is used to classify each image sample in the test set to obtain the category result of each image sample.

[0006] In conjunction with the first aspect, further, extracting the initial features of each image sample to form the original feature matrix includes: Each image sample is preprocessed, and the initial features of each preprocessed image sample are extracted to form the original feature matrix; Preprocessing includes uniform resizing, grayscale or color space conversion, and pixel value normalization; The initial features include color histogram features, local binary pattern texture features, and deep features from the output of a pre-trained convolutional neural network.

[0007] Combining the first aspect, the further update formula for the ReliefF weights is: ; in, Represents the first element in the original feature matrix. The ReliefF weights of each feature. Indicates the first training set Image samples, , They respectively represent searching in the feature space and The same or different category labels The th nearest neighbor sample indivual, This represents the total number of image samples in the training set. , They represent the first and second digits of the original feature matrix, respectively. One feature in and , The difference function between them.

[0008] In conjunction with the first aspect, further, when the first element in the original feature matrix... When a feature is a continuous feature, its presence in the sample With sample The difference function between them is: ; When the first in the original feature matrix When a feature is a discrete feature, its presence in the sample With sample The difference function between them is: ; in, Represents the first element in the original feature matrix. One feature in the sample With sample The difference function between them , Representing samples respectively ,sample In the original feature matrix, the first The values ​​that can be taken on each feature , These represent the nth element in the original feature matrix. The maximum and minimum values ​​of each feature on the training set.

[0009] In conjunction with the first aspect, further screening strategies include: Remove features whose ReliefF weights are less than the weight threshold, or retain the top 30% of features with the highest ReliefF weights. The formula for calculating the weight threshold is: ; in, Indicates the weight threshold. This represents the mean of the ReliefF weights for all features in the original feature matrix. This represents the standard deviation of the ReliefF weights for all features in the original feature matrix. This represents the adjustment factor.

[0010] Building upon the first aspect, we can further explore the formula for calculating the weights as follows: ; The formula for calculating development weight is: ; in, Indicates the exploration weight, Indicates development weight, Indicates the current iteration number. Indicates the maximum number of iterations; definition The initial search phase involves increasing the exploration weight and employing a global exploration strategy to update individuals in the population. This increases the probability of crossover and random perturbation operations. The probability of crossover is set to... The random perturbation operation is achieved by randomly flipping binary bits, with the probability of random flipping set to 1. ; definition The phase is the mid-to-late search stage. In the mid-to-late search stage, the development weight is increased and a local development strategy is adopted to update the individuals in the population. Bit flip operations are performed around the best individual in the current population. The probability of the bit flip operation is calculated by the following formula: ; in, This indicates the probability of a bit-flipping operation. Indicates the total number of candidate features; The formula for updating binary bits is: ; in, Indicates the first in the population The first individual's corresponding binary string one binary bit The first character represents the binary string corresponding to the best individual in the population. One binary digit.

[0011] In conjunction with the first aspect, further, converting the updated individual into an effective binary code through discretization mapping includes: The sigmoid function is used to convert the updated intermediate continuous values ​​of an individual into probability values: ; in, , Represent the i-th element in the population. The individual's first The probability value corresponding to each bit, and the intermediate continuous values; The updated individual is converted into a valid binary code through a thresholding operation: ; in, Indicates the updated The first of the binary codes corresponding to the individual One binary digit.

[0012] In conjunction with the first aspect, furthermore, the classification accuracy of the SVM classification model is achieved by using... The average classification accuracy is calculated using folded cross-validation, which divides the training set into... A set of non-overlapping subsets, used each time A subset is used to train the SVM classification model, and the remaining subset is used for testing. The formula for calculating the average classification accuracy is: ; in, This represents the average classification accuracy. Indicates the first The total number of image samples in the test set. Indicates the first The number of correctly classified image samples in the test set; The formula for calculating the feature compression ratio is: ; in, Indicates the feature compression ratio. This indicates the number of selected candidate features. , Represents the first in binary encoding one binary bit , Indicates the total number of candidate features; The formula for calculating the overall fitness value is: ; in, This represents the overall fitness value. and All are weighting coefficients, satisfying and .

[0013] Secondly, this invention provides an SVM image classification system that integrates the ReliefF mechanism and a metaheuristic algorithm, comprising: The data acquisition module is used to acquire image samples to be classified and label them with category labels to form the original dataset, and extract the initial features of each image sample to form the original feature matrix; The feature filtering module is used to divide the original dataset into training and test sets. Based on the category labels and initial features of each image sample in the training set, the features in the original feature matrix are sorted in descending order according to the ReliefF weights, and a selection subset of candidate features is selected using a filtering strategy. The binary string generation module is used to assign a binary bit to each candidate feature in the candidate feature subset and generate a binary string. A value of 1 in the binary bit represents that the corresponding candidate feature is selected, and a value of 0 represents that the corresponding candidate feature is not selected. The iteration module is used to initialize the population of the metaheuristic algorithm. Each individual in the population represents a binary string. Iterative search starts from the initialized population. The exploration weight and development weight are dynamically calculated based on the ratio of the current iteration number to the maximum iteration number. After each iteration, the updated individual is converted into a valid binary code through discretization mapping to generate a new generation of population. The decoding module decodes each binary code in each generation of the population, selects candidate features corresponding to the binary bits with a value of 1 in the binary code to train an SVM classification model, calculates the classification accuracy of the SVM classification model, calculates the feature compression ratio based on the number of selected candidate features, calculates the comprehensive fitness value of the binary code based on the classification accuracy and feature compression ratio, and feeds the comprehensive fitness value back to the population update mechanism of the metaheuristic algorithm until the iteration termination condition is reached. The candidate features corresponding to the binary bits with a value of 1 in the binary code with the highest comprehensive fitness value are selected to train an SVM classification model. The trained SVM classification model is then used to classify each image sample in the test set to obtain the category result of each image sample.

[0014] Thirdly, the present invention provides a computer device, comprising: Storage medium: used to store computer programs; Processor: for executing the computer program to implement the SVM image classification method that integrates the ReliefF mechanism and metaheuristic algorithm as described in the first aspect.

[0015] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the SVM image classification method that integrates the ReliefF mechanism and the metaheuristic algorithm described in the first aspect.

[0016] Fifthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the SVM image classification method that integrates the ReliefF mechanism and the metaheuristic algorithm described in the first aspect.

[0017] Compared with the prior art, the beneficial effects of the present invention are: This invention provides an SVM image classification method that integrates the ReliefF mechanism and a metaheuristic algorithm. By combining ReliefF feature selection with a binary metaheuristic algorithm, it achieves effective dimensionality reduction of high-dimensional image features, improving SVM classification accuracy while reducing redundant features. Through multi-strategy metaheuristic optimization, it quickly converges to the optimal feature subset in the high-dimensional feature space, significantly improving training efficiency and reducing computational overhead, making it suitable for large-scale image datasets. The SVM classification model trained with the optimized feature subset exhibits stronger generalization ability and higher classification accuracy for new images, while reducing the risk of overfitting, making it suitable for image classification tasks in practical applications. Attached Figure Description

[0018] Figure 1 This is a flowchart of the SVM image classification method that integrates the ReliefF mechanism and metaheuristic algorithm provided in this embodiment of the invention; Figure 2 This is a schematic diagram of image preprocessing and initial feature extraction provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the multi-strategy binary heuristic algorithm provided in an embodiment of the present invention. Detailed Implementation

[0019] The technical solution of the present invention will be further described in detail below with reference to specific embodiments.

[0020] Embodiments of the present invention are described in detail below. Examples of these embodiments are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention. Unless otherwise specified, embodiments of the present invention and the technical features thereof can be combined with each other.

[0021] This invention provides an SVM image classification method that integrates the ReliefF mechanism and metaheuristic algorithms, comprising: Obtain image samples to be classified and label them with category labels to form the original dataset. Extract the initial features of each image sample to form the original feature matrix. The original dataset is divided into a training set and a test set. Based on the category label and initial features of each image sample in the training set, the features in the original feature matrix are sorted in descending order according to the ReliefF weights, and a selection strategy is used to select a subset of candidate features. Each candidate feature in the candidate feature subset is assigned a binary bit to generate a binary string. A value of 1 indicates that the corresponding candidate feature is selected, and a value of 0 indicates that the corresponding candidate feature is not selected. The metaheuristic algorithm population is initialized, where each individual represents a binary string. Iterative search is started from the initialized population. The exploration weight and development weight are dynamically calculated based on the ratio of the current iteration number to the maximum iteration number. After each iteration, the updated individual is converted into an effective binary code through discretization mapping to generate a new generation of population. For each generation of the population, each binary code is decoded. Candidate features corresponding to the binary bits with a value of 1 are selected to train an SVM classification model. The classification accuracy of the SVM classification model is calculated. The feature compression ratio is calculated based on the number of selected candidate features. The comprehensive fitness value of the binary code is calculated based on the classification accuracy and the feature compression ratio. The comprehensive fitness value is fed back to the population update mechanism of the metaheuristic algorithm until the iteration termination condition is reached. The candidate features corresponding to the binary bits with a value of 1 in the binary code with the highest comprehensive fitness value are selected to train an SVM classification model. The trained SVM classification model is used to classify each image sample in the test set to obtain the category result of each image sample.

[0022] The SVM image classification method that integrates the ReliefF mechanism and metaheuristic algorithm provided in this invention solves the problem of limited classification performance of traditional SVM in high-dimensional image data by integrating feature selection, parameter optimization and SVM classification model.

[0023] Figure 1 This is a flowchart of the SVM image classification method that integrates the ReliefF mechanism and metaheuristic algorithm provided in this embodiment. This flowchart only shows the logical order of the method in this embodiment. Provided there are no conflicts, different flowcharts may be used. Figure 1 Complete the steps shown or described in the order indicated.

[0024] The SVM image classification method that integrates the ReliefF mechanism and metaheuristic algorithm provided in this embodiment can be applied to a terminal and can be executed by an SVM image classification system that integrates the ReliefF mechanism and metaheuristic algorithm. This system can be implemented by software and / or hardware and can be integrated into the terminal, such as any tablet computer or computer device with communication function.

[0025] In one possible embodiment, the SVM image classification method that integrates the ReliefF mechanism and the metaheuristic algorithm specifically includes the following steps: Step 1: Obtain image samples to be classified and label them with category labels to form the original dataset; extract the initial features of each image sample to form the original feature matrix. In this embodiment, image samples to be classified are obtained and labeled manually or automatically according to their content or category to form an original dataset with clear category labels.

[0026] Specifically, LabelImg or pre-trained object detection tools are used to annotate image samples with category labels. Each image is assigned a category label, ensuring that the label is consistent with the image content, thus forming a structured dataset. The annotation process needs to verify the accuracy of the labels and avoid introducing noise.

[0027] In this embodiment, extracting the initial features of each image sample to form the original feature matrix specifically includes: preprocessing each image sample and extracting the initial features of each preprocessed image sample to form a high-dimensional original feature matrix.

[0028] Specifically, preprocessing includes uniform size adjustment, grayscale or color space conversion, and pixel value normalization.

[0029] Uniform resizing uses bilinear interpolation to adjust all image samples to a fixed resolution, such as 256×256 pixels. The bilinear interpolation algorithm is used to achieve size scaling and reduce distortion.

[0030] Grayscale conversion uses a formula Convert an RGB color image to a grayscale image, where , , These represent the pixel values ​​for the red, green, and blue channels, respectively. This indicates the output grayscale pixel value.

[0031] Color space conversion can be either HSV or Lab space. For example, RGB to HSV conversion involves calculating hue (H), saturation (S), and value (V).

[0032] Pixel value normalization uses the formula ,in, Represents the original pixel matrix. This represents the global pixel mean of all image samples in the original dataset. This represents the standard deviation of all image samples in the original dataset. The normalized pixel values ​​are constrained to the range of [-1,1] or [0,1] to eliminate differences in illumination and contrast and improve the robustness of feature extraction.

[0033] This normalization process is beneficial to the model's convergence stability and avoids gradient explosion.

[0034] Initial features are extracted from the standardized image, and the color histogram features are calculated as follows: ,in, Indicates the first The quantization values ​​of each pixel, such as an 8-bin histogram. Indicates the total number of pixels. Indicates a bin index. Indicates an indicator function, when When it falls into bin The value is 1 if it is true and 0 otherwise. Texture features use a local binary mode, defined as follows: , Indicates the center pixel value. Indicates the first The value of each neighboring pixel. Represents the number of domain points. Represents the neighborhood radius. Deep features are extracted using a pre-trained convolutional neural network, such as ResNet, and the output activation map is used as a feature vector. All features are concatenated to form a high-dimensional original feature matrix.

[0035] In this embodiment, the initial features include color histogram features, local binary pattern texture features, and depth features output by the pre-trained convolutional neural network.

[0036] Step 2: Divide the original dataset into a training set and a test set. Based on the category labels and initial features of each image sample in the training set, sort the features in the original feature matrix in descending order according to the ReliefF weights, and use a screening strategy to select a subset of candidate features. In this embodiment, the original data is randomly divided into non-overlapping training and test sets according to a preset ratio to ensure the effectiveness of subsequent model training and evaluation, and to provide a unified and standardized data foundation for all subsequent analyses.

[0037] Specifically, the original dataset is randomly divided into non-overlapping training and test sets according to a preset ratio. For example, 70% of the original dataset is divided into the training set and 30% into the test set. A random seed is used to ensure repeatability, and a mutually exclusive index set is generated. and ,satisfy: ; in, Represents the training set, This represents the test set. This indicates the proportion of the training set in the original dataset. This partition ensures unbiased model evaluation.

[0038] The ReliefF weights reflect the contribution of features to distinguishing different classes of samples; a higher ReliefF weight indicates stronger discriminative power. All features are sorted in descending order based on their ReliefF weights. A weight threshold is set, or a specific proportion of top-ranking features are retained; low-weight features below the threshold are considered redundant or noisy and are discarded. This step compresses the original high-dimensional feature space, resulting in a subset of candidate features that retains most of the discriminative information, thus significantly reducing the dimensionality and computational burden of subsequent optimization searches.

[0039] In this embodiment, the update formula for the ReliefF weights is: ; in, Represents the first element in the original feature matrix. The ReliefF weights of each feature. Indicates the first training set Image samples, , They respectively represent searching in the feature space and The same or different category labels The th nearest neighbor sample indivual, This represents the total number of image samples in the training set. , These represent the nth element in the original feature matrix. One feature in and , The difference function between them.

[0040] Specifically, for each image sample in the training set, based on Euclidean distance or other predefined distance metrics, a search is performed in the feature space for the image sample with the same class label. The nearest neighbor samples and the class labels that differ from the image sample. The nearest neighbor samples are used to update the ReliefF weights according to the ReliefF weight update formula. This process is repeated for all image samples to complete the ReliefF weight update and obtain the ReliefF weight of each feature in the original feature matrix.

[0041] By comparing the feature differences between a sample and its neighbors of different classes or of the same class, the contribution of features to class distinction is quantified. A higher ReliefF weight indicates a stronger discriminative ability of the feature, which is beneficial for highlighting high-discrimination features and suppressing noise. After iterating over all samples, the final weight vector is obtained. Subsequently, the final weight vector is sorted in descending order to obtain an ordered feature index sequence.

[0042] In this embodiment, when calculating feature differences, continuous features are calculated using the absolute value of the normalized feature difference, while discrete features are calculated using an indication method that the feature values ​​are the same; if they are the same, the difference is 0, and if they are different, the difference is 1.

[0043] When the first in the original feature matrix When a feature is a continuous feature, its presence in the sample With sample The difference function between them is: ; When the first in the original feature matrix When a feature is a discrete feature, its presence in the sample With sample The difference function between them is: ; in, Represents the first element in the original feature matrix. One feature in the sample With sample The difference function between them , Representing samples respectively ,sample In the original feature matrix, the first The values ​​that can be taken on each feature , These represent the nth element in the original feature matrix. The maximum and minimum values ​​of each feature on the training set.

[0044] In this embodiment, the screening strategy specifically includes: removing features whose ReliefF weight is less than the weight threshold, or retaining the top 30% of features with ReliefF weight.

[0045] Specifically, the formula for calculating the weight threshold is: ; in, Indicates the weight threshold. This represents the mean of the ReliefF weights for all features in the original feature matrix. This represents the standard deviation of the ReliefF weights for all features in the original feature matrix. Indicates the adjustment factor. The value ranges from 0.5 to 1.0.

[0046] Finally, the output retains the set of feature indices, which constitutes a subset of candidate features. This preserves highly discriminative features and significantly reduces the number of candidate features for subsequent binary heuristic search, thereby reducing computational complexity and improving efficiency.

[0047] Step 3: Assign a binary bit to each candidate feature in the candidate feature subset to generate a binary string. A value of 1 indicates that the corresponding candidate feature is selected, and a value of 0 indicates that the corresponding candidate feature is not selected. In this embodiment, each candidate feature in the candidate feature subset is assigned a binary bit, and a binary string with a length equal to the total number of candidate features in the candidate feature subset is generated, thus transforming the feature selection problem into a search problem in the binary solution space.

[0048] Specifically, the binary encoding method is as follows: Let the candidate feature subset contain... Candidate features, binary string ,in, , … … They represent the 1st, 2nd, ..., ...th elements in the candidate feature subset. … One candidate feature, , Indicates the first in the candidate feature subset One candidate feature was selected. Indicates the first in the candidate feature subset When no candidate feature is selected, the solution space is defined as follows: .

[0049] The solution space size directly depends on the total number of candidate features in the selected feature subset, ensuring that the search dimension is consistent with the feature size after initial screening. The core parameters of the metaheuristic algorithm are initialized to construct the search framework. The population size is then set. This represents the number of initial candidate solutions, typically set to 30 to balance exploration efficiency and computational cost. The maximum number of iterations is defined as the algorithm's termination condition, generally set to 200 to cover the convergence process. Configuration control coefficients include the probability of mutation operations. and the probability of crossover operations The probability of mutation controls the probability of individual position flipping to maintain diversity, while the probability of crossover adjusts the intensity of information exchange between individuals. The probabilities of mutation and crossover are initialized to 0.05 and 0.8 respectively, providing a baseline for subsequent multi-strategy updates. Parameter settings are based on engineering practice to ensure that the discreteness of the solution space is fully preserved. The advantage of binary encoding is that it reduces the dimensionality of high-dimensional feature selection problems to binary optimization, significantly reducing computational complexity; for example, compared to the original feature space, the solution space size is compressed from a combinatorial series to... This improves search efficiency. Initializing the control coefficients supports adaptive strategy switching, enhancing the algorithm's robustness. Finally, a formal definition of the discrete optimization problem is formed: the objective function is to maximize the fitness value, the decision variable is s, and the constraints are... The search environment is composed of parameter tuples Complete description.

[0050] Step 4: Initialize the population of the metaheuristic algorithm. Each individual in the population represents a binary string. Start iteratively searching from the initialized population. Dynamically calculate the exploration weight and development weight based on the ratio of the current iteration number to the maximum iteration number. After each iteration, convert the updated individual into a valid binary code through discretization mapping to generate a new generation of population. In this embodiment, the population size, maximum number of iterations, probability of mutation operation, and probability of crossover operation of the metaheuristic algorithm are initialized.

[0051] Specifically, the population size is set to 30, the maximum number of iterations is set to 200, the probability of mutation is initialized to 0.05, and the probability of crossover is initialized to 0.8.

[0052] Metaheuristic algorithms include particle swarm optimization and differential evolution strategies.

[0053] The particle swarm optimization formulas for velocity and position updates are: ; in, , They represent the first , During the nth iteration The speed of each particle , They represent the first , During the nth iteration The position of each particle. For inertial weights, and All are acceleration constants. and All numbers are random numbers within the interval [0,1]. Indicates the first The individual best position in the history of each particle. This indicates the globally optimal position.

[0054] The formulas for differential evolution mutation and crossover operations are as follows: ; in, Indicates the current individual, This refers to an intermediate individual resulting from mutation. This represents a new individual generated through crossover. , , They represent the first , , A random individual, Indicates the scaling factor. Represents a random number within the interval [0,1]. Indicates other.

[0055] In this embodiment, the formula for calculating the exploration weight is: ; The formula for calculating development weight is: ; in, Indicates the exploration weight, Indicates development weight, Indicates the current iteration number. This indicates the maximum number of iterations.

[0056] In this embodiment, the exploration weight is increased and a global exploration strategy is used to update individuals in the population during the early stages of the search, while the development weight is increased and a local development strategy is used to update individuals in the population during the later stages of the search. The probability of bit-flipping operations in the later stages of the search is inversely proportional to the total number of candidate features and positively correlated with the development weight, ensuring a refined local search around the optimal individual.

[0057] definition The initial search phase involves increasing the exploration weight and employing a global exploration strategy to update individuals in the population. This increases the probability of crossover and random perturbation operations. The probability of crossover is set to... The random perturbation operation is achieved by randomly flipping binary bits, with the probability of random flipping set to 1. .

[0058] definition The phase is the mid-to-late search stage. In the mid-to-late search stage, the development weight is increased and a local development strategy is adopted to update the individuals in the population. Bit-flipping operations are performed around the best individual in the current population. The probability of the bit-flipping operation is calculated by the following formula: ; in, This indicates the probability of a bit-flipping operation. This represents the total number of candidate features.

[0059] The formula for updating binary bits is: ; in, Indicates the first in the population The first individual's corresponding binary string one binary bit The first character represents the binary string corresponding to the best individual in the population. One binary digit.

[0060] In this embodiment, converting the updated individual into a valid binary code through discretization mapping specifically includes the following steps: Step 1: Convert the intermediate continuous values ​​of the updated individual into probability values ​​using the sigmoid function: ; in, , Represent the i-th element in the population. The individual's first The probability value corresponding to each bit, and the intermediate continuous values; Step 2: Convert the updated individual into a valid binary code through a thresholding operation: ; in, Indicates the updated The first of the binary codes corresponding to the individual One binary digit.

[0061] In the early stages of the search, a strategy favoring global exploration is adopted, such as increasing the probability of random perturbations or crossover operations, to broadly explore the feature combination space. In the later stages of the search, a strategy emphasizing local development is used, such as performing fine-grained bit-flipping operations around the current best individual to stably approximate a better solution. After each iteration, specific discretization mapping rules ensure that newly generated individuals are still valid binary codes. This dynamic strategy switching balances exploration and development; the high probability of exploration in the early stages reduces the risk of premature convergence, while the high probability of development in the later stages improves convergence stability, thereby optimizing search efficiency. Through dynamic coordination of strategies, a balance is struck between global exploration and local development capabilities.

[0062] Step 5: Decode each binary code in each generation of the population, select candidate features corresponding to the binary bits with a value of 1 in the binary code to train the SVM classification model, calculate the classification accuracy of the SVM classification model, calculate the feature compression ratio based on the number of selected candidate features, calculate the comprehensive fitness value of the binary code based on the classification accuracy and feature compression ratio, and feed the comprehensive fitness value back to the population update mechanism of the metaheuristic algorithm until the iteration termination condition is reached. Select the candidate features corresponding to the binary bits with a value of 1 in the binary code with the highest comprehensive fitness value to train the SVM classification model, and use the trained SVM classification model to classify each image sample in the test set to obtain the category result of each image sample.

[0063] Specifically, the decoding process directly maps to the binary vector, selects candidate features corresponding to the binary bits with a value of 1 in the binary encoding, and trains the SVM classification model. The optimization objective of the SVM classification model is: ; in, Represents the weight vector. Indicates the bias term. Represents the regularization parameter. Indicates the first Feature vectors of image samples Indicates the first The category labels of each image sample This indicates transpose.

[0064] In this embodiment, the classification accuracy of the SVM classification model is achieved by using... The average classification accuracy calculated by folded cross-validation can enhance the robustness of the evaluation.

[0065] Specifically, the training set is divided into A set of non-overlapping subsets, used each time One subset is used to train the SVM classification model, and the remaining subset is used for testing.

[0066] The formula for calculating average classification accuracy is: ; in, This represents the average classification accuracy. Indicates the first The total number of image samples in the test set. Indicates the first The number of correctly classified image samples in the test set.

[0067] The formula for calculating the feature compression ratio is: ; in, Indicates the feature compression ratio. This indicates the number of selected candidate features. , Represents the first in binary encoding one binary bit , This represents the total number of candidate features.

[0068] The formula for calculating the overall fitness value is: ; in, This represents the overall fitness value. and All are weighting coefficients, satisfying and .

[0069] This weighted design balances high accuracy and low dimensionality, avoids overfitting, and improves generalization ability, which helps the algorithm converge to an efficient solution.

[0070] In this embodiment, the comprehensive fitness value is fed back to the population update mechanism of the metaheuristic algorithm to guide the selection, elimination and update direction of individuals in the population, and drive the algorithm to converge to the optimal feature combination that has both high classification accuracy and low feature dimensionality.

[0071] This invention provides an SVM image classification system that integrates the ReliefF mechanism and a metaheuristic algorithm, comprising: The data acquisition module is used to acquire image samples to be classified and label them with category labels to form the original dataset, and extract the initial features of each image sample to form the original feature matrix; The feature filtering module is used to divide the original dataset into training and test sets. Based on the category labels and initial features of each image sample in the training set, the features in the original feature matrix are sorted in descending order according to the ReliefF weights, and a selection subset of candidate features is selected using a filtering strategy. The binary string generation module is used to assign a binary bit to each candidate feature in the candidate feature subset and generate a binary string. A value of 1 in the binary bit represents that the corresponding candidate feature is selected, and a value of 0 represents that the corresponding candidate feature is not selected. The iteration module is used to initialize the population of the metaheuristic algorithm. Each individual in the population represents a binary string. Iterative search starts from the initialized population. The exploration weight and development weight are dynamically calculated based on the ratio of the current iteration number to the maximum iteration number. After each iteration, the updated individual is converted into a valid binary code through discretization mapping to generate a new generation of population. The decoding module decodes each binary code in each generation of the population, selects candidate features corresponding to the binary bits with a value of 1 in the binary code to train an SVM classification model, calculates the classification accuracy of the SVM classification model, calculates the feature compression ratio based on the number of selected candidate features, calculates the comprehensive fitness value of the binary code based on the classification accuracy and feature compression ratio, and feeds the comprehensive fitness value back to the population update mechanism of the metaheuristic algorithm until the iteration termination condition is reached. The candidate features corresponding to the binary bits with a value of 1 in the binary code with the highest comprehensive fitness value are selected to train an SVM classification model. The trained SVM classification model is then used to classify each image sample in the test set to obtain the category result of each image sample.

[0072] The SVM image classification system that integrates the ReliefF mechanism and the metaheuristic algorithm provided in this embodiment of the invention can execute the SVM image classification method that integrates the ReliefF mechanism and the metaheuristic algorithm provided in this embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0073] This invention provides a computer device, comprising: Storage medium: used to store computer programs; Processor: Used to execute computer programs to implement the SVM image classification method that integrates the ReliefF mechanism and metaheuristic algorithm provided in the embodiments of the present invention.

[0074] This invention provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the SVM image classification method that integrates the ReliefF mechanism and the metaheuristic algorithm provided in this invention.

[0075] This invention provides a computer program product, including a computer program that, when executed by a processor, implements the SVM image classification method that integrates the ReliefF mechanism and the metaheuristic algorithm provided in this invention.

[0076] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0077] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A system that specifies functions in one or more boxes.

[0078] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including an instruction set implemented in a process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0079] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The steps of the function specified in one or more boxes.

[0080] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. An SVM image classification method integrating the ReliefF mechanism and metaheuristic algorithm, characterized in that, include: Obtain image samples to be classified and label them with category labels to form the original dataset. Extract the initial features of each image sample to form the original feature matrix. The original dataset is divided into a training set and a test set. Based on the category label and initial features of each image sample in the training set, the features in the original feature matrix are sorted in descending order according to the ReliefF weights, and a selection strategy is used to select a subset of candidate features. Each candidate feature in the candidate feature subset is assigned a binary bit to generate a binary string. A value of 1 indicates that the corresponding candidate feature is selected, and a value of 0 indicates that the corresponding candidate feature is not selected. The metaheuristic algorithm population is initialized, where each individual represents a binary string. Iterative search is started from the initialized population. The exploration weight and development weight are dynamically calculated based on the ratio of the current iteration number to the maximum iteration number. After each iteration, the updated individual is converted into an effective binary code through discretization mapping to generate a new generation of population. For each generation of the population, each binary code is decoded. Candidate features corresponding to the binary bits with a value of 1 are selected to train an SVM classification model. The classification accuracy of the SVM classification model is calculated. The feature compression ratio is calculated based on the number of selected candidate features. The comprehensive fitness value of the binary code is calculated based on the classification accuracy and the feature compression ratio. The comprehensive fitness value is fed back to the population update mechanism of the metaheuristic algorithm until the iteration termination condition is reached. The candidate features corresponding to the binary bits with a value of 1 in the binary code with the highest comprehensive fitness value are selected to train an SVM classification model. The trained SVM classification model is used to classify each image sample in the test set to obtain the category result of each image sample.

2. The SVM image classification method integrating the ReliefF mechanism and metaheuristic algorithm according to claim 1, characterized in that, Extracting initial features from each image sample to form the original feature matrix includes: Each image sample is preprocessed, and the initial features of each preprocessed image sample are extracted to form the original feature matrix; Preprocessing includes uniform resizing, grayscale or color space conversion, and pixel value normalization; The initial features include color histogram features, local binary pattern texture features, and deep features from the output of a pre-trained convolutional neural network.

3. The SVM image classification method integrating the ReliefF mechanism and metaheuristic algorithm according to claim 1, characterized in that, The formula for updating the ReliefF weights is: ; in, Represents the first element in the original feature matrix. The ReliefF weights of each feature. Indicates the first training set Image samples, , They respectively represent searching in the feature space and Same or different category labels The th nearest neighbor sample indivual, This represents the total number of image samples in the training set. , They represent the first and second digits of the original feature matrix, respectively. One feature in and , The difference function between them.

4. The SVM image classification method integrating the ReliefF mechanism and metaheuristic algorithm according to claim 3, characterized in that, When the first in the original feature matrix When a feature is a continuous feature, its presence in the sample With sample The difference function between them is: ; When the first in the original feature matrix When a feature is a discrete feature, its presence in the sample With sample The difference function between them is: ; in, Represents the first element in the original feature matrix. One feature in the sample With sample The difference function between them , Representing samples respectively ,sample In the original feature matrix, the first The values ​​of each feature , They represent the first and second digits of the original feature matrix, respectively. The maximum and minimum values ​​of each feature on the training set.

5. The SVM image classification method integrating the ReliefF mechanism and metaheuristic algorithm according to claim 1, characterized in that, Screening strategies include: Remove features whose ReliefF weights are less than the weight threshold, or retain the top 30% of features with the highest ReliefF weights. The formula for calculating the weight threshold is: ; in, Indicates the weight threshold. This represents the mean of the ReliefF weights for all features in the original feature matrix. This represents the standard deviation of the ReliefF weights for all features in the original feature matrix. This represents the adjustment factor.

6. The SVM image classification method integrating the ReliefF mechanism and metaheuristic algorithm according to claim 1, characterized in that, The formula for calculating the exploration weight is: ; The formula for calculating development weight is: ; in, Indicates the exploration weight, Indicates development weight, Indicates the current iteration number. Indicates the maximum number of iterations; definition The initial search phase involves increasing the exploration weight and employing a global exploration strategy to update individuals in the population. This increases the probability of crossover and random perturbation operations. The probability of crossover is set to... The random perturbation operation is achieved by randomly flipping binary bits, with the probability of random flipping set to 1. ; definition The phase is the mid-to-late search stage. In the mid-to-late search stage, the development weight is increased and a local development strategy is adopted to update the individuals in the population. Bit-flipping operations are performed around the best individual in the current population. The probability of the bit-flipping operation is calculated by the following formula: ; in, This indicates the probability of a bit-flipping operation. Indicates the total number of candidate features; The formula for updating binary bits is: ; in, Indicates the first in the population The first individual's corresponding binary string one binary bit The first character represents the binary string corresponding to the best individual in the population. One binary digit.

7. The SVM image classification method integrating the ReliefF mechanism and metaheuristic algorithm according to claim 1, characterized in that, Converting the updated individual into an effective binary code through discretization mapping includes: The sigmoid function is used to convert the updated intermediate continuous values ​​of an individual into probability values: ; in, , Represent the i-th element in the population. The individual's first The probability value corresponding to each bit, and the intermediate continuous values; The updated individual is converted into a valid binary code through a thresholding operation: ; in, Indicates the updated The first of the binary codes corresponding to the individual One binary digit.

8. The SVM image classification method integrating the ReliefF mechanism and metaheuristic algorithm according to claim 1, characterized in that, The classification accuracy of the SVM classification model is achieved by using... The average classification accuracy is calculated using folded cross-validation, which divides the training set into... A set of non-overlapping subsets, used each time A subset is used to train the SVM classification model, and the remaining subset is used for testing. The formula for calculating the average classification accuracy is: ; in, This represents the average classification accuracy. Indicates the first The total number of image samples in the test set. Indicates the first The number of correctly classified image samples in the test set; The formula for calculating the feature compression ratio is: ; in, Indicates the feature compression ratio. This indicates the number of selected candidate features. , Represents the first in binary encoding one binary bit , Indicates the total number of candidate features; The formula for calculating the overall fitness value is: ; in, This represents the overall fitness value. and All are weighting coefficients, satisfying and .

9. An SVM image classification system integrating the ReliefF mechanism and metaheuristic algorithm, characterized in that, include: The data acquisition module is used to acquire image samples to be classified and label them with category labels to form the original dataset, and extract the initial features of each image sample to form the original feature matrix; The feature filtering module is used to divide the original dataset into training and test sets. Based on the category labels and initial features of each image sample in the training set, the features in the original feature matrix are sorted in descending order according to the ReliefF weights, and a selection subset of candidate features is selected using a filtering strategy. The binary string generation module is used to assign a binary bit to each candidate feature in the candidate feature subset and generate a binary string. A value of 1 in the binary bit represents that the corresponding candidate feature is selected, and a value of 0 represents that the corresponding candidate feature is not selected. The iteration module is used to initialize the population of the metaheuristic algorithm. Each individual in the population represents a binary string. Iterative search starts from the initialized population. The exploration weight and development weight are dynamically calculated based on the ratio of the current iteration number to the maximum iteration number. After each iteration, the updated individual is converted into a valid binary code through discretization mapping to generate a new generation of population. The decoding module decodes each binary code in each generation of the population, selects candidate features corresponding to the binary bits with a value of 1 in the binary code to train an SVM classification model, calculates the classification accuracy of the SVM classification model, calculates the feature compression ratio based on the number of selected candidate features, calculates the comprehensive fitness value of the binary code based on the classification accuracy and feature compression ratio, and feeds the comprehensive fitness value back to the population update mechanism of the metaheuristic algorithm until the iteration termination condition is reached. The candidate features corresponding to the binary bits with a value of 1 in the binary code with the highest comprehensive fitness value are selected to train an SVM classification model. The trained SVM classification model is then used to classify each image sample in the test set to obtain the category result of each image sample.

10. A computer device, characterized in that, include: Storage medium: used to store computer programs; Processor: for executing the computer program to implement the SVM image classification method according to any one of claims 1 to 8, which integrates the ReliefF mechanism and the metaheuristic algorithm.