Model training method and device, equipment and storage medium

By constructing a supernetwork and updating the fine-tuned weights, combined with pre-training and a low-rank matrix, the problems of forgotten knowledge and underfitting during model fine-tuning are solved, thus improving the accuracy of the classification model.

CN117253079BActive Publication Date: 2026-11-27BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311207062.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-18
Publication Date
2026-11-27
Estimated Expiration
2043-09-18

AI Technical Summary

Technical Problem

Existing model fine-tuning methods are prone to causing classification models to forget pre-trained knowledge or underfit, resulting in reduced accuracy.

Method used

By constructing a supernetwork, using a combination of pre-trained weights and fine-tuned weights, freezing the model parameters except for the fully connected layers, updating only the fine-tuned weights, and updating the fine-tuned weights through a low-rank matrix, a target subnetwork is generated to retain pre-trained knowledge and improve fit.

Benefits of technology

It effectively retains pre-training knowledge, improves the fitting degree during the model fine-tuning stage, avoids underfitting, and enhances the accuracy of the classification model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117253079B_ABST
    Figure CN117253079B_ABST
Patent Text Reader

Abstract

The present disclosure provides a model training method and device, equipment and storage medium, relates to the field of artificial intelligence, and can be applied to image classification, character recognition and the like. The specific scheme comprises the following steps: constructing a super network according to a pre-trained classification model, wherein the pre-trained classification model is obtained by training an initial neural network according to pre-training samples; wherein the weights of the fully connected layer of the super network comprise pre-training weights and fine-tuning weights, the pre-training weights are the weights of the fully connected layer in the pre-trained classification model, and the fine-tuning weights are determined according to a preset low-rank matrix; training the super network according to fine-tuning samples, updating the fine-tuning weights, obtaining a target super network, and the target super network comprises at least two sub-networks; determining a target sub-network based on the at least two sub-networks; and generating a target classification model according to the target sub-network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence, specifically to the technical fields of computer vision and deep learning, and can be applied to scenarios such as image classification and text recognition. In particular, it relates to a model training method, apparatus, device, and storage medium. Background Technology

[0002] Neural networks are an important artificial intelligence technology that has been widely used in fields such as image recognition, natural language processing, medicine, and finance. By training the constructed neural network, a neural network model that achieves the expected function (such as image recognition and audio recognition) can be obtained.

[0003] The training process of a neural network model involves inputting a sufficient number of samples into an initial neural network, using a certain algorithm to update the parameters of the neural network, so that the output of the neural network matches the expected value, thereby obtaining a neural network model that can output the expected value based on the input value to achieve the expected function.

[0004] To improve the training speed and performance of neural network models (such as classification models), when training a classification model, the initial neural network can be pre-trained on a very large dataset to obtain a pre-trained classification model with better generalization performance. Then, the model can be fine-tuned according to the dataset corresponding to the specific task of the actual application scenario to obtain a classification model for the specific task of the actual application scenario. Summary of the Invention

[0005] This disclosure provides a model training method, apparatus, device, and storage medium that can improve the accuracy of the trained classification model.

[0006] According to a first aspect of this disclosure, a model training method is provided, comprising:

[0007] Based on the pre-trained classification model, a supernetwork is constructed. The pre-trained classification model is obtained by training an initial neural network using pre-trained samples. The weights of the fully connected layers in the supernetwork include pre-trained weights and fine-tuned weights. The pre-trained weights are the weights of the fully connected layers in the pre-trained classification model, and the fine-tuned weights are determined based on a preset low-rank matrix. The supernetwork is trained using fine-tuned samples, and the fine-tuned weights are updated to obtain the target supernetwork, which includes at least two subnetworks. The target subnetwork is determined based on the at least two subnetworks. The target classification model is generated based on the target subnetwork.

[0008] According to a second aspect of this disclosure, a model training apparatus is provided, the apparatus comprising: a construction module, a training module, a determination module, and a generation module.

[0009] The construction module is used to build a supernetwork based on a pre-trained classification model. The pre-trained classification model is obtained by training an initial neural network based on pre-trained samples. The weights of the fully connected layers of the supernetwork include pre-trained weights and fine-tuned weights. The pre-trained weights are the weights of the fully connected layers in the pre-trained classification model, and the fine-tuned weights are determined based on a preset low-rank matrix.

[0010] The training module is used to train the supernetwork based on the fine-tuning samples, update the fine-tuning weights, and obtain the target supernetwork, which includes at least two subnetworks.

[0011] The determination module is used to determine the target subnetwork based on at least two subnetworks.

[0012] The generation module is used to generate a target classification model based on the target sub-network.

[0013] According to a third aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method as described in the first aspect.

[0014] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing a computer to perform the method according to the first aspect.

[0015] According to a fifth aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method according to the first aspect.

[0016] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0017] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0018] Figure 1 A schematic flowchart illustrating the model training method provided in this embodiment of the disclosure;

[0019] Figure 2 Another schematic diagram of the model training method provided in the embodiments of this disclosure;

[0020] Figure 3 Another flowchart illustrating the model training method provided in this embodiment of the disclosure;

[0021] Figure 4 Another flowchart illustrating the model training method provided in this embodiment of the disclosure;

[0022] Figure 5 A schematic diagram of the composition of the model training apparatus provided in the embodiments of this disclosure;

[0023] Figure 6 This is a schematic diagram illustrating the composition of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0024] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0025] It should be understood that in the embodiments of this disclosure, the character " / " generally indicates that the preceding and following objects are in an "or" relationship. The terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.

