Training methods, devices, and electronic equipment for image multi-classification models

By training the initial first network and the initial second network in parallel, the computational complexity and performance degradation issues when adding new categories in image classification models are resolved. This enables the rapid addition of new categories and the fusion of multi-dimensional basic networks, thereby improving the model's adaptability and accuracy.

CN119006901BActive Publication Date: 2026-11-17MICRO DREAM TECHTRONIC NETWORK TECH CHINACO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411028303.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2026-11-17
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

Existing technologies require retraining when adding new categories to image classification models, which increases computational complexity, is time-consuming and labor-intensive, and reduces the model's ability to recognize existing categories, sometimes even causing an exponential drop in performance.

Method used

A parallel training method is adopted, using the initial first network and initial second network in the initial image multi-classification model, and adding a binary classification network through iterative training. Parameters of the same magnitude as the parameters of the initial first network are selected as training parameters, and the remaining parameters are fixed parameters, until the convergence condition is reached, forming an N+1 classification model.

Benefits of technology

It reduces training complexity and model maintenance costs, enables rapid addition of new categories, has strong adaptability and scalability, high real-time performance, strong feature diversity, high accuracy, and can handle constantly changing datasets to meet the rapid development of business needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119006901B_ABST
    Figure CN119006901B_ABST
Patent Text Reader

Abstract

This invention discloses a training method, apparatus, and electronic device for an image multi-classification model. The method includes: determining an initial image multi-classification model comprising an initial first network and an initial second network, wherein the initial first network is an N-classification network, and the initial second network comprises N binary classification networks with a parameter magnitude greater than that of the initial first network; acquiring a first training sample set comprising images of N categories and images of a newly added category (N+1); iteratively training the initial first network using the first training sample set until convergence is achieved, resulting in a trained first network; adding a binary classification network to the initial second network, and iteratively training it using the first training sample set, selecting parameters of the same magnitude as those of the initial first network as updated training parameters during training, while keeping the remaining parameters fixed, until convergence is achieved, resulting in a trained second network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image classification technology, and in particular to a training method, apparatus, and electronic device for an image multi-classification model. Background Technology

[0002] Currently, deep learning models are being used more and more widely in image classification. When adding new categories to images, it usually requires a lot of time and computational resources to retrain the model so that it can recognize the new categories.

[0003] Because the model needs to be retrained every time a new category is added, it not only increases computational complexity, time and effort, but also raises maintenance costs. Moreover, the model parameters are adjusted during retraining, which leads to a decrease in the model's ability to recognize the original categories. In fact, as the number of categories increases linearly, the model's performance can drop exponentially. Summary of the Invention

[0004] The purpose of this invention is to provide a training method, apparatus, and electronic device for an image multi-classification model to solve the problems in the prior art.

[0005] To solve the above-mentioned technical problems, the embodiments of the present invention are implemented as follows:

[0006] In a first aspect, an embodiment of the present invention provides a training method for an image multi-classification model, comprising:

[0007] An initial image multi-classification model is determined, comprising an initial first network and an initial second network. The initial first network is an N-classification network, which is used to predict the probability of N categories for the input image and output an N-classification result. The initial second network comprises N binary classification networks, which are used to determine whether the input image belongs to the corresponding category and output a binary classification result. The number of parameters in the initial second network is greater than the number of parameters in the initial first network.

[0008] Obtain a first training sample set, which includes images of the N categories and images of the (N+1)th newly added category;

[0009] The initial first network is iteratively trained using the first training sample set until the convergence condition is met, resulting in a trained first network. The trained first network is an N+1 classification network, which is used to predict the probability of N+1 categories for the input image and output N+1 classification results.

[0010] A binary classification network is added to the initial second network to obtain the second network to be trained; the second network to be trained is iteratively trained using the first training sample set. During the training process, parameters of the same magnitude as the parameters of the initial first network are selected as the training parameters to be updated, and the remaining parameters are set as fixed parameters and remain unchanged until the convergence condition is reached to obtain the trained second network, which includes N+1 binary classification networks.

[0011] Wherein, the initial first network and the second network to be trained are trained in parallel, and the trained first network and the trained second network constitute the trained image multi-classification model in the second aspect. This embodiment of the invention provides a training apparatus for an image multi-classification model, comprising:

[0012] A determination module is used to determine an initial image multi-classification model. The initial image multi-classification model includes an initial first network and an initial second network. The initial first network is an N-classification network, which is used to predict the probability of N categories of the input image and output N-classification results. The initial second network includes N binary classification networks, which are used to determine whether the input image belongs to the corresponding category and output binary classification results. The parameter magnitude of the initial second network is greater than that of the initial first network.

[0013] The acquisition module is used to acquire a first training sample set, which includes images of the N categories and images of the (N+1)th newly added category;

[0014] The first training module is used to iteratively train the initial first network using the first training sample set until the convergence condition is met, thereby obtaining the trained first network. The trained first network is an N+1 classification network, which is used to predict the probability of N+1 categories of the input image and output the N+1 classification result.

[0015] The second training module is used to add a binary classification network to the initial second network to obtain a second network to be trained; the second network to be trained is iteratively trained using the first training sample set, and during the training process, parameters of the same magnitude as the parameters of the initial first network are selected as training parameters to be updated, while the remaining parameters are set as fixed parameters and remain unchanged until the convergence condition is reached to obtain the trained second network, which includes N+1 binary classification networks.

[0016] The initial first network and the second network to be trained are trained in parallel, and the trained first network and the trained second network constitute the trained image multi-classification model.

[0017] Thirdly, embodiments of the present invention provide an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the training method for the image multi-classification model provided in the above embodiments.

[0018] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the training method for the image multi-classification model provided in the above embodiments.

[0019] Fifthly, embodiments of the present invention provide a computer program product, including a computer program that, when executed by a processor, implements the steps of the training method for the image multi-classification model provided in the above embodiments.

