Image classification method based on novelty and neural architecture search algorithm

By introducing novel search and NSGA-II algorithm into neural architecture search methods, combined with the method of reducing search space, the problem of long search time and easy to fall into local optimality in the prior art is solved, and more efficient search and higher quality neural architecture are achieved.

CN119540606APending Publication Date: 2025-02-28SHENZHEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411408958.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-02-28

Smart Images

  • Figure CN119540606A_ABST
    Figure CN119540606A_ABST
Patent Text Reader

Abstract

The invention discloses an image classification method based on novelty and a neural architecture search algorithm, and the method comprises the following steps: dividing a data set into a test set and a training set, training the test set, and training a hypernet through the training set; then, calculating the fitness of the population architecture by using a hypernet; then, according to errors generated by different calculation sequences, calculating the novelty of the individual architecture in sequence, and recording the novelty into an archive; then, generating a next generation of population by utilizing NSGA-II, and further obtaining an optimal architecture; and then reducing a search space by using the optimal architecture, and finally putting the test set into the trained architecture and the search space, and calculating the precision of the test set. According to the method, the search space is reduced by utilizing the optimal architecture, and the specific steps are as follows: identifying the search space with a good solution by utilizing a genetic algorithm, reducing the operation quantity of any two nodes, carrying out inheriting operation on the architecture weight of the super-network, inheriting the operation and the weight of a larger super-network search space, gradually reducing the search space, and obtaining the optimal solution of the super-network. And a search space with relatively high quality is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of neural architecture technology, and specifically relates to an image classification method based on novelty and neural architecture search algorithm. Background Art

[0002] Convolutional neural networks have played an important role in solving various computer vision problems, but their architectures are mainly designed through intuition and understanding of specific problems. The neural architecture search method can automatically and efficiently search for neural architectures for specific tasks, and has good results, and has good prospects in the field of computer vision.

[0003] The neural architecture search method needs to evaluate each architecture through training from scratch, which is time-consuming. Since the weights between the search space architectures are shared, the hypernet can be used to calculate the fitness between the architectures, but due to the collaborative adaptability between the composite edges of the hypernet, it will lead to the problem of local optimality. The existing technology uses novelty search methods and multi-objective genetic algorithms to solve this problem. This method introduces a novelty search method to explore the search space, and uses the multi-objective genetic algorithm NSGA-Ⅱ to achieve the two goals of maximizing novelty and maximizing adaptability. The accuracy of the existing technology in the S1 search space is lower than that of some algorithms, and the search space used by the algorithm is larger, and the search efficiency is low. Summary of the invention

[0004] The purpose of the present invention is to provide an image classification method based on novelty and neural architecture search algorithm to solve the problems raised in the above background technology: the search space of the prior art is large, which will lead to a long search time and low search efficiency.

[0005] To achieve the above object, the present invention adopts the following technical solutions:

[0006] An image classification method based on novelty and neural architecture search algorithm comprises the following steps:

[0007] S1. Complete initialization: Use NSGA-Ⅱ algorithm to initialize the population P, and initialize the supernet S and archive record set archive;

[0008] S2. Use the current population to train the supernet: randomly generate operations and weights for each individual in the population, generate architecture parameters α, and then copy each architecture to the supernet in turn, and use the training set to train the supernet S;

[0009] S3, evaluate the architecture fitness: treat all architectures as the weights of the architectures in the shared search space of the subnet of the supernet, normalize the architecture parameter α, and use the supernet to calculate the fitness F-acc of each individual architecture in the population;

[0010] S4. Evaluate the novelty of the architecture: Use the archived record set to calculate the novelty F-nov of each individual architecture in the population in turn according to the errors caused by different calculation orders, update the archived record set archive, and record the architecture of the current population and its novelty in it;

[0011] S5. Generate the next generation population using the NSGA-Ⅱ algorithm: quickly sort the individuals in the population according to their fitness, complete the classification operation, use the novelty of the individuals to select the next generation population, and obtain a Pareto optimal front end and the best architecture;

[0012] S6. Reduce the search space based on the best architecture: Reduce the number of architecture operations and perform weight inheritance operations on the supernet architecture to obtain a smaller and higher-quality search space;

[0013] S7. Calculate the accuracy of the test set: Place the test set into the optimal architecture and search space obtained, and calculate the accuracy of the test set in the S1 and S2 search spaces respectively.

[0014] Preferably, the data sets used in the present invention are CIFAR10 and CIFAR100, including two search spaces S1 and S2, and the two data sets are tested in the two search spaces respectively.

[0015] Preferably, the process of the NSGA-Ⅱ algorithm is: initialize the population, perform non-dominated sorting on the population, and perform selection, crossover, and mutation operations to generate a new population, perform fast non-dominated sorting on the original population and the new population using fitness, and select the next generation population based on novelty.