[0026] Neural networks are an important artificial intelligence technology that has been widely used in fields such as image recognition, natural language processing, medicine, and finance. By training the constructed neural network, a neural network model that achieves the expected function (such as image recognition and audio recognition) can be obtained.

[0027] The training process of a neural network involves inputting a sufficient number of samples into the neural network, using a certain algorithm to update the parameters of the neural network, so that the output of the neural network matches the expected value, thereby obtaining a neural network model that can output the expected value based on the input value to achieve the expected function.

[0028] To improve the training speed and performance of neural network models (such as classification models), when training a classification model, the initial neural network can be pre-trained on a very large dataset to obtain a pre-trained classification model with better generalization performance. Then, the model can be fine-tuned according to the dataset corresponding to the specific task of the actual application scenario to obtain a classification model for the specific task of the actual application scenario.

[0029] For example, when training a classification model for recognizing objects in an image, if the specific task in a real-world application scenario is to identify giraffes in an image, and the number of sample images containing giraffes is small or the sample image quality is poor, the initial neural network can be trained first using existing sample images containing other animals (such as cats, dogs, etc.) to obtain a pre-trained image classification model. Then, the pre-trained image classification model can be fine-tuned using the number of sample images containing giraffes, so that the final image classification model can recognize giraffes in the image.

[0030] Currently, model fine-tuning methods generally include performing full parameter fine-tuning on the basis of a pre-trained classification model, or freezing the backbone network parameters of a pre-trained classification model and only fine-tuning the last fully connected layer.

[0031] However, full parameter tuning can easily cause the classification model to forget the knowledge learned during the pre-training stage, while fine-tuning only the final fully connected layer can easily lead to underfitting, both of which ultimately result in low accuracy of the trained classification model. Full parameter tuning may interfere with the model parameters of the pre-trained classification model, causing the model to forget the knowledge learned during the pre-training stage, thus significantly affecting the model parameters and ultimately reducing the accuracy of the trained classification model. Fine-tuning only the final fully connected layer, due to the small number of parameters tuned, may lead to underfitting in the resulting model, also resulting in reduced accuracy of the classification model.

[0032] Against this background, this disclosure provides a model training method that can improve the accuracy of the trained classification model.

[0033] The execution entity of the model training method provided in this disclosure can be a computer or server, or other electronic devices with data processing capabilities; alternatively, the execution entity can be a processor (e.g., a central processing unit (CPU)) in the aforementioned electronic device; furthermore, the execution entity can be an application (APP) installed in the aforementioned electronic device that can implement the function of the method; or, the execution entity can be a functional module or unit in the aforementioned electronic device that has the function of the method, etc. No limitation is placed on the execution entity of this method.

[0034] The training method for this model will be illustrated below with reference to the accompanying drawings.

[0035] Figure 1 This is a schematic flowchart illustrating the model training method provided in an embodiment of this disclosure. Figure 1 As shown, the method may include:

[0036] S101. Construct a supernetwork based on the pre-trained classification model. The pre-trained classification model is obtained by training the initial neural network based on the pre-trained samples.

[0037] The weights of the fully connected layers in the hypernetwork include pre-trained weights and fine-tuned weights. The pre-trained weights are the weights of the fully connected layers in the pre-trained classification model, while the fine-tuned weights are determined based on a preset low-rank matrix.

[0038] For example, the initial neural network can be a convolutional neural network (CNN), a recurrent neural network (RNN), or something similar, including fully connected layers; there is no limitation here. Furthermore, there is no limitation on the number of fully connected layers in the initial neural network. For instance, the initial neural network can be a Vit-Base network with 48 fully connected layers built using a Transformer architecture.

[0039] For example, pre-trained samples can be used as input to the initial neural network, and the classification labels corresponding to the pre-trained samples can be used as output to train the initial neural network to obtain a pre-trained classification model.

[0040] For example, the types of pre-training samples and training samples can be the same, both of which can include at least one of images, audio, and text, and the classification model can be an image classification model, an audio classification model, or a text classification model.

[0041] For example, taking images containing giraffes as training samples, the target classification task of the classification model as recognizing giraffes in the images, and images containing cats and dogs as pre-training samples, after training the initial neural network with the pre-training samples, a pre-trained classification model is obtained. The pre-trained classification model cannot directly recognize giraffes in the images; it only learns feature knowledge about cats and dogs.

[0042] For example, the weights of the fully connected layer in a hypernetwork can be the sum of pre-trained weights and fine-tuned weights. The expression for the fully connected layer in a hypernetwork can be y = Wx + ΔWx + b, where x represents the input of the fully connected layer, y represents the output of the fully connected layer, W represents the pre-trained weights, ΔW represents the fine-tuned weights, ΔW is a learnable parameter in residual form, and b represents the bias.

[0043] It should be understood that the weights of fully connected layers in a hypernetwork can also be the product or ratio of pre-trained weights and fine-tuned weights, etc., without any restrictions.

[0044] For example, the fine-tuning weights can be represented as the product, ratio, or sum of two low-rank matrices, and there are no restrictions on how the fine-tuning weights are represented.

[0045] S102. Train the supernetwork based on the fine-tuned samples, update the fine-tuned weights, and obtain the target supernetwork.

[0046] The target supernetwork includes at least two subnetworks.

[0047] For example, fine-tuned samples (i.e., training samples) can be used as input to the supernetwork, and the classification labels corresponding to the pre-trained samples can be used as output to train the supernetwork, thus obtaining the target supernetwork. During training, all model parameters except for the fine-tuned weights of the fully connected layers can be frozen, allowing updates to be made only to the fine-tuned weights.