[0020] As can be seen from the technical solutions provided by the above embodiments of the present invention, the embodiments of the present invention determine an initial image multi-classification model, which includes an initial first network and an initial second network. The initial first network is an N-classification network used to predict the probability of N categories of the input image and output an N-classification result. The initial second network includes N binary classification networks used to determine whether the input image belongs to the corresponding category and output a binary classification result. The parameter magnitude of the initial second network is greater than that of the initial first network. A first training sample set is obtained, including images of N categories and images of the N+1th newly added category. The initial first network is iteratively trained using the first training sample set until the convergence condition is reached to obtain the trained first network, which is an N+1 classification network. A binary classification network is added to the initial second network to obtain the training first network. The second network is trained iteratively using a first training sample set. During training, parameters of the same magnitude as those in the initial first network are selected as the updated training parameters, while the remaining parameters are kept constant until convergence is achieved. This process yields the trained second network, which comprises N+1 binary classification networks. The training of the initial first network and the second network is conducted in parallel. The trained first and second networks together form the trained image multi-classification model. Because parallel training eliminates the need to train the fixed parameters in the second network, it reduces training complexity and model maintenance costs. The model converges rapidly, allows for the rapid addition of new categories, and can handle constantly changing or expanding datasets. It is flexible, adaptable, scalable, and real-time, meeting the rapidly evolving business needs. Furthermore, the model employs multi-branch networks with varying parameter magnitudes, transforming the N-classification task into N binary classification tasks for training. This achieves a multi-dimensional basic network fusion training method, resulting in strong feature diversity, outputs results from different dimensions, high accuracy, and strong business generalization ability. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart illustrating a training method for an image multi-classification model provided in an embodiment of the present invention.

[0023] Figure 2 A flowchart illustrating another training method for an image multi-classification model provided in an embodiment of the present invention;

[0024] Figure 3 A schematic diagram of the architecture of the image multi-classification model provided in an embodiment of the present invention;

[0025] Figure 4 This is a schematic diagram of the image multi-classification model training process provided in an embodiment of the present invention;

[0026] Figure 5 A schematic diagram of the structure of a training device for an image multi-classification model provided in an embodiment of the present invention;

[0027] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0028] This invention provides a training method, apparatus, and electronic device for an image multi-classification model.

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

[0030] The image multi-classification model training method and apparatus provided in this invention can be applied to a server, which can be a standalone server or a server cluster composed of multiple servers, with no specific limitation. Application scenarios of the above method and apparatus include adding new categories to the image multi-classification model for training. The image multi-classification model has already been pre-trained and can recognize N categories; adding a new category refers to retraining the image multi-classification model to learn the (N+1)th category. Through the above method and apparatus, the complexity of training and the maintenance cost of the model can be reduced, enabling rapid addition of new categories and multi-dimensional basic network fusion training. It exhibits strong adaptability and scalability, high real-time performance, and can meet the rapid development of business needs.

[0031] like Figure 1 As shown, this embodiment of the invention provides a training method for an image multi-classification model, which may specifically include the following steps.

[0032] S102: Determine the initial image multi-classification model.

[0033] In this embodiment, the initial image multi-classification model includes an initial first network and an initial second network. The initial first network is an N-classification network, used to predict the probability of N categories for the input image and output an N-classification result. The initial second network includes N binary classification networks, used to determine whether the input image belongs to the corresponding category and output a binary classification result. The number of parameters in the initial second network is greater than that in the initial first network.

[0034] The above-mentioned initial first network output N classification results means that the output results include N probability values, each corresponding to one of the N categories.

[0035] In this embodiment of the invention, the initial image multi-classification model can be trained using a second training sample set, which includes images of the aforementioned N categories. During the training of the initial image multi-classification model using the second training sample set, labels corresponding to the N categories have already been added to the initial first network.

[0036] The initial second network outputting N binary classification results means that the output includes N sets of classification results, each corresponding to one of the N categories. Each set of classification results includes two labels: 1 and 0. 1 indicates belonging to the category corresponding to that set, and 0 indicates not belonging to the category corresponding to that set. During the training of the initial image multi-classification model using the second training sample set, N sets of binary classification labels, each containing two labels, have already been added to the initial second network.

[0037] S104: Obtain the first training sample set, which includes images of N categories and images of the (N+1)th newly added category.

[0038] S106: Use the first training sample set to iteratively train the initial first network until the convergence condition is met, and obtain the trained first network.

[0039] The first network after training is an N+1 classification network, which is used to predict the probability of N+1 categories for the input image and output the N+1 classification result.

[0040] S108: Add a binary classification network to the initial second network to obtain the second network to be trained.

[0041] S110: Use the first training sample set to iteratively train the second network to be trained. During the training process, select parameters of the same order of magnitude as the parameters of the initial first network as the training parameters to be updated, and set the remaining parameters as fixed parameters to remain unchanged until the convergence condition is met to obtain the trained second network.

[0042] The trained second network consists of N+1 binary classification networks.

[0043] In this embodiment of the invention, the initial first network and the second network to be trained are trained in parallel, and the trained first network and the trained second network constitute the trained image multi-classification model.

[0044] In this embodiment, training parameters refer to the parameters that need to be retrained when adding new categories to the initial image multi-class classification model, while fixed parameters refer to the parameters that do not need to be retrained when adding new categories to the initial image multi-class classification model; that is, the fixed parameters remain unchanged during the retraining process. This approach can greatly reduce the complexity of retraining, save computational resources and time costs, and improve model training efficiency.

[0045] In one implementation, step S110 above, where parameters of the same magnitude as the initial parameters of the first network are selected as the training parameters for updating during training, and the remaining parameters are set as fixed parameters that remain unchanged, may specifically include:

[0046] During training, multiple hierarchical structures are selected along the forward propagation direction. The parameters in the selected hierarchical structures are set as fixed parameters and remain unchanged. The parameters in the remaining hierarchical structures of the second network to be trained are used as the training parameters for updating. The magnitude of the parameters in the remaining hierarchical structures is the same as the magnitude of the parameters in the initial first network.

[0047] In another implementation, step S110 above, where parameters of the same magnitude as the initial parameters of the first network are selected as the training parameters for updating during training, and the remaining parameters are set as fixed parameters that remain unchanged, may specifically include:

[0048] During training, multiple hierarchical structures are selected along the backpropagation direction. The parameters in the selected hierarchical structures are used as the training parameters for updating, while the parameters in the remaining hierarchical structures of the second network to be trained are set as fixed parameters and remain unchanged. The magnitude of the parameters in the selected hierarchical structures is the same as the magnitude of the parameters in the initial first network.

[0049] In this embodiment, the aforementioned "equal magnitude" means that the difference between the number of parameters and the number of parameters in the initial first network is within a specified range. This specified range can be set as needed, and the specific value is not limited.

[0050] In one implementation, the above method may further include:

[0051] During parallel training, the total loss value is obtained based on the first loss value of the initial first network's loss function and the second loss value of the second network to be trained. The initial image multi-classification model is then optimized by backpropagation based on the total loss value.

[0052] Backpropagation optimization refers to iteratively training the model using backpropagation to reduce the total loss value until the model convergence condition is met and training stops, which means that the model's accuracy has met the requirements.

[0053] In one implementation, obtaining the total loss value based on the first loss value of the loss function of the initial first network and the second loss value of the loss function of the second network to be trained can specifically include:

[0054] If the accuracy of the initial image multi-classification model is not lower than a specified threshold during parallel training, the first loss value of the loss function of the initial first network and the second loss value of the loss function of the second network to be trained are added together to obtain the total loss value.

[0055] If the accuracy of the initial image multi-classification model is lower than a specified threshold due to parallel training, a first weight is set for the first loss value of the loss function of the initial first network, and a second weight is set for the second loss value of the loss function of the second network to be trained, wherein the first weight is greater than the second weight; the first loss value and the second loss value are weighted and summed according to the first weight and the second weight to obtain the total loss value.

[0056] The method provided in this embodiment determines an initial image multi-classification model, which includes an initial first network and an initial second network. The initial first network is an N-classification network used to predict the probability of N categories of the input image and output an N-classification result. The initial second network includes N binary classification networks used to determine whether the input image belongs to the corresponding category and output a binary classification result. The parameter magnitude of the initial second network is larger than that of the initial first network. A first training sample set is obtained, including images of N categories and images of the (N+1)th newly added category. The initial first network is iteratively trained using the first training sample set until convergence is reached, resulting in a trained first network, which is an N+1 classification network. A binary classification network is added to the initial second network to obtain the second network to be trained. A training sample set is used to iteratively train the second network to be trained. During the training process, parameters of the same magnitude as those of the initial first network are selected as the training parameters for updating, while the remaining parameters are set to fixed parameters and remain unchanged until the convergence condition is met, resulting in the trained second network, which includes N+1 binary classification networks. The training of the initial first network and the second network to be trained is conducted in parallel. The trained first network and the trained second network together form the trained image multi-classification model. Since parallel training does not require training the fixed parameters in the second network, the complexity of training and the maintenance cost of the model are reduced. The model converges rapidly, enabling the rapid addition of new categories. It can handle constantly changing or expanding datasets, is flexible in application, highly adaptable and scalable, and has high real-time performance, meeting the rapid development of business needs. Moreover, the model uses multi-branch networks with different parameter magnitudes, transforming the N-classification task into N binary classification tasks for training. This achieves a multi-dimensional basic network fusion training method, resulting in strong feature diversity, output of results from different dimensions, high accuracy, and strong business generalization ability.

[0057] like Figure 2 As shown, this embodiment of the invention provides another method for training an image multi-classification model, which may specifically include the following steps.

[0058] S202: Determine the initial image multi-classification model.

[0059] In this embodiment, the image multi-classification model includes an initial first network and an initial second network. The initial first network is an N-classification network, which predicts the probability of N categories for the input image and outputs an N-classification result. The initial second network includes N binary classification networks, which determine whether the input image belongs to a corresponding category and output a binary classification result. The number of parameters in the initial second network is greater than that in the initial first network.

[0060] In this embodiment, the initial first network can be implemented using a network with a small number of parameters, i.e., a relatively simple network, such as the Inception network. The initial second network can be implemented using a network with a large number of parameters, i.e., a more complex and mature network, such as the ResNet network. For example, the number of parameters in the initial second network can be much larger than the number of parameters in the initial first network. For instance, the difference between the total number of parameters in the initial second network and the total number of parameters in the initial first network exceeds a specified threshold. This threshold can be set as needed, such as 50 or 100, etc. This embodiment does not specifically limit the numerical value.

[0061] S204: Obtain the first training sample set, which includes images of N categories and images of the (N+1)th newly added category.

[0062] S206: Use the first training sample set to iteratively train the initial first network until the convergence condition is met, and obtain the trained first network.

[0063] The first network after training is an N+1 classification network, which is used to predict the probability of N+1 categories for the input image and output the N+1 classification result.

[0064] S208: Add a binary classification network to the initial second network to obtain the second network to be trained.

[0065] S210: Use the first training sample set to iteratively train the second network to be trained. During the training process, select multiple hierarchical structures according to the forward propagation direction, set the parameters in the selected hierarchical structures as fixed parameters and keep them unchanged, and use the parameters in the remaining hierarchical structures of the second network to be trained as training parameters for updating until the convergence condition is reached, and obtain the trained second network.

[0066] The trained second network comprises N+1 binary classification networks. The initial first network and the second network to be trained are trained in parallel. The trained first network and the trained second network together form the trained image multi-classification model.

