A Network Architecture Search Method for YOLOv5 Object Recognition Based on Multi-Objective Genetic Algorithm

By optimizing the YOLOv5 target recognition network architecture using a multi-objective genetic algorithm, the problems of insufficient computational efficiency and flexibility of existing algorithms are solved, and efficient and accurate target recognition and cross-domain transfer capabilities are achieved.

CN117911832BActive Publication Date: 2026-11-10XIDIAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311782099.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-22
Publication Date
2026-11-10
Estimated Expiration
2043-12-22

AI Technical Summary

Technical Problem

Existing target recognition algorithms based on architecture search have shortcomings in terms of computational efficiency and flexibility. In particular, they have low target recognition accuracy under different datasets and large search space, requiring efficient search and optimization.

Method used

A multi-objective genetic algorithm is used to search the network architecture of YOLOv5 object recognition. By determining the searchable space, encoding method, objective function and iterative verification, a non-dominated solution set is generated to optimize the structure and parameters of the network model.

Benefits of technology

It improves the computational efficiency of target recognition, enhances the flexibility and accuracy of the algorithm, realizes automated search of neural network architecture, and supports cross-domain transfer and few-shot learning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117911832B_ABST
    Figure CN117911832B_ABST
Patent Text Reader

Abstract

This invention provides a network architecture search method for YOLOv5 target recognition based on a multi-objective genetic algorithm, comprising: determining the searchable space of the YOLOv5 feature extraction backbone network; determining the correspondence between different network models and encoding / decoding in the YOLOv5 feature extraction backbone network based on high-precision encoding methods of various candidate operations in the searchable space; determining multiple objective functions selected by the multi-objective genetic algorithm based on network model parameters; encoding the initialized multiple network models to form a network model population, and training and validating the decoded models on a defined dataset to obtain numerical indices of the multiple objective functions corresponding to the network models under this encoding; updating the population encoding using the multi-objective genetic algorithm according to the network model encoding and the corresponding numerical indices of the multiple objective functions; iteratively verifying the encoding updates of different network models to generate a set of non-dominated solution sets. This invention improves detection accuracy and reduces computational costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of deep learning technology, and in particular to a network architecture search method for YOLOv5 target recognition based on a multi-objective genetic algorithm. Background Technology

[0002] Computer vision is an important branch of artificial intelligence, aiming to enable computers to understand and interpret image and video data from the real world. The research background of object recognition algorithms is multifaceted, including developments in computer vision, image and video data processing, applications of machine learning and deep learning, and the demands of application scenarios. These factors mutually reinforce each other, driving the continuous development and progress of object recognition algorithms.

[0003] Existing target recognition algorithms based on architecture search are methods that achieve target recognition by searching for the optimal neural network architecture. These algorithms typically consist of two phases: an architecture search phase and a target recognition phase.

[0004] In the architecture search phase, target recognition algorithms based on architecture search automatically discover the optimal neural network architecture through search algorithms. This process typically employs automated methods, such as searching and optimizing based on reinforcement learning, genetic algorithms, and particle swarm optimization. These algorithms, according to the requirements and constraints of the target recognition task, evaluate and compare different network structures to find the optimal network architecture.

[0005] In the target recognition stage, architecture-based target recognition algorithms use the optimal neural network architecture found to perform target detection and classification on the input image. This process typically employs common target detection and classification algorithms such as YOLO, Faster R-CNN, and SSD. These algorithms preprocess the input image using a trained model, extract image features, and then use a classifier to classify the features to achieve target recognition.

[0006] The advantage of architecture search-based target recognition algorithms lies in their ability to automatically discover superior network architectures, thus saving time and effort compared to manual design. This method not only improves model performance but also accelerates the model design process. However, architecture search-based target recognition algorithms also face some challenges, such as the need to set appropriate parameters and select suitable evaluation metrics. Furthermore, due to the complexity and diversity of neural network architectures, the search space can be very large, necessitating efficient search and optimization.

[0007] Based on the above analysis, the computational efficiency of target recognition in existing technologies is low, and the flexibility and accuracy of target recognition are low for different indicators under different datasets. Summary of the Invention

[0008] In view of this, the present invention provides a network architecture search method for YOLOv5 target recognition based on a multi-objective genetic algorithm to solve the above problems.

[0009] A first aspect of the present invention provides a network architecture search method for YOLOv5 target recognition based on a multi-objective genetic algorithm, comprising: Step 1, determining the searchable space of the YOLOv5 feature extraction backbone network; Step 2, determining the correspondence between different network models and encoding / decoding in the YOLOv5 feature extraction backbone network based on high-precision encoding methods of various candidate operations in the searchable space; Step 3, determining multiple objective functions selected by the multi-objective genetic algorithm based on the network model parameters of the YOLOv5 feature extraction backbone network; Step 4, encoding the initialized multiple network models to form a network model population, and training and validating them on a defined dataset after decoding to obtain the numerical indices of the multiple objective functions corresponding to the network models under this encoding; Step 5, updating the population encoding using a multi-objective genetic algorithm according to the encoding of the network models and the corresponding numerical indices of the multiple objective functions; Step 6, iteratively verifying the different network model encoding updates through Steps 4 and 5 to generate a set of non-dominated solution sets.