[0048] For example, during each iteration of the training process, each fully connected layer can randomly select two or more values ​​from the corresponding preset candidate value set as the number of columns or rows of the low-rank matrix corresponding to the fine-tuning weights in each fully connected layer.

[0049] S103. Determine the target subnetwork based on at least two subnetworks.

[0050] For example, based on a supernetwork, a series of subnetworks can be derived. The number of columns or rows of the low-rank matrix corresponding to the fine-tuning weights in each fully connected layer of the subnetwork can be selected as any value from a preset candidate value set. By selecting the number of columns or rows of the low-rank matrix corresponding to the fine-tuning weights of each fully connected layer from the preset candidate value set, corresponding subnetworks can be constructed based on the supernetwork. The constructed subnetworks can then be tested, and the subnetwork with the best performance can be used as the target subnetwork. Alternatively, the target subnetwork can be obtained from the target supernetwork using a search algorithm.

[0051] S104. Generate a target classification model based on the target sub-network.

[0052] For example, during the model inference stage, a classification model that is completely consistent with the network structure and parameters of the target sub-network can be directly generated as the target classification model based on the network structure and parameters of the target sub-network.

[0053] In some possible embodiments, the aforementioned pre-trained classification model can also be a pre-trained classification model. For example, if the classification model M is a pre-trained image classification model for recognizing animals, the fine-tuning samples can be set as images of animals that the model can recognize. Through steps S101 to S104, the image classification model M can be retrained to obtain a more accurate image classification model.

[0054] This embodiment of the disclosure constructs a supernetwork including fine-tuned weights based on a pre-trained classification model. The supernetwork is trained based on fine-tuned samples, and the fine-tuned weights are updated. This yields a target supernetwork that updates the low-rank matrix instead of updating the original pre-trained parameters, effectively preserving the knowledge learned in the pre-training stage. Then, a target subnetwork is determined from at least two subnetworks corresponding to the target supernetwork. Based on the target subnetwork, a target classification model that effectively preserves pre-trained knowledge and updates more model parameters can be obtained. This reduces the destruction of knowledge learned in the pre-training stage during the model fine-tuning stage and improves the fitting degree of the data during the model fine-tuning stage, avoiding underfitting and thus improving the accuracy of the trained classification model.

[0055] The following example illustrates the training method for an image classification model, which may include:

[0056] Step 1: Construct a supernetwork based on the pre-trained image classification model. The pre-trained image classification model is obtained by training the initial neural network based on the pre-trained samples.

[0057] The weights of the fully connected layers in the hypernetwork include pre-trained weights and fine-tuned weights. The pre-trained weights are the weights of the fully connected layers in the pre-trained classification model, and the fine-tuned weights are determined based on a preset low-rank matrix. The type of the pre-trained samples is images.

[0058] Step 2: Train the supernetwork using the fine-tuning samples, update the fine-tuning weights, and obtain the target supernetwork. The target supernetwork includes at least two subnetworks; the type of fine-tuning samples is images.

[0059] Step 3: Determine the target subnetwork based on at least two subnetworks.

[0060] Step 4: Generate a target image classification model based on the target sub-network.

[0061] By following steps 1 to 4 above, the accuracy of the trained image classification model can be improved.

[0062] It should be understood that the model training method disclosed herein can also be applied to neural network models such as text recognition and classification models and audio classification models to improve the accuracy of neural network models. This disclosure does not limit the specific application of this model training method (i.e., the type of neural network model).

[0063] For example, when the classification model is an audio classification model, the pre-training samples and training samples can be audio; when the classification model is a text recognition classification model, the pre-training samples and training samples can be images, videos, etc. that contain text.

[0064] In some possible implementations, the preset low-rank matrix includes a first low-rank matrix and a second low-rank matrix, and the fine-tuning weight is the product matrix of the first low-rank matrix and the second low-rank matrix.

[0065] For example, the expression for the fully connected layer of a hypernetic network can be y = Wx + ΔWx + b = Wx + ABx + b, where A represents the first low-rank matrix and B represents the second low-rank matrix.

[0066] For example, the matrix sizes of the first low-rank matrix and the second low-rank matrix can be the same or different, and there is no restriction on this.

[0067] This embodiment limits the preset low-rank matrices to include a first low-rank matrix and a second low-rank matrix, and the fine-tuning weights are the product of the first low-rank matrix and the second low-rank matrix. This can improve the accuracy of the updated fine-tuning weights during the training of the supernetwork, and further improve the accuracy of the trained classification model.

[0068] In some possible implementations, the number of columns in the first low-rank matrix is ​​equal to the number of rows in the second low-rank matrix, and the number of columns in the first low-rank matrix and the number of rows in the second low-rank matrix are any values ​​in a preset set of candidate values. The size of the product matrix of the first low-rank matrix and the second low-rank matrix is ​​the same as the size of the matrix corresponding to the pre-trained weights.

[0069] For example, the matrix size is the number of rows and columns of the matrix, and is usually expressed as "number of rows × number of columns".

[0070] For example, the matrix size of the pre-trained weights is determined by the pre-trained classification model, and there is no restriction on the matrix size of the pre-trained weights. For instance, the matrix size of the pre-trained weights can be d×d, or it can be d×p, where d and p are both positive integers. Similarly, there is no restriction on the matrix size of the fine-tuned weights.