[0067] In this embodiment of the invention, forward propagation refers to starting from the input data and calculating and transmitting the data layer by layer through the neural network to finally obtain the model's output. During forward propagation, the input data undergoes a linear transformation through the weights and biases of each layer, followed by a non-linear transformation through an activation function, and then is output to the next layer, until the output layer is reached. The purpose of forward propagation is to calculate the model's predicted values.

[0068] In this embodiment of the application, the selected hierarchical structures can be selected according to the following principle: the parameter magnitudes of the remaining hierarchical structures in the second network to be trained after selection are of the same magnitude as the parameter magnitudes of the initial first network.

[0069] The term "equal order of magnitude" refers to the difference between the number of parameters in the remaining hierarchical structures and the number of parameters in the initial first network being within a specified range. This specified range can be set as needed and is not specifically limited.

[0070] For example, the number of parameters in the remaining hierarchical structures is 28, and the number of parameters in the initial first network is 30, with a specified range of 0 to 10. The difference between the number of parameters in the remaining hierarchical structures and the number of parameters in the initial first network is within this specified range, so they are of the same order of magnitude.

[0071] Among them, the fixed parameters remain unchanged in value during each retraining process of the model, that is, they do not participate in the retraining, thus ensuring the iteration speed and overall generalization ability of the model.

[0072] For example, if the second network to be trained has a total of 100 parameters, and the multi-layered structure selected according to the forward propagation direction has 85 parameters, then these 85 parameters are set as fixed parameters and will not participate in retraining. The remaining layered structure has a total of 15 parameters, then these 15 parameters are set as training parameters and will participate in retraining.

[0073] In this embodiment, the image multi-classification model, after pre-training, is already capable of recognizing N categories. When a new category is added, the output of the first network becomes N+1 classification results. The first network is then retrained to add a new label to the original N labels, namely the label corresponding to the new category. Similarly, the output of the second network becomes N+1 binary classification results. The training parameters of the second network are retrained to add a new set of labels to the original N sets of binary classification labels, namely a set of labels (0,1) corresponding to the new category, where 0 represents not belonging to the new category and 1 represents belonging to the new category.

[0074] Step S210 above describes the training method by setting parameters according to the forward propagation direction. In this embodiment, the training method by setting parameters according to the backward propagation direction can also be used, that is, the following steps can be used instead:

[0075] The second network to be trained is iteratively trained using the first training sample set. During the training process, multiple hierarchical structures are selected according to the backpropagation direction. The parameters in the selected hierarchical structures are used as the training parameters for updating, while the parameters in the remaining hierarchical structures of the second network to be trained are set as fixed parameters and remain unchanged until the convergence condition is met, resulting in the trained second network. The parameter magnitude of the selected hierarchical structures is the same as that of the initial first network.

[0076] Backpropagation, in particular, refers to calculating the gradient backwards from the model's predictions to the true labels using the chain rule, based on the difference between the model's predictions and the actual labels. This gradient is then propagated from the output layer back to every layer of the network to update the model's parameters. During backpropagation, the error at the output layer is first calculated, then propagated from the output layer to the hidden layers, then to shallower hidden layers, and finally to the input layer. Through backpropagation, gradient information about each parameter with respect to the loss function can be obtained, thereby enabling parameter optimization and updates.

[0077] For example, if the second network to be trained has a total of 100 parameters, and the multi-layered structure selected according to the backpropagation direction has 10 parameters, then these 10 parameters will be used as the training parameters for updating, i.e., they will participate in the retraining. The remaining layered structures have a total of 90 parameters, which will be set as fixed parameters and will not participate in the retraining.

[0078] In this embodiment, regardless of whether the forward propagation direction or the backward propagation direction is used to set the training parameters and the fixed parameters, the model can achieve rapid convergence, thereby improving the efficiency and accuracy of training.

[0079] S212: If the accuracy of the initial image multi-classification model is lower than a specified threshold due to parallel training, set a first weight for the first loss value of the loss function of the initial first network, and set a second weight for the second loss value of the loss function of the second network to be trained.

[0080] In this embodiment, the specified threshold can be set according to actual needs, and the specific value is not limited. The loss function of the initial first network and the loss function of the second network to be trained can both be the cross-entropy loss function softmax, or other loss functions can be used, and there is no specific limitation.

[0081] In this embodiment, the first weight and the second weight can be dynamically adjusted. For example, both can be initially set to 1, meaning the weights of the first loss value and the second loss value are consistent. When the accuracy of the initial image multi-classification model is lower than a specified threshold, the first weight can be set to be greater than the second weight to ensure that the first loss value of the first network, Inception, is optimized primarily. Alternatively, the second weight can be kept unchanged or its value reduced to ensure minimal fluctuation in the output of the second network, ResNet, thus minimizing its impact on model accuracy. This dynamic weight adjustment method maintains a balanced training method between the initial first network and the second network to be trained, improving model performance and training efficiency.

[0082] For example, during model retraining, the initial first network maintains N-class training. As the number of classes increases, it affects the model's classification performance. When the model's accuracy drops from 97% to 94.8%, it falls below the 95% threshold, so the weights are dynamically adjusted. The first weight is set to 1.2, and the second weight to 1. This continuously reduces the first loss value during backpropagation optimization, improving the optimization effect of the initial first network and enhancing the model's accuracy and performance.

[0083] S214: Based on the first weight and the second weight, the first loss value and the second loss value are weighted and summed to obtain the total loss value. The initial image multi-classification model is then optimized by backpropagation based on the total loss value.

[0084] During the backpropagation optimization process, since the initial first network and the second network to be trained have parameters of similar magnitude, i.e., little difference, the overall training iteration time is basically the same, which can achieve rapid model convergence. The classification performance of the model will not decrease exponentially with the increase of the number of classifications, thus improving training efficiency and timeliness.