[0010] In another implementation of the present invention, the YOLOv5 feature extraction backbone network includes a C3 module consisting of three stacked convolutions. The convolutional blocks in the C3 module use 3x3 convolutional kernels. The stride of the first convolutional block is 2, which can halve the size of the feature map. The strides of the second and third convolutional blocks are 1.

[0011] In another implementation of the present invention, the correspondence between different network models and encoding / decoding in the YOLOv5 feature extraction backbone network is determined based on a high-precision encoding method for various candidate operations in the searchable space. This includes: using concise mapping integer encoding for various candidate operations in the searchable space and writing them into the network for searching; encoding four different C3 modules using 1, 2, 3, and 4, with the corresponding positions being the first position; encoding four different sizes of convolutional kernels using 1, 3, 5, and 7, with the corresponding positions being the middle positions; and encoding four different numbers of channels using 32, 64, 128, 256, and 512, with the corresponding positions being the last positions. Based on the above high-precision encoding method, the correspondence between different network models and encoding / decoding is determined.

[0012] In another implementation of the present invention, multiple initialized network models are encoded to form a network model population. After decoding, the population is trained and validated on a defined dataset to obtain numerical indices of multiple objective functions corresponding to the network models under this encoding. This includes: encoding multiple initialized network models to form a network model population; performing selection, crossover, mutation, fast non-dominated sorting, and crowding distance calculation steps in a multi-objective genetic algorithm on the network model population to generate a new population; and decoding individuals in the network model population and training and validating them on a defined dataset to obtain a trained network model and determine the numerical indices of multiple objective functions corresponding to the network models under this encoding.

[0013] In another implementation of the present invention, the mathematical expression of the multi-objective bilayer optimization method for deep neural network architecture search used in step four and step five for iterative verification of different network model encoding updates is as follows:

[0014]

[0015]

[0016] In this context, the upper-level variable α is the encoding of the deep neural network architecture, the lower-level variable w is the weight parameter of the network model, f1 and f2 are the upper-level objective functions to be optimized, representing the model validation error rate and the model size, respectively, and Γ(w; α) is the lower-level objective function, representing the mean squared error of the model training.

[0017] In another implementation of the present invention, the YOLOv5 target recognition network architecture search method based on a multi-objective genetic algorithm further includes: updating the weights of the network model using a gradient descent backpropagation algorithm, with the update formula being:

[0018]

[0019] Where lr is the learning rate, N is the batch size, x is the independent variable, and h is the learning rate. θ (x) is the fitting function, and y is the target value.

[0020] In another implementation of the present invention, the specific process of the multi-objective genetic algorithm includes: randomly generating an initial population, where each individual represents a solution to the problem; for each individual, calculating its function value across multiple objectives; performing a non-dominated sort on the individuals in the initial population, dividing them into different frontier levels; using crowding distance to measure the crowding of individuals on the same frontier to ensure the diversity of the initial population; selecting a certain number of individuals from the initial population as parent individuals based on the non-dominated sort and crowding distance; and using a tournament selection method to perform a crossover operation on the selected parent individuals to generate new individuals. The process involves: mutating new individuals to introduce new genetic changes; merging parent individuals, new individuals, and mutated individuals into a new population; evaluating the fitness of the new population and calculating the multi-objective function values ​​for each individual; selecting the next generation from the new population based on non-dominated ranking and crowding distance at critical rankings; using non-dominated ranking and crowding distance for environmental selection to preserve diverse individuals; determining whether termination conditions are met, such as reaching the maximum number of iterations or satisfying certain convergence conditions, and outputting the final approximate optimal non-dominated solution set, i.e., the optimal solution set under multiple objective functions.

[0021] In another implementation of the present invention, the YOLOv5 target recognition network architecture search method based on multi-objective genetic algorithm further includes: passing the optimized weight parameters in the parent population to the offspring population to accelerate the convergence speed of the offspring population.

[0022] The network architecture search method for YOLOv5 target recognition based on a multi-objective genetic algorithm of this invention improves the computational efficiency of target recognition, considers different indicators for different datasets, and enhances the flexibility and accuracy of target recognition. The significance of solving the problems and defects in the prior art is as follows:

[0023] (1) Automated search: One of the main objectives of this invention is to achieve an automated search process for neural network architectures. Through automated search, the optimal network structure can be found to improve the performance and effectiveness of image recognition tasks.

[0024] (2) Improving performance and efficiency: This invention aims to improve the performance and efficiency of image recognition tasks by searching and optimizing the structure of neural networks. We attempt to explore new search spaces, search algorithms, and network designs to find better network structures, as well as efficient network architectures for specific tasks and hardware platforms.

[0025] (3) Cross-domain transfer: One of the research objectives of this invention is to realize the transferability of network architecture across different domains. This means that the optimal network structure found in one domain can be transferred to other domains and achieve good performance. This is very important for various image recognition applications that employ deep learning technology.

