Image classification method based on collaborative optimization algorithm and feature selection mechanism

CN118351379BActive Publication Date: 2026-09-29YTO EXPRESS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

[0003]传统的图像分类方法主要以机器学习方法为主,包括支持向量机(SVM)、K最近邻(KNN)、决策树等,但随着技术的发展,传统的机器学习方法的弊端也逐渐显露出来,如传统机器学习方法需要手动选择和提取图像的特征,在解决数据集较大的分类问题时,其性能通常不如深度学习方法

Benefits of technology

[0017]本发明对比现有技术有如下的有益效果:本发明的基于协同优化算法和特征选取机制的图像分类方法,通过结合粒子群算法和遗传编程算法的优化能力得到最优的特征提取结构,并提出新的特征选取机制,有效提高了图像特征提取的质量和图像分类的准确率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118351379B_ABST
    Figure CN118351379B_ABST
Patent Text Reader

Abstract

The application discloses an image classification method based on a cooperative optimization algorithm and a feature selection mechanism, which effectively improves the quality of image feature extraction and the accuracy of image classification. The technical scheme is as follows: step S1: pre-processing the collected images; step S2: constructing an image feature extraction model based on a genetic programming algorithm and performing image feature extraction, cooperating with individual information optimization thought, giving the individual in the algorithm position and speed information, and adjusting the selection operator by updating the individual position and speed information; step S3: constructing a feature selection model to select the extracted features; step S4: taking the selected features as input to train an SVM classifier; and step S5: adopting the trained SVM classifier to classify the express images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to image classification, specifically to an image classification method based on a collaborative optimization algorithm and feature selection mechanism, which is particularly applicable to the field of express logistics. Background Technology

[0002] In the logistics and express delivery industry, image classification can be used for identification and classification during item sorting. By acquiring images of goods, the types of goods can be automatically identified and classified. The appropriate packaging method can be matched to the type of goods; for example, electronic products need to be packaged in express boxes for protection, clothing needs to be packaged in express bags, and documents need to be packaged in document bags. This automatically matches suitable packaging methods for each type of goods, effectively improving the efficiency of sorting and packaging when goods leave the warehouse. However, the sorting process places high demands on image feature extraction and classification technology; therefore, a high-performance, high-accuracy image feature extraction and classification method is needed.

[0003] Traditional image classification methods primarily rely on machine learning approaches, including Support Vector Machines (SVM), K-Nearest Neighbors (KNN), and decision trees. However, with technological advancements, the drawbacks of traditional machine learning methods have become increasingly apparent. For instance, they require manual selection and extraction of image features, and their performance is often inferior to deep learning methods when dealing with classification problems involving large datasets. Evolutionary computation, a population-based global optimization algorithm, possesses high robustness and broad adaptability. It can adaptively search for feasible solutions based on problem size, effectively handling complex problems that traditional optimization algorithms struggle with. It offers significant advantages in image feature extraction and classification research and also provides valuable reference for research on image classification methods for goods in logistics environments.

[0004] Based on the above problems, it is indeed necessary to propose an image classification method based on collaborative optimization algorithm and feature selection mechanism in the field of express logistics. Summary of the Invention

[0005] The following provides a brief overview of one or more aspects to offer a basic understanding of them. This overview is not an exhaustive summary of all conceived aspects, nor is it intended to identify key or decisive elements of all aspects, nor to define the scope of any or all aspects. Its sole purpose is to present some concepts of one or more aspects in a simplified form to prepare for the more detailed descriptions that follow.

[0006] The purpose of this invention is to solve the above problems and provide an image classification method based on a collaborative optimization algorithm and feature selection mechanism, which effectively improves the quality of image feature extraction and the accuracy of image classification.

[0007] The technical solution of this invention is as follows: This invention discloses an image classification method based on a collaborative optimization algorithm and a feature selection mechanism, the method comprising: Step S1: Preprocess the acquired images; Step S2: Construct an image feature extraction model based on the genetic programming algorithm and extract image features. In conjunction with the idea of ​​individual information optimization, assign position and velocity information to individuals in the algorithm, and adjust the selection operator by updating the position and velocity information of individuals. Step S3: Construct a feature selection model to select from the extracted features; Step S4: Train the SVM classifier using the selected features as input; Step S5: Use the trained SVM classifier to classify the express delivery images.