[0016] Preferably, the architecture of the present invention includes two types of cells: Normal Cell and Reduction Cell. When the resolution of the input feature and the output feature are consistent, Normal Cell is used, and when the resolution of the output feature is half of the input feature, Reduction Cell is used.

[0017] Preferably, in the overall architecture, the design principle of Normal Cell and Reduction Cell is to insert one Reduction Cell into every N Normal Cells.

[0018] Preferably, the search space S1 includes Normal Cell and Reduction Cell, each cell includes 7 nodes, 8 operations and 14 edges. The search space S2 includes only Normal Cell, each cell includes 4 nodes, 5 operations and 6 edges.

[0019] Technical effects and advantages of the present invention: The present invention proposes an image classification method based on novelty and neural architecture search algorithm. Compared with the prior art, the present invention can avoid the local optimal trap by using the novelty search method, and can obtain a higher quality neural architecture by using the NSGA-Ⅱ algorithm; by reducing the search space, the search space can be reduced, the supernet performance can be improved, a smaller search space can be obtained, and the search accuracy can be improved. Therefore, the present invention can obtain a search architecture with higher quality and a smaller search space, which can effectively avoid the problem that the neural search architecture algorithm is prone to fall into the local optimal state, and can effectively improve the search efficiency, reduce the search time, and improve the algorithm accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is the experimental flow chart of the present invention;

[0021] Figure 2 It is the algorithm flow chart of NSGA-Ⅱ of the present invention;

[0022] Figure 3 This is a diagram of the architecture of the search space of the present invention;

[0023] Figure 4 This is an example diagram of the Normal cell model of the present invention;

[0024] Figure 5 This is an example diagram of the Reduction cell model of the present invention. DETAILED DESCRIPTION

[0025] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. The specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0026] The present invention provides Figure 1-5 An image classification method based on novelty and neural architecture search algorithm is shown, comprising the following steps:

[0027] S1. Complete initialization: Use NSGA-Ⅱ algorithm to initialize the population P, and initialize the supernet S and archive record set archive;

[0028] S2. Use the current population to train the supernet: randomly generate operations and weights for each individual in the population, generate architecture parameters α, and then copy each architecture to the supernet in turn, and use the training set to train the supernet S;

[0029] S3, evaluate the architecture fitness: treat all architectures as the weights of the architectures in the shared search space of the subnet of the supernet, normalize the architecture parameter α, and use the supernet to calculate the fitness F-acc of each individual architecture in the population;

[0030] S4. Evaluate the novelty of the architecture: Use the archived record set to calculate the novelty F-nov of each individual architecture in the population in turn according to the errors caused by different calculation orders, update the archived record set archive, and record the architecture of the current population and its novelty in it;

[0031] S5. Generate the next generation population using the NSGA-Ⅱ algorithm: quickly sort the individuals in the population according to their fitness, complete the classification operation, use the novelty of the individuals to select the next generation population, and obtain a Pareto optimal front end and the best architecture;

[0032] S6. Reduce the search space based on the best architecture: Reduce the number of architecture operations and perform weight inheritance operations on the supernet architecture to obtain a smaller and higher-quality search space;

[0033] S7. Calculate the accuracy of the test set: Place the test set into the optimal architecture and search space obtained, and calculate the accuracy of the test set in the S1 and S2 search spaces respectively.

[0034] Preferably, the above operation uses novelty search, NSGA-Ⅱ algorithm and reduced search space method. The role of using the novelty search method is: novelty search is a very efficient search optimization method. The neural architecture search algorithm uses the supernet search architecture and is prone to fall into the local optimal trap, while the use of this method can effectively avoid the local optimal trap; the role of using the NSGA-Ⅱ algorithm is: regard the experiment as a multi-objective problem, and use the NSGA-Ⅱ algorithm to achieve two goals: maximize novelty and maximize fitness, so as to obtain a higher quality neural architecture; the role of using the reduced search space method is: reducing the search space can improve the performance of the supernet, obtain a higher quality and smaller search space, and improve the search accuracy. The role of using two search spaces in this experiment is to prove the effectiveness of the algorithm that can be extended to any search space.