[0071] For example, the matrix size of the pre-trained weights in the same fully connected layer is the same as the matrix size of the product of the first low-rank matrix and the second low-rank matrix (i.e., the fine-tuned weights). The matrix sizes can be the same or different between different fully connected layers. For example, in a hypernetwork, the matrix size of the pre-trained weights in fully connected layer Q1 is 100×100, and the matrix size of the fine-tuned weights is 100×100; the matrix size of the pre-trained weights in fully connected layer Q2 can be 100×200, and the matrix size of the fine-tuned weights can be 100×200; the matrix size of the pre-trained weights in fully connected layer Q3 can be 100×100, and the matrix size of the fine-tuned weights can be 100×100.

[0072] For example, when pre-trained weights The fine-tuning weights in the same fully connected layer First low-rank matrix Second low-rank matrix When pre-trained weights The fine-tuning weights in the same fully connected layer First low-rank matrix Second low-rank matrix Where r is the number of columns in the first low-rank matrix A and the number of rows in the second low-rank matrix B.

[0073] For example, the preset candidate value set may include positive integers that are smaller than the number of rows and columns of the matrix in the pre-trained weights. For instance, taking a matrix size of 100×100 for the pre-trained weights as an example, the preset candidate value set may include 2, 4, 6, and 8, and there is no limitation on the number or size of the data in the preset candidate value set.

[0074] For example, when a hypernetwork includes multiple fully connected layers, the preset candidate value sets corresponding to each fully connected layer may be the same or different.

[0075] This embodiment limits the number of columns of the first low-rank matrix to be equal to the number of rows of the second low-rank matrix. The number of columns of the first low-rank matrix and the number of rows of the second low-rank matrix are any values ​​in the preset candidate value set. The size of the product matrix of the first low-rank matrix and the second low-rank matrix is ​​the same as the size of the matrix corresponding to the pre-trained weights. This can further improve the accuracy of the updated fine-tuned weights when the supernetwork is trained.

[0076] Figure 2 This is another schematic diagram of the model training method provided in the embodiments of this disclosure. For example... Figure 2 As shown, generating a target classification model based on the target sub-network can include:

[0077] S201. Update the weights of each fully connected layer in the target sub-network according to the pre-trained weights and fine-tuned weights of each fully connected layer in the target sub-network.

[0078] For example, when the weights of the fully connected layer of the target subnetwork are the sum of the pre-trained weights and the fine-tuned weights, the weights of the fully connected layer of the target subnetwork can be updated to the sum of the pre-trained weights and the fine-tuned weights; when the weights of the fully connected layer of the target subnetwork are the product of the pre-trained weights and the fine-tuned weights, the weights of the fully connected layer of the target subnetwork can be updated to the product of the pre-trained weights and the fine-tuned weights.

[0079] S202. Generate a target classification model based on the target sub-network with updated weights.

[0080] For example, during the model inference phase, the fine-tuned weights of each fully connected layer in the target sub-network have been obtained through the aforementioned training. Based on the target sub-network with updated weights, the number of model parameters of the target classification model generated based on the target sub-network with updated weights is the same as the number of model parameters of the pre-trained classification model, without adding any additional parameters.

[0081] This embodiment updates the weights of each fully connected layer in the target subnetwork based on the pre-trained weights and fine-tuned weights of each fully connected layer. Based on the target subnetwork with updated weights, a target classification model with the same number of model parameters can be generated. This ensures that the time consumption and memory usage during the model inference stage do not increase, thereby reducing the cost of later maintenance and upgrades of the classification model and enabling rapid iterative updates of the classification model.

[0082] In one possible implementation, the weights of each fully connected layer in the target sub-network are updated based on the pre-trained weights and fine-tuned weights of each fully connected layer in the target sub-network, including:

[0083] Based on the pre-trained weights and fine-tuned weights of each fully connected layer in the target sub-network, the weights of each fully connected layer in the target sub-network are updated to the sum of the pre-trained weights and fine-tuned weights of each fully connected layer.

[0084] This embodiment updates the weights of each fully connected layer in the target subnetwork to the sum of the pre-trained weights and fine-tuned weights corresponding to each fully connected layer, thereby improving the speed of generating the target classification model.

[0085] Figure 3 This is another schematic flowchart illustrating the model training method provided in this disclosure. For example... Figure 3 As shown, determining the target subnetwork from at least two subnetworks can include:

[0086] S301. Based on the test samples, test each subnetwork corresponding to the target supernetwork to obtain the test results of each subnetwork corresponding to the target supernetwork.

[0087] For example, the content type of the test sample can be the same as the content type of the fine-tuning sample. For instance, if the fine-tuning sample is an image containing a giraffe, then the test sample will also be an image containing a giraffe.

[0088] For example, test samples can be used as network inputs to each subnetwork corresponding to the target supernetwork, and each subnetwork corresponding to the target supernetwork can output corresponding classification results. The classification results of each subnetwork can be compared with the real results to obtain the test results of each subnetwork corresponding to the target supernetwork.

[0089] For example, test results may include the accuracy, recall, etc. of the sub-network's classification, without limitation.

[0090] S302. Determine the target subnetwork based on the test results of each subnetwork corresponding to the target supernetwork.

[0091] For example, taking the classification accuracy of a subnetwork as an example, the subnetwork with the highest classification accuracy or any subnetwork with a relatively high accuracy can be determined as the target subnetwork.

[0092] In this embodiment, the target supernetwork is tested using test samples to obtain the test results of each subnetwork. Based on the test results of each subnetwork, the target subnetwork is determined, thus accurately obtaining the target subnetwork.