[0026] (4) Few-shot learning: Few-shot learning refers to model training and inference under limited sample conditions. One of the research objectives of this invention is to explore how to improve the performance of image recognition under few-shot conditions by automatically searching and optimizing network structures and designing network architectures adapted to few-shot learning tasks. Attached Figure Description

[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. By reading the detailed description of the embodiments below, the advantages and benefits of the solutions will become clear to those skilled in the art. The accompanying drawings are only for illustrating preferred embodiments and are not intended to limit the present invention. In the accompanying drawings:

[0028] Figure 1 This is a flowchart illustrating the steps of a YOLOv5 target recognition network architecture search method based on a multi-objective genetic algorithm, according to an embodiment of the present invention.

[0029] Figure 2 This is a schematic diagram illustrating the deep neural network architecture search principle of an embodiment of the present invention.

[0030] Figure 3 This is a schematic diagram of the algorithm flow of a multi-objective genetic algorithm according to an embodiment of the present invention.

[0031] Figure 4 This is a schematic diagram of the deep neural network architecture search algorithm according to an embodiment of the present invention.

[0032] Figure 5 This is a schematic diagram of the encoding and decoding correspondence of the YOLOv5 target recognition feature extraction backbone network architecture search space according to an embodiment of the present invention.

[0033] Figure 6 This is a schematic diagram of the model solution set searched by the YOLOv5 target recognition network architecture search method based on a multi-objective genetic algorithm according to an embodiment of the present invention.

[0034] Figure 7 This is a schematic diagram of the optimal YOLOv5 framework selected by the YOLOv5 target recognition network architecture search method based on multi-objective genetic algorithm according to an embodiment of the present invention. Detailed Implementation

[0035] To facilitate understanding, before describing the specific embodiments of the present invention in detail, the prior art of the network architecture search method for YOLOv5 target recognition based on multi-target genetic algorithm of the present invention will be exemplarily described.

[0036] In recent years, the YOLO (You Only Look Once) series of object detection algorithms has developed rapidly. Compared with other object detection algorithms, YOLO is a real-time object detection algorithm that can achieve higher processing speed and more accurate detection results. The basic principle of the YOLO series of object detection algorithms is to divide the input image into a grid, with each grid predicting a fixed number of bounding boxes, and classifying whether an object exists in the bounding box. The YOLO series of algorithms uses a regression approach to perform classification and localization tasks simultaneously, that is, using the position and class probability of the object box as the target of the regression task.

[0037] The YOLO series of algorithms includes multiple versions, including YOLOv1, YOLOv2, YOLOv3, YOLOv4, and YOLOv5. These versions have been continuously improved and optimized in terms of model structure, object detection accuracy, and running speed. Among them, YOLOv3 and YOLOv4 adopt deeper neural network structures and introduce mechanisms such as multi-scale feature fusion and contextual information to improve the accuracy and speed of object detection.

[0038] The YOLO series of object detection algorithms have high real-time performance and accuracy, making them suitable for real-time vision applications such as autonomous driving and intelligent monitoring. However, because the YOLO series algorithms have high requirements for model structure and computing resources, the training time and computational cost on large-scale datasets are also high. In addition, since the YOLO series algorithms use regression for object detection, false detections and false negatives may occur.

[0039] In summary, the YOLO series of object detection algorithms is an efficient and accurate object detection algorithm suitable for real-time vision applications. However, further improvements and refinements are still needed to enhance detection accuracy and reduce computational costs.

[0040] The YOLOv5 algorithm used in this invention is a single-stage target detection algorithm that directly detects and locates targets from the original image.

[0041] YOLOv5 features improvements at the input layer, baseline network, Neck network, and Head output layer. At the input layer, YOLOv5 introduces techniques such as Mosaic data augmentation, adaptive anchor box calculation, and adaptive image scaling, significantly enhancing the model's generalization ability and running speed. In the baseline network, YOLOv5 integrates novel ideas from other detection algorithms, such as the Focus structure and CSP structure. In the Neck network, YOLOv5 adds an FPN+PAN structure, enhancing feature transfer and multi-scale prediction capabilities. At the Head output layer, YOLOv5 uses the same anchor box mechanism as YOLOv4, but improves the loss function and prediction box selection method during training, employing GIOU_Loss and DIOU_nms.

[0042] In summary, YOLOv5 has achieved significant improvements in both speed and accuracy compared to YOLOv4. It boasts advantages such as high-speed operation, high accuracy, and applicability to various image resolutions, making it widely applicable in scenarios such as autonomous driving, robot perception, and image analysis.

[0043] Neural Architecture Search (NAS) is an automated method designed to automatically discover the optimal neural network architecture using search algorithms. This approach improves model performance and efficiency by evaluating and comparing different network structures to find the best solution.

[0044] In Neural Network Analyzer (NAS), the search space defines the set of possible architectures. This search space can include different numbers of network layers, channels, operators, etc. The definition of the search space has a significant impact on the quality of the search results. The search strategy is a core part of NAS, and various search strategies can be used, such as random search, evolutionary algorithms, and reinforcement learning. These strategies find the optimal solution by evaluating and comparing different network architectures. During the search process, optimization techniques such as pruning and parameter sharing can also be incorporated to reduce the size of the search space.

[0045] When evaluating the performance of network architectures, each network is not usually trained to convergence. Instead, methods such as weight sharing and early stopping are used to minimize the training time of individual networks. Performance evaluation metrics typically include accuracy, computation speed, and model size.

[0046] The emergence of NAS simplifies the model design process by automatically discovering better network structures, thereby saving time and effort in manual design. This method can not only improve model performance but also accelerate the model design process.

[0047] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and thoroughly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art should fall within the protection scope of the present invention.

[0048] Figure 1 A flowchart illustrating the steps of a network architecture search method for YOLOv5 target recognition based on a multi-objective genetic algorithm, as provided in this embodiment of the invention, is shown below. Figure 1 As shown, this embodiment mainly includes the following steps:

[0049] S101. Determine the searchable space of the YOLOv5 feature extraction backbone network.

[0050] For example, the searchable space of the YOLOv5 feature extraction backbone network is determined, such as the different convolutional modules that can be selected, the number of feature channels in each layer, and the size of the convolutional kernels.

[0051] S102. Based on the high-precision encoding method of various candidate operations in the searchable space, determine the correspondence between different network models and encoding / decoding in the YOLOv5 feature extraction backbone network.

[0052] For example, the high-precision encoding method of various candidate modules in the search space is determined, and the correspondence between different network models and encoding / decoding can be obtained based on the high-precision encoding method.

[0053] S103. Determine the network model parameters of the YOLOv5 feature extraction backbone network and select multiple objective functions in the multi-objective genetic algorithm.

[0054] For example, multiple objective functions are selected in a multi-objective genetic algorithm, such as the size of the network model, the number of parameters, precision error, and the number of floating-point operations. Objective functions are generally divided into two categories: one is f1…f2, which is determined by the model parameters w and the model structure a. l For example, precision, recall, and speed; another type depends entirely on the model structure 'a'. l+1 …f n For example, model size and computational complexity. These objectives are contradictory, but the optimal model structure can be obtained through multi-objective optimization methods. This invention focuses on the field of object recognition, and selects the average accuracy of the model and the model size as the two objective functions.

[0055] S104. Encode the multiple network models after initialization to form a network model population. After decoding, train and validate on the defined dataset to obtain the numerical indices of multiple objective functions corresponding to the network models under this encoding.

[0056] For example, when initializing the network model population, the network model needs to be encoded in order to perform selection, crossover and mutation steps in the multi-objective genetic algorithm. However, before that, it needs to be decoded and trained on a defined dataset. According to the training hyperparameter settings of YOLOv5 on the COCO dataset, this invention tests and obtains the numerical indices of the two objective functions corresponding to the network model under different encodings.

[0057] S105. Based on the network model's encoding and the numerical indices of the corresponding multiple objective functions, a multi-objective genetic algorithm is used to update the population encoding.

[0058] For example, the selection operation in multi-objective genetic algorithms typically employs tournament selection, choosing individuals that perform well under multiple objective functions. Crossover operations need to consider the relationships between multiple objective functions to ensure that the generated offspring individuals perform well under all objective functions; common crossover methods include two-point crossover and multi-point crossover. Mutation operations are used to introduce new individual diversity to avoid getting trapped in local optima. In multi-objective genetic algorithms, mutation operations need to consider the relationships between multiple objective functions to ensure that mutated individuals show some improvement under all objective functions; common mutation methods include uniform mutation and basic position mutation.

[0059] S106. Iteratively verify the encoding updates of different network models through steps four and five to generate a set of non-dominated solutions.

[0060] For example, by iteratively verifying the encoding updates of different network models through steps S104 and S105, a set of non-dominated solution sets is generated. The present invention can select a suitable target recognition model from these solutions according to different needs in actual scenarios.

[0061] The network architecture search method for YOLOv5 target recognition based on a multi-objective genetic algorithm of this invention improves the computational efficiency of target recognition, considers different indicators for different datasets, and enhances the flexibility and accuracy of target recognition. The significance of solving the problems and defects in the prior art is as follows:

[0062] (1) Automated search: One of the main objectives of this invention is to achieve an automated search process for neural network architectures. Through automated search, the optimal network structure can be found to improve the performance and effectiveness of image recognition tasks.

[0063] (2) Improving performance and efficiency: This invention aims to improve the performance and efficiency of image recognition tasks by searching and optimizing the structure of neural networks. We attempt to explore new search spaces, search algorithms, and network designs to find better network structures, as well as efficient network architectures for specific tasks and hardware platforms.

[0064] (3) Cross-domain transfer: One of the research objectives of this invention is to realize the transferability of network architecture across different domains. This means that the optimal network structure found in one domain can be transferred to other domains and achieve good performance. This is very important for various image recognition applications that employ deep learning technology.

[0065] (4) Few-shot learning: Few-shot learning refers to model training and inference under limited sample conditions. One of the research objectives of this invention is to explore how to improve the performance of image recognition under few-shot conditions by automatically searching and optimizing network structures and designing network architectures adapted to few-shot learning tasks.

[0066] In another implementation of the present invention, the YOLOv5 feature extraction backbone network includes a C3 module consisting of three stacked convolutions. The convolutional blocks in the C3 module use 3x3 convolutional kernels. The stride of the first convolutional block is 2, which can halve the size of the feature map. The strides of the second and third convolutional blocks are 1.

[0067] For example, the convolutional blocks in the C3 module all use 3x3 convolutional kernels. This invention modifies the C3 module by introducing attention mechanisms, ghost convolutions, cross convolutions, and other operations, introducing new modules to expand the search space to improve the stability and generalization performance of the model; in addition, this invention also defines the search space for the convolutional kernel size and the search space for the number of channels per layer to adapt to more varied scenarios.

[0068] In another implementation of the present invention, the correspondence between different network models and encoding / decoding in the YOLOv5 feature extraction backbone network is determined based on a high-precision encoding method for various candidate operations in the searchable space. This includes: using concise mapping integer encoding for various candidate operations in the searchable space and writing them into the network for searching; encoding four different C3 modules using 1, 2, 3, and 4, with the corresponding positions being the first position; encoding four different sizes of convolutional kernels using 1, 3, 5, and 7, with the corresponding positions being the middle positions; and encoding four different numbers of channels using 32, 64, 128, 256, and 512, with the corresponding positions being the last positions. Based on the above high-precision encoding method, the correspondence between different network models and encoding / decoding is determined.

[0069] For example, by determining the high-precision encoding methods for various candidate operations in the search space, the correspondence between different network models and encoding / decoding methods can be obtained. For instance... Figure 5 As shown, the improved C3 module specifically includes the kernel size and number of channels: The C3 module is a basic module in YOLOv5. This invention expands the search space by adding an attention module, a cross-convolution module, and a ghost convolution module. The attention module can increase the model's ability to capture local information without increasing the model size, especially improving the model's accuracy for small targets; the cross-convolution module applies different convolution methods to perform multi-scale transformations on image information, further improving the model's ability to extract features; and the ghost convolution module is a module that handles information redundancy, reducing the model size without sacrificing accuracy.

[0070] Preferably, the present invention also encodes and searches the convolution kernel and the number of channels between different levels, incorporating them into the search space. The value range of the convolution kernel is [1x1, 3x3, 5x5, 7x7]. Small convolution kernels have relatively fewer parameters and can better capture local features; while large convolution kernels can capture global features and have better parameter sharing effect in architecture search. The value range of the number of channels is [32, 64, 128, 256, 512].

[0071] In another implementation of the present invention, multiple initialized network models are encoded to form a network model population. After decoding, the population is trained and validated on a defined dataset to obtain numerical indices of multiple objective functions corresponding to the network models under this encoding. This includes: encoding multiple initialized network models to form a network model population; performing selection, crossover, mutation, fast non-dominated sorting, and crowding distance calculation steps in a multi-objective genetic algorithm on the network model population to generate a new population; and decoding individuals in the network model population and training and validating them on a defined dataset to obtain a trained network model and determine the numerical indices of multiple objective functions corresponding to the network models under this encoding.

[0072] In another implementation of the present invention, the mathematical expression of the multi-objective bilayer optimization method for deep neural network architecture search used in step four and step five for iterative verification of different network model encoding updates is as follows:

[0073]

[0074]

[0075] In this context, the upper-level variable α is the encoding of the deep neural network architecture, the lower-level variable w is the weight parameter of the network model, f1 and f2 are the upper-level objective functions to be optimized, representing the model validation error rate and the model size, respectively, and Γ(w; α) is the lower-level objective function, representing the mean squared error of the model training.

[0076] For example, this is a two-layer optimization problem. When the upper-layer objective function reaches its optimum, this invention can obtain an optimal deep neural network architecture. Once α is determined, the neural model architecture is also determined. At this point, the upper layer passes α to the lower layer to train the current neural network on the training set, obtaining the optimal w. * (α) parameter, at which point the lower layer will w * (α) is passed to the upper layer, where the two function metrics of the current neural network are evaluated on the validation set. The two processes are continuously iterated until a set of optimal non-dominated solutions is obtained. Then, a suitable target recognition model can be selected from this set according to different needs of the actual scenario.

[0077] In another implementation of the present invention, the YOLOv5 target recognition network architecture search method based on a multi-objective genetic algorithm further includes: updating the weights of the network model using a gradient descent backpropagation algorithm, with the update formula being:

[0078]

[0079] Where lr is the learning rate, N is the batch size, x is the independent variable, and h is the learning rate. θ (x) is the fitting function, and y is the target value.

[0080] For example, this invention trains the network model on the COCO dataset after decoding and updates the weights of the neural network using fixed initial learning rate, Adam optimizer momentum, penalty factor, and training epochs. Stochastic gradient descent refers to updating θ by randomly selecting one sample from the sample set each time, with the update formula as follows:

[0081]

[0082] Where lr is the learning rate, N is the batch size, x is the independent variable, and h is the learning rate. θ (x) is the fitting function, and y is the target value.

[0083] In another implementation of the present invention, the specific process of the multi-objective genetic algorithm includes: randomly generating an initial population, where each individual represents a solution to the problem; for each individual, calculating its function value across multiple objectives; performing a non-dominated sort on the individuals in the initial population, dividing them into different frontier levels; using crowding distance to measure the crowding of individuals on the same frontier to ensure the diversity of the initial population; selecting a certain number of individuals from the initial population as parent individuals based on the non-dominated sort and crowding distance; and using a tournament selection method to perform a crossover operation on the selected parent individuals to generate new individuals. The process involves: mutating new individuals to introduce new genetic changes; merging parent individuals, new individuals, and mutated individuals into a new population; evaluating the fitness of the new population and calculating the multi-objective function values ​​for each individual; selecting the next generation from the new population based on non-dominated ranking and crowding distance at critical rankings; using non-dominated ranking and crowding distance for environmental selection to preserve diverse individuals; determining whether termination conditions are met, such as reaching the maximum number of iterations or satisfying certain convergence conditions, and outputting the final approximate optimal non-dominated solution set, i.e., the optimal solution set under multiple objective functions.

[0084] For example, a multi-objective genetic algorithm is an evolutionary algorithm used to solve multi-objective optimization problems. It searches for optimal solutions to multiple objective functions by maintaining a set of non-dominated individuals (called a population). Figure 3 As shown, the search strategy for selecting the YOLOv5 target recognition deep neural network architecture search method based on multi-objective genetic algorithm provided in this embodiment of the invention is a multi-objective genetic algorithm including:

[0085] Population initialization: A set of individuals is randomly generated as the initial population. Each individual includes a set of decision variables, which will be used to optimize multiple objective functions.

[0086] Fitness assessment: For each individual, calculate its fitness value across multiple objective functions. This can be achieved by calculating the individual's objective function values.

[0087] Non-dominated ranking: For each individual, a non-dominated ranking is performed based on its fitness values ​​on multiple objective functions. Non-dominated ranking can divide individuals into different frontier ranks in order to determine the quality of individuals.

[0088] Crowding distance calculation: For individuals at the critical level, calculate the crowding degree of each individual and prioritize placing the sparsest individuals into the next generation of the population.

[0089] Genetic manipulation: In genetic manipulation, populations are updated through operations such as selection, crossover, and mutation. Selection typically favors individuals with high frontier rank to retain better individuals. Crossover and mutation are used to generate new individuals to increase population diversity.

[0090] Environmental selection: After updating the population, environmental selection is performed to maintain the population size. Tournament selection is usually used to select better individuals.

[0091] Elite set retention strategy: Retain the set of individuals with the lowest non-dominant ranking and update it every generation.

[0092] Termination conditions: Check termination conditions, such as reaching the maximum number of iterations or the fitness of the population converging to a certain extent.

[0093] Output: When the termination condition is met, the final elite solution set is output as the optimal non-dominated solution set of the multi-objective genetic algorithm. These individuals represent the compromise solution set on multiple objective functions.

[0094] Through the above process, the multi-objective genetic algorithm can search for the optimal non-dominated solution set of multiple objective functions, helping to solve multi-objective optimization problems.

[0095] In another implementation of the present invention, the YOLOv5 target recognition network architecture search method based on multi-objective genetic algorithm further includes: passing the optimized weight parameters in the parent population to the offspring population to accelerate the convergence speed of the offspring population.

[0096] For example, to accelerate the convergence speed of the algorithm, this invention employs a weight-sharing strategy, which involves passing the optimized weight parameters from the parent population to the offspring population to speed up the convergence of the offspring population. Through this method, the offspring population can be further optimized based on the parent population, avoiding the time consumption of training from scratch, thereby effectively accelerating the training process of the neural network. This weight-sharing strategy can be applied to optimization algorithms such as evolutionary algorithms, providing an effective means of accelerating the training of complex neural network models.

[0097] It should be understood that the principle of architecture search is to use search algorithms (such as evolutionary algorithms, Bayesian optimization, reinforcement learning, etc.) to find the optimal neural network structure and hyperparameters in a given search space to achieve the best performance and results. For example... Figure 2 As shown, the architecture search principle of the YOLOv5 target recognition deep neural network architecture search method based on multi-objective genetic algorithm provided in this embodiment of the invention includes:

[0098] Defining the search space: First, it is necessary to define the search space of the neural network structure, including the number of layers, the number of nodes in each layer, the activation function, the connection method, etc.

[0099] Choose a search strategy: Based on the characteristics of the problem and the size of the search space, select a suitable search algorithm, such as evolutionary algorithms, Bayesian optimization, reinforcement learning, etc.

[0100] Network performance evaluation: During the search process, the performance of each candidate network needs to be evaluated to determine its performance on the target task.

[0101] Update network structure and hyperparameters: Based on the results of the search algorithm, update the structure and hyperparameters of the deep neural network to find the optimal network structure.

[0102] Repeated search process: Repeat the above steps until the preset stopping condition is reached (such as reaching the maximum number of iterations, performance no longer improving, etc.).

[0103] Architecture search can automatically find the optimal neural network structure and hyperparameters, avoiding the tedious process of manually adjusting the network structure and hyperparameters, and can also improve the performance and effectiveness of neural networks.

[0104] Furthermore, this invention considers multiple optimization objective functions. Through a multi-objective genetic algorithm, it simultaneously addresses the conflicting objectives of average model accuracy and model size, achieving a balanced result. The search and training algorithm of this invention can handle different problems and search for the most suitable deep neural network for target recognition on different datasets. Moreover, it allows for the selection of network models with corresponding size and accuracy requirements based on different needs. These networks not only have simple structures and low computational cost but also strong generalization capabilities. Compared with other advanced algorithms, this invention achieves higher recognition accuracy while maintaining computational speed, providing a better solution for practical applications.

[0105] In another implementation of this invention, the training set is a simulated dataset of visible light images of 15 different types of targets in an open scene. These 15 different target categories are multiple weak target classes in the images, with only 10-20 images for each class. Therefore, this is a small-sample, small-target image recognition problem. This invention proposes a data augmentation-based processing method for small-sample datasets. By performing operations such as cropping, translation, rotation, and transformation on the small-sample dataset, the diversity of the dataset is expanded, improving the model's generalization ability and accuracy. Cropping the original images generates image patches of different sizes and positions, increasing the number of samples in the dataset while preserving the local features of the targets. Translation and rotation of the cropped image patches generate images at different angles and positions, further increasing the dataset's diversity and improving the model's ability to recognize targets at different angles and positions. Furthermore, by changing the brightness, contrast, and color attributes of the images, images with different appearances are generated, increasing the variability of the dataset and improving the model's ability to recognize targets in different scenes.

[0106] Specifically, the solution set obtained using steps S101-S106 is as follows: Figure 6 As shown, blue dots represent model solutions, and red dots represent non-dominated solutions. A model that balances average accuracy and parameter count is selected. The specific model structure is as follows. Figure 7 As shown.

[0107] In the experiment, the original small sample dataset of only 150 images was augmented to obtain 900 images, which were randomly divided into a training set of 600 images, a validation set of 150 images, and a test set of 150 images. An optimal network model was obtained using a two-layer lightweight neural network architecture, and compared with current mainstream manually designed network models. The experimental results are shown in Table 1. It can be seen that compared with the mainstream YOLOv5s network, this invention achieves only a 0.2% drop in mAP, while using only 1 / 4 of the model parameters and floating-point operations of the baseline, thus demonstrating the feasibility of the proposed algorithm.

[0108] Model AP (%) AR(%) mAP(%) Param(M) GFLOPs YOLOv3-tiny 64.9 57.9 60.7 0.6 0.4 YOLOv5s 96.5 92.4 96.2 7.2 16.4 Our model 96.4 92.0 96.0 1.8 4.3

[0109] Table 1: Comparison of Two-Tier Architecture Design and Baseline Model

[0110] In another implementation of the present invention, object detection experiments were conducted on the VOC (Visual Object Classes) dataset. The VOC dataset is a commonly used dataset for object detection and image segmentation tasks. The dataset consists of 20 different object categories, including people, cars, dogs, cats, airplanes, etc. The VOC dataset contains a large number of images and corresponding annotation information, which can be used to train and evaluate the performance of object detection and image segmentation models.

[0111] The VOC dataset contains approximately 10,000 images, some of which are used for training and some for testing. The annotation information includes the category, location, and size of each object, which helps the model accurately identify and locate objects.

[0112] The VOC dataset is widely used in research and development for object detection and image segmentation. Many research papers and competitions use the VOC dataset for model evaluation and comparison. Its richness and annotation quality make it an important benchmark for evaluating the performance of object detection and image segmentation algorithms. The specific operation steps are as follows:

[0113] 1. Perform an architecture search operation on the simulation dataset. After the search is completed, the optimal architecture is obtained.

[0114] 2. Rebuild the network with the optimal architecture and train and validate it on the VOC dataset.

[0115] In the experiments, the generalization ability of the architecture search was further evaluated on the VOC dataset, and the overall results are shown in Table 2. Similarly, although our architecture search model is slightly lower than the baseline model overall, the model with fewer parameters is searched in this invention, which also verifies the generalization ability of the model.

[0116]

[0117] Table 2: Comparison of Two-Tier Architecture Design and Baseline Model

[0118] Specific embodiments of the invention have now been described. Other embodiments are within the scope of the appended claims. In some cases, the actions described in the claims can be performed in a different order and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing can be advantageous.

[0119] It should be noted that all directional indicators (such as up, down, left, right, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicator will also change accordingly.

[0120] In the description of this invention, the terms "first" and "second" are used only for convenience in describing different components or names, and should not be construed as indicating or implying a sequential relationship, relative importance, or implicitly specifying the number of technical features indicated. Thus, a feature defined with "first" and "second" may explicitly or implicitly include at least one of that feature.

[0121] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.

[0122] It should be noted that although specific embodiments of the present invention have been described in detail with reference to the accompanying drawings, this should not be construed as limiting the scope of protection of the present invention. Various modifications and variations that can be made by those skilled in the art without inventive effort within the scope described in the claims still fall within the scope of protection of the present invention.

[0123] The examples of the embodiments of the present invention are intended to concisely illustrate the technical features of the embodiments of the present invention, so that those skilled in the art can intuitively understand the technical features of the embodiments of the present invention, and are not intended to be an improper limitation of the embodiments of the present invention.

[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A network architecture search method for YOLOv5 target recognition based on a multi-objective genetic algorithm, characterized in that, include: Step 1: Determine the searchable space of the YOLOv5 feature extraction backbone network; Step 2: Based on the high-precision encoding methods of various candidate operations in the searchable space, determine the correspondence between different network models and encoding / decoding in the YOLOv5 feature extraction backbone network; Step 3: Determine the multiple objective functions selected in the multi-objective genetic algorithm based on the network model parameters of the YOLOv5 feature extraction backbone network; Step 4: Encode the multiple network models after initialization to form a network model population. After decoding, train and validate on the defined dataset to obtain the numerical indices of multiple objective functions corresponding to the network models under this encoding. Step 5: Based on the network model's encoding and the corresponding numerical indices of multiple objective functions, update the population encoding using a multi-objective genetic algorithm; Step 6: Iteratively verify the encoding updates of different network models through steps 4 and 5 to generate a set of non-dominated solutions; The YOLOv5 feature extraction backbone network includes a C3 module consisting of three stacked convolutions. The convolutional blocks in the C3 module use 3×3 convolutional kernels. The stride of the first convolutional block is 2, which halves the size of the feature map. The strides of the second and third convolutional blocks are 1. The high-precision encoding method based on various candidate operations in the searchable space determines the correspondence between different network models and encoding / decoding in the YOLOv5 feature extraction backbone network, including: The various candidate operations in the searchable space are encoded using concise mappings and written into the network for searching; Encode the four different C3 modules using 1, 2, 3, and 4, with the corresponding positions being the first and second characters; The four different sizes of the convolution kernel are encoded using 1, 3, 5, and 7, with the corresponding positions being the middle bits; The four different channel numbers are encoded using 32, 64, 128, 256, and 512, with the corresponding position being the last bit; Based on the above high-precision encoding method, the correspondence between different network models and encoding / decoding is determined.

2. The method according to claim 1, characterized in that, The process involves encoding multiple initialized network models to form a network model population, decoding them, and then training and validating them on a defined dataset to obtain numerical indices for multiple objective functions corresponding to the network models under this encoding, including: The initialized network models are encoded to form a network model population; The network model population is subjected to steps such as selection, crossover, mutation, fast non-dominated sorting, and crowding distance calculation in a multi-objective genetic algorithm to generate a new population. After decoding, individuals in the network model population are trained and validated on a defined dataset to obtain a trained network model, and the numerical indices of multiple objective functions corresponding to this encoding are determined.

3. The method according to claim 1, characterized in that, The mathematical expression of the multi-objective bilayer optimization method for searching deep neural network architectures used in the iterative verification of different network model encoding updates in steps four and five is as follows: Among them, upper-level variables It is the encoding of the deep neural network architecture, the lower-level variables. These are the weight parameters of the network model. These are the upper-level objective functions that need to be optimized, representing the model validation error rate and the model size, respectively. It is the lower-level objective function, representing the mean squared error of the model training.

4. The method according to claim 3, characterized in that, Also includes: The weights of the network model are updated using the gradient descent backpropagation algorithm, and the update formula is as follows: in It's the learning rate. It refers to the number of sample batches. It is the independent variable. It is a fitting function. That is the target value.

5. The method according to claim 1, characterized in that, The specific process of the multi-objective genetic algorithm includes: Randomly generate the initial population, with each individual representing a solution to the problem; For each individual, calculate its function value across multiple objectives; The individuals in the initial population are sorted non-dominated to divide them into different frontier ranks; On the same frontier, crowding distance is used to measure the crowding of individuals to ensure the diversity of the initial population; Based on non-dominated ordering and crowding distance, a certain number of individuals are selected from the initial population as parent individuals; A tournament selection method is used to cross over the selected parent individuals to generate new individuals; To perform mutation operations on new individuals and introduce new genetic changes; The parent individuals, the new individuals, and the mutated individuals are merged into a new population; The fitness of the new population is assessed, and the multi-objective function value of each individual is calculated. The next generation of population is selected from the new population based on the non-dominant ranking level and the crowding distance of the critical ranking level. Environmental selection is performed using non-dominated ranking and crowding distance to preserve individuals with diversity; Determine whether the termination condition is met, such as reaching the maximum number of iterations or satisfying certain convergence conditions, and output the final approximate optimal non-dominated solution set, that is, the optimal solution set under multiple objective functions.

6. The method according to claim 5, characterized in that, Also includes: The optimized weight parameters from the parent population are passed to the offspring population to accelerate the convergence speed of the offspring population.

Citation Information

Patent Citations

  • Target detection model construction method based on neural network architecture search

    CN114419389A

  • Model generation method and device, structure search method and device and electronic equipment

    CN116680559A