An image classification method based on genetic algorithm and partitioned data set

By introducing genetic algorithms and dividing data set methods in the design of the CNN structure, combining depth and width module, optimizing the CNN structure design, solving the problem of large consumption of existing algorithm computing resources and low accuracy, and achieved more efficient and accurate image classifications.

CN114662593BActive Publication Date: 2025-01-28JIANGNAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210297893.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-24
Publication Date
2025-01-28
Estimated Expiration
2042-03-24

AI Technical Summary

Technical Problem

The existing CNN automatic structure design algorithm consumes a lot of computing resources and runtime, and the final CNN network structure image classification accuracy is low, and the existing algorithm ignores the CNN network width structure information.

Method used

The CNN structure design is based on the method of genetic algorithm and the data set, and the CNN structural design process is optimized by introducing Resinenet depth modules and Inception width modules to optimize the CNN structure design through FEATURE, Transition, and Dropout modules.

Benefits of technology

Improved the execution speed and image classification of the CNN structure design, reducing the consumption of computing resources, enhancing the reliability of the algorithm, and using the width structure information of the CNN network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114662593B_ABST
    Figure CN114662593B_ABST
Patent Text Reader

Abstract

The invention discloses an image classification method based on a genetic algorithm and a partitioned data set, and belongs to the technical field of image recognition and classification. The method improves the execution speed of CNN structure design based on a genetic algorithm by partitioning the data set, and improves the reliability of the image classification method by correcting the CNN individual fitness function obtained by training the partitioned data set. At the same time, in order to solve the problem that the existing method only uses ResNet and DenseNet deep modules for CNN structure design and ignores the CNN network width structure, the method introduces the Inception module, and proposes the Feature module as the first layer of the CNN network structure to ensure that the input image has enough features for the deep module to learn, the Transition module transforms the feature dimension of the feature map, and the Dropout module prevents the overfitting of the network, thereby comprehensively improving the accuracy of image classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an image classification method based on a genetic algorithm and a divided data set, and belongs to the technical field of image recognition and classification. Background Art

[0002] In recent years, convolutional neural networks (CNNs) have made great achievements in processing computer vision tasks and have become the mainstream method for solving image classification. From initially stacking network layers to make the network deeper, to later integrating the residual structure and dense connection structure of different depth network layer features, to the structure of network width feature fusion, the CNN network structure has become the key to affecting the performance of CNN models, and the performance of CNN models will further affect the accuracy of image classification, target detection, target tracking and other tasks using the model.

[0003] However, the traditional manual design of CNN structure is not easy. It not only requires a lot of CNN-related expertise and rich experience, but also requires different CNN network structures to be designed for different data sets, which greatly limits the development of CNN. In essence, CNN structure design is an optimization problem. By optimizing the network model M, the loss function L(M,T) on the training data set T is minimized. The CNN model M can be represented by the network internal structure encoding vector λ, and is learned by a specific learning algorithm A on the training set T, that is, M=A(λ,T). Then the goal of CNN structure design is to find an optimal network structure solution λ * , so that M * =A(λ * ,T), and satisfies L(M * ,V) is the smallest, which can be expressed by the following mathematical formula:

[0004] λ * =arg λ minL(T,M)=arg λ minf(λ,A,T,V,L)

[0005] The objective function f receives the vector λ representing the network structure encoding as input and outputs the corresponding loss value. The training set T and the validation set V are divided by the training set according to a certain ratio to satisfy By minimizing the loss value of the objective function f, the optimal λ can be obtained, and then the network model M can be constructed. Finally, the generalization ability of M is verified on the test set. In theory, the network structure λ can be optimized by algorithms such as gradient descent, but it is difficult to achieve in practice. The reasons are as follows:

[0006] 1. Optimizing the loss value of the objective function f is essentially about finding a specific λ, which is a combinatorial optimization problem with large computational complexity and high computational cost.

[0007] 2. The structural vector λ representing the network model M is a discrete code and cannot be processed by the traditional method of processing continuous functions.

[0008] Therefore, in recent years, a large number of search algorithms that can automatically design CNN structures have been proposed. These algorithms can automatically search for CNN structures with superior performance without the need for human knowledge and experience. According to whether preprocessing is required before searching, these algorithms can be roughly divided into two categories: semi-automatic CNN structure search algorithms represented by algorithms such as Genetic CNN, Hierarchical Evolution, EAS, Block-QNN-S, and fully automatic CNN structure search algorithms represented by Large-scale Evolution, CGP-CNN, NAS, MetaQNN, IPPSO, AE-CNN, etc. The above semi-automatic and fully automatic CNN structure search algorithms are all based on evolutionary computing algorithms or reinforcement learning algorithms. For example, Genetic CNN, Hierarchical Evolution, CGP-CNN, Large-scale Evolution, AE-CNN, IIPSO are based on evolutionary computing algorithms, and NSA, MetaQN, EAS and Block-QNN-S are based on reinforcement learning algorithms.

[0009] Although the above-mentioned CNN structure automatic search algorithm can reduce the difficulty of manually designing CNN structure, such algorithms often consume a lot of computing resources and running time. For example, the NAS algorithm based on reinforcement learning needs to run on 800 computing units (GPU) for 28 days on the CIFAR-10 dataset. The structure search algorithm based on evolutionary computing can reduce the dependence on computing resources to a certain extent, but the algorithm still takes a lot of time to execute. For example, the AE-CNN based on genetic algorithm (GA) needs to run on 1 computing unit (GPU) for 30 days on the CIFAR-10 dataset to find the optimal solution for the CNN structure.

[0010] At the same time, with the introduction of GoogleNet, width structure has become an effective means of feature extraction for convolutional neural networks. However, when existing algorithms perform structure search, they often only extract feature information from the depth direction of the network, and do not fully utilize the width structure information of CNN. For example, AE-CNN based on ResNet Block and DesNet Block depth modules utilizes the depth information of the network and ignores the width information of the network.

[0011] Therefore, under limited resources, it still requires a lot of work to quickly search for CNN structures with superior performance to improve the accuracy of image classification. Summary of the invention

[0012] In order to solve the problem that the CNN automatic structure design consumes a lot of computing resources and running time in the current image classification process and the image classification accuracy of the CNN network structure finally obtained is low, the present invention provides an image classification method based on a genetic algorithm and a partitioned data set, the method comprising:

[0013] Step 1: Based on the ResNet module, DenseNet depth module and Inception width module in the CNN network, the CNN structure is linearly encoded with variable length, and the population P is initialized to obtain the initial population P0;

[0014] Step 2: Divide the public data set used for image classification training into a test set and a training set according to a predetermined ratio, and calculate the image classification accuracy of each CNN individual after training each CNN individual on it for a limited number of times as the fitness value of each CNN individual in the population P;

[0015] Step 3: According to the correction method Correct the fitness value of each CNN individual obtained in step 2;

[0016] Step 4: According to the corrected fitness value of each CNN individual, crossover and mutation operations are performed to generate offspring;

[0017] Step 5: The CNN individuals of the offspring and parent generations are selected to generate a new population;

[0018] Step 6: Repeat steps 2 to 5 until the termination condition is met, and use the CNN individual with the best fitness in the final population P' to perform image classification.

[0019] Optionally, the correction method in step three It is composed of two correction functions l1 and l2; the step three includes:

[0020] Step 1 calculates the parameter amount of each CNN individual in the initial population P0, the model accuracy of each CNN individual based on the partitioned data set, and the model accuracy of each CNN individual based on the complete data set, and saves them to arrays p and acc respectively div and acc full middle;

[0021] Step 2: Set p and acc div As the input of the correction function l1, acc full As expected inputs of the correction function l1, weights w1, w2 and b of the correction function l1 are determined;

[0022] The corrected function l1 is:

[0023] l1:acc full =w1*acc div -w2*|pp d |+b

[0024] where acc full is the accuracy of CNN individuals in dividing the data set, p is the number of parameters of CNN individuals, and p d It is the a priori expected parameter quantity, that is, the parameter quantity of the CNN individual under the expected accuracy value;

[0025] Step 3: According to the parameter quantity p of each CNN individual i Determine the correction function l2:

[0026]

[0027] p min is the lower boundary value of the parameter, p max is the upper boundary value of the parameter, α is the attenuation coefficient, β is the step size control factor, and γ represents the number of iterations;

[0028] Step 4, according to the correction method Correct the fitness value of each CNN individual obtained in step 2;

[0029] Correction method for:

[0030]

[0031] Among them, l2 is based on p i The value range of determines the corresponding value.

[0032] Optional, p d =(p max +p min ) / 2

[0033] Optionally, the termination condition in step six is ​​iterating to a specified algebra e.

[0034] Optionally, the attenuation coefficient α is set to 0.8, and the step size control factor β is set to 0.1.

[0035] Optionally, the number of iterations γ takes the value 20.

[0036] Optionally, the data set used for image classification training in step 2 includes the public data sets CIFAR-10 and CIFAR100.

[0037] Optionally, step 2 includes: dividing the CIFAR-10 and CIFAR-100 data sets at a ratio of 1:5, and dividing the test set and the training set at a ratio of 1:4 on the divided data sets.

[0038] The present invention also provides the application of the above-mentioned image classification method in the field of target detection, i.e. tracking, and face recognition.

[0039] The beneficial effects of the present invention are:

[0040] The execution speed of the CNN structure design method based on genetic algorithm is improved by dividing the data set, and the reliability of the image classification method is improved by correcting the individual fitness function of CNN obtained by training the divided data set. At the same time, in order to solve the problem that the existing mainstream methods only use ResNet and DenseNet deep modules for CNN structure design and ignore the CNN network width structure, this method introduces the Inception module to make up for this defect, and proposes the Feature module as the first layer of the CNN network structure to ensure that the input image has enough features for the deep module to learn. The Transition module transforms the feature dimension of the feature map, and the Dropout module prevents the network from overfitting, which comprehensively improves the accuracy of image classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0042] Figure 1 It is a schematic diagram of the residual network structure.

[0043] Figure 2 It is a schematic diagram of densely connected network structure.

[0044] Figure 3 It is a schematic diagram of the width network structure.

[0045] Figure 4 It is a schematic diagram of the Feature module structure.

[0046] Figure 5 It is a schematic diagram of linear CNN structure encoding based on depth and width modules. DETAILED DESCRIPTION

[0047] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0048] Introduction to basic theory:

[0049] In the traditional CNN structure, each network layer is directly connected, and the shallow features are passed to the deep network layer by layer through convolution, pooling and nonlinear operations. This kind of layer-by-layer connected traditional CNN structure is represented by LeNet, AlexNet and VGG-Net. When training the traditional layer-by-layer connected CNN, as the number of network layers increases, there will be problems of gradient explosion and gradient disappearance, which is often difficult to train. This greatly limits the development of CNN, so researchers proposed the residual network ResNet.

[0050] The introduction of residual structure in residual network makes it possible to connect CNN across layers, changing the traditional CNN structure that only adjacent layers can be connected, making the feature extraction method between network layers more flexible, such as Figure 1 As shown in the figure. The residual network structure integrates the feature information of shallow and deep layers to reduce overfitting. At the same time, the residual structure can ensure the loss function calculation and solve the problem that deep network models are difficult to train. However, the residual network structure only connects specific layers across layers through the residual structure.

[0051] Different from the residual network structure, each layer of the densely connected network structure DenseNet can be connected, such as Figure 2 As shown in the figure. Through dense connections between layers, the information between layers is retained to the greatest extent. Each layer concatenates the inputs of all previous layers and then passes the output feature maps to all subsequent layers. Densely connected networks also alleviate the gradient vanishing problem, strengthen feature transfer, and use features more effectively, while reducing parameters to a certain extent.

[0052] The above residual network structure and densely connected network structure both increase the feature learning ability of CNN networks by deepening the number of CNN layers; and a new CNN model structure that appeared in 2014, Inception (also known as GoogleNet), enhances the feature learning ability of CNN structure models by making the network structure wider. With the same amount of computation, more features can be extracted, thereby improving training results. Figure 3 shown.

[0053] However, the existing semi-automatic and fully-automatic CNN structure search algorithms only consider the internal structure parameters of CNN, or the connections between networks, or only extract feature information from the depth direction of the network, and do not fully utilize the relevant information of the CNN width structure. Therefore, the CNN structures finally obtained cannot achieve higher image classification accuracy.

[0054] Embodiment 1:

[0055] This embodiment provides a method for automatically designing a CNN network structure for image classification, the method comprising:

[0056] Step 1: Based on the ResNet module, DenseNet depth module and Inception width module in the CNN network, the CNN structure is linearly encoded with variable length, and the population P is initialized to obtain the initial population P0;

[0057] Step 2: Divide the public data set used for image classification training into a test set and a training set according to a predetermined ratio, and calculate the image classification accuracy of each CNN individual after training each CNN individual on it for a limited number of times as the fitness value of each CNN individual in the population P;

[0058] Step 3: According to the correction method Correct the fitness value of each CNN individual obtained in step 2;

[0059] Step 4: According to the corrected fitness value of each CNN individual, crossover and mutation operations are performed to generate offspring;

[0060] Step 5: The CNN individuals of the offspring and parent generations are selected to generate a new population;

[0061] Step 6: Repeat steps 2 to 5 until the termination condition is met, and use the CNN individual with the best fitness in the final population P' to perform image classification.

[0062] Embodiment 2:

[0063] This embodiment provides an image classification method based on a genetic algorithm and a partitioned data set. The method automatically designs a CNN network structure based on the genetic algorithm and the partitioned data set. The CNN network structure finally designed is used for image classification. Figure 1 , the method comprising:

[0064] Step 1. Perform linear variable-length encoding on the CNN structure based on the linear encoding method of the depth module and the width module;

[0065] Based on the ResNet module, DenseNet module, Inception module, Feature module, Transition module and Dropout module, the CNN structure is linearly encoded with variable length.

[0066] Step 2. According to the encoding method in step 1, initialize a population containing 30 CNN network structure individuals to obtain the initial population P0.

[0067] Step 3. Divide the CIFAR-10 and CIFAR-100 datasets at a ratio of 1:5, and divide the test set and the training set at a ratio of 1:4 on the divided datasets; CIFAR-10 and CIFAR-100 datasets are two public datasets.

[0068] Step 4. Train for 30 epochs on the above divided data set to obtain the classification accuracy of each CNN individual initialized in step 2 on the divided data set as the individual's fitness.

[0069] Step 5. According to the correction method Correct the fitness value of the individual obtained in step 4.

[0070] Correction method It consists of two correction functions, l1 and l2. The calculation formula of l1 is as follows:

[0071] l1:acc full =w1*acc div -w2*|pp d |+b (2)

[0072] where acc full is the accuracy of CNN individuals in dividing the data set, p is the number of parameters of CNN individuals, and p d is the expected parameter, w1, w2 and b are the classification accuracy acc of each individual in the initialization population P0 on the partitioned data set div , parameter quantity p and classification accuracy acc on the complete dataset full The parameters of the trained linear regression model are obtained. The training steps are as follows:

[0073] Step 1. Initialize the population P according to the linear encoding method based on the depth module and the width module described in step 1. Figure 5 shown.

[0074] Step 2. Calculate the parameters of each CNN individual in the population P, based on the model accuracy on the partitioned dataset and the model accuracy on the complete dataset, and save them to p,acc div and acc full The corresponding array.

[0075] Step 3. Add p and acc div The corresponding array is used as the input of the linear model l1, acc full As the expected input to the linear regression model, train the linear model.

[0076] Step 4. After the model training is completed, the model weights w1, w2 and b are obtained.

[0077] Since l1 only trains each CNN individual in the initial test population P0 to obtain a regression model, as the invention iterates, the l1 correction effect will become smaller and smaller. In order to make up for the l1 defect, the l2 regularization method is introduced. As shown in formula (3), p i is the individual parameter, p d is the a priori expected parameter, p min is the lower boundary value of the parameter, p max is the upper boundary value of the parameter, generally p d =(p max +p min ) / 2pmin, α is the attenuation coefficient, the value is 0.8, β is the step size control factor, the value is 0.1, and γ is the number of iterations of the present invention, which is 20 in this article.

[0078]

[0079] Formula (4) gives the correction method The calculation formula is: div is the accuracy of the CNN individual trained on the partitioned dataset, p i is the CNN model parameter, p d are the expected model parameters, w1, w2 and b are the regularization l1 parameters.

[0080]

[0081] The formula (4) is used to calculate The value is used as the corrected precision.

[0082] Step 6. According to the corrected fitness value, perform crossover and mutation operations on the individuals in the population until the termination condition is met, otherwise jump to step 4.

[0083] The final CNN network structure is used for image classification.

[0084] This application method introduces the Inception width module based on the ResNet module and the DenseNet depth module, so that this method can automatically design a CNN network with a deep structure and a wide structure, and improve the accuracy of the CNN network in processing image classification tasks. The verification experiment process and results are as follows:

[0085] Ten independent experiments were conducted on the mainstream datasets CIFAR-10 and CIFAR100 for image classification tasks, where Acc(%) represents the accuracy of the automatically designed CNN structure, Avg is the average of the 10 independent experiments, With indicates whether the Inception width module is used, and CIFAR-10 and CIFAR-100 indicate the datasets of the experiments.

[0086] The experimental results are shown in Table 1. By comparing the average values, it can be seen that, whether on CIFAR-10 or CIFAR-100, after the Inception structure is introduced in this application, the performance of the CNN automatically searched out in the classification task is better than that without the Inception structure.

[0087] Table 1 Comparison of the effects of using or not using the Inception module on CIFAR-10 and CIFAR-100 image classification data

[0088] No. 1 2 3 4 5 6 7 8 9 10 Avg With CIFAR Acc(%) 93.75 93.62 93.83 93.5 94.25 94.17 94.47 94.02 94.12 93.27 93.9 No -10 Acc(%) 94.1 93.87 94.29 94.12 94.18 94.21 94.08 94.13 94.27 94 94.1 Yes -10 Acc(%) 75.36 75.8 75.6 73.9 74.7 75.2 73.9 74.8 75.3 75.9 75.04 No -100 Acc(%) 75.7 76.3 75.8 74.6 75.4 74.8 74.2 75.37 75.7 76 75.38 Yes -100

[0089] This application method introduces the traditional division of data sets. The correction method, as shown in Formula 4, corrects the CNN accuracy on the divided data set based on the pre-trained linear correction model l1 in the initial population and the parameter amount of the CNN network structure, and the iterative algebraic quadratic correction method l2 of the model, which improves the speed of the automatic design of the CNN network structure of the present invention, reduces computing resources, and greatly improves the reliability of the algorithm. The verification experiment process and results are as follows:

[0090] The present invention conducted 10 comparative experiments on the CIFAR-10 dataset. The experimental results are shown in Table 2, where Acc (%) represents the accuracy of the automatically searched CNN structure on the CIFAR-10 classification task, Params represents the parameter quantity of the corresponding structure, and Avg represents the average value of the 10 experiments. The upper part of Table 2 is not used. The corrected experimental results, the lower part is with The experimental results of the correction effect (in bold) show that The average parameter of the correction method is not Corrected At the same time, the accuracy of 94.567% is better than 93.82%; therefore, it can be seen that in image classification tasks, The modified CNN structure can be searched out with fewer parameters, more stable model and higher accuracy.

[0091] Table 2 Correction methods on CIFAR-10 dataset Effect

[0092]

[0093]

[0094] In order to further highlight the progress of the present invention over the prior art, the present invention has conducted experiments on CIFAR-10 and CIAFR-100, and compared the current mainstream methods. The results are shown in Tables 3, 4, and 5, where the column below CIFAR-10 and CIFAR-100 represents the error rate corresponding to each method. The lower the error rate, the better the effect. Prams represents the number of parameters of the designed CNN network structure. The smaller the number of parameters, the better the network structure. GPU Days indicates the execution time of the method. 1 GPU Day represents the computing resources required to run on a 2080Ti graphics card for one day. The smaller the GPU Day value, the shorter the running time required for the method. The hand-crafted represents the manually designed method. FAE-CNN, the abbreviation of the present invention, is completely automatic.

[0095] Table 3 Comparison of experimental results of FAE-CNN and manually designed methods on CIFAR-10 and CIFAR-100

[0096] CIFAR-10 CIFAR-100 Params GPU Days DenseNet(k=12) 5.24 24.42 1.0M hand-crafted ResNet(depth=101) 6.43 25.16 1.7M hand-crafted ResNet(depth=1202) 7.93 27.82 10.2M hand-crafted MaxOut 9.3 38.6 hand-crafted VGG 6.66 28.05 20.4M hand-crafted NetWork in Network 8.81 35.68 hand-crafted Highway Network 7.72 32.39 hand-crafted All-CNN 7.25 33.71 hand-crafted FractalNet 5.22 22.3 38.6M hand-crafted FAE-CNN 5.13 3.5 completely automatic FAE-CNN 23.74 6 completely automatic

[0097] Table 3 shows the comparison between the FAE-CNN of the present invention and the method of manually designed CNN classification network on CIFAR-10 and CIFAR-100. Whether on CIFAR-10 or CIFAR-100, FRAE-CNN has better effect overall. Although the error rate of FractalNet is 22.3% on CIFAR-100, which is better than 23.74% of DLAE-CNN, the parameter amount of the FAE-CNN of the present invention is 4.0M, which is much smaller than 38.6M.

[0098] Table 4 Comparison of experimental results of FAE-CNN and semi-automatic design methods on CIFAR-10 and CIFAR-100

[0099]

[0100]

[0101] Table 4 shows the effect comparison between the FAE-CNN of the present invention and the semi-automatic CNN structure design algorithm. The error rate of HierarchicalEvolution on the CIFAR10 data set is only 3.63%, but the 300 GPU Days required to run the algorithm require a large amount of computing resources, while the FAE-CNN of the present invention only needs 3.5 GPU Days to run the algorithm once on CIFAR-10 (pre-training a regression model 2.5 GPU Days + structure search 1 GPU Day), and the required computing resources are greatly reduced. For EAS, the error rate on CIFAR-10 is 4.23%, but in terms of the number of parameters and the required computing resources, the FAE-CNN of the present invention is relatively better. Similarly, compared with the Block-QNNS algorithm, the FAE-CNN requires fewer computing resources. Therefore, compared with the semi-automatic structure search algorithm, the FAE-CNN of the present invention can search for a competitive solution.

[0102] Table 5 Comparison of experimental results of FAE-CNN and fully automatic design methods on CIFAR-10 and CIFAR-100

[0103] CIFAR-10 CIAFR-100 Params GPU Days Large Scale Evolution 5.4 5.4M 2750 completely automatic Large Scale Evolution 23 40.4M 2750 completely automatic CGP-CNN 5.98 2.64M 27 completely automatic NAS 6.01 2.5M 22400 completely automatic MetaQNN 6.92 27.14 100 completely automatic AE-CNN 4.3 20.85 2.0M 27 completely automatic AE-CNN 5.4M 36 completely automatic AE-CNN+E2EPP 5.3 22.02 8.5 completely automatic AE-CNN+E2EPP 8.5 completely automatic FAE-CNN 5.13 1.9M 3.5 completely automatic FAE-CNN 23.74 4.0M 6 completely automatic

[0104] Table 5 shows the experimental effect comparison of the FAE-CNN of the present invention relative to the fully automatic search algorithm. The FAE-CNN of the present invention is better than CGP-CNN, NAS, and MetaQNN. Although the Large Scale Evolution algorithm achieves an error rate of 23% on CIFAR-100, which is better than the FAE-CNN algorithm, Large Scale Evolution requires 2750 GPU Days to run once, and the algorithm requires a lot of computing resources. Compared with the AE-CNN algorithm, although the FAE-CNN is inferior in accuracy on CIFAR-10 and CIFAR-100, the final model parameters are less than AE-CNN, and the execution time is greatly reduced. Compared with the AE-CNN+E2EPP algorithm based on the proxy model, the accuracy and algorithm execution time of the optimal CNN model searched by FRAE-CNN on CIFAR-10 are better than the former. On CIFAR-100, although the error rate of the CNN structure automatically searched by FRAE-CNN is 23.74%, which is worse than 22.02% of AE-CNN+E2EPP, the FRAR-CNN algorithm takes 6 GPU Days to run, which is less than 8.5 GPU Days. Therefore, the FAE-CNN of the present invention can quickly search for a CNN structure model with superior image classification performance.

[0105] Some steps in the embodiments of the present invention may be implemented using software, and the corresponding software program may be stored in a readable storage medium, such as a CD or a hard disk.

[0106] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. An image classification method based on genetic algorithm and partitioned data set, characterized in that: The method comprises: Step 1: Based on the ResNet module, DenseNet depth module and Inception width module in the CNN network, the CNN structure is linearly encoded with variable length, and the population P is initialized to obtain the initial population P0; Step 2: Divide the public data set used for image classification training into a test set and a training set according to a predetermined ratio, and calculate the image classification accuracy of each CNN individual after training each CNN individual on it for a limited number of times as the fitness value of each CNN individual in the population P; Step 3: According to the correction method Correct the fitness value of each CNN individual obtained in step 2; Step 4: According to the corrected fitness value of each CNN individual, crossover and mutation operations are performed to generate offspring; Step 5: The CNN individuals of the offspring and parent generations are selected to generate a new population; Step 6: Repeat steps 2 to 5 until the termination condition is met, and use the CNN individual with the best fitness in the population P' to classify the image; The correction method in step 3 It is composed of two correction functions l1 and l2; the step three includes: Step 1 calculates the parameter amount of each CNN individual in the initial population P0, the model accuracy of each CNN individual based on the partitioned data set, and the model accuracy of each CNN individual based on the complete data set, and saves them to arrays p and acc respectively div and acc full middle; Step 2: Set p and acc div As the input of the correction function l1, acc full As expected inputs of the correction function l1, weights w1, w2 and b of the correction function l1 are determined; The corrected function l1 is: l1:acc full =w1*acc div -w2*|p-p d |+b where acc div is the accuracy of CNN individuals in dividing the data set, p is the number of parameters of CNN individuals, and p d It is the a priori expected parameter quantity, that is, the parameter quantity of the CNN individual under the expected accuracy value; Step 3: According to the parameter quantity p of each CNN individual i Determine the correction function l2: pmi n is the lower boundary value of the parameter quantity, pma x is the upper boundary value of the parameter, α is the attenuation coefficient, β is the step size control factor, and γ represents the number of iterations; Step 4, according to the correction method Correct the fitness value of each CNN individual obtained in step 2; Correction method for: Among them, l2 is based on p i The value range of determines the corresponding value.

2. The method according to claim 1, characterized in that p d =(p max +p min ) / 2。 3. The method according to claim 2, characterized in that The termination condition in step six is ​​that the iteration reaches a specified number of generations e.

4. The method according to claim 3, characterized in that The attenuation coefficient α is set to 0.8, and the step size control factor β is set to 0.

1.

5. The method according to claim 4, characterized in that The number of iterations γ is set to 20.

6. The method according to claim 1, characterized in that The data sets used for image classification training in step 2 include the public data sets CIFAR-10 and CIFAR100.

7. The method according to claim 1, characterized in that The step 2 includes: dividing the CIFAR-10 and CIFAR-100 data sets at a ratio of 1:5, and dividing the test set and the training set at a ratio of 1:4 on the divided data sets.

Citation Information

Patent Citations

  • Automatic grouping multi-scale lightweight deep convolutional neural network optimization method

    CN113011091A

  • Power transmission line external insulation state monitoring method and system based on the Internet of Things

    CN113295700A