[0093] In one possible implementation, the test results of each subnetwork corresponding to the target supernetwork include recall and precision. Based on the test results of each subnetwork corresponding to the target supernetwork, the target subnetwork is determined, including:

[0094] Based on the recall and precision of each subnetwork corresponding to the target supernetwork, the evaluation value of each subnetwork corresponding to the target supernetwork is determined; the target subnetwork is determined based on the subnetwork corresponding to the evaluation value.

[0095] For example, the sum of the recall and precision of each subnetwork corresponding to the target supernetwork can be used as the evaluation value.

[0096] For example, a preset first weight can be associated with the recall rate of each sub-network corresponding to the target supernetwork, and a preset second weight can be associated with the accuracy rate of each sub-network corresponding to the target supernetwork. The sum of the first weight and the second weight can be equal to 1, and there is no restriction on the magnitude of the first weight and the second weight. Then the evaluation value can be the sum of the product of the recall rate of each sub-network corresponding to the target supernetwork and the first weight, and the product of the accuracy rate of each sub-network corresponding to the target supernetwork and the second weight.

[0097] For example, the subnetwork with the highest evaluation value among all subnetworks, or any subnetwork with a relatively high evaluation value, can be identified as the target subnetwork.

[0098] For example, taking the target supernetwork as an example, the subnetworks corresponding to the target supernetwork include a first subnetwork and a second subnetwork. The first subnetwork has a recall rate of 95% and a precision rate of 90%, and the second subnetwork has a recall rate of 90% and a precision rate of 95%. The first weight is 0.3 and the second weight is 0.7. Then, the evaluation value of the first subnetwork is 0.95*0.3+0.90*0.7=0.915, and the evaluation value of the second subnetwork is 0.90*0.3+0.95*0.7=0.9825. Therefore, the second subnetwork with the highest evaluation value is determined as the target subnetwork.

[0099] This embodiment determines the evaluation value of each subnetwork corresponding to the target supernetwork based on the recall rate and precision of each subnetwork corresponding to the target supernetwork, and identifies the subnetwork corresponding to the highest evaluation value as the target subnetwork. This allows for the evaluation of subnetworks from multiple dimensions, thus more accurately determining the target subnetwork.

[0100] Figure 4 This is another schematic flowchart illustrating the model training method provided in this disclosure. For example... Figure 4 As shown, the test results of each subnetwork corresponding to the target supernetwork include recall and precision. Based on the test results of each subnetwork corresponding to the target supernetwork, the target subnetwork is determined, which may include:

[0101] S401. Based on the recall rate of each subnetwork corresponding to the target supernetwork, determine the candidate subnetworks.

[0102] For example, the candidate subnetwork can be a subnetwork with a recall rate greater than or equal to a preset first threshold, and there is no restriction on the size of the first threshold.

[0103] S402. Based on the accuracy of each subnetwork corresponding to the target supernetwork, determine the target subnetwork from the candidate subnetworks.

[0104] For example, the target subnetwork can be any candidate subnetwork with an accuracy greater than or equal to a preset second threshold, and there is no restriction on the size of the preset second threshold.

[0105] For example, candidate subnetworks whose accuracy is greater than or equal to a preset second threshold and whose accuracy is greater than that of other candidate subnetworks can also be identified as target subnetworks.

[0106] This embodiment determines candidate subnetworks based on the recall rate of each subnetwork corresponding to the target supernetwork, and determines the target subnetwork from the candidate subnetworks based on the accuracy rate of each subnetwork corresponding to the target supernetwork. This allows for the evaluation of subnetworks from multiple dimensions, resulting in a more accurate determination of the target subnetwork.

[0107] In one possible implementation, determining the target subnetwork from at least two subnetworks may include:

[0108] A genetic algorithm is used to search for the neural network structure of the target supernetwork. The target subnetwork is determined based on the fitness of the subnetwork, and the fitness is used to characterize the classification accuracy of the subnetwork.

[0109] For example, when using a genetic algorithm to search for the neural network structure of a target supernetwork, the subnetworks corresponding to the target supernetwork can be used as chromosomes in the genetic algorithm, and corresponding fitness functions can be constructed. The fitness value of each subnetwork can be calculated through the fitness function corresponding to each subnetwork.

[0110] For example, the genetic algorithm sequentially applies selection, crossover, and mutation genetic operators, and then re-evaluates the chromosome individuals until the stopping condition is met. The individual with the highest fitness is selected as the search result, which is the individual with the largest fitness value calculated according to the fitness function.

[0111] For example, the stopping condition could be that the maximum number of generations has been reached, or that the best fitness value has not improved significantly in the past few generations, or that the duration of the genetic algorithm exceeds a preset threshold, etc. There are no restrictions on the stopping condition.

[0112] This embodiment utilizes a genetic algorithm to search for the neural network structure of the target supernetwork. Based on the fitness of the subnetwork, which represents the classification accuracy of the subnetwork, the target subnetwork can be quickly determined from the target supernetwork.

[0113] In one possible implementation, the ratio of the number of rows in the matrix corresponding to the pre-trained weights to any value in the preset candidate value set is greater than or equal to a first preset value, and the ratio of the number of columns in the matrix corresponding to the pre-trained weights to the values ​​in the preset candidate value set is greater than or equal to a second preset value.

[0114] For example, the first preset value and the second preset value can be the same or different.