[0008] According to an embodiment of the image classification method based on the collaborative optimization algorithm and feature selection mechanism of the present invention, step S1 includes: Step S1.1: Adjust the images to the same fixed size; Step S1.2: Divide each pixel value in the image by 255 to scale the pixel values ​​of the image to the range of [0, 1]; Step S1.3: Use the pixel value mean subtraction method to traverse all images in the training set, calculate the average value of each pixel position, and subtract the average value from each pixel value to reduce redundant information in the image data and make the data distribution more concentrated and average. Step S1.4: Transform the original image by translating, rotating, scaling, and flipping to generate more training samples for image data augmentation. The augmented images will be used together with the original images for training to improve the diversity and robustness of the data.

[0009] According to an embodiment of the image classification method based on collaborative optimization algorithm and feature selection mechanism of the present invention, in step S2, the image feature extraction model constructed based on genetic programming algorithm includes two structurally similar image feature extraction models A and B. The two models A and B are used to extract features from the same image simultaneously, and can extract as many features as possible from the image. The hierarchical structure of model A from bottom to top is the input layer, convolutional layer, pooling layer and convolution / pooling layer. The hierarchical structure of model B is based on A, with a specific region image extraction layer added after the convolution / pooling layer, which is used to extract local features with greater influence.

[0010] According to an embodiment of the image classification method based on the collaborative optimization algorithm and feature selection mechanism of the present invention, step S2 further includes: Step S2.1: Define the algorithm's function set, terminator set, and parameters; Step S2.2: Use the genetic programming algorithm to build the model. Randomly select a function from the function set as the root node. Select the same number of child nodes as the number of independent variables processed by the function. If the selected function is a function, repeat the above operation; if the selected terminator is a terminator, stop selecting the subtree. This generates the initial individual. Step S2.3: Using the preprocessed test image set as input, extract features from the images using the image feature extraction model constructed in the above steps to obtain image features; Step S2.4: Calculate the fitness of an individual based on the score of the optimal feature group selected from the features extracted using the structure and the classification accuracy obtained after training the classifier using the optimal feature group, according to the feature selection model. Step S2.5: The idea of ​​collaborative individual information optimization is to assign velocity and position information to each individual in the population of the genetic programming algorithm. By comparing and replacing the current fitness value of an individual with the individual's historical best fitness value and the global best fitness value, the velocity and position information of the individual are updated. The selection probability of the individual in the iteration process of the genetic programming algorithm is adjusted according to the final velocity and position information. Step S2.6: Select individuals for crossover and mutation operations according to the determined selection operator, and replace some individuals in the original population with the newly generated individuals to generate a new population according to the elite retention strategy; Step S2.7: Repeat the above operation. When the pre-set conditions for successful problem solving are met, the iteration terminates, and the tree structure with the best image feature extraction effect is obtained. Step S2.8: Input the preprocessed image into the constructed model A for feature extraction; Step S2.9: Obtain Model B using the same operation as above, and input the preprocessed image into Model B for feature extraction.

[0011] According to an embodiment of the image classification method based on the collaborative optimization algorithm and feature selection mechanism of the present invention, step S2.5 further includes: Step S2.5.1: Initialize the velocity and position of each individual in the population; Step S2.5.2: Calculate the current fitness value of each individual, the fitness value of the individual's historical best position information, and the fitness value of the global best individual position information; Step S2.5.3: Compare the current fitness value of an individual, the fitness value of the individual's historical best position information, and the fitness value of the global best individual position information, and perform corresponding processing based on the comparison results; Step S2.5.4: Update the individual's velocity and position information based on the updated individual historical best value and global best value; Step S2.5.5: Update the final position and velocity information obtained after multiple iterations; Step S2.5.6: Use min-max normalization to standardize the final position and velocity information to the range [0,1]; Step 2.5.7: Adjust the selection probability of the corresponding individuals during the iteration process based on the final position and velocity information.

[0012] According to an embodiment of the image classification method based on the collaborative optimization algorithm and feature selection mechanism of the present invention, in step S3, the feature selection model includes an image generator, a scorer, and a selector, wherein the image generator is used to select features and generate an image according to certain rules; the scorer is used to compare the generated image with the original image and score it; and the selector is used to select the feature with better performance based on the score and output it.

