Generative adversarial network architecture search method and system based on GA-PSO hybrid algorithm
Through the generative adversarial network architecture search method of GA-PSO hybrid algorithm, combined with the global exploration of genetic algorithm and particle swarm optimization, the instability and multi-objective optimization dissonance problems in the GAN training process are solved, and efficient and stable network architecture search is achieved, improving the generation quality and diversity.
Patent Information
- Application Number
- CN202510580529.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-05-07
AI Technical Summary
The existing generative adversarial network (GAN) training process is unstable and is susceptible to pattern crashes and gradient disappearance problems. The generated sample quality fluctuates and lacks diversity. Traditional manual design models require a lot of trial and error adjustments. The network architecture design is sensitive and complex tasks is poorly adaptable. The existing automated architecture search methods have problems such as low efficiency, poor stability and uncoordinated multi-objective optimization.
The generative adversarial network architecture search method based on GA-PSO hybrid algorithm is adopted, and local optimization is found through global exploration of genetic algorithms and particle swarm optimization. The hypernetwork architecture is built and combined with weight sharing evaluation, and the inertial weight and learning factors are dynamically adjusted to achieve multi-objective optimization.
It improves the generation quality and diversity of generative adversarial networks, shortens the search cycle, improves search efficiency and stability, and provides an efficient and robust automated architecture design solution.
Smart Images