[0115] For example, the ratio of the number of rows in the matrix corresponding to the pre-trained weights to any value in the preset candidate value set is greater than or equal to a first preset value, which can be that the value in the preset candidate value set differs from the number of rows in the matrix corresponding to the pre-trained weights by at least two orders of magnitude; the ratio of the number of columns in the matrix corresponding to the pre-trained weights to the value in the preset candidate value set is greater than or equal to a second preset value, which can be that the value in the preset candidate value set differs from the number of columns in the matrix corresponding to the pre-trained weights by at least two orders of magnitude.

[0116] For example, at least two orders of magnitude can be that the ratio of the number of rows in the matrix corresponding to the pre-trained weights to any value in the preset candidate value set is greater than or equal to 100, and the ratio of the number of columns in the matrix corresponding to the pre-trained weights to any value in the preset candidate value set is greater than or equal to 100.

[0117] This embodiment limits the ratio of the number of rows in the matrix corresponding to the pre-trained weights to any value in the preset candidate value set to be greater than or equal to a first preset value, and the ratio of the number of columns in the matrix corresponding to the pre-trained weights to the values ​​in the preset candidate value set to be greater than or equal to a second preset value. This allows the number of columns in the first low-rank matrix and the number of rows in the second low-rank matrix to be much smaller than the number of rows and columns in the matrix corresponding to the pre-trained weights, thereby improving the training speed of the supernetwork.

[0118] The foregoing primarily describes the solutions provided by the embodiments of this disclosure from a methodological perspective. To achieve the aforementioned functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.

[0119] In an exemplary embodiment, this disclosure also provides a model training apparatus that can be used to implement the model training method as described in the foregoing embodiments.

[0120] Figure 5 This is a schematic diagram illustrating the composition of the model training apparatus provided in an embodiment of this disclosure. Figure 5 As shown, the device may include: a construction module 501, a training module 502, a determination module 503, and a generation module 504.

[0121] Module 501 is used to construct a supernetwork based on a pre-trained classification model. The pre-trained classification model is obtained by training an initial neural network based on pre-trained samples. The weights of the fully connected layers of the supernetwork include pre-trained weights and fine-tuned weights. The pre-trained weights are the weights of the fully connected layers in the pre-trained classification model, and the fine-tuned weights are determined based on a preset low-rank matrix.

[0122] Training module 502 is used to train the supernetwork based on fine-tuning samples, update the fine-tuning weights, and obtain the target supernetwork, which includes at least two subnetworks.

[0123] The determination module 503 is used to determine the target subnetwork based on at least two subnetworks.

[0124] The generation module 504 is used to generate a target classification model based on the target sub-network.

[0125] In one possible implementation, the preset low-rank matrix includes a first low-rank matrix and a second low-rank matrix, and the fine-tuning weight is the product matrix of the first low-rank matrix and the second low-rank matrix.

[0126] In one possible implementation, the number of columns in the first low-rank matrix is ​​equal to the number of rows in the second low-rank matrix, and the number of columns in the first low-rank matrix and the number of rows in the second low-rank matrix are any values ​​in a preset set of candidate values. The size of the product matrix of the first low-rank matrix and the second low-rank matrix is ​​the same as the size of the matrix corresponding to the pre-trained weights.

[0127] In one possible implementation, the generation module 504 is specifically used for:

[0128] Based on the pre-trained and fine-tuned weights of each fully connected layer in the target sub-network, update the weights of each fully connected layer in the target sub-network; based on the target sub-network with updated weights, generate a target classification model.

[0129] In one possible implementation, the generation module 504 is specifically used for:

[0130] Based on the pre-trained weights and fine-tuned weights of each fully connected layer in the target sub-network, the weights of each fully connected layer in the target sub-network are updated to the sum of the pre-trained weights and fine-tuned weights of each fully connected layer.

[0131] In one possible implementation, the determining module 503 is specifically used for:

[0132] Based on the test samples, each subnetwork corresponding to the target supernetwork is tested to obtain the test results of each subnetwork corresponding to the target supernetwork; based on the test results of each subnetwork corresponding to the target supernetwork, the target subnetwork is determined.

[0133] In one possible implementation, the test results of each sub-network corresponding to the target supernetwork include recall and precision. The determination module 503 is specifically used for:

[0134] Based on the recall and precision of each subnetwork corresponding to the target supernetwork, the evaluation value of each subnetwork corresponding to the target supernetwork is determined; the target subnetwork is determined based on the subnetwork corresponding to the evaluation value.

[0135] In one possible implementation, the test results of each sub-network corresponding to the target supernetwork include recall and precision. The determination module 503 is specifically used for:

[0136] Candidate subnetworks are determined based on the recall of each subnetwork corresponding to the target supernetwork; the target subnetwork is determined from the candidate subnetworks based on the precision of each subnetwork corresponding to the target supernetwork.

[0137] In one possible implementation, the determining module 503 is specifically used for:

[0138] A genetic algorithm is used to search for the neural network structure of the target supernetwork. The target subnetwork is determined based on the fitness of the subnetwork, and the fitness is used to characterize the classification accuracy of the subnetwork.

[0139] In one possible implementation, the ratio of the number of rows in the matrix corresponding to the pre-trained weights to any value in the preset candidate value set is greater than or equal to a first preset value, and the ratio of the number of columns in the matrix corresponding to the pre-trained weights to the values ​​in the preset candidate value set is greater than or equal to a second preset value.

[0140] It should be noted that, Figure 5 The module division described herein is illustrative and represents only one logical functional division; in actual implementation, other division methods may be used. For example, two or more functions can be integrated into a single processing module. This disclosure does not impose any limitations on this. The integrated modules described above can be implemented in hardware or as software functional modules.