[0085] Figure 3 This is a schematic diagram of the architecture of an image multi-classification model provided in an embodiment of the present invention. Figure 3As shown, the image multi-classification model includes an initial first network and an initial second network. The initial first network outputs N classification results, and the initial second network outputs N binary classification results, with the parameter magnitude of the initial second network being larger than that of the initial first network. N represents the number of categories already identified by the image multi-classification model. Images A and B represent two categories from the N categories, such as cat and dog. The initial second network, after adding a binary classification network, determines its fixed parameters and training parameters based on the parameter magnitude of the initial first network. When a new category, such as mouse, is added, the training parameters of both the initial first network and the second network (after adding the second network) are retrained. Backpropagation optimization is performed based on the loss functions of both networks, thereby achieving rapid model convergence and improving the model's accuracy and training efficiency.

[0086] Figure 4 This is a schematic diagram illustrating the training process of an image multi-classification model provided in an embodiment of the present invention. Figure 4 As shown, the image multi-classification model includes an Inception network and a ResNet network. The ResNet network divides the parameters into fixed parameters and training parameters based on the parameter magnitude of the Inception network. The parameter magnitude of the training parameters is the same as that of the Inception network. The image multi-classification model has been pre-trained with labeled data for N categories. When a new category is added, the training parameters of the ResNet network and the Inception network are retrained to learn to recognize the new category. Solid circles in the figure represent already recognized categories, and dashed circles represent the new categories learned during retraining. Backpropagation optimization is performed based on the loss functions of the two networks, ultimately resulting in an image multi-classification model with the expected accuracy. This achieves rapid learning of new categories, improving training efficiency and model accuracy.

[0087] The method provided in this embodiment determines an initial image multi-classification model, which includes an initial first network and an initial second network. The initial first network is an N-classification network used to predict the probability of N categories of the input image and output an N-classification result. The initial second network includes N binary classification networks used to determine whether the input image belongs to the corresponding category and output a binary classification result. The parameter magnitude of the initial second network is larger than that of the initial first network. A first training sample set is obtained, including images of N categories and images of the (N+1)th newly added category. The initial first network is iteratively trained using the first training sample set until convergence is reached, resulting in a trained first network, which is an N+1 classification network. A binary classification network is added to the initial second network to obtain the second network to be trained. A training sample set is used to iteratively train the second network to be trained. During the training process, parameters of the same magnitude as those of the initial first network are selected as the training parameters for updating, while the remaining parameters are set to fixed parameters and remain unchanged until the convergence condition is met, resulting in the trained second network, which includes N+1 binary classification networks. The training of the initial first network and the second network to be trained is conducted in parallel. The trained first network and the trained second network together form the trained image multi-classification model. Since parallel training does not require training the fixed parameters in the second network, the complexity of training and the maintenance cost of the model are reduced. The model converges rapidly, enabling the rapid addition of new categories. It can handle constantly changing or expanding datasets, is flexible in application, highly adaptable and scalable, and has high real-time performance, meeting the rapid development of business needs. Moreover, the model uses multi-branch networks with different parameter magnitudes, transforming the N-classification task into N binary classification tasks for training. This achieves a multi-dimensional basic network fusion training method, resulting in strong feature diversity, output of results from different dimensions, high accuracy, and strong business generalization ability.

[0088] The above describes the training method for an image multi-classification model provided by embodiments of the present invention. Based on the same idea, embodiments of the present invention also provide a training device for an image multi-classification model, such as... Figure 5 As shown.

[0089] The determination module 501 is used to determine the initial image multi-classification model. The initial image multi-classification model includes an initial first network and an initial second network. The initial first network is an N-classification network, which is used to predict the probability of N categories of the input image and output the N-classification result. The initial second network includes N binary classification networks, which are used to determine whether the input image belongs to the corresponding category and output the binary classification result. The number of parameters in the initial second network is greater than the number of parameters in the initial first network.

[0090] The acquisition module 502 is used to acquire a first training sample set, which includes images of N categories and images of the (N+1)th newly added category.

[0091] The first training module 503 is used to iteratively train the initial first network using the first training sample set until the convergence condition is met, and obtain the trained first network. The trained first network is an N+1 classification network. The N+1 classification network is used to predict the probability of N+1 categories of the input image and output the N+1 classification result.

[0092] The second training module 504 is used to add a binary classification network to the initial second network to obtain the second network to be trained; the second network to be trained is iteratively trained using the first training sample set. During the training process, parameters of the same magnitude as the parameters of the initial first network are selected as the training parameters to be updated, and the remaining parameters are set as fixed parameters and remain unchanged until the convergence condition is reached to obtain the trained second network, which includes N+1 binary classification networks.

[0093] The initial first network and the second network to be trained are trained in parallel. The trained first network and the trained second network together form the trained image multi-classification model.

[0094] In this embodiment of the invention, the initial image multi-classification model is trained using a second training sample set, which includes images of the aforementioned N categories.

[0095] In one implementation, the second training module 504 may include:

[0096] The forward setup unit is used to select multiple hierarchical structures along the forward propagation direction during training. The parameters in the selected hierarchical structures are set as fixed parameters and remain unchanged. The parameters in the remaining hierarchical structures of the second network to be trained are used as the updated training parameters. The magnitude of the parameters in the remaining hierarchical structures is the same as the magnitude of the parameters in the initial first network.

[0097] In one implementation, the second training module 504 may include:

[0098] The backpropagation unit is used to select multiple hierarchical structures during training in the direction of backpropagation. The parameters in the selected hierarchical structures are used as the updated training parameters, while the parameters in the remaining hierarchical structures of the second network to be trained are set as fixed parameters. The magnitude of the parameters in the selected hierarchical structures is the same as the magnitude of the parameters in the initial first network.

[0099] In this embodiment of the application, the above-mentioned equivalent magnitude means that the difference between the number of parameters and the number of parameters of the initial first network is within a specified range.