[0013] According to an embodiment of the image classification method based on the collaborative optimization algorithm and feature selection mechanism of the present invention, step S3 further includes: Step S3.1: The image generator selects features according to rules and generates an image based on the selected features as input to the scorer; Step S3.2: The scorer compares the generated image with the original image; Step S3.3: Score the selected feature vectors based on similarity; Step S3.4: Select the features again and repeat the above steps, i.e., it is necessary to perform... Second choice and rating; Step S3.5: Score the feature vectors and input them into the selector; Step S3.6: Use a self-attention mechanism in the selector to select the feature 3D tensor with the highest score, use the softmax function to convert the feature score into weights, and perform weighted processing on each feature to obtain a new feature vector.

[0014] According to an embodiment of the image classification method based on the collaborative optimization algorithm and feature selection mechanism of the present invention, step S3.2 further includes: Step S3.2.1: Convert the original image and the generated image to grayscale respectively; Step S3.2.2: Read the pixels of each point in the original image and the generated image respectively and generate a feature sequence; Step S3.2.3: Compare the feature sequences of the two images and calculate the difference for each corresponding pixel to generate a difference sequence; Step S3.2.4: Define a threshold, compare the values ​​in the difference sequence with the threshold respectively. If the value is greater than the threshold, it is recorded as 0, otherwise it is recorded as 1. Finally, the contrast sequence is composed of 0 and 1. Calculate the proportion of the value 1 in the sequence to obtain the similarity.

[0015] According to an embodiment of the image classification method based on collaborative optimization algorithm and feature selection mechanism of the present invention, step S4 specifically involves: converting the new feature vector... The SVM classifier is fed into the dataset and evaluated using five-fold cross-validation. In each round of cross-validation, one set is selected as the validation set, and the remaining four sets are used as the training set. The SVM model is trained using the training set data, and the images are classified into n classes. The classification accuracy of the trained model on the validation set is calculated as the evaluation result for that round. The above process is repeated five times. Finally, the average of these five evaluation results is used as the final classification accuracy for the calculation of the fitness value.

[0016] According to an embodiment of the image classification method based on collaborative optimization algorithm and feature selection mechanism of the present invention, the specific steps of step S5 are as follows: after the iteration of the genetic programming algorithm ends, the optimal feature extraction structure is used to extract features from the training set images, the SVM classifier is trained using the feature-extracted training set, and the trained classifier is used to classify the acquired images, outputting the category to which the image belongs.

[0017] Compared with the prior art, the present invention has the following beneficial effects: The image classification method of the present invention based on collaborative optimization algorithm and feature selection mechanism obtains the optimal feature extraction structure by combining the optimization capabilities of particle swarm optimization algorithm and genetic programming algorithm, and proposes a new feature selection mechanism, which effectively improves the quality of image feature extraction and the accuracy of image classification. Attached Figure Description

[0018] The above-described features and advantages of the present invention will be better understood after reading the following detailed description of embodiments of the present disclosure in conjunction with the accompanying drawings. In the drawings, components are not necessarily drawn to scale, and components having similar related characteristics or features may have the same or similar reference numerals.

[0019] Figure 1 A flowchart of an embodiment of the image classification method based on the collaborative optimization algorithm and feature selection mechanism of the present invention is shown.

[0020] Figure 2 It shows Figure 1 A schematic diagram of the image feature extraction and feature selection model in the illustrated embodiment.

[0021] Figure 3 It shows Figure 1 A detailed flowchart of image feature extraction in the illustrated embodiment. Detailed Implementation

[0022] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. It should be noted that the aspects described below with reference to the accompanying drawings and specific embodiments are merely exemplary and should not be construed as limiting the scope of protection of the present invention in any way.

[0023] Figure 1 The flowchart of an embodiment of the image classification method based on the cooperative optimization algorithm and feature selection mechanism of the present invention is shown. Please refer to... Figure 1 The implementation steps of the method in this embodiment are described in detail below.

[0024] Step S1: Preprocess the acquired images.

[0025] Step S1 includes the following processing flow.

[0026] Step S1.1: Adjust the images to the same fixed size.