[0141] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0142] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0143] In an exemplary embodiment, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described in the above embodiments. The electronic device may be the computer or server described above.

[0144] In an exemplary embodiment, the readable storage medium may be a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method described in the above embodiments.

[0145] In an exemplary embodiment, the computer program product includes a computer program that, when executed by a processor, implements the method described in the above embodiments.

[0146] Figure 6A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0147] like Figure 6 As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. The RAM 603 may also store various programs and data required for the operation of the electronic device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0148] Multiple components in electronic device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of displays, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows electronic device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0149] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as model training methods. For example, in some embodiments, the model training method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the model training method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the model training method by any other suitable means (e.g., by means of firmware).

[0150] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0151] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0152] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0153] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0154] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), middleware components (e.g., an application server), or frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0155] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0156] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0157] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A model training method, the method comprising: A hypernetwork is constructed based on a pre-trained classification model, wherein the pre-trained classification model is obtained by training an initial neural network based on pre-training samples; wherein the classification model is one of an image classification model, an audio classification model, or a text classification model. The weights of the fully connected layers in the hypernetwork include pre-trained weights and fine-tuned weights. The pre-trained weights are the weights of the fully connected layers in the pre-trained classification model, and the fine-tuned weights are determined based on a preset low-rank matrix. The expression for the fully connected layers in the hypernetwork is as follows: ,in, This represents the input to the fully connected layer. This represents the output of the fully connected layer. Indicates pre-trained weights, The fine-tuning weights, expressed as learnable parameters in residual form, Indicates bias; The supernetwork is trained based on the fine-tuning samples, all model parameters except the fine-tuning weights are frozen, and only the fine-tuning weights are updated to obtain the target supernetwork, which includes at least two subnetworks. In each iteration of the training process, each fully connected layer randomly selects two or more values ​​from the corresponding preset candidate value set as the number of columns or rows of the low-rank matrix corresponding to the fine-tuning weights in each fully connected layer. The fine-tuned samples are datasets corresponding to specific tasks in actual application scenarios, and both the pre-trained samples and the fine-tuned samples include at least one of images, audio, and text. The target subnetwork is determined based on the at least two subnetworks; wherein, the number of columns or rows of the low-rank matrix corresponding to the fine-tuning weights in each fully connected layer of the subnetwork is any value in the preset candidate value set, and the corresponding subnetwork is constructed based on the supernetwork by selecting the number of columns or rows of the low-rank matrix corresponding to the fine-tuning weights of each fully connected layer in the preset candidate value set. Based on the target sub-network, a target classification model is generated; wherein the number of model parameters of the target classification model is the same as the number of model parameters of the pre-trained classification model, without adding any additional parameters.

2. The method according to claim 1, wherein the preset low-rank matrix includes a first low-rank matrix and a second low-rank matrix, and the fine-tuning weight is the product matrix of the first low-rank matrix and the second low-rank matrix.

3. The method according to claim 2, wherein the number of columns of the first low-rank matrix is ​​equal to the number of rows of the second low-rank matrix, the number of columns of the first low-rank matrix and the number of rows of the second low-rank matrix are any values ​​in a preset candidate value set, and the size of the product matrix of the first low-rank matrix and the second low-rank matrix is ​​the same as the size of the matrix corresponding to the pre-trained weights.

4. The method according to any one of claims 1-3, wherein generating a target classification model based on the target sub-network comprises: Update the weights of each fully connected layer in the target sub-network based on the pre-trained weights and fine-tuned weights of each fully connected layer in the target sub-network; The target classification model is generated based on the target sub-network with updated weights.

5. The method according to claim 4, wherein updating the weights of each fully connected layer in the target sub-network based on the pre-trained weights and fine-tuned weights of each fully connected layer in the target sub-network comprises: Based on the pre-trained weights and fine-tuned weights of each fully connected layer in the target sub-network, the weights of each fully connected layer in the target sub-network are updated to the sum of the pre-trained weights and fine-tuned weights of each fully connected layer.

6. The method according to any one of claims 1-5, wherein determining the target subnetwork based on the at least two subnetworks comprises: Based on the test samples, each subnetwork corresponding to the target supernetwork is tested to obtain the test results of each subnetwork corresponding to the target supernetwork. The target subnetwork is determined based on the test results of each subnetwork corresponding to the target supernetwork.

7. The method according to claim 6, wherein the test results of each sub-network corresponding to the target supernetwork include recall and precision, and the step of determining the target sub-network based on the test results of each sub-network corresponding to the target supernetwork includes: Based on the recall rate and precision of each subnetwork corresponding to the target supernetwork, the evaluation value of each subnetwork corresponding to the target supernetwork is determined; The target subnetwork is determined based on the subnetwork corresponding to the evaluation value.

8. The method according to claim 6, wherein the test results of each sub-network corresponding to the target supernetwork include recall and precision, and the step of determining the target sub-network based on the test results of each sub-network corresponding to the target supernetwork includes: Candidate subnetworks are determined based on the recall rate of each subnetwork corresponding to the target supernetwork; The target subnetwork is determined from the candidate subnetworks based on the accuracy of each subnetwork corresponding to the target supernetwork.

9. The method according to any one of claims 1-5, wherein determining the target subnetwork from the at least two subnetworks comprises: A genetic algorithm is used to search for the neural network structure of the target supernetwork. Based on the fitness of the subnetwork, the target subnetwork is determined, and the fitness is used to characterize the classification accuracy of the subnetwork.