Figure CN120124685B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a network architecture search method, specifically a generative adversarial network architecture search method and system based on a GA-PSO hybrid algorithm, belonging to the technical field of deep neural networks. Background Art
[0002] Since its introduction in 2014, generative adversarial networks (GANs) have demonstrated great potential in applications such as image generation and super-resolution reconstruction, thanks to their adversarial training mechanism between generators and discriminators. However, their practical application still faces multiple challenges. GAN training is highly unstable and susceptible to mode collapse and vanishing gradient problems, resulting in fluctuating quality and insufficient diversity in generated samples. Network architecture design has long relied on expert experience, and traditional hand-crafted models require extensive trial-and-error parameter adjustments, making them difficult to adapt to complex tasks. Furthermore, networks are extremely sensitive to architectural details, and subtle structural differences can significantly degrade generation performance. In recent years, neural architecture search (NAS) technology has provided new insights for automated network design, but its application to GANs remains plagued by key bottlenecks. Differentiable search methods based on gradient optimization fail due to the non-convexity of the adversarial training objective, which is susceptible to dynamic imbalances between the generator and discriminator. Reinforcement learning methods require independent training and verification of each candidate architecture, while single GAN training can take hundreds of epochs, significantly increasing search costs. While evolutionary algorithms can globally explore the architecture space, they tend to favor models with simple structures and few parameters, triggering a "small model trap." Simple architectures dominate the population due to their rapid training convergence, while complex architectures, requiring long-term tuning, are prematurely eliminated, further exacerbating training instability. Existing research has attempted to balance generation quality and distribution fit. However, under the weight-sharing mechanism, the gradient updates of supernets are dominated by simple architectures, making it difficult to fully optimize the parameters of complex models, resulting in a self-reinforcing resource bias. Traditional Pareto front screening fails to effectively integrate local refined search, resulting in insufficient sparsity in the solution set distribution. Furthermore, the trade-off between parameter count and generation quality favors computational efficiency, which suppresses the potential of deep models. These problems highlight the systematic defects of existing methods in terms of efficiency, stability and multi-objective collaboration, and there is an urgent need to break through the core bottleneck of automated architecture search. Summary of the Invention
[0003] Purpose of the invention: In response to the above problems, the purpose of the present invention is to provide a generative adversarial network architecture search method and system based on the GA-PSO hybrid algorithm, which collaboratively searches for high-performance network architectures through the global exploration of genetic algorithms and the local optimization of particle swarm optimization, constructs a supernet and evaluates subnets based on weight sharing to find the generative adversarial network architecture with the best performance.
[0004] Technical solution: On the one hand, the present invention proposes a generative adversarial network architecture search method based on the GA-PSO hybrid algorithm, comprising the following steps:
[0005] Step 1: Build a supernet architecture for the generative adversarial network, including a fully connected layer, an upsampling layer, a downsampling layer, and multiple convolutional modules. The multiple convolutional modules constitute a search space and define candidate operations in the search space.
[0006] Step 2: Using the supernet architecture as an individual in the population, the NSGA-II algorithm is used to perform a global search to obtain the non-dominated layer.
[0007] Step 3: Stratify and screen the population using non-dominated sorting and crowding distance to obtain elite offspring;
[0008] Step 4: Use the particle swarm optimization algorithm to adjust the local parameters of the first n0 elite offspring, where ;
[0009] Step 5: Determine whether the iteration termination condition is met. If not, jump to step 2; otherwise, terminate the search and output the optimal supernet architecture that meets the convergence condition.
[0010] Furthermore, step 2 includes:
[0011] Step 201: randomly generate an initial population P0 consisting of a supernet structure, where the individual code corresponding to each supernet structure is an integer matrix;
[0012] Step 202: Each supernet architecture calculates dual objective metrics: IS and FID through the pre-trained Inception v3 network. IS represents maximizing image quality, and FID represents minimizing the gap with the true distribution.
[0013] Step 203: Calculate the objective function value of each supernet architecture using the following formula:
[0014] ,
[0015] ,
[0016] ,
[0017] Where, represents the supernet architecture parameters, represents the optimal architecture parameters of the supernet, is a multi-objective optimization function. It means minimizing the distribution difference between generated samples and real samples. Represents maximizing the diversity and quality of generated samples, are the weights of the supernet generator, is the weight of the optimal supernet generator, represents the expected calculation of the random noise variable z, and calculates the statistical expectation on the input noise distribution of the generator G(z), that is, the expected performance measure of the generator generating fake samples through the noise vector, is the adversarial loss of the generator; represents the weight of the supernet discriminator, is the weight of the optimal supernet discriminator, Represents the expected calculation of the real data sample 𝑥, and calculates the expected response of the discriminator D(x) to the sample under the real data distribution, is the discriminant loss of the discriminator D on the real data. The discriminator D needs to maximize the probability D(x) that the real sample x is judged to be real. The generator tries to make the generated sample The probability of being judged as true by the discriminator D Approaching 0;
[0018] Step 204, the solution is screened by the elite retention strategy, and the first n1 individuals are directly selected according to the objective function value to enter the next generation, and the crossover offspring and the mutated individuals are recombined to generate a new population, where ;
[0019] Step 205 : Divide the new population into different non-dominated layers through non-dominated sorting.
[0020] Furthermore, in step 205, dividing the population into different non-dominated layers by non-dominated sorting includes:
[0021] If the IS of individual A ≥ the IS of individual B, and the FID of individual A ≤ the FID of individual B, then individual A dominates individual B. Individuals that are not dominated by any individual belong to the first layer. The dominated individuals are removed layer by layer until all individuals are stratified and different non-dominated layers are obtained.
[0022] Furthermore, step 3 includes:
[0023] According to the preset number of screening, individuals are selected from the first non-dominated layer. When the number of individuals in the first non-dominated layer is insufficient, they are supplemented by the next non-dominated layer, and so on. When individuals must be selected from the same non-dominated layer, individuals with high crowding are given priority. The screened individuals are used as elite offspring.
[0024] Furthermore, before calculating the congestion, the IS and FID values are normalized to the [0, 1] interval, the target space is set as a two-dimensional grid, and the sum of the interval distances between adjacent solutions of each network structure in the two target dimensions of IS and FID is taken to calculate the congestion of network structure i. The formula is:
[0025] ,
[0026] Where, Indicates that the target Dimensionally, sorted individuals The target value of the next adjacent individual, Indicates that the target Dimensionally, sorted individuals The target value of the previous adjacent individual.
[0027] Furthermore, step 4 includes:
[0028] Step 401: Take the first n0 elite offspring as the initial particle swarm, flatten the corresponding integer matrix into a vector, with each dimension ranging from [0,6], as the initial position of the particle, and set the velocity vector to a random floating point number in the interval [-1,1];
[0029] Step 402: Calculate the fitness function, which integrates FID and IS with boundary constraints; the fitness function is:
[0030] ,
[0031] Where, represents the boundary constraint penalty term, Represents the weight coefficient, which is used to adjust the penalty intensity. represents the dimension parameter of particle k;
[0032] Step 403: Set the inertia weight from Linearly decreasing to , calculate the inertia weight under the current number of iterations, the formula is:
[0033] ,
[0034] Where t is the current iteration number, T max is the maximum number of iterations, is the initial value of inertia weight, is the final value of inertia weight;
[0035] Step 404: Update the speed. The formula is:
[0036] ,
[0037] Where, is the learning factor, r1 and r2 are random numbers in [0,1], The best architecture parameters generated for this particle history, is the current global optimal generator architecture parameter, Continue the original moving direction of the particle, w is the inertia weight, It is The particle The velocity vector, It is The position vector of particle i at the iteration, Drive particles closer to their own optimal solution, Guide particles to gather towards the optimal solution of the group;
[0038] Step 405: After the speed is updated, obtain the floating point position Increment, according to the enumeration value of the architecture parameter convolution type and number of channels, the floating-point result is rounded to the nearest integer. The np.clip function is used to enforce the value range of the architecture parameter to be limited to the predefined integer range. The formula is:
[0039] ,
[0040] Where, Take the enumeration value of the convolution type and number of channels of the architecture parameters, Represents the minimum and maximum operation encoding respectively;
[0041] Step 406, for location update, the formula is: , and crop to ; Respectively represent the minimum and maximum values of the particle position parameters, is the particle at the tth iteration The velocity vector of
[0042] Step 407 : When the maximum number of iterations is reached or the solution converges, the iteration is stopped to obtain the optimal architecture solution; otherwise, the process returns to step 402 .
[0043] Another aspect of the present invention provides a generative adversarial network architecture search system based on a GA-PSO hybrid algorithm, comprising:
[0044] Building modules, building a generative adversarial network supernet, cell level configuration 3 3 convolution, 5 5 void convolution and skip connection candidate operations, the node connection topology allows up to 3 input edges, and supports dynamic selection of normalization layers and activation functions;
[0045] Training module, only one bilinear upsampling or 3 is activated at a time 3. Depth-wise separable convolution operation paths, and adversarial training with a fixed-structure discriminator. A non-repeated uniform sampling strategy is adopted, and each path needs to be fairly iterated in the same adversarial environment.
[0046] Optimization module, which generates an initial population based on the genetic algorithm and explores a wide solution space through crossover and mutation; particle swarm optimization is used to optimize the results of the genetic algorithm, and dynamic inertia weight and gradient sensitivity analysis are adopted to break through the local optimum; the mixing ratio is set as n3 genetic algorithm search and (1 - n3) particle swarm optimization, where 65% < n3 < 75%, and global particle swarm optimization reinforcement is performed every preset number of generations, and the architecture parameters are ensured to meet the preset constraints through discretized position update.
[0047] Beneficial effects: Compared with the prior art, the significant advantages of the present invention are:
[0048] By integrating the global exploration ability of the genetic algorithm and the local optimization ability of particle swarm optimization, and adopting the NSGA-II multi-objective optimization framework, the present invention generates an initial Pareto front solution set and dynamically adjusts the inertia weight and learning factor, effectively breaking through the limitation that traditional evolutionary algorithms are prone to fall into the small model trap;
[0049] During the search process, by constructing a supernet architecture containing multi-granularity modules, including 9 searchable convolutional modules, supporting dynamically selecting the optimal operator from 5 candidate convolutional operations, and combining the weight sharing mechanism to directly inherit the subnet weights, the search efficiency is effectively improved;
[0050] To solve the problem of computing resource consumption, the present invention designs a hierarchical coding strategy to decompose the architecture parameters into discrete topological variables and continuous hyperparameters, maintains the diversity of the solution set through crowding distance calculation, and adopts a non-replacement sampling strategy to eliminate evaluation bias. This collaborative optimization mechanism enables the finally obtained optimal architecture to provide an efficient and robust solution for the automated design of generative adversarial networks. Brief Description of the Drawings
[0051] Figure 1 is the flowchart of the GA-PSO hybrid algorithm in the present invention;
[0052] Figure 2 is the architecture diagram of the supernet convolutional module of the generative adversarial network in the present invention;
[0053] Figure 3 is the basic framework diagram of the supernet training of the generative adversarial network in the present invention;
[0054] Figure 4 is the schematic diagram of the architecture search space of the generative adversarial network in the present invention;
[0055] Figure 5 is the trend diagram of the IS score of the architecture optimization in the present invention;
[0056] Figure 6 is the trend diagram of the FID score of the architecture optimization in the present invention. Detailed Embodiment
[0057] In order to make the purpose, technical solutions and advantages of this application more clear, this application is further described in detail below with reference to the accompanying drawings and embodiments.
[0058] Example 1
[0059] The present embodiment describes a method for searching a generative adversarial network architecture based on a GA-PSO hybrid algorithm, as shown in the flowchart. Figure 1 As shown, the following steps are included:
[0060] Step 1: Build a supernet architecture for the generative adversarial network, including a fully connected layer, an upsampling layer, a downsampling layer, and multiple convolutional modules. The multiple convolutional modules constitute a search space and define candidate operations in the search space.
[0061] In this example, the generative adversarial network includes a generator and a discriminator. The network structure of the generator is not fixed and requires optimization search in the search space. The supernet in the generative adversarial network is trained using a single-path sampling strategy method. Only one path in the supernet generator is activated, and it is trained against the fixed-structure discriminator.
[0062] In one example, the generator's backbone architecture, a supernet, includes one fully connected layer, four downsampling layers, four upsampling layers, and nine convolutional modules. The fully connected, downsampling, and upsampling layers are fixed layers and do not participate in the search. The convolutional modules are search layers, and the search process involves selecting the optimal operation from each edge of the convolutional module as the final optimal subnet operation.
[0063] Each downsampling layer contains 1 global maximum pooling operation; each upsampling layer contains 1 transposed convolution operation; each convolution module contains 3 nodes and 2 edges, where the 3 nodes represent 3 groups of feature maps and the 2 edges represent 2 groups of convolution operations. Each group of convolution operations contains 2 ordinary convolution operations and 3 depth-separable convolution operations.
[0064] The edges connecting different intermediate nodes perform some operations, process the data of the input nodes, and finally output the results by the output nodes. Candidate operations include: convolution, convolution, Depthwise Separable Convolution, Depthwise Separable Convolution and Depthwise separable convolution operations are used to achieve effective feature extraction, information fusion, and resolution adjustment to improve the performance and representation of the model.
[0065] In order to more clearly express the network architecture of the generative adversarial network, the present invention adopts The matrix represents the architecture of a generator. The matrix represents 7 types of parameters in 3 network layers, including convolution kernel size, number of channels, normalization method, etc. The value range is limited to [0,6]. 0 in the interval means Convolution, 1 means Convolution, 2 means Depthwise separable convolution, 3 represents Depthwise separable convolution, 4 represents Depthwise separable convolution, 5 represents Mixed convolution, 6 represents skip connection.
[0066] In one example, if Figure 2 The supernet convolution module architecture diagram shown in Figure 2 contains multiple convolution modules, each of which contains multiple candidate operations, such as convolution, convolution, Depthwise separable convolution, etc. The search space adopts a multi-granularity modular design, covering dual configurable dimensions at the cell level and network level. At the cell level, each module supports 、 , dilated convolution, skip connection and other operations, and allows the configuration of the topology of the connection between nodes, with a maximum of 3 input edges. At the same time, the normalization layer and ReLU / Swish activation function can be adaptively selected. At the network level, the global architecture parameters include the number of subnets of the generator, whether to insert a downsampling pooling layer, and the dynamic scaling strategy of the number of channels per layer, such as Furthermore, through the weight sharing mechanism of the dynamic hypernet, all candidate architectures share the same set of differentiable relaxed weight parameters, enabling efficient end-to-end joint optimization.
[0067] like Figure 4 The search space of the generative adversarial network architecture shown in the figure, the input noise first enters the fully connected layer, and then enters the generator module composed of unit 1, unit 2, and unit 3. Figure 4 The numbers 0, 1, 2, 3, and 4 represent the five nodes in each unit. Each node has a corresponding convolution operation, including upsampling, normalization, and downsampling operations. Nodes are connected through these operations. The generator network architecture unit includes upsampling and normalization operations, while the discriminator network architecture unit includes downsampling and normalization operations. The parameters of the discriminator supernet remain fixed and are not involved in the architecture search.
[0068] The supernet is a low-level architecture library containing multiple candidate operations. Its weight-sharing mechanism allows all subnets to share the same set of differentiable parameters, reducing search costs. A subnet is an instance architecture generated by dynamically selecting specific combinations of operations from the supernet's candidate set. The supernet serves as the parent framework, and the subnets are optimized configurations found. The architecture consists of multiple convolutional modules, each containing multiple candidate operations, such as standard convolution and depthwise separable convolution. The feature maps generated by these operations are fused through element-by-element addition to produce a new hybrid feature map. During training, the supernet automatically selects and adjusts the weights of these candidate operations through learning and optimization, ultimately determining the optimal combination of operations and network structure.
[0069] To ensure fairness and reduce bias, a sampling strategy without replacement is adopted to ensure that different super network operations are trained for the same duration under the same discriminator adversarial training. After a certain number of training times, a commonality-based strategy is used to identify potential good operations or exit poorly performing operations, which improves training efficiency and reduces the negative impact of poor paths on good paths. Since the super network training method adopts a single-path sampling strategy, the subnet can directly inherit weights from the super network without retraining, thereby achieving good performance. Therefore, the present invention uses a trained super network as an auxiliary performance evaluator, where the subnet evaluation process does not require retraining, but directly inherits the weights of the super network to evaluate and search for potential powerful architectures.
[0070] Step 2: Using the supernet architecture as an individual in the population, the NSGA-II algorithm is used to perform a global search to obtain the non-dominated layer.
[0071] Furthermore, step 2 includes:
[0072] Step 201: randomly generate 100 initial populations P0 consisting of supernet structures. The individual code corresponding to each supernet structure is Integer matrix, the matrix value is strictly limited to the interval [0,6], and 0 in the interval means Convolution, 1 means Convolution, 2 means Depthwise separable convolution, 3 represents Depthwise separable convolution, 4 represents Depthwise separable convolution, 5 represents Mixed convolution, 6 represents skip connection;
[0073] Step 202: Each supernet architecture calculates dual objective metrics: IS and FID through the pre-trained Inception v3 network. IS represents maximizing image quality, and FID represents minimizing the gap with the true distribution.
[0074] The calculation formula of IS is:
[0075] ,
[0076] Where, Represents a generator Find the expectation of all samples x under the distribution, Represents the divergence calculation function, which measures the two distributions and The smaller the value, the closer the distribution is. represents the conditional probability, that is, the probability that the generated sample x belongs to category y, represents the marginal probability, that is, the category distribution of all generated samples;
[0077] The calculation formula for FID is:
[0078] ,
[0079] Where, is the mean of the two feature distributions, is the covariance matrix of the two feature distributions, Tr is the sum of the diagonal elements of the matrix, which is used to quantify the difference in the covariance matrix;
[0080] Step 203: Calculate the objective function value of each supernet architecture using the following formula:
[0081] ,
[0082] ,
[0083] ,
[0084] Where, represents the supernet architecture parameters, represents the optimal architecture parameters of the supernet, is a multi-objective optimization function. It means minimizing the distribution difference between generated samples and real samples. Represents maximizing the diversity and quality of generated samples, are the weights of the supernet generator, is the weight of the optimal supernet generator, represents the expected calculation of the random noise variable z, and calculates the statistical expectation on the input noise distribution of the generator G(z), that is, the expected performance measure of the generator generating fake samples through the noise vector, is the adversarial loss of the generator G; represents the weight of the supernet discriminator, is the weight of the optimal supernet discriminator, Represents the expected calculation of the real data sample 𝑥, and calculates the expected response of the discriminator D(x) to the sample under the real data distribution, is the discriminant loss of the discriminator D on the real data. The discriminator D needs to maximize the probability D(x) that the real sample x is judged to be real. G tries to make the generated sample The probability of being judged as true by the discriminator D Approaching 0;
[0085] Step 204: Filter the solution using the elite retention strategy, select the top 10% individuals based on the objective function value and directly enter the next generation, and recombining the crossover offspring and the mutated individuals to generate a new population;
[0086] Step 205 : Divide the new population into different non-dominated layers through non-dominated sorting.
[0087] Furthermore, in step 205, dividing the population into different non-dominated layers by non-dominated sorting includes:
[0088] If the IS of individual A ≥ the IS of individual B, and the FID of individual A ≤ the FID of individual B, then individual A dominates individual B. Individuals that are not dominated by any individual belong to the first layer. The dominated individuals are removed layer by layer until all individuals are stratified and different non-dominated layers are obtained.
[0089] Step 3: Perform stratified screening on the population through non-dominated sorting and crowding distance to obtain elite offspring.
[0090] Furthermore, step 3 includes:
[0091] According to the preset number of screening, individuals are selected from the first non-dominated layer. When the number of individuals in the first non-dominated layer is insufficient, they are supplemented by the next non-dominated layer, and so on. When individuals must be selected from the same non-dominated layer, individuals with high crowding are given priority. The screened individuals are used as elite offspring.
[0092] When selecting elite offspring, we prioritize the frontier layer and prioritize the same-layer sparseness. We begin selecting individuals from the first layer of the non-dominated layer, supplementing them with the second layer if insufficient, and so on. When selecting from the same layer, we prioritize subnets with high congestion. To prevent falling into a local optimum, if the frontier does not improve for three consecutive generations, we increase the congestion weight to force the search area to expand. We also record the IS mean and FID variance of the frontier for each generation. If the rate of change of both is less than 1% for more than five generations, early stopping is triggered.
[0093] Furthermore, before calculating the congestion, the IS and FID values are normalized to the [0, 1] interval to avoid the interference of dimensional differences in distance calculation. The target space is set as a two-dimensional grid, and the sum of the interval distances between adjacent solutions of each network structure in the two target dimensions of IS and FID is taken to calculate the congestion of network structure i. The formula is:
[0094] ,
[0095] Where, Indicates that the target Dimensionally, sorted individuals The target value of the next adjacent individual, Indicates that the target Dimensionally, sorted individuals The target value of the previous adjacent individual.
[0096] To address the global exploration limitations and premature convergence of genetic algorithms (GAs), this example introduces particle swarm optimization (PSO) for local optimization. While GAs can perform wide-area search through crossover and mutation, they lack the ability to fine-tune elite architectures and are prone to falling into suboptimal solutions. PSOs, on the other hand, leverage their redirection mechanism, drawing on both individual and group experience, to precisely adjust parameters within a small range, effectively breaking through local optima. This complementary optimization mechanism is particularly effective in addressing the "small model trap," where GAs' global search tends to favor low-cost, small models, while PSOs enhance the competitiveness of complex, high-performance architectures through neighborhood perturbations.
[0097] Step 4: Use the particle swarm optimization algorithm to adjust the local parameters of the first n0 elite offspring, where .
[0098] In one example, the top 10% elite offspring can be selected for local parameter tuning.
[0099] Furthermore, step 4 includes:
[0100] Step 401: The first 10% elite offspring are used as the initial particle swarm, and the corresponding integer matrix is flattened into a 21-dimensional vector, with each dimension ranging from [0, 6], as the initial position of the particle, and the velocity vector is set to a random floating point number in the interval [-1, 1].
[0101] Step 402: Calculate the fitness function, which integrates FID and IS with boundary constraints; the fitness function is:
[0102] ,
[0103] Where, represents the boundary constraint penalty term, Represents the weight coefficient, which is used to adjust the penalty intensity. represents the dimension parameter of particle k;
[0104] The penalty for out-of-bounds particles increases linearly with the number of iterations to the final value, prompting the architecture to move to the area that satisfies the fitness function, and A square penalty is imposed when the particle crosses the boundary, forcing the particle to converge to a legal discrete point. The sum of the 21-dimensional vectors after the architecture matrix is flattened, where each dimension corresponds to the operation encoding of the network layer, such as convolution type and number of channels;
[0105] Step 403: Set the inertia weight from Linearly decreasing to , calculate the inertia weight under the current number of iterations, the formula is:
[0106] ,
[0107] Where t is the current iteration number, T max is the maximum number of iterations, is the initial value of inertia weight, is the final value of inertia weight;
[0108] In an example , , the velocity of the particle swarm in dimension d at the tth iteration, the inertia weight Decrease linearly from 0.9 to 0.4 to balance the dependence on historical speed;
[0109] Step 404: Update the speed. The formula is:
[0110] ,
[0111] Where, represents the velocity of the particle at the tth iteration, As a learning factor, r1 and r2 are random numbers in [0,1] to introduce exploration randomness. The best architecture parameters generated for this particle history, is the current global optimal generator architecture parameter, Continue the original moving direction of the particle, w is the inertia weight, is the velocity vector of particle i at the tth iteration, Drive particles closer to their own optimal solution, Guide particles to gather towards the optimal solution of the group;
[0112] Step 405: After the speed is updated, obtain the floating point position Increment, according to the enumeration value of the architecture parameter convolution type and number of channels, the floating-point result is rounded to the nearest integer. The np.clip function is used to enforce the value range of the architecture parameter to be limited to the predefined integer range. The formula is:
[0113] ,
[0114] In the formula, x takes the enumeration value of the convolution type and number of channels of the architecture parameter, Represents the minimum and maximum operation encoding respectively;
[0115] Step 406, for location update, the formula is:
[0116] , and crop to , Respectively represent the minimum and maximum values of the particle position parameters, is the particle at the tth iteration The velocity vector of
[0117] Step 407 : When the maximum number of iterations is reached or the solution converges, the iteration is stopped to obtain the optimal architecture solution; otherwise, the process returns to step 402 .
[0118] During the particle swarm optimization process, the sensitivity gradient of each dimension of the current optimal particle to FID is calculated every 5 generations. , and the speed is corrected according to the negative gradient. The calculation formula of the sensitivity gradient is: ,In order to prevent falling into local optimum, the sensitivity gradient is used to ,correct the speed.
[0119] In the solution set after PSO optimization, The integer encoding matrix is flattened into a 21-dimensional vector. After normalizing the IS and FID values, the cross-region weights are dynamically adjusted. A hybrid strategy is used to generate a Pareto optimal architecture set to ensure multi-objective balance.
[0120] Step 5: Determine whether the iteration termination condition is met. If not, jump to step 2; otherwise, terminate the search and output the optimal supernet architecture that meets the convergence condition.
[0121] Floating-point values corrected for particle velocity are rounded and clipped to the integer encoding range to maintain architectural validity. The optimal particle's sensitivity gradient to FID is calculated every five generations, and velocity increments are applied in the negative direction to break through local optima. The search is controlled by a composite termination condition: termination occurs when the maximum number of iterations is reached, the standard deviation of fitness over consecutive generations is less than a threshold, or the time consumed exceeds 20% of the GA phase. Finally, a converged solution set is output using an elite retention strategy, and boundary clipping is used to ensure that the solution set meets graphics memory or latency requirements.
[0122] The hybrid strategy of genetic algorithm and particle swarm optimization algorithm adopts hierarchical hybrid optimization mechanism, and achieves dynamic balance between global exploration and local optimization through GA-PSO collaborative strategy in each generation of evolution. The core implementation plan includes a three-stage optimization chain: the GA global search stage adopts the improved NSGA-II algorithm, Integer matrix architecture encoding is used for multi-objective optimization, and non-dominated sorting and crowding distance calculation are used to ensure the diversity of the solution set. The top 10% elite architectures selected will be input into PSO for neighborhood refinement, and a two-layer guidance mechanism will be constructed through dynamic inertia weights and learning factors. Gradient sensitivity analysis is introduced in the PSO stage, and the sensitivity gradient of the optimal particle to FID is calculated every 5 generations. Velocity corrections are applied in the negative direction to effectively break out of local optima. Discretization ensures parameter compliance, rounding off 21-dimensional vector parameters after floating-point operations, and using the np.clip function to strictly constrain the interval to [0, 6] to maintain the physical validity of the architecture encoding.
[0123] Perform supernet training, such as Figure 3 As shown in the left half, the supernet generator is trained adversarially against a fixed-structure discriminator. In each round of training, a single path is randomly activated, and only the weight of the currently activated path is optimized through gradient updates; other inactivated paths are not optimized. During training, the contribution of each operation to generation performance is evaluated in real time, and poorly performing operations are discarded. If the FID value of a layer using bilinear upsampling consistently exceeds that of nearest neighbor interpolation, the operation is removed from the candidate set.
[0124] Performing architecture search: Figure 3 As shown in the right half, based on the trained supernet, a hybrid optimization algorithm is used to search for the Pareto optimal architecture under multi-objective constraints.
[0125] The termination condition comprehensively considers the maximum number of iterations, the standard deviation of the particle swarm's fitness, and the computational resource limit, ultimately outputting a locally enhanced Pato frontier optimal architecture set. This stage significantly improves the quality of a single solution while maintaining the diversity of the solution set through gradient-assisted search in the constrained space.
[0126] Evaluation and selection: The optimized architecture is evaluated based on IS and FID, and the optimal architecture is selected for training. In the system, Pareto front selection achieves a balance between performance and efficiency through multi-objective collaborative optimization. First, the algorithm clearly defines three optimization goals: generation quality, model efficiency, and training cost. Dynamic path selection and weight sharing cover a variety of subnetwork structures in a single supernet, supporting flexible switching between lightweight and multi-convolution stacking and channel expansion hybrid modes, and providing hardware-friendly underlying module support for multi-objective Pareto front search. To generate the Pareto front, the NSGA-II evolutionary algorithm is used: candidate architectures are layered according to dominance relationships through non-dominated sorting, with solutions with low FID and low parameter count being placed at the top level, and non-dominated levels are prioritized. At the same time, a crowding comparison mechanism is introduced to screen out sparsely distributed individuals in the target space to avoid the lack of population diversity caused by the aggregation of solutions, ensuring that the front covers different trade-off directions. The dynamic maintenance strategy further optimizes the search process. The elite retention mechanism directly inherits the previous generation Pareto optimal solution to prevent the loss of high-quality architectures. Constrained optimization sets hard thresholds for video memory usage or latency, allowing only network architectures that meet the constraints to participate in cross-mutation, thereby guiding the search for excellent network architectures.
[0127] The performance verification experiments of the present invention are carried out on two benchmark datasets, CIFAR-10 and STL-10. The STL-10 dataset consists of ten categories of natural images with an original resolution of 10,000 pixels. According to the standard classification, 50,000 images are used as training sets and 10,000 images are used as test sets. The STL-10 dataset contains 13,000 images with an original resolution of 10,000 pixels. The ten types of images are uniformly scaled to Pixels to balance computational efficiency and model performance. Through the proposed automated architecture search method, the system successfully obtained a network structure with excellent generative capabilities and generated new images using known images and this network structure. Figure 5 and Figure 6 The performance evolution curve of the architecture during the training of the CIFAR-10 dataset is specifically demonstrated. The images generated by the architecture are significantly superior to traditional methods in terms of visual fidelity and detail richness, and can synthesize high-quality samples with natural texture features and semantic consistency.
[0128] The performance evaluation of the present invention is based on two core quantitative indicators in the generative adversarial network: IS and FID. Figure 5 As shown, IS extracts the feature distribution of the generated image through the pre-trained Inception-v3 network and calculates its inter-class separability and diversity. The larger the value, the better the generated sample performs in terms of visual quality and category diversity. Ideally, high clarity and cross-category semantic discrimination should be achieved at the same time. Figure 6The FID in the algorithm compares the statistical distribution differences between the generated and real images in feature space. Smaller values indicate a higher degree of alignment between the deep features of the two, and the generated results are closer to the real data in terms of probability distribution. Experiments demonstrate that the proposed architecture search method, through dynamic gradient guidance and multi-objective collaborative optimization, can complete efficient searches within hours. The resulting architectures exhibit rapid convergence when independently retrained.
[0129] This paper describes a generative adversarial network architecture search method based on a GA-PSO hybrid algorithm, focusing on the automated design and optimization of deep neural network architectures. Compared to traditional methods, it is more efficient and stable in terms of efficiency, stability, and multi-objective collaboration. By combining the global exploration capabilities of a genetic algorithm with the local optimization capabilities of a particle swarm optimization, combined with dynamic supernet training, a weight sharing mechanism, and a hybrid ratio optimization strategy, the architecture search efficiency and generation performance of generative adversarial networks are improved.
[0130] Example 2
[0131] The generative adversarial network architecture search system based on the GA-PSO hybrid algorithm described in this embodiment includes:
[0132] Building blocks for constructing generative adversarial network supernets, with cell-level support for configuration convolution, Candidate operations for dilated convolution and skip connections are supported. The node-to-node connection topology allows up to three input edges and supports dynamic selection of normalization layers and ReLU / Swish activation functions.
[0133] Training module, only one bilinear upsampling or The depth-wise separable convolution operation path is trained adversarially with a fixed-structure discriminator, using a non-repeated uniform sampling strategy. Each path must be fairly iterated in the same adversarial environment.
[0134] The optimization module generates an initial population based on the NSGA-II genetic algorithm and explores the wide-area solution space through crossover and mutation. Particle swarm optimization fine-tunes the GA results, employing dynamic inertia weighting and gradient sensitivity analysis to achieve breakthroughs in local optimality. The hybrid ratio is set to 70% GA search and 30% PSO optimization, with global PSO reinforcement performed every five generations. Discrete position updates ensure that architectural parameters meet preset constraints.
Claims
1. A generative adversarial network architecture search method based on a GA-PSO hybrid algorithm, characterized by: The steps include: Step 1: Build a supernet architecture for the generative adversarial network, including a fully connected layer, an upsampling layer, a downsampling layer, and multiple convolutional modules. The multiple convolutional modules constitute a search space and define candidate operations in the search space. Step 2: Using the supernet architecture as an individual in the population, the NSGA-II algorithm is used to perform a global search to obtain the non-dominated layer. Step 3: Stratify and screen the population using non-dominated sorting and crowding distance to obtain elite offspring; Step 4: Use the particle swarm optimization algorithm to adjust the local parameters of the first n0 elite offspring, where ; Step 5: Determine whether the iteration termination condition is met. If not, jump to step 2; otherwise, terminate the search and output the optimal supernet architecture that meets the convergence condition. The team trained and tested the model on two benchmark datasets, CIFAR-10 and STL-10. The CIFAR-10 dataset consists of ten categories of natural images, and the STL-10 dataset consists of ten categories of images. The team used a generative adversarial network architecture search method to obtain an optimal supernet architecture with generative capabilities, and then used the known images and this optimal supernet architecture to generate new images. Step 2 includes: Step 201: randomly generate an initial population P0 consisting of a supernet structure, where the individual code corresponding to each supernet structure is an integer matrix; Step 202: Each supernet architecture calculates dual objective metrics: IS and FID through the pre-trained Inception v3 network. IS represents maximizing image quality, and FID represents minimizing the gap with the true distribution. Step 203: Calculate the objective function value of each supernet architecture using the following formula: , , , Where, represents the supernet architecture parameters, represents the optimal architecture parameters of the supernet, is a multi-objective optimization function. It means minimizing the distribution difference between generated samples and real samples. Represents maximizing the diversity and quality of generated samples, are the weights of the supernet generator, is the weight of the optimal supernet generator, represents the expected calculation of the random noise variable z, and calculates the statistical expectation on the input noise distribution of the generator G(z), that is, the expected performance measure of the generator generating fake samples through the noise vector, is the adversarial loss of the generator; represents the weight of the supernet discriminator, is the weight of the optimal supernet discriminator, Represents the real data sample x Expected calculation, calculate the expected response of the discriminator D(x) to the sample under the real data distribution, is the discrimination loss of the discriminator D on the real data. The discriminator D needs to maximize the real sample x The probability D(x) is judged to be true, the generator tries to generate samples The probability of being judged as true by the discriminator D Approaching 0; Step 204, the solution is screened by the elite retention strategy, and the first n1 individuals are directly selected according to the objective function value to enter the next generation, and the crossover offspring and the mutated individuals are recombined to generate a new population, where ; Step 205 : Divide the new population into different non-dominated layers through non-dominated sorting.
2. The generative adversarial network architecture search method based on the GA-PSO hybrid algorithm according to claim 1 is characterized in that: In step 205, dividing the population into different non-dominated layers by non-dominated sorting includes: If the IS of individual A ≥ the IS of individual B, and the FID of individual A ≤ the FID of individual B, then individual A dominates individual B. Individuals that are not dominated by any individual belong to the first layer. The dominated individuals are removed layer by layer until all individuals are stratified and different non-dominated layers are obtained.
3. The method for searching a generative adversarial network architecture based on a GA-PSO hybrid algorithm according to claim 2, characterized in that: Step 3 includes: According to the preset number of screening, individuals are selected from the first non-dominated layer. When the number of individuals in the first non-dominated layer is insufficient, they are supplemented by the next non-dominated layer, and so on. When individuals must be selected from the same non-dominated layer, individuals with high crowding are given priority. The screened individuals are used as elite offspring.
4. The method for searching a generative adversarial network architecture based on a GA-PSO hybrid algorithm according to claim 3, characterized in that: Before calculating the congestion, the IS and FID values are normalized to the [0, 1] interval, the target space is set as a two-dimensional grid, and the sum of the interval distances between adjacent solutions of each network structure in the two target dimensions of IS and FID is taken to calculate the congestion of network structure i. The formula is: , Where, Indicates that the target The target value of the next adjacent individual of the sorted individual i in the dimension, Represents the target value of the previous adjacent individual of the sorted individual i in the target k dimension.
5. The method for searching a generative adversarial network architecture based on a GA-PSO hybrid algorithm according to claim 4, characterized in that: Step 4 includes: Step 401: Take the first n0 elite offspring as the initial particle swarm, flatten the corresponding integer matrix into a vector, with each dimension ranging from [0,6], as the initial position of the particle, and set the velocity vector to a random floating point number in the interval [-1,1]; Step 402: Calculate the fitness function, which integrates FID and IS with boundary constraints; the fitness function is: , Where, represents the boundary constraint penalty term, Represents the weight coefficient, which is used to adjust the penalty intensity. represents the dimension parameter of particle k; Step 403: Set the inertia weight from Linearly decreasing to , calculate the inertia weight under the current number of iterations, the formula is: , Where t is the current iteration number, T max is the maximum number of iterations, is the initial value of inertia weight, is the final value of inertia weight; Step 404: Update the speed. The formula is: , Where, is the learning factor, r1 and r2 are random numbers in [0,1], The best architecture parameters generated for this particle history, is the current global optimal generator architecture parameter, Continue the original moving direction of the particle, w is the inertia weight, It is The velocity vector of particle i at the iteration, It is The position vector of particle i at the iteration, Drive particles closer to their own optimal solution, Guide particles to gather towards the optimal solution of the group; Step 405: After the speed is updated, obtain the floating point position Increment, according to the enumeration value of the architecture parameter convolution type and number of channels, the floating-point result is rounded to the nearest integer. The np.clip function is used to enforce the value range of the architecture parameter to be limited to the predefined integer range. The formula is: , Where, Take the enumeration value of the convolution type and number of channels of the architecture parameters, Represents the minimum and maximum operation encoding respectively; Step 406, for location update, the formula is: , and crop to ; Respectively represent the minimum and maximum values of the particle position parameters, is the particle at the tth iteration The velocity vector of Step 407: Stop the iteration when the maximum number of iterations is reached or the solution converges to obtain the optimal architecture solution; otherwise, return to Step 402.
6. A system for implementing the GA-PSO hybrid algorithm-based generative adversarial network architecture search method according to claim 1, characterized in that: It includes: Building blocks for constructing generative adversarial network supernets, with cell-level support for configuration convolution, Candidate operations for dilated convolution and skip connections. The node-to-node connection topology allows up to three input edges and supports dynamic selection of normalization layers and activation functions. Training module, only one bilinear upsampling or The depth-wise separable convolution operation path is trained adversarially with a fixed-structure discriminator, using a non-repeated uniform sampling strategy. Each path must be fairly iterated in the same adversarial environment. An optimization module that generates an initial population based on a genetic algorithm and explores a wide solution space through crossover and mutation; particle swarm optimization is used to optimize the results of the genetic algorithm, and dynamic inertia weights and gradient sensitivity analysis are adopted to break through local optima; the mixing ratio is set as n3 genetic algorithm search and (1 - n3) particle swarm optimization, where 65% < n3 < 75%, and global particle swarm optimization reinforcement is performed every preset number of generations. The position update is discretized to ensure that the architecture parameters meet the preset constraints.
Citation Information
Patent Citations
Multi-objective deep convolution generative adversarial network model and learning method thereof
CN108171266A
Hybrid particle swarm optimization algorithm in combination with genetic algorithm
CN108399451A