[0100] In this embodiment of the application, the above-mentioned device is further used to: obtain a total loss value based on the first loss value of the loss function of the initial first network and the second loss value of the loss function of the second network to be trained during parallel training, and perform backpropagation optimization on the initial image multi-classification model based on the total loss value.

[0101] In one implementation, when the above-described apparatus obtains the total loss value based on the first loss value of the loss function of the initial first network and the second loss value of the loss function of the second network to be trained, it can be specifically used for:

[0102] If the accuracy of the initial image multi-classification model is not lower than a specified threshold during parallel training, the first loss value of the loss function of the initial first network and the second loss value of the loss function of the second network to be trained are added together to obtain the total loss value.

[0103] If the accuracy of the initial image multi-classification model is lower than a specified threshold due to parallel training, a first weight is set for the first loss value of the loss function of the initial first network, and a second weight is set for the second loss value of the loss function of the second network to be trained. The first weight is greater than the second weight. Based on the first weight and the second weight, the first loss value and the second loss value are weighted and summed to obtain the total loss value.

[0104] The apparatus provided in this embodiment can execute the method provided in any of the above method embodiments. For details of the process, please refer to the description in the method embodiments, which will not be repeated here.

[0105] The apparatus provided in this embodiment determines an initial image multi-classification model, which includes an initial first network and an initial second network. The initial first network is an N-classification network used to predict the probability of N categories of the input image and output an N-classification result. The initial second network includes N binary classification networks used to determine whether the input image belongs to the corresponding category and output a binary classification result. The parameter magnitude of the initial second network is greater than that of the initial first network. A first training sample set is obtained, including images of N categories and images of the (N+1)th newly added category. The initial first network is iteratively trained using the first training sample set until convergence is achieved, resulting in a trained first network, which is an N+1 classification network. A binary classification network is added to the initial second network to obtain the second network to be trained. A training sample set is used to iteratively train the second network to be trained. During the training process, parameters of the same magnitude as those of the initial first network are selected as the training parameters for updating, while the remaining parameters are set to fixed parameters and remain unchanged until the convergence condition is met, resulting in the trained second network, which includes N+1 binary classification networks. The training of the initial first network and the second network to be trained is conducted in parallel. The trained first network and the trained second network together form the trained image multi-classification model. Since parallel training does not require training the fixed parameters in the second network, the complexity of training and the maintenance cost of the model are reduced. The model converges rapidly, enabling the rapid addition of new categories. It can handle constantly changing or expanding datasets, is flexible in application, highly adaptable and scalable, and has high real-time performance, meeting the rapid development of business needs. Moreover, the model uses multi-branch networks with different parameter magnitudes, transforming the N-classification task into N binary classification tasks for training. This achieves a multi-dimensional basic network fusion training method, resulting in strong feature diversity, output of results from different dimensions, high accuracy, and strong business generalization ability.

[0106] Figure 6 This is a schematic diagram of the hardware structure of an electronic device to implement various embodiments of the present invention. The electronic device 600 includes, but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, a processor 610, and a power supply 611, etc. Those skilled in the art will understand that... Figure 6 The electronic device structures shown are not intended to limit the electronic device. An electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements. In embodiments of the present invention, the electronic device includes, but is not limited to, mobile phones, tablet computers, laptops, PDAs, in-vehicle terminals, wearable devices, and pedometers.

[0107] The processor 610 is used to determine an initial image multi-classification model, which includes an initial first network and an initial second network. The initial first network is an N-classification network, which is used to predict the probability of N categories of the input image and output an N-classification result. The initial second network includes N binary classification networks, which are used to determine whether the input image belongs to the corresponding category and output a binary classification result. The number of parameters in the initial second network is greater than the number of parameters in the initial first network.

[0108] Obtain a first training sample set, which includes images of the N categories and images of the (N+1)th newly added category;

[0109] The initial first network is iteratively trained using the first training sample set until the convergence condition is met, resulting in a trained first network. The trained first network is an N+1 classification network, which is used to predict the probability of N+1 categories for the input image and output N+1 classification results.

[0110] A binary classification network is added to the initial second network to obtain the second network to be trained; the second network to be trained is iteratively trained using the first training sample set. During the training process, parameters of the same magnitude as the parameters of the initial first network are selected as the training parameters to be updated, and the remaining parameters are set as fixed parameters and remain unchanged until the convergence condition is reached to obtain the trained second network. The trained second network includes N+1 binary classification networks.

[0111] The initial first network and the second network to be trained are trained in parallel, and the trained first network and the trained second network constitute the trained image multi-classification model.

[0112] In one implementation, the processor 610 can be used to: select multiple hierarchical structures along the forward propagation direction during training, set the parameters in the selected hierarchical structures as fixed parameters and keep them unchanged, and use the parameters in the remaining hierarchical structures of the second network to be trained as the training parameters for updating. The magnitude of the parameters in the remaining hierarchical structures is the same as the magnitude of the parameters in the initial first network.

[0113] In another implementation, the processor 610 can be used to: select multiple hierarchical structures in the backpropagation direction during training, use the parameters in the selected hierarchical structures as training parameters for updating, and set the parameters in the remaining hierarchical structures of the second network to be trained as fixed parameters that remain unchanged. The magnitude of the parameters in the selected hierarchical structures is the same as the magnitude of the parameters in the initial first network.

[0114] In this embodiment, the above-mentioned equivalent magnitude means that the difference between the number of parameters and the number of parameters in the initial first network is within a specified range.

[0115] In one implementation, the processor 610 is further configured to: obtain a total loss value based on the first loss value of the loss function of the initial first network and the second loss value of the loss function of the second network to be trained during parallel training, and perform backpropagation optimization on the initial image multi-classification model based on the total loss value.