10. The method according to claim 3, wherein the ratio of the number of rows of the matrix corresponding to the pre-trained weights to any value in the preset candidate value set is greater than or equal to a first preset value, and the ratio of the number of columns of the matrix corresponding to the pre-trained weights to the values ​​in the preset candidate value set is greater than or equal to a second preset value.

11. A model training apparatus, the apparatus comprising: A construction module is used to construct a hypernetwork based on a pre-trained classification model. The pre-trained classification model is obtained by training an initial neural network using pre-trained samples. The classification model is one of an image classification model, an audio classification model, or a text classification model. The weights of the fully connected layers in the hypernetwork include pre-trained weights and fine-tuned weights. The pre-trained weights are the weights of the fully connected layers in the pre-trained classification model, and the fine-tuned weights are determined based on a preset low-rank matrix. The expression for the fully connected layers in the hypernetwork is as follows: ,in, This represents the input to the fully connected layer. This represents the output of the fully connected layer. Indicates pre-trained weights, The fine-tuning weights, expressed as learnable parameters in residual form, Indicates bias; The training module is used to train the supernetwork based on the fine-tuning samples, freeze all model parameters except for the fine-tuning weights, and update only the fine-tuning weights to obtain the target supernetwork, which includes at least two subnetworks. In each iteration of the training process, each fully connected layer randomly selects two or more values ​​from the corresponding preset candidate value set as the number of columns or rows of the low-rank matrix corresponding to the fine-tuning weights in each fully connected layer. The fine-tuning samples are datasets corresponding to specific tasks in actual application scenarios, and both the pre-training samples and the fine-tuning samples include at least one of images, audio, and text. The determination module is used to determine a target subnetwork based on the at least two subnetworks; wherein the number of columns or rows of the low-rank matrix corresponding to the fine-tuning weights in each fully connected layer of the subnetwork is any value in the preset candidate value set, and the corresponding subnetwork is constructed based on the supernetwork by selecting the number of columns or rows of the low-rank matrix corresponding to the fine-tuning weights of each fully connected layer in the preset candidate value set. The generation module is used to generate a target classification model based on the target sub-network; wherein the number of model parameters of the target classification model is the same as the number of model parameters of the pre-trained classification model, without adding any additional parameters.

12. The apparatus according to claim 11, wherein the preset low-rank matrix includes a first low-rank matrix and a second low-rank matrix, and the fine-tuning weight is the product matrix of the first low-rank matrix and the second low-rank matrix.

13. The apparatus according to claim 12, wherein the number of columns of the first low-rank matrix is ​​equal to the number of rows of the second low-rank matrix, the number of columns of the first low-rank matrix and the number of rows of the second low-rank matrix are any values ​​in a preset candidate value set, and the size of the product matrix of the first low-rank matrix and the second low-rank matrix is ​​the same as the size of the matrix corresponding to the pre-trained weights.

14. The apparatus according to any one of claims 11-13, wherein the generating module is specifically used for: Update the weights of each fully connected layer in the target sub-network based on the pre-trained weights and fine-tuned weights of each fully connected layer in the target sub-network; The target classification model is generated based on the target sub-network with updated weights.

15. The apparatus according to claim 14, wherein the generating module is specifically used for: Based on the pre-trained weights and fine-tuned weights of each fully connected layer in the target sub-network, the weights of each fully connected layer in the target sub-network are updated to the sum of the pre-trained weights and fine-tuned weights of each fully connected layer.

16. The apparatus according to any one of claims 11-15, wherein the determining module is specifically configured to: Based on the test samples, each subnetwork corresponding to the target supernetwork is tested to obtain the test results of each subnetwork corresponding to the target supernetwork. The target subnetwork is determined based on the test results of each subnetwork corresponding to the target supernetwork.

17. The apparatus according to claim 16, wherein the test results of each sub-network corresponding to the target supernetwork include recall and precision, and the determining module is specifically used for: Based on the recall rate and precision of each subnetwork corresponding to the target supernetwork, the evaluation value of each subnetwork corresponding to the target supernetwork is determined; the target subnetwork is determined based on the subnetwork corresponding to the evaluation value.

18. The apparatus according to claim 16, wherein the test results of each sub-network corresponding to the target supernetwork include recall and precision, and the determining module is specifically used for: Candidate subnetworks are determined based on the recall rate of each subnetwork corresponding to the target supernetwork; The target subnetwork is determined from the candidate subnetworks based on the accuracy of each subnetwork corresponding to the target supernetwork.

19. The apparatus according to any one of claims 11-15, wherein the determining module is specifically configured to: A genetic algorithm is used to search for the neural network structure of the target supernetwork. Based on the fitness of the subnetwork, the target subnetwork is determined, and the fitness is used to characterize the classification accuracy of the subnetwork.

20. The apparatus according to claim 13, wherein the ratio of the number of rows of the matrix corresponding to the pre-trained weights to any value in the preset candidate value set is greater than or equal to a first preset value, and the ratio of the number of columns of the matrix corresponding to the pre-trained weights to the values ​​in the preset candidate value set is greater than or equal to a second preset value.

21. An electronic device, comprising: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method according to any one of claims 1-10.

22. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method according to any one of claims 1-10.

23. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-10.

Citation Information

Patent Citations

  • Method for obtaining neural network model, and image processing method and device

    CN113570029A

  • Online data network fine-grained emotion detection method and device based on fine-tuning large model

    CN116737938A