[0027] Step S1.2: Divide each pixel value in the image by 255 to scale the pixel values ​​of the image to the range of [0, 1].

[0028] Step S1.3: Use the pixel value mean subtraction method to traverse all images in the training set, calculate the average value of each pixel position, and subtract the average value from each pixel value to reduce redundant information in the image data and make the data distribution more concentrated and average.

[0029] Step S1.4: Transform the original image by translating, rotating, scaling, flipping, etc. to generate more training samples for image data augmentation. The augmented images will be used together with the original images for training to improve the diversity and robustness of the data.

[0030] Step S2: Construct an image feature extraction model based on the genetic programming algorithm and extract image features. In conjunction with the idea of ​​individual information optimization, assign position and velocity information to individuals in the algorithm, and adjust the selection operator by updating the position and velocity information of individuals.

[0031] The image feature extraction model built based on the genetic programming algorithm mainly consists of two structurally similar image feature extraction models, A and B. Models A and B are used to extract features from the same image simultaneously, aiming to extract as many features as possible. The hierarchical structure of model A, from bottom to top, consists of an input layer, a convolutional layer, a pooling layer, and a convolutional / pooling layer.

[0032] Convolutional layers primarily utilize relevant functions to perform operations such as convolution, scaling, activation, or enhancement on images. Taking convolution as an example, the calculation formula for convolution is as follows:

[0033] in, These are the width and height of the output image, respectively. These are the width and height of the input image, respectively. The kernel size is the convolution kernel size. To fill the number of circles, The step size.

[0034] The pooling layer primarily performs max pooling on the image features that have undergone a series of operations in the convolutional layers. The formula for calculating the pooling operation is as follows:

[0035] in, These are the width and height of the output image, respectively. These are the width and height of the input image, respectively. The kernel size is the convolution kernel size. The step size.

[0036] The convolutional / pooling layer is a flexible layer. It has the same functionalities as the convolutional and pooling layers, but the appropriate functionalities can be used depending on the situation during the iteration process using the genetic programming algorithm. Model B's hierarchical structure adds a specific region image extraction layer after the convolutional / pooling layers, based on model A. This layer is mainly used for local extraction of certain influential features.

[0037] Step S2 includes the following processing flow. Specifically, the specific processing for constructing the image feature extraction model is as follows.

[0038] Step S2.1: Define the function set, terminator set, and parameters of the algorithm. The function set includes functions such as convolution, pooling, scaling, activation, and enhancement. The terminator set includes images and filters. The parameters include population size, maximum number of iterations, crossover operator, and mutation operator in genetic programming algorithms, and particle number, maximum iteration coefficient, learning factor, and inertia weight in particle swarm optimization algorithms.

[0039] Step S2.2: Use the genetic programming algorithm to build the model. Randomly select a function from the function set as the root node. Select the same number of child nodes as the number of independent variables processed by the function. If the selected function is a function, repeat the above operation; if the selected terminator is a terminator, stop selecting the subtree. This generates the initial individual.

[0040] Step S2.3: Using the preprocessed test image set Using the above steps as input, the image feature extraction model is used to extract features from the image, resulting in image feature Z.

[0041] Step S2.4: Score the optimal feature group selected from the features Z extracted using this structure according to the feature selection model. The classification accuracy obtained after training the classifier using the optimal feature set To calculate the fitness of an individual. The specific calculation formula is as follows:

[0042] in, To determine the degree of influence of classification accuracy on fitness calculation, D Scoring the optimal feature set for the feature selection model .

[0043] Step S2.5: The collaborative individual information optimization approach assigns velocity and position information to each individual in the genetic programming algorithm population. This is achieved by comparing and replacing the individual's current fitness value with its historical best fitness value and the global best fitness value. The selection probability of each individual during the iterative process of the genetic programming algorithm is then adjusted based on the final velocity and position information. (See [link to relevant documentation]). Figure 3 The specific steps of step S2.5 are as follows.

[0044] Step S2.5.1: Initialize the velocity and position of each individual in the population, and let the position information of the i-th individual be... Speed ​​information is ; Step S2.5.2: Calculate the current fitness value for each individual. The individual's historical best position information fitness value and global optimal individual location information fitness value :

[0045] Among them, the function The settings are configured according to different practical problems.

[0046] Step S2.5.3: For each... If a comparison is made, Then use replace Similarly, if Then use replace .

[0047] Step S2.5.4: Update the individual's velocity and position information based on the updated historical best value and global best value, using the following formula:

[0048] in, For individual speed information, For individual location information, For inertial weights, As a learning factor, This represents the individual's historical best location information. This represents the globally optimal individual location information.

[0049] Step S2.5.5: Update the final location information obtained after multiple iterations to... Speed ​​information is .

[0050] Step S2.5.6: Use min-max normalization to standardize the final position and velocity information to the range [0,1]. The calculation formula is as follows:

[0051] in, These represent the particle's velocity and position, respectively. These are the normalized velocity and position, respectively. These represent the maximum and minimum particle velocities, respectively. These represent the maximum and minimum values ​​of the particle's position, respectively.

[0052] Step 2.5.7: Adjust the selection probability of the corresponding individuals during the iteration process based on the final position and velocity information. The specific formula is as follows:

[0053] in, The initial selection probabilities, obtained from roulette wheel selection, are the probabilities before adjustment. The adjusted selection probability. These are the weighting coefficients. For the final position and velocity information, This provides the initial position and velocity information.

[0054] Step S2.6: Select individuals for crossover and mutation operations according to the determined selection operator. According to the elite retention strategy, replace some individuals in the original population with the newly generated individuals to generate a new population.

[0055] Step S2.7: Repeat the above operation. When the pre-set conditions for successful problem solving are met, the iteration terminates, and the tree structure A with the best image feature extraction effect is obtained.

[0056] Step S2.8: Input the preprocessed image Y into the constructed model A for feature extraction, and denote the extracted features as... .

[0057] Step S2.9: Obtain model B using the same operation as above, and input the preprocessed image Y into model B for feature extraction. Record the extracted features as... .

[0058] Step S3: Construct a feature selection model to select the extracted features.

[0059] Feature selection models include image generators, scorers, and selectors, such as... Figure 2 As shown in the diagram, the image generator selects features according to certain rules and generates an image; the scorer compares the generated image with the original image and assigns a score; and the selector selects the feature with the better score for output.

[0060] The main steps of the feature selection model are: Step S3.1: The image generator selects features according to the following rules, and generates an image based on the selected features. And it serves as the input to the scorer. The specific rule is: the three-dimensional tensor of the features extracted by model A is denoted as... The three-dimensional tensor of the features extracted by model B is denoted as ,in, Let A and B represent the feature maps of the i-th feature extracted by models A and B, respectively. The image generator randomly generates a selection sequence C consisting of n 0s or 1s, and stipulates that the generated sequence is non-repeating, such as {0,1,…,1}. If the i-th value is 0, it means that the i-th feature extracted by model A is selected; if it is 1, it means that the i-th feature extracted by model B is selected.

[0061] Step S3.2: The scorer will generate the image By comparing with the original image Y, we obtain The specific steps for image similarity comparison are as follows: Step S3.2.1: Convert the original image and the generated image to grayscale respectively; Step S3.2.2: Read the pixels of each point in the original image and the generated image respectively, and generate a feature sequence. ; Step S3.2.3: Compare the feature sequences of the two images and calculate the difference between each corresponding pixel to generate a difference sequence. ; Step S3.2.4: Define a threshold The values ​​in the difference sequence are compared with the threshold. If the difference is greater than the threshold, it is recorded as 0, and otherwise it is recorded as 1. The final contrast sequence consists of 0 and 1. The similarity D is obtained by calculating the proportion of the value 1 in the sequence.

[0062] Step S3.3: Score the selected feature vectors based on similarity; Step S3.4: Select the features again and repeat the above steps, i.e., it is necessary to perform... Second choice and rating; Step S3.5: Denote the score of the feature vector as X and input it into the selector; Step S3.6: Employ a self-attention mechanism in the selector to select the feature 3D tensor with the highest score. = The softmax function is used to convert feature scores into weights. Each feature is weighted to obtain a new feature vector. .in, , This is the new feature of the i-th element after weighted processing. Let i be the weight of the i-th feature. This refers to the i-th feature before weighted processing.

[0063] Step S4: Train the SVM classifier using the selected features as input.

[0064] The specific steps of step S4 are as follows: The new feature vector... Input an SVM classifier and evaluate it using five-fold cross-validation. In each round of cross-validation, one set of data is selected as the validation set, and the remaining four sets are used as the training set. The SVM model is trained using the training set data to classify images into n classes, and the classification accuracy of the trained model on the validation set is calculated as the evaluation result for that round. This process is repeated five times, and the average of these five evaluation results is taken as the final classification accuracy. Feedback is provided for calculating the fitness value.

[0065] Step S5: Use the trained classifier to classify the express delivery images.

[0066] The specific steps of step S5 are as follows: After the iteration of the genetic programming algorithm ends, use the optimal feature extraction structure to extract features from the training set images, train an SVM classifier using the feature-extracted training set, and use the trained classifier to classify the acquired images, outputting the category to which the image belongs. .

[0067] The following is an example of the present invention. In order to verify the beneficial effects of the present invention, a simulation experiment is conducted for scientific demonstration.

[0068] The following is an example of express delivery image classification results obtained by the express delivery image classification method based on collaborative optimization algorithm and feature selection mechanism provided by the present invention: In the feature extraction model, it is assumed that the population size in the genetic programming algorithm parameters is 100, the maximum number of iterations is 50, the crossover operator is single-point crossover, and the mutation operator is uniform mutation; the particle swarm optimization algorithm parameters are 50 particles, the maximum iteration coefficient is 30, the learning factor is 2, and the inertia weight is 0.8.

[0069] Assuming the velocity and position of each particle are a 5-dimensional vector, , The velocity and position information of one of the particles are respectively , After multiple iterations, the final velocity and position information obtained are as follows: , Initial selection operator .

[0070] Then the adjusted selection operator can be obtained. .

[0071] In the feature selection model, assuming the selected feature sequence is {0,1,1,0,1}, the feature sequence of the original image after grayscale conversion... The generator generates feature sequences of the image. threshold .

[0072] Then the difference sequence can be obtained. The contrast sequence is (1,1,1,1,1,1,0,1,1), and the training feature selection structure scores the optimal feature group D=0.89.

[0073] Assuming the classification accuracy is obtained by training an SVM using the optimal feature set... =0.85, the degree of influence of classification accuracy on fitness calculation. =0.8.

[0074] The fitness value is calculated based on the fitness function. .

[0075] Assuming the collected images are preprocessed to obtain a pixel count of Based on the above calculation process, the model of this invention is used for image classification to obtain the final output result: Image category: 6.

[0076] This result indicates that the item in the image belongs to the sixth category of items defined by the system.

[0077] As can be seen from the above, the express delivery image classification method based on collaborative optimization algorithm and feature selection mechanism provided by the present invention effectively improves the performance and accuracy of image feature extraction by using the collaborative use of optimization algorithms and constructing feature extraction and selection models.

[0078] Although the methods described above are illustrated and depicted as a series of actions for the sake of simplicity, it should be understood and appreciated that these methods are not limited by the order of the actions, as some actions may occur in a different order and / or concurrently with other actions from the illustrations and descriptions herein or not illustrated and described herein but which may be understood by those skilled in the art, according to one or more embodiments.

[0079] Those skilled in the art will further appreciate that the various illustrative logic blocks, modules, circuits, and algorithm steps described in conjunction with the embodiments disclosed herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability between hardware and software, the various illustrative components, blocks, modules, circuits, and steps are described above in a generalized manner in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the specific application and the design constraints imposed on the overall system. Those skilled in the art may implement the described functionality in different ways for each specific application, but such implementation decisions should not be construed as departing from the scope of the invention.

[0080] The various illustrative logic blocks, modules, and circuits described in conjunction with the embodiments disclosed herein can be implemented or performed using a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. The general-purpose processor may be a microprocessor, but in alternatives, it may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors cooperating with a DSP core, or any other such configuration.

[0081] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of both. The software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor such that the processor can read and write information to / from the storage medium. In an alternative, the storage medium may be integrated into the processor. The processor and storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In an alternative, the processor and storage medium may reside as discrete components in the user terminal.

[0082] In one or more exemplary embodiments, the described functionality may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software as a computer program product, the functionality may be stored or transmitted as one or more instructions or code on or through a computer-readable medium. A computer-readable medium includes both computer storage media and communication media, encompassing any medium that facilitates the transfer of a computer program from one location to another. A storage medium may be any available medium accessible to a computer. By way of example and not limitation, such a computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disc storage, disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and is accessible to a computer. Any connection is also legitimately referred to as a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of a medium. As used in this article, disk and disc include compact discs (CDs), laser discs, optical discs, digital multi-purpose discs (DVDs), floppy disks, and Blu-ray discs. Disks typically reproduce data magnetically, while discs reproduce data optically using lasers. Combinations of these should also be included within the scope of computer-readable media.

[0083] The prior description of this disclosure is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to this disclosure will be apparent to those skilled in the art, and the general principles defined herein may be applied to other variations without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not intended to be limited to the examples and designs described herein, but should be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An image classification method based on a collaborative optimization algorithm and a feature selection mechanism, characterized in that, The methods include: Step S1: Preprocess the acquired images; Step S2: Construct an image feature extraction model based on the genetic programming algorithm and extract image features. In conjunction with the idea of ​​individual information optimization, assign position and velocity information to individuals in the algorithm, and adjust the selection operator by updating the position and velocity information of individuals. Step S3: Construct a feature selection model to select from the extracted features; Step S4: Train the SVM classifier using the selected features as input; Step S5: Use the trained SVM classifier to classify the express delivery images; In step S3, the feature selection model includes an image generator, a scorer, and a selector. The image generator is used to select features and generate an image according to certain rules; the scorer is used to compare the generated image with the original image and score it; and the selector is used to select the feature with the highest score and output it. Step S3 further includes: Step S3.1: The image generator selects features according to rules and generates an image based on the selected features as input to the scorer; Step S3.2: The scorer compares the generated image with the original image; Step S3.3: Score the selected feature vectors based on similarity; Step S3.4: Select the features again and repeat the above steps, i.e., it is necessary to perform... Second choice and rating; Step S3.5: Input the score of the feature vector into the selector; Step S3.6: In the selector, a self-attention mechanism is used to select the feature three-dimensional tensor with the highest score. The softmax function is used to convert the scores of each feature in the feature three-dimensional tensor into weights. The weighted processing of each feature in the feature three-dimensional tensor is then performed to obtain a new feature vector.

2. The image classification method based on collaborative optimization algorithm and feature selection mechanism according to claim 1, characterized in that, Step S1 includes: Step S1.1: Adjust the images to the same fixed size; Step S1.2: Divide each pixel value in the image by 255 to scale the pixel values ​​of the image to the range of [0, 1]; Step S1.3: Use the pixel value mean subtraction method to traverse all images in the training set, calculate the average value of each pixel position, and subtract the average value from each pixel value to reduce redundant information in the image data and make the data distribution more concentrated and average. Step S1.4: Transform the original image by translating, rotating, scaling, and flipping to generate more training samples for image data augmentation. The augmented images will be used together with the original images for training to improve the diversity and robustness of the data.

3. The image classification method based on collaborative optimization algorithm and feature selection mechanism according to claim 1, characterized in that, In step S2, the image feature extraction model constructed based on the genetic programming algorithm includes two structurally similar image feature extraction models A and B. Models A and B are used to extract features from the same image simultaneously, which can extract as many features as possible from the image. The hierarchical structure of model A from bottom to top consists of an input layer, a convolutional layer, a pooling layer, and a convolution / pooling layer. The hierarchical structure of model B is based on model A, with the addition of a specific region image extraction layer after the convolution / pooling layer for local extraction of features with greater influence.

4. The image classification method based on collaborative optimization algorithm and feature selection mechanism according to claim 3, characterized in that, Step S2 further includes: Step S2.1: Define the algorithm's function set, terminator set, and parameters; Step S2.2: Use the genetic programming algorithm to build the model. Randomly select a function from the function set as the root node. Select the same number of child nodes as the number of independent variables processed by the function. If the selected child node is a function, repeat the above operation; if the selected child node is a terminator, stop the selection. This generates the initial individual. Step S2.3: Using the preprocessed test image set as input, extract features from the images using the image feature extraction model constructed in the above steps to obtain image features; Step S2.4: Calculate the fitness of an individual by scoring the optimal feature group selected from the features extracted by the image feature extraction model according to the feature selection model described in step S3 and the classification accuracy obtained after training the classifier using the optimal feature group; Step S2.5: The idea of ​​collaborative individual information optimization is to assign velocity and position information to each individual in the population of the genetic programming algorithm. By comparing and replacing the current fitness value of an individual with the individual's historical best fitness value and the global best fitness value, the velocity and position information of the individual are updated. The selection probability of the individual in the iteration process of the genetic programming algorithm is adjusted according to the final velocity and position information. Step S2.6: Select individuals for crossover and mutation operations according to the determined selection operator, and replace some individuals in the original population with the newly generated individuals to generate a new population according to the elite retention strategy; Step S2.7: Repeat the above operation. When the preset iteration termination condition is met, the iteration terminates, and the tree structure with the best image feature extraction effect is obtained. Step S2.8: Input the preprocessed image into the constructed model A for feature extraction; Step S2.9: Obtain Model B using the same operation as above, and input the preprocessed image into Model B for feature extraction.

5. The image classification method based on collaborative optimization algorithm and feature selection mechanism according to claim 4, characterized in that, Step S2.5 further includes: Step S2.5.1: Initialize the velocity and position of each individual in the population; Step S2.5.2: Calculate the current fitness value of each individual, the fitness value of the individual's historical best position information, and the fitness value of the global best individual position information; Step S2.5.3: Compare the current fitness value of an individual, the fitness value of the individual's historical best position information, and the fitness value of the global best individual position information. If the current fitness value of an individual is greater than the fitness value of the individual's historical best position information, then replace the individual's historical best position information with the individual's current position information; if the current fitness value of an individual is greater than the fitness value of the global best individual position information, then replace the global best individual position information with the individual's current position information. Step S2.5.4: Update the individual's velocity and position information based on the updated individual historical best value and global best value; Step S2.5.5: Update the final position and velocity information obtained after multiple iterations; Step S2.5.6: Use min-max normalization to standardize the final position and velocity information to the range [0,1]; Step 2.5.7: Adjust the selection probability of the corresponding individuals during the iteration process based on the final position and velocity information.

6. The image classification method based on collaborative optimization algorithm and feature selection mechanism according to claim 1, characterized in that, Step S3.2 further includes: Step S3.2.1: Convert the original image and the generated image to grayscale respectively; Step S3.2.2: Read the pixels of each point in the original image and the generated image respectively and generate a feature sequence; Step S3.2.3: Compare the feature sequences of the two images and calculate the difference for each corresponding pixel to generate a difference sequence; Step S3.2.4: Define a threshold, compare the values ​​in the difference sequence with the threshold respectively. If the value is greater than the threshold, it is recorded as 0, otherwise it is recorded as 1. Finally, the contrast sequence is composed of 0 and 1. Calculate the proportion of the value 1 in the sequence to obtain the similarity.

7. The image classification method based on collaborative optimization algorithm and feature selection mechanism according to claim 1, characterized in that, The specific steps of step S4 are as follows: input the new feature vector into the SVM classifier, and use five-fold cross-validation for evaluation. In each round of cross-validation, select one set as the validation set and the remaining four sets as the training set. Use the training set data to train the SVM model, classify the image into n classes, and calculate the classification accuracy of the trained model on the validation set as the evaluation result of that round. Repeat the above process five times, and finally use the average of these five evaluation results as the final classification accuracy for the calculation of the fitness value.

8. The image classification method based on collaborative optimization algorithm and feature selection mechanism according to claim 1, characterized in that, The specific steps of step S5 are as follows: After the iteration of the genetic programming algorithm ends, the optimal feature extraction structure is used to extract features from the training set images, and the feature selection model described in step S3 is used to select the extracted features. The selected features are used as the training set to train the SVM classifier, and the trained classifier is used to classify the acquired images and output the category to which the image belongs.

Citation Information

Patent Citations

  • Power equipment fault image recognition disaster exploration system and method based on multiple DCNN networks

    CN113205039A

  • Skin cancer computer-aided diagnosis method and system based on two-stage genetic programming and storage medium

    CN117497180A