[0035] Reference Figure 1, describes the experimental flow chart of the present invention. The experiment first obtains the best search space and the best architecture through the training data set, and then uses the test set to calculate the accuracy. The data sets used in this experiment are CIFAR10 and CIFAR100, including two search spaces S1 and S2, and the two data sets are tested on the two search spaces respectively. The specific steps are: divide the data set into a test set and a training set. First, train the test set, initialize a population, a supernet and an archive record set, then randomly generate the architecture parameter α of each individual architecture in the population, and copy the α of each individual architecture to the supernet, and use the training set to train the supernet; then use the supernet to calculate the fitness of the population architecture; then calculate the novelty of the individual architecture in turn according to the errors generated by different calculation orders, and record them in the archive; then, use NSGA-Ⅱ to generate the next generation population, and then obtain the best architecture; then use the best architecture to reduce the search space, reduce the number of architecture operations, and perform weight inheritance operations on the supernet architecture to obtain a smaller and high-quality search space; finally, put the test set into the trained architecture and search space, and calculate the accuracy of the test set.

[0036] Reference Figure 2 , describes the operation process of the NSGA-Ⅱ algorithm. The process of the NSGA-Ⅱ algorithm is: initialize the population, perform non-dominated sorting on the population, and perform selection, crossover, and mutation operations to generate a new population, perform fast non-dominated sorting on the original population and the new population using fitness, and select the next generation population based on novelty.

[0037] Reference Figure 3 , describes the architecture of the two search spaces S1 and S2 used in the present invention. The architecture of the present invention includes two types of cells: Normal Cell and Reduction Cell. When the resolution of the input feature and the output feature are consistent, Normal Cell is used. When the resolution of the output feature is half of the input feature, Reduction Cell is used. In the overall architecture, the design principle of Normal Cell and Reduction Cell is to insert a Reduction Cell into every N Normal Cells. The search space S1 includes Normal Cell and Reduction Cell, and each cell includes 7 nodes, 8 operations and 14 edges. The search space S2 only includes Normal Cell, and each cell includes 4 nodes, 5 operations and 6 edges.

[0038] Reference Figure 4 , describes an example graph of the Normal cell model searched by the neural architecture search method, including 4 nodes and 11 edges.

[0039] Reference Figure 5, describes an example graph of the Reduction cell model searched by the neural architecture search method, including 4 nodes and 12 edges.

[0040] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. An image classification method based on novelty and neural architecture search algorithm, characterized in that, The steps include: S1. Complete initialization: Use NSGA-Ⅱ algorithm to initialize the population P, and initialize the supernet S and archive record set archive; S2. Use the current population to train the supernet: randomly generate operations and weights for each individual in the population, generate architecture parameters α, and then copy each architecture to the supernet in turn, and use the training set to train the supernet S; S3, evaluate the architecture fitness: treat all architectures as the weights of the architectures in the shared search space of the subnet of the supernet, normalize the architecture parameter α, and use the supernet to calculate the fitness F-acc of each individual architecture in the population; S4. Evaluate the novelty of the architecture: Use the archived record set to calculate the novelty F-nov of each individual architecture in the population in turn according to the errors caused by different calculation orders, update the archived record set archive, and record the architecture of the current population and its novelty in it; S5. Generate the next generation population using the NSGA-Ⅱ algorithm: quickly sort the individuals in the population according to their fitness, complete the classification operation, use the novelty of the individuals to select the next generation population, and obtain a Pareto optimal front end and the best architecture; S6. Reduce the search space based on the best architecture: Reduce the number of architecture operations and perform weight inheritance operations on the supernet architecture to obtain a smaller and higher-quality search space; S7. Calculate the accuracy of the test set: Place the test set into the optimal architecture and search space obtained, and calculate the accuracy of the test set in the S1 and S2 search spaces respectively.

2. The image classification method based on novelty and neural architecture search algorithm according to claim 1, characterized in that: The data sets used in the present invention are CIFAR10 and CIFAR100, including two search spaces S1 and S2, and the two data sets are tested in the two search spaces respectively.

3. The image classification method based on novelty and neural architecture search algorithm according to claim 1, characterized in that: The process of the NSGA-Ⅱ algorithm is as follows: initialize the population, perform non-dominated sorting on the population, perform selection, crossover, and mutation operations to generate a new population, perform fast non-dominated sorting on the original population and the new population using fitness, and select the next generation population based on novelty.

4. The image classification method based on novelty and neural architecture search algorithm according to claim 1, characterized in that: The architecture of the present invention includes two types of cells: Normal Cell and Reduction Cell. When the resolution of the input feature and the output feature are the same, Normal Cell is used. When the resolution of the output feature is half of the input feature, Reduction Cell is used.

5. The image classification method based on novelty and neural architecture search algorithm according to claim 4, characterized in that: In the overall architecture, the design principle of Normal Cell and Reduction Cell is to insert a Reduction Cell into every N Normal Cells.

6. An image classification method based on novelty and neural architecture search algorithm according to claims 2 and 4, characterized in that: The search space S1 includes Normal Cell and Reduction Cell, each cell includes 7 nodes, 8 operations and 14 edges. The search space S2 includes only Normal Cell, each cell includes 4 nodes, 5 operations and 6 edges.