[0116] The step of obtaining the total loss value based on the first loss value of the loss function of the initial first network and the second loss value of the loss function of the second network to be trained may include: when the accuracy of the initial image multi-classification model is not lower than a specified threshold due to parallel training, adding the first loss value of the loss function of the initial first network and the second loss value of the loss function of the second network to be trained to obtain the total loss value; when the accuracy of the initial image multi-classification model is lower than the specified threshold due to parallel training, setting a first weight for the first loss value of the loss function of the initial first network, setting a second weight for the second loss value of the loss function of the second network to be trained, wherein the first weight is greater than the second weight, and performing a weighted summation of the first loss value and the second loss value based on the first weight and the second weight to obtain the total loss value.

[0117] The electronic device provided in this embodiment determines an initial image multi-classification model, which includes an initial first network and an initial second network. The initial first network is an N-classification network used to predict the probability of N categories of the input image and output an N-classification result. The initial second network includes N binary classification networks used to determine whether the input image belongs to the corresponding category and output a binary classification result. The parameter magnitude of the initial second network is greater than that of the initial first network. A first training sample set is obtained, including images of N categories and images of the (N+1)th newly added category. The initial first network is iteratively trained using the first training sample set until convergence is reached, resulting in a trained first network, which is an N+1 classification network. A binary classification network is added to the initial second network to obtain the second network to be trained. The first training sample set is used to iteratively train the second network to be trained. During the training process, parameters of the same magnitude as those of the initial first network are selected as the training parameters for updating, while the remaining parameters are set to fixed parameters and remain unchanged until the convergence condition is met, resulting in the trained second network. The trained second network consists of N+1 binary classification networks. The training of the initial first network and the second network to be trained is carried out in parallel. The trained first network and the trained second network together form the trained image multi-classification model. Since there is no need to train the fixed parameters in the second network during parallel training, the complexity of training and the maintenance cost of the model are reduced. The model converges rapidly, enables the rapid addition of new categories, can handle constantly changing or expanding datasets, is flexible in application, highly adaptable and scalable, and has high real-time performance, which can meet the rapid development of business needs. Moreover, the model uses multi-branch networks with different parameter magnitudes to transform the N-classification task into N binary classification tasks for training, realizing a multi-dimensional basic network fusion training method. It has strong feature diversity, outputs results from different dimensions, high accuracy, and strong business generalization ability.

[0118] It should be understood that, in this embodiment of the invention, the radio frequency unit 601 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink data from the base station and processes it with the processor 610; additionally, it transmits uplink data to the base station. Typically, the radio frequency unit 601 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, etc. Furthermore, the radio frequency unit 601 can also communicate with networks and other electronic devices through a wireless communication system.

[0119] The electronic device provides users with wireless broadband internet access through the network module 602, such as helping users send and receive emails, browse web pages, and access streaming media.

[0120] The audio output unit 603 can convert audio data received by the radio frequency unit 601 or the network module 602 or stored in the memory 609 into audio signals and output them as sound. Furthermore, the audio output unit 603 can also provide audio output related to specific functions performed by the electronic device 600 (e.g., call signal reception sound, message reception sound, etc.). The audio output unit 603 includes a speaker, a buzzer, and a receiver, etc.

[0121] Input unit 604 is used to receive audio or video signals. Input unit 604 may include a graphics processing unit (GPU) 6041 and a microphone 6042. GPU 6041 processes image data of still images or videos acquired by an image capture device (such as a camera) in video capture mode or image capture mode. The processed image frames can be displayed on display unit 606. The image frames processed by GPU 6041 can be stored in memory 609 (or other storage medium) or transmitted via radio frequency unit 601 or network module 602. Microphone 6042 can receive sound and process such sound into audio data. The processed audio data can be converted into a format that can be transmitted to a mobile communication base station via radio frequency unit 601 in telephone call mode.

[0122] The electronic device 600 also includes at least one sensor 605, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 6061 according to the ambient light level, and the proximity sensor can turn off the display panel 6061 and / or backlight when the electronic device 600 is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used to identify the posture of the electronic device (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc. The sensor 605 may also include a fingerprint sensor, pressure sensor, iris sensor, molecular sensor, gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc., which will not be described in detail here.

[0123] The display unit 606 is used to display information input by the user or information provided to the user. The display unit 606 may include a display panel 6061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0124] User input unit 607 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of electronic devices. Specifically, user input unit 607 includes a touch panel 6071 and other input devices 6072. Touch panel 6071, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near touch panel 6071). Touch panel 6071 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 610, which receives and executes commands from the processor 610. In addition, touch panel 6071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. Besides touch panel 6071, user input unit 607 may also include other input devices 6072. Specifically, other input devices 6072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, joysticks, etc., which will not be described in detail here.

[0125] Furthermore, the touch panel 6071 can cover the display panel 6061. When the touch panel 6071 detects a touch operation on or near it, it transmits the information to the processor 610 to determine the type of touch event. Subsequently, the processor 610 provides corresponding visual output on the display panel 6061 based on the type of touch event. Although in Figure 6 In this embodiment, the touch panel 6071 and the display panel 6061 are two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 6071 and the display panel 6061 can be integrated to realize the input and output functions of the electronic device. The specific implementation is not limited here.

[0126] Interface unit 608 serves as an interface for connecting external devices to electronic device 600. For example, external devices may include a wired or wireless headphone port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, and so on. Interface unit 608 can be used to receive input from external devices (e.g., data, power, etc.) and transmit the received input to one or more components within electronic device 600, or it can be used to transmit data between electronic device 600 and external devices.

[0127] The memory 609 can be used to store software programs and various data. The memory 609 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback, image playback, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). Furthermore, the memory 609 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0128] The processor 610 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 609, and by calling data stored in the memory 609, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. The processor 610 may include one or more processing units; preferably, the processor 610 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 610.

[0129] The electronic device 600 may also include a power supply 611 (such as a battery) for supplying power to various components. Preferably, the power supply 611 is logically connected to the processor 610 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system.

[0130] Preferably, the present invention also provides an electronic device, including a processor 610, a memory 609, and a computer program stored in the memory 609 and executable on the processor 610. When the computer program is executed by the processor 610, it implements the various processes of the above method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0131] This invention also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here.

[0132] This invention also provides a computer-readable storage medium storing a computer program. When executed by a processor, this computer program implements the various processes of the above-described method embodiments and achieves the same technical effects. To avoid repetition, further details are omitted here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0133] The computer-readable storage medium provided in this embodiment of the invention reduces the complexity of training and the maintenance cost of the model. The model converges rapidly, enabling the quick addition of new categories. It can handle constantly changing or expanding datasets, offering flexible application, strong adaptability and scalability, and high real-time performance, thus meeting the rapidly evolving business needs. Furthermore, the model employs multi-branch networks with varying parameter magnitudes, resulting in strong feature diversity, outputting results across different dimensions, high accuracy, and strong business generalization ability.

[0134] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0135] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0136] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The function specified in one or more boxes.

[0137] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0138] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0139] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0140] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0141] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0142] The above description is merely an embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.

Claims

1. A training method for an image multi-classification model, characterized in that, The method includes: An initial image multi-classification model is determined, comprising an initial first network and an initial second network. The initial first network is an N-classification network, which is used to predict the probability of N categories for the input image and output an N-classification result. The initial second network comprises N binary classification networks, which are used to determine whether the input image belongs to the corresponding category and output a binary classification result. The number of parameters in the initial second network is greater than the number of parameters in the initial first network. Obtain a first training sample set, which includes images of the N categories and images of the (N+1)th newly added category; The initial first network is iteratively trained using the first training sample set until the convergence condition is met, resulting in a trained first network. The trained first network is an N+1 classification network, which is used to predict the probability of N+1 categories for the input image and output N+1 classification results. A binary classification network is added to the initial second network to obtain the second network to be trained; the second network to be trained is iteratively trained using the first training sample set. During the training process, parameters of the same magnitude as the parameters of the initial first network are selected as the training parameters to be updated, and the remaining parameters are set as fixed parameters and remain unchanged until the convergence condition is reached to obtain the trained second network, which includes N+1 binary classification networks. The initial first network and the second network to be trained are trained in parallel, and the trained first network and the trained second network constitute the trained image multi-classification model.

2. The method according to claim 1, characterized in that, The initial image multi-classification model is trained using a second training sample set, which includes images of the N categories.

3. The method according to claim 1, characterized in that, During training, parameters of the same order of magnitude as those in the initial first network are selected as the training parameters for updating, while the remaining parameters are set to remain unchanged as fixed parameters, including: During training, multiple hierarchical structures are selected according to the forward propagation direction; Set the parameters in the selected hierarchy to be fixed and remain unchanged; The parameters in the remaining layers of the second network to be trained are used as the training parameters for updating. The parameter magnitudes of the remaining hierarchical structures are of the same magnitude as those of the initial first network.

4. The method according to claim 1, characterized in that, During training, parameters of the same order of magnitude as those in the initial first network are selected as the training parameters for updating, while the remaining parameters are set to remain unchanged as fixed parameters, including: During training, multiple hierarchical structures are selected according to the backpropagation direction; The parameters in the selected hierarchical structure are used as the training parameters for updating; The parameters in the remaining layers of the second network to be trained are set to fixed parameters and remain unchanged; The parameter magnitudes of the selected hierarchical structure are of the same magnitude as those of the initial first network.

5. The method according to claim 1, characterized in that, Also includes: During parallel training, the total loss value is obtained based on the first loss value of the loss function of the initial first network and the second loss value of the loss function of the second network to be trained. The initial image multi-classification model is optimized by backpropagation based on the total loss value.

6. The method according to claim 5, characterized in that, The process of obtaining the total loss value based on the first loss value of the loss function of the initial first network and the second loss value of the loss function of the second network to be trained includes: If the accuracy of the initial image multi-classification model is not lower than a specified threshold during parallel training, the first loss value of the loss function of the initial first network and the second loss value of the loss function of the second network to be trained are added together to obtain the total loss value. If the accuracy of the initial image multi-classification model is lower than a specified threshold due to parallel training, a first weight is set for the first loss value of the loss function of the initial first network, and a second weight is set for the second loss value of the loss function of the second network to be trained, wherein the first weight is greater than the second weight; based on the first weight and the second weight, the first loss value and the second loss value are weighted and summed to obtain the total loss value.

7. A training device for an image multi-classification model, characterized in that, The device includes: A determination module is used to determine an initial image multi-classification model. The initial image multi-classification model includes an initial first network and an initial second network. The initial first network is an N-classification network, which is used to predict the probability of N categories of the input image and output N-classification results. The initial second network includes N binary classification networks, which are used to determine whether the input image belongs to the corresponding category and output binary classification results. The parameter magnitude of the initial second network is greater than that of the initial first network. The acquisition module is used to acquire a first training sample set, which includes images of the N categories and images of the (N+1)th newly added category; The first training module is used to iteratively train the initial first network using the first training sample set until the convergence condition is met, thereby obtaining the trained first network. The trained first network is an N+1 classification network, which is used to predict the probability of N+1 categories of the input image and output the N+1 classification result. The second training module is used to add a binary classification network to the initial second network to obtain a second network to be trained; the second network to be trained is iteratively trained using the first training sample set, and during the training process, parameters of the same magnitude as the parameters of the initial first network are selected as training parameters to be updated, while the remaining parameters are set as fixed parameters and remain unchanged until the convergence condition is reached to obtain the trained second network, which includes N+1 binary classification networks. The initial first network and the second network to be trained are trained in parallel, and the trained first network and the trained second network constitute the trained image multi-classification model.

8. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the training method for an image multi-classification model as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the training method for the image multi-classification model as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the steps of the training method for the image multi-classification model according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Neural network training method and device, image processing method and device, equipment and storage medium

    CN111860823A

  • Incremental learning method and system for detecting fake face image video

    CN116310754A