Image classification method based on collaborative optimization algorithms and feature selection mechanism
This image classification method, which utilizes collaborative optimization algorithms and feature selection mechanisms, leverages genetic programming and particle swarm optimization to optimize image feature extraction. Combined with an SVM classifier, it addresses the issues of poor accuracy and feature extraction in image classification during express logistics, achieving more efficient logistics sorting and packaging.
Patent Information
- Application Number
- PCT/CN2024/123535
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-05-09
- Filing Date
- 2024-10-09
- Publication Date
- 2025-11-13
AI Technical Summary
Existing technologies have poor accuracy in image classification and feature extraction in the express logistics field, making it difficult to meet the needs of efficient sorting and packaging.
An image classification method based on collaborative optimization algorithm and feature selection mechanism is adopted. The image feature extraction model is constructed by genetic programming algorithm, and the individual position and velocity information is optimized by particle swarm algorithm. The feature selection model is constructed and the SVM classifier is used for image classification.
It improves the quality of image feature extraction and the accuracy of classification, thereby increasing the efficiency of logistics sorting and packaging.
Smart Images

Figure CN2024123535_13112025_PF_FP_ABST
Abstract
Description
Image classification method based on collaborative optimization algorithm and feature selection mechanism Invention 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, 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.
[0005] Invention Overview
[0006] 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.
[0007] 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.
[0008] 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:
[0009] Step S1: Preprocess the acquired images;
[0010] 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.
[0011] Step S3: Construct a feature selection model to select from the extracted features;
[0012] Step S4: Train the SVM classifier using the selected features as input;
[0013] Step S5: Use the trained SVM classifier to classify the express delivery images.
[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 S1 includes:
[0015] Step S1.1: Adjust the images to the same fixed size;
[0016] 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];
[0017] 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.
[0018] 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.
[0019] 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.
[0020] 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:
[0021] Step S2.1: Define the algorithm's function set, terminator set, and parameters;
[0022] 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.
[0023] 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;
[0024] 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.
[0025] 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.
[0026] 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;
[0027] 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.
[0028] Step S2.8: Input the preprocessed image into the constructed model A for feature extraction;
[0029] Step S2.9: Obtain Model B using the same operation as above, and input the preprocessed image into Model B for feature extraction.
[0030] 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:
[0031] Step S2.5.1: Initialize the velocity and position of each individual in the population;
[0032] 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;
[0033] 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;
[0034] Step S2.5.4: Update the individual's velocity and position information based on the updated individual historical best value and global best value;
[0035] Step S2.5.5: Update the final position and velocity information obtained after multiple iterations;
[0036] Step S2.5.6: Use min-max normalization to standardize the final position and velocity information to the range [0, 1];
[0037] Step 2.5.7: Adjust the selection probability of the corresponding individuals during the iteration process based on the final position and velocity information.
[0038] 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.
[0039] 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:
[0040] 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;
[0041] Step S3.2: The scorer compares the generated image with the original image;
[0042] Step S3.3: Score the selected feature vectors based on similarity;
[0043] Step S3.4: Select features again and repeat the above steps, which means that 2n selections and scores are required;
[0044] Step S3.5: Score the feature vectors and input them into the selector;
[0045] 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.
[0046] 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:
[0047] Step S3.2.1: Convert the original image and the generated image to grayscale respectively;
[0048] Step S3.2.2: Read the pixels of each point in the original image and the generated image respectively and generate a feature sequence;
[0049] 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;
[0050] 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, record it as 0, otherwise record it 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.
[0051] According to an embodiment of the image classification method based on the collaborative optimization algorithm and feature selection mechanism of the present invention, the specific steps of step S4 are as follows: input the new feature vector into the SVM classifier, evaluate it using five-fold cross-validation, 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.
[0052] According to an embodiment of the image classification method based on the 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 and output the category to which the image belongs.
[0053] Compared with the prior art, the present invention has the following beneficial effects: The image classification method based on the collaborative optimization algorithm and feature selection mechanism of the present invention 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
[0054] 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.
[0055] Figure 1 shows a flowchart of an embodiment of the image classification method based on the collaborative optimization algorithm and feature selection mechanism of the present invention.
[0056] Figure 2 shows a schematic diagram of the image feature extraction and feature selection model in the embodiment shown in Figure 1.
[0057] Figure 3 shows a detailed flowchart of image feature extraction in the embodiment shown in Figure 1.
[0058] Detailed description of the invention
[0059] 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.
[0060] Figure 1 illustrates the flowchart of an embodiment of the image classification method based on the collaborative optimization algorithm and feature selection mechanism of the present invention. Referring to Figure 1, the implementation steps of this embodiment are detailed below.
[0061] Step S1: Preprocess the acquired images.
[0062] Step S1 includes the following processing flow.
[0063] Step S1.1: Adjust the images to the same fixed size.
[0064] 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].
[0065] 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.
[0066] 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.
[0067] 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.
[0068] 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.
[0069] 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:
[0070] in, These are the width and height of the output image, respectively. The width and height of the input image are respectively, and the kernel is the kernel. size is the kernel size, padding is the number of padding loops, and stride is the stride.
[0071] 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:
[0072] in, These are the width and height of the output image, respectively. The width and height of the input image are respectively, and the kernel is the kernel. size is the kernel size, and stride is the stride.
[0073] 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.
[0074] Step S2 includes the following processing flow. Specifically, the specific processing for constructing the image feature extraction model is as follows.
[0075] 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.
[0076] 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.
[0077] Step S2.3: Using the preprocessed test image set Y c Using the above steps as input, the image feature extraction model is used to extract features from the image, resulting in image feature Z.
[0078] Step S2.4: Calculate the individual's fitness s(i,t) based on the score D(Y, Y') of the optimal feature group selected from the features Z extracted using this structure by the feature selection model, and the classification accuracy η obtained after training the classifier using the optimal feature group. The specific calculation formula is as follows:
[0079] Where δ represents the influence of classification accuracy on fitness calculation, and D represents the score D(Y, Y') of the feature selection model for the optimal feature group.
[0080] 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. See Figure 3. The specific steps of step S2.5 are as follows.
[0081] 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 x. i =(x i1 x i2 , ..., x in The speed information is v. i =(v i1 v i2 , ..., v in );
[0082] Step S2.5.2: Calculate the current fitness value F for each individual. i The individual's historical best position information j best = (j1, j2, ..., j n The fitness value F) jbest and the global optimal individual position information q best = (q1, q2, ..., q n The fitness value F) qbest :
[0083] F i =fitness(x i )
[0084] F jbest =fitness(j best )
[0085] F qbest =fitness(q) best )
[0086] The fitness() function is configured according to different practical problems.
[0087] Step S2.5.3: For F respectively i F jbest F qbest Compare, if F i >F jbest Then use x i =(x i1 x i2 , ..., x in Replace j best = (j1, j2, ..., j n Similarly, if F i >F qbest Then use x i =(x i1 x i2 , ..., x in Replace q best =(q1, q2, ..., q n ).
[0088] 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:
[0089] v i =ω*v i +α1(j best -x i )+α2(q best -x i )
[0090] x i =x i +v i
[0091] Among them, v i For individual velocity information, x i For individual location information, ω is the inertia weight, α1 and α2 are learning factors, and j best For the individual's historical best position information, q best This represents the globally optimal individual location information.
[0092] Step S2.5.5: Update the final position information obtained after multiple iterations to x. i '= (x i1 ', x i2 ',...,x iN The speed information is v. i '=(v i1 ', v i2 ',...,v iN ').
[0093] 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:
[0094] Among them, v i ', x i 'These represent the particle's velocity and position,' These are the normalized velocity and position, v. max ', v min 'x' represents the maximum and minimum particle velocities, respectively. max ', x min ' represents the maximum and minimum values of the particle's position, respectively.
[0095] 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:
[0096] Among them, P s P represents the initial selection probability, obtained from roulette wheel selection, before adjustment. s ' represents the adjusted selection probability, and β1 and β2 are the weighting coefficients. For the final position and velocity information, This provides the initial position and velocity information.
[0097] 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.
[0098] 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.
[0099] Step S2.8: Input the preprocessed image Y into the constructed model A for feature extraction, and denote the extracted features as Z. A .
[0100] 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 Z. B ...
[0101] Step S3: Construct a feature selection model to select the extracted features.
[0102] The feature selection model includes an image generator, a scorer, and a selector, as shown in Figure 2. 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; the selector selects the best-performing feature based on the score.
[0103] The main steps of the feature selection model are:
[0104] Step S3.1: The image generator selects features according to the following rules, generates an image based on the selected features, denoted as Y', and uses it as input to the scorer. Specifically, the three-dimensional tensor of the features extracted by model A is denoted as Z. A ={z1 A z2 A , ..., z n A Let Z be the three-dimensional tensor of the features extracted by model B. B ={z1 B z2 B , ..., z n B}, where z i A , z i B 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.
[0105] Step S3.2: The scorer compares the generated image Y' with the original image Y to obtain D(Y, Y'). The specific steps of image similarity comparison are as follows:
[0106] Step S3.2.1: Convert the original image and the generated image to grayscale respectively;
[0107] Step S3.2.2: Read the pixels of each point in the original image and the generated image respectively and generate feature sequences T and T′;
[0108] 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.
[0109] Step S3.2.4: Define a threshold K, 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 D.
[0110] Step S3.3: Score the selected feature vectors based on similarity;
[0111] Step S3.4: Select the features again and repeat the above steps, which requires 2 steps. n Second choice and rating;
[0112] Step S3.5: Denote the score of the feature vector as X and input it into the selector;
[0113] Step S3.6: Employ a self-attention mechanism in the selector to select the feature 3D tensor Z with the highest score. m ={z1 m z2 m , ..., z n m The softmax function is used to convert the feature scores into weights w = softmax(z) = {w1, w2, ..., w...}. n Each feature is weighted to obtain a new feature vector Z' = {z1', z2', ..., z}. n'}. Among them, z i '=w i z i m , z i 'W represents the new feature of the i-th element after weighted processing. i Let z be the weight of the i-th feature. i m This refers to the i-th feature before weighted processing.
[0114] Step S4: Train the SVM classifier using the selected features as input.
[0115] The specific steps of step S4 are as follows: Create a new feature vector x' = {x1', x2', ..., x...} k The input SVM classifier is evaluated 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 the images into n classes. The classification accuracy of the trained model on the validation set is then calculated as the evaluation result for that round. This process is repeated five times, and the average of these five evaluation results is used as the final classification accuracy η to calculate the fitness value.
[0116] Step S5: Use the trained classifier to classify the express delivery images.
[0117] 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 collected images, outputting the category Y = i (i = 1, 2, ..., n) to which the image belongs.
[0118] 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.
[0119] 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:
[0120] 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.
[0121] Assume that the velocity and position of each particle are 5-dimensional vectors, α1 = 0.5, α2 = 0.3, and the velocity and position information of one particle are v = (0.2, -0.1, 0.3, 0.4, -0.2) and x = (0.5, 0.7, 0.1, -0.3, 0.9), respectively. After multiple iterations, the final velocity and position information obtained are v' = (0.1, -0.05, 0.2, 0.3, -0.15) and x' = (0.6, 0.65, 0.15, -0.2, 0.85), respectively. The initial selection operator P... s =0.5.
[0122] Then the adjusted selection operator P can be obtained. s = 0.49725.
[0123] 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 is T = (1, 3, 6, 3, 1, 2, 1, 8, 7), the feature sequence of the image generated by the generator is T' = (3, 5, 2, 3, 2, 4, 6, 2, 5), and the threshold K = 3.
[0124] Then the difference sequence can be obtained. The contrast sequence is (1, 1, 1, 1, 1, 1, 0, 1, 1), and the score D for the optimal feature group of the training feature selection structure is 0.89.
[0125] Assume that the classification accuracy obtained by training the SVM using the optimal feature set is η = 0.85, and the influence of classification accuracy on the fitness calculation is β = 0.8.
[0126] The fitness value s(i,t) calculated according to the fitness function is 0.493.
[0127] 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:
[0128] Image category: 6.
[0129] This result indicates that the item in the image belongs to the sixth category of items defined by the system.
[0130] 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.
[0131] 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.
[0132] 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.
[0133] 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.
[0134] 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.
[0135] 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.
[0136] 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.
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, which is used to extract local 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 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.
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, 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.
6. The image classification method based on collaborative optimization algorithm and feature selection mechanism according to claim 1, characterized in that, 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 better performance based on the score.
7. The image classification method based on collaborative optimization algorithm and feature selection mechanism according to claim 6, characterized in that, 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, which requires 2 steps. n Second choice and rating; Step S3.5: Score the feature vectors and input them into the selector; Step S3.6: Employ 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 scores into weights, and perform weighted processing on each feature to obtain a new... eigenvectors.
8. The image classification method based on collaborative optimization algorithm and feature selection mechanism according to claim 7, 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, record it as 0, otherwise record it 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.
9. 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 evaluate it using five-fold cross-validation. 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.
10. 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, the SVM classifier is trained using the feature-extracted training set, and the trained classifier is used to classify the acquired images and output the category to which the image belongs.
Citation Information
Patent Citations
Coevolutionary algorithm optimized support vector machine wetland remote sensing remote sensing classification method
CN107067035A
Explanatable genetic programming image classification method capable of simultaneously realizing feature extraction and selection
CN116543230A
Image classification method based on collaborative optimization algorithm and feature selection mechanism
CN118351379A
Training an image processing neural network without human selection of features
US20130266214A1
Cited By
A domain-independent heuristic automatic design method for classical planning based on large language model and evolutionary computation
CN122472160A