Training method of image classification network, image classification method, device and medium

By grouping the sample data and conducting multiple rounds of training, the problem of uneven accuracy in image classification networks caused by insufficient sample quantity was solved, thereby improving the accuracy and robustness of image classification networks.

CN116070694BActive Publication Date: 2026-07-31SHENZHEN LINGYUN VISION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN LINGYUN VISION TECH CO LTD
Filing Date
2022-12-29
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In the field of industrial computer vision, insufficient sample size leads to an uneven accuracy curve in image classification networks, affecting their accuracy and robustness.

Method used

By determining the difficulty value of the sample data and grouping them, the image classification network is trained using a multi-round training method to gradually improve its accuracy and robustness.

Benefits of technology

Through multiple rounds of training, the accuracy and robustness of the image classification network are gradually improved, thereby enhancing the network's recognition capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116070694B_ABST
    Figure CN116070694B_ABST
Patent Text Reader

Abstract

This specification relates to a training method for an image classification network, an image classification method, an apparatus, and a medium. The training method includes: determining the difficulty value of sample data; grouping the sample data based on the difficulty value and a preset ratio to obtain multiple sample data groups; the difficulty value range of the sample data in each sample data group is different; training a pre-constructed image classification network for at least two rounds based on the multiple sample data groups to obtain a target image classification network; wherein, in each round of training, a different sample set is used, with the number of sample data groups in the sample set used in the later round of training being greater than the number of sample data groups used in the sample set used in the previous round of training; the sample set includes at least one sample data group. The embodiments of this specification group the sample data according to its difficulty and use the grouped sample data groups to perform multiple rounds of training on the image classification network, thereby improving the accuracy and robustness of the image classification network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of neural network technology, and in particular to a training method for an image classification network, an image classification method, an apparatus, and a medium. Background Technology

[0002] Image classification is a common task in industrial computer vision. With the development of deep learning technology, the requirements for the accuracy and robustness of image classification networks in industrial computer vision are becoming increasingly stringent. However, in some industries, the number of samples collected is often insufficient, leading to an uneven accuracy curve during training, which in turn affects the accuracy and robustness of the image classification network. Therefore, a training method is urgently needed to improve the accuracy and robustness of image classification networks. Summary of the Invention

[0003] This specification aims to address, at least to some extent, one of the technical problems in the related art. To this end, one objective of this specification is to propose a training method for image classification networks that can group sample data according to their difficulty, and then use these grouped sample data sets to train the image classification network multiple times, thereby improving the accuracy and robustness of the resulting target image classification network.

[0004] The second objective of this specification is to propose a training device for an image classification network.

[0005] The third objective of this specification is to propose an image classification method.

[0006] The fourth objective of this specification is to provide an electronic device.

[0007] The fifth objective of this specification is to provide a computer-readable storage medium.

[0008] To achieve the above objectives, a training method for an image classification network is proposed in the first aspect of this specification. The training method includes: determining the difficulty value of sample data; grouping the sample data into multiple sample data groups based on the difficulty value and a preset ratio; wherein the difficulty value range of the sample data in each sample data group is different; training a pre-constructed image classification network for at least two rounds based on the multiple sample data groups to obtain a target image classification network; wherein, in each round of training, a different sample set is used, and the number of sample data groups in the sample set used in the later round of training is greater than the number of sample data groups in the sample set used in the previous round of training; the sample set includes at least one sample data group.

[0009] The training method for the image classification network according to the embodiments of this specification first determines the difficulty value of the sample data. The sample data is then grouped according to the difficulty value and a preset ratio to obtain multiple sample data groups. The difficulty value range of the sample data in each sample data group is different. The constructed image classification network is trained multiple times using these sample data groups, with each subsequent training round using a larger number of sample data groups than the previous round. After multiple rounds of training, the target image classification network is obtained. The embodiments of this specification can gradually improve the accuracy of the image classification network through multiple rounds of training, and also enhance the robustness of the image classification network.

[0010] In some embodiments of this specification, the image classification network trained in the previous round is used as the image classification network to be trained in the next round, and the training of the image classification network in the next round is performed when the image classification network trained in the previous round converges, until the image classification network trained in the last round is used as the target image classification network.

[0011] In some embodiments of this specification, a pre-constructed image classification network is trained for at least two rounds based on multiple sample data sets, including: using a first sample data set from the multiple sample data sets as a first sample set to train the image classification network for the first round, and adding a sample data set different from the first sample data set to train the image classification network trained in the first round for the next round, and so on, until the image classification network trained in the previous round is trained for the last round using a sample set composed of multiple sample data sets.

[0012] In some embodiments of this specification, the difficulty value of the newly added sample data group in the sample set used in the later round of training is greater than the difficulty value of the sample data group in the sample set used in the previous round of training.

[0013] In some embodiments of this specification, the sample data includes benign sample data and non-beneficial sample data. Grouping the sample data based on difficulty value and preset ratio includes: sorting the benign sample data and non-beneficial sample data according to difficulty value respectively; and grouping the sorted benign sample data and non-beneficial sample data according to preset ratio to obtain a first preset number of benign sample data groups and a first preset number of non-beneficial sample data groups.

[0014] In some embodiments of this specification, after grouping the sample data, the training method further includes: determining a target benign sample data group in a first preset number of benign sample data groups where the average difficulty value of the sample data reaches a first preset value; determining a target undesirable sample data group in a first preset number of undesirable sample data groups where the average difficulty value of the sample data reaches a second preset value; and performing data augmentation on the target benign sample data group and the target undesirable sample data group respectively.

[0015] In some embodiments of this specification, determining the difficulty value of the sample data includes: performing initial training on a pre-constructed image classification network based on the sample data to obtain an initial image classification network; determining the loss value of the sample data based on the initial image classification network, and using the loss value as the difficulty value of the sample data.

[0016] In some embodiments of this specification, the training phase of the pre-constructed image classification network for at least two rounds includes a first training phase and a second training phase. The training method further includes setting the learning rate of the second training phase to be less than the learning rate of the first training phase, and ensuring that the learning rate is equal for each round of training in the first training phase.

[0017] To achieve the above objectives, a second aspect of this specification provides a training apparatus for an image classification network. The apparatus includes: a difficulty value determination module for determining the difficulty value of sample data; a grouping module for grouping the sample data based on the difficulty value and a preset ratio to obtain multiple sample data groups; wherein the difficulty value range of the sample data in each sample data group is different; and a training module for training a pre-constructed image classification network on the multiple sample data groups for at least two rounds to obtain a target image classification network. In each round of training, a different sample set is used, with the number of sample data groups in the sample set used in the later round of training being greater than the number of sample data groups in the sample set used in the previous round of training; the sample set includes at least one sample data group.

[0018] The training apparatus for the image classification network according to the embodiments of this specification first determines the difficulty value of the sample data, and then groups the sample data into multiple sample data groups according to the difficulty value and a preset ratio. The difficulty value range of the sample data in each sample data group is different. The constructed image classification network is trained multiple times using these sample data groups, with each subsequent training round using a larger number of sample data groups than the previous round. After multiple rounds of training, the target image classification network is obtained. The embodiments of this specification can gradually improve the accuracy of the image classification network through multiple rounds of training, and also enhance the robustness of the image classification network.

[0019] To achieve the above objectives, a third aspect of this specification proposes an image classification method, which includes: acquiring an image to be classified; inputting the image to be classified into a pre-trained target image classification network to obtain a classification result. The target image classification network is trained according to the method of any of the above embodiments.

[0020] According to the image classification method of the embodiments of this specification, an image to be classified is obtained, and the image to be classified is input into a trained target image classification network for processing to obtain the category to which the image to be classified belongs. The target image classification network of the embodiments of this specification is obtained by training sample data grouped according to difficulty values ​​through multiple rounds, thereby improving its accuracy and robustness.

[0021] To achieve the above objectives, a fourth aspect of this specification provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the training method or image classification method of the image classification network of any of the above embodiments.

[0022] According to embodiments of this specification, when the computer program is executed by a processor, the accuracy of the image classification network can be gradually improved by training the image classification network through multiple rounds, thereby enhancing the robustness of the image classification network.

[0023] To achieve the above objectives, a fifth aspect of this specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the training method or image classification method of the image classification network of any of the above embodiments.

[0024] The electronic device according to the embodiments of this specification can gradually improve the accuracy of the image classification network by training it through multiple rounds when the processor executes the computer program, thereby improving the robustness of the image classification network.

[0025] Additional aspects and advantages of this specification will be set forth in part in the description which follows, and in part will be obvious from the description or may be learned by practice of this specification. Attached Figure Description

[0026] Figure 1 This is a flowchart of the training method for the image classification network in the embodiments of this specification.

[0027] Figure 2 This is a schematic diagram of image classification network training according to one embodiment of this specification.

[0028] Figure 3 This is a flowchart of sample data processing according to one embodiment of this specification.

[0029] Figure 4 This is a flowchart of the image classification method according to an embodiment of this specification.

[0030] Figure 5 This is a structural block diagram of the training device for the image classification network in the embodiments of this specification.

[0031] Figure 6 This is a structural block diagram of the electronic device according to an embodiment of this specification. Detailed Implementation

[0032] The embodiments of this specification are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this specification, and should not be construed as limiting this specification.

[0033] Image classification is a common task in industrial computer vision. However, in some industrial production sectors, such as the 3C industry, the amount of data that can be collected is limited, and the data quality is inconsistent. In such cases, due to the small number of samples, the accuracy curve of the image classification model fluctuates greatly and is not smooth enough when training, thus affecting the accuracy and robustness of the image classification network. However, with the development of deep learning, the accuracy requirements for image classification networks in industrial computer vision are becoming increasingly higher. Therefore, there is an urgent need for a training method to improve the accuracy and robustness of image classification networks.

[0034] refer to Figure 1 This specification presents an embodiment of a method for training an image classification network. The training method includes:

[0035] S110, Determine the difficulty value of the sample data.

[0036] S120: The sample data is grouped based on the difficulty value and a preset ratio to obtain multiple sample data groups. The difficulty value range of the sample data in each of the sample data groups is different.

[0037] S130, the pre-constructed image classification network is trained for at least two rounds based on multiple sample data sets to obtain the target image classification network.

[0038] In each training round, a different sample set is used, with the number of sample data groups in the sample set used in the later training round being greater than the number of sample data groups in the sample set used in the previous training round; the sample set includes at least one sample data group.

[0039] In some cases, the pre-built image classification network can be a binary classification network or a multi-class classification network, depending on the specific classification requirements. When building an image classification model, new convolutional layers and fully connected layers can be constructed to form the image classification network; alternatively, existing image classification models can be used as a basis, with improvements made to relevant connected or convolutional layers to obtain the image classification network of the embodiments described in this specification. Regardless of the method used to construct the image classification network, insufficient sample data may prevent it from achieving the desired training effect. Therefore, the embodiments of this specification have made improvements to the sample data and training process to enhance the accuracy and robustness of the image classification network.

[0040] Specifically, the acquired sample data is first processed to determine its difficulty value. The sample data can consist of several images. The difficulty value indicates whether the images presented in the sample data are easily categorized. When the amount of sample data is relatively large, a pre-trained image classification model can be used to determine the difficulty value for all sample data. When the amount of sample data is relatively small, the initial image classification network constructed in the embodiments of this specification can be used to determine the difficulty value of the sample data. The difficulty value of the sample data is then determined based on relevant data or parameters obtained after processing the sample data by the model or network, such as the loss value.

[0041] Next, the sample data is grouped according to the determined difficulty values ​​and preset ratios, resulting in multiple sample data groups. The difficulty value range of the sample data in each sample data group is different. The number of sample data included in each sample data group can be different. For example, if the difficulty value range of all sample data is [0,1], where a difficulty value of 0 indicates the lowest recognition difficulty and a difficulty value of 1 indicates the highest recognition difficulty, then during grouping, sample data with difficulty values ​​in the range [0,0.5] can be assigned to one sample data group; sample data with difficulty values ​​in the range [0.5,0.8] can be assigned to another sample data group; and sample data with difficulty values ​​in the range [0.8,1] can be assigned to another sample data group. Ultimately, three sample data groups can be obtained.

[0042] To ensure the image classification network's accuracy is gradually improved through multiple training rounds, the proportion of samples in the less difficult datasets can be set higher than the proportion of samples in the more difficult datasets.

[0043] For example, suppose the sample data needs to be divided into three groups. The preset ratio can be set to 6:3:1. First, sort the sample data according to their difficulty level, from lowest to highest. Then, group the first 60% of the sorted data into one group. Next, group the last 10% of the sorted data into another group. Finally, group the remaining 30% of the data into a third group.

[0044] The pre-built image classification network is trained for at least two rounds based on multiple sets of sample data. In the embodiments of this specification, the number of training rounds for the image classification network is the same as the number of sample data sets. For example, if three sets of sample data are obtained after grouping, then three rounds of training are sufficient for the image classification network.

[0045] The sample set used in each training round is different, with the number of sample data groups in the sample set used in later training rounds being greater than the number of sample data groups in the sample set used in previous training rounds. For example, after grouping, n sample data groups are obtained. When training the image classification network for the first round, one of these sample data groups can be used. After the first round of training, one sample data group is added to the first round's sample set as the sample set for the second round of training, and so on, until all sample data groups are used as the sample set for the final round of training, resulting in the target image classification network that meets the accuracy requirements.

[0046] It should be noted that when training an image classification network, the parameters to be trained can be selected based on the actual accuracy requirements or the network construction method. For example, if the image classification network is constructed by improving a fully connected layer of an existing model, then only the parameters of the improved fully connected layer can be trained. If high accuracy is required for the network classification model, then all parameters of the image classification network can be trained. Although training all parameters is slower, it can lead to higher performance for the image classification network. In other cases, if the shallow layer parameters are kept constant, then only some parameters of the deeper layers can be trained to obtain the target image classification network.

[0047] The image classification network training method according to the embodiments of this specification involves grouping sample data to train the constructed image classification network through multiple rounds of training. Each time a new sample data group is added, the accuracy of the image classification network is gradually improved, ultimately resulting in a target image classification network that meets the required accuracy. This training method, even with limited sample data, can continuously select the optimal network through multiple rounds of training and fine-tune the parameters of the image classification network by adding sample data groups in each round, thereby improving the accuracy and robustness of the image classification model.

[0048] In some embodiments of this specification, the image classification network trained in the previous round is used as the image classification network to be trained in the next round, and the training of the image classification network in the next round is performed when the image classification network trained in the previous round converges, until the image classification network trained in the last round is used as the target image classification network.

[0049] Specifically, in order to obtain the target image classification network with the highest accuracy after multiple rounds of training on the constructed image classification network, the image classification network trained in the previous round can be used as the image classification network to be trained in the next round. In this way, the parameters that need to be adjusted can be further optimized based on the new sample set in each round of training, until the image classification network trained in the last round converges, and then the image classification network trained in the last round is used as the target image classification network.

[0050] In some embodiments of this specification, a pre-constructed image classification network is trained for at least two rounds based on multiple sample data sets, including: using a first sample data set from the multiple sample data sets as a first sample set to train the image classification network for the first round, and adding a sample data set different from the first sample data set to train the image classification network trained in the first round for the next round, and so on, until the image classification network trained in the previous round is trained for the last round using a sample set composed of multiple sample data sets.

[0051] Specifically, see Figure 2 The diagram illustrates the training of an image classification network. After grouping the sample data, four sample data groups are obtained: Index1, Index2, Index3, and Index4. In the first round of training, sample data group Index1 is used as the first sample set to train the constructed image classification network. When the image classification network trained in the first round converges, it is used as the image classification network to be trained in the second round. Sample data group Index2 is added to the first sample set as the sample set for the second round of training, and the image classification network trained in the first round is used for training. When the image classification network trained in the third round converges, it is used as the image classification network to be trained in the third round. This process continues until all four sample data groups are used as sample sets for the fourth round of training of the image classification network trained in the third round. After the image classification network trained in the fourth round converges, the training of the constructed image classification network is complete. The image classification network trained in the fourth round is then used as the target image classification network.

[0052] In some embodiments of this specification, the difficulty value of the newly added sample data group in the sample set used in the later round of training is greater than the difficulty value of the sample data group in the sample set used in the previous round of training.

[0053] In some cases, the initially established model is easier to learn from simple samples. After continuous learning, it is possible to optimize parameters based on difficult samples. Therefore, in the embodiments of this specification, the difficulty value of the sample data in the added sample data set during the subsequent training round is higher than the difficulty value of the sample data in the sample set used in the previous training round. For example, Figure 2 In the training diagram shown, the difficulty value of the sample data in sample data group Index1 is less than or equal to the difficulty value of the sample data in sample data group Index2, which is less than or equal to the difficulty value of the sample data in sample data group Index3, which is less than or equal to the difficulty value of the sample data in sample data group Index4.

[0054] In some embodiments of this specification, the sample data includes benign sample data and non-beneficial sample data. Grouping the sample data based on difficulty values ​​and preset ratios includes: sorting the benign and non-beneficial sample data according to their difficulty values; and grouping the sorted benign and non-beneficial sample data into a first preset number of benign sample data groups and a first preset number of non-beneficial sample data groups based on preset ratios.

[0055] In some cases, when using a pre-defined classifier to determine the difficulty value of sample data, the classifier will judge whether the sample data is good or bad based on some pre-defined conditions. Good sample data, commonly known as OK sample data, indicates that the sample data is a good sample that passes the test for this classifier. Bad sample data, commonly known as NG sample data, indicates that the sample data is a bad sample that fails the test for the pre-defined classifier.

[0056] When the sample data includes both benign and unfavorable sample data, grouping the sample data can include: distinguishing between benign and unfavorable sample data, and grouping the benign and unfavorable sample data separately. Specifically, benign and unfavorable sample data are sorted in ascending order of difficulty. Based on the same preset ratio, the sorted benign and unfavorable sample data are grouped separately to obtain a first preset number of benign sample data groups and a first preset number of unfavorable sample data groups.

[0057] In some embodiments of this specification, after grouping the sample data, the training method further includes: determining a target benign sample data group from a first preset number of benign sample data groups where the average difficulty value of the sample data reaches a first preset value; determining a target undesirable sample data group from a first preset number of undesirable sample data groups where the average difficulty value of the sample data reaches a second preset value; and performing data augmentation on the target benign sample data group and the target undesirable sample data group respectively.

[0058] In some cases, when the amount of sample data is insufficient, the number of samples with higher difficulty values ​​is also relatively small. In such cases, to further improve the accuracy of the target image classification network, appropriate data augmentation can be performed on the difficult samples to increase their quantity and diversity.

[0059] Specifically, the average difficulty value of the sample data in each sample data group is determined. From a first preset number of benign sample data groups, the benign sample data groups with an average difficulty value reaching the first preset value are selected as target sample data groups. Similarly, from a first preset number of unfavorable sample data groups, the unfavorable sample data groups with an average difficulty value reaching the second preset value are selected as target unfavorable sample data groups. Data augmentation is then performed on the target benign sample data groups and the target unfavorable sample data groups respectively. Generally, the target benign sample data group with the highest average difficulty value can be determined using the first preset value, and the target unfavorable sample data group with the highest average difficulty value can be determined using the second preset value. Augmentation is then performed on the target benign sample data group and the target unfavorable sample data group with the highest average difficulty value respectively. Alternatively, depending on the data characteristics, two or three benign and unfavorable sample data groups can be determined using the first and second preset values ​​for data augmentation.

[0060] Typically, when training an image classification network, good and bad sample data sets are used as corresponding sample sets. Therefore, the number of target good and bad sample data sets is the same. If it is determined that data augmentation will only be performed on the good sample data set with the highest average difficulty, then correspondingly, data augmentation will also only be performed on the bad sample data set with the highest average difficulty.

[0061] For example, when grouping the sample data, the good sample data and the bad sample data are each divided into three groups. Data augmentation is performed on both the target good sample data group and the target bad sample data group with the highest average difficulty value, each augmented to twice the original sample data group. The augmented sample data can be stored as a separate sample data group. After data augmentation, both the good sample data group and the bad sample data group become four groups. When training the image classification network, the good sample data group with the lowest average difficulty value and the bad sample data group with the lowest average difficulty value are first used as the sample set for the first round of training. After the image classification network converges in the first round of training, the image classification network trained in the first round is selected as the image classification network to be trained in the second round. Simultaneously, one good sample data group and one bad sample data group are added to the sample set as the sample set for the second round of training. The added good sample data group has the lowest average difficulty value among the remaining good sample data groups, and the added bad sample data group also has the lowest average difficulty value among the remaining bad sample data groups. However, the average difficulty of the newly added benign sample data set is greater than that of the benign sample data set used in the first round of training; the average difficulty of the newly added unbeneficial sample data set is also greater than that of the unbeneficial sample data set used in the first round of training. The image classification network to be trained is then trained a second time using the sample set with the newly added sample data set. This process continues until a fourth round of training is performed using four benign sample data sets and four unbeneficial sample data sets. After the image classification network converges in the fourth round of training, the trained image classification network is selected as the target image classification network.

[0062] In some embodiments of this specification, determining the difficulty value of the sample data includes: performing initial training on a pre-constructed image classification network based on the sample data to obtain an initial image classification network; determining the loss value of the sample data based on the initial image classification network; and using the loss value as the difficulty value of the sample data.

[0063] In some cases, since different image classification models perceive the difficulty of sample data differently, in order to improve the accuracy and robustness of the image classification network constructed in the embodiments of this specification, the difficulty value of the sample data can be directly determined by the constructed image classification network.

[0064] Since the initially constructed image classification network has very poor recognition and classification capabilities, it's advisable to first train it through several rounds of training using all sample data. Then, the trained image classification network can be used to determine the difficulty value of the sample data. Specifically, the pre-constructed image classification network is first trained on the sample data to obtain an initial image classification network. The initial training rounds don't need to be numerous, and the sample data doesn't require sorting or grouping. The sample data is then input back into the initial image classification network for processing, yielding a loss value for each sample. Since a smaller loss value indicates that the sample is easier to recognize, the loss value of the sample data can be directly used as the difficulty value of the sample data.

[0065] In some embodiments of this specification, reference is made to Figure 3 The diagram illustrates that the process of processing sample data may include: initially training a pre-constructed image classification network based on the sample data to obtain an initial image classification network; determining the loss value of the sample data based on the initial image classification network, and using the loss value as the difficulty value of the sample data; grouping the sample data based on the difficulty value and a preset ratio to obtain multiple sample data groups; and performing data augmentation on the target sample data group among the multiple sample data groups.

[0066] In some embodiments of this specification, the training phase of the pre-constructed image classification network for at least two rounds includes a first training phase and a second training phase. The training method further includes setting the learning rate of the second training phase to be less than the learning rate of the first training phase, and ensuring that the learning rate is equal for each round of training in the first training phase.

[0067] Backpropagating the output error to the network parameters to fit the sample output is essentially an optimization process, gradually approaching the optimal solution. However, the amount of error used in each parameter update needs to be determined by a parameter called the learning rate, also known as the step size. As a crucial hyperparameter in supervised learning and deep learning, the learning rate determines whether and when the objective function converges to a local minimum. A suitable learning rate enables the objective function to converge to a local minimum within a suitable timeframe.

[0068] Since image classification networks have relatively low accuracy in the early stages of training, belonging to the coarse-fit phase, the learning rate needs to decrease with each training epoch to reach the minimum loss more quickly and ensure that the converged loss value is the globally optimal solution of the image classification network. Therefore, the training process of the pre-built image classification network can be divided into two stages, setting the learning rate of the second training stage to be lower than that of the first training stage, in order to gradually obtain the minimum loss value of the image classification network. Because the embodiments in this specification address situations where there is insufficient sample data, the learning rate for each training epoch in the first training stage can be set to the same value.

[0069] Corresponding to the above embodiments, this specification also proposes an image classification method. For example... Figure 4 As shown, this image classification method includes:

[0070] S410, Obtain the image to be classified.

[0071] S420: Input the image to be classified into a pre-trained target image classification network to obtain the classification result.

[0072] The target image classification network is trained according to the method of any of the above embodiments.

[0073] It should be noted that the training details of the target image classification network not disclosed in the image classification method of this embodiment are as follows: please refer to the details disclosed in the embodiments of the image classification network training method in this specification, which will not be repeated here.

[0074] According to the image classification method of the embodiments of this specification, an image to be classified is obtained, and the image to be classified is input into a trained target image classification network for processing to obtain the category to which the image to be classified belongs. The target image classification network of the embodiments of this specification is obtained by training sample data grouped according to difficulty values ​​through multiple rounds, thereby improving its accuracy and robustness.

[0075] Corresponding to the above embodiments, this specification also proposes a training device for an image classification network. For example... Figure 5 As shown, the training device includes: a difficulty value determination module 510, used to determine the difficulty value of the sample data; a grouping module 520, used to group the sample data based on the difficulty value and a preset ratio to obtain multiple sample data groups; wherein the difficulty value range of the sample data in each sample data group is different; and a training module 530, used to perform at least two rounds of training on a pre-constructed image classification network based on the multiple sample data groups to obtain a target image classification network. In each round of training, a different sample set is used, with the number of sample data groups in the sample set used in the later round of training being greater than the number of sample data groups in the sample set used in the previous round of training; each sample set includes at least one sample data group.

[0076] It should be noted that for details not disclosed in the training device of the image classification network in this embodiment, please refer to the details disclosed in the embodiment of the training method of the image classification network in this specification, which will not be repeated here.

[0077] The training apparatus for the image classification network according to the embodiments of this specification first determines the difficulty value of the sample data, and then groups the sample data into multiple sample data groups according to the difficulty value and a preset ratio. The constructed image classification network is trained multiple times using these sample data groups, with each subsequent training round using a sample set containing more sample data groups than the previous round. After multiple rounds of training, the target image classification network is obtained. The embodiments of this specification can gradually improve the accuracy of the image classification network through multiple rounds of training, and also enhance the robustness of the image classification network.

[0078] Corresponding to the above embodiments, this specification also proposes a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the training method or image classification method of the image classification network of any of the above embodiments.

[0079] According to embodiments of this specification, when the computer program is executed by a processor, the accuracy of the image classification network can be gradually improved by training the image classification network through multiple rounds, thereby enhancing the robustness of the image classification network.

[0080] Corresponding to the above embodiments, this specification also provides an electronic device.

[0081] Figure 6 This is a structural block diagram of an electronic device according to one embodiment of this specification, such as... Figure 6 As shown, the electronic device 600 includes a memory 604, a processor 602, and a computer program 606 stored in the memory 604 and executable on the processor 602. When the processor 602 executes the computer program, it implements the training method or image classification method of the image classification network of any of the above embodiments.

[0082] The electronic device according to the embodiments of this specification can gradually improve the accuracy of the image classification network by training it through multiple rounds when the processor executes the computer program, thereby improving the robustness of the image classification network.

[0083] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0084] It should be understood that various parts of this specification can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0085] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0086] In the description of this specification, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this specification and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this specification.

[0087] Furthermore, the terms "first," "second," etc., used in the embodiments of this specification are for descriptive purposes only and should not be construed as indicating or implying relative importance, or implicitly specifying the number of technical features indicated in this embodiment. Therefore, features defined with terms such as "first" and "second" in the embodiments of this specification can explicitly or implicitly indicate that the embodiment includes at least one of those features. In the description of this specification, the word "multiple" means at least two or more, such as two, three, four, etc., unless otherwise explicitly specified in the embodiments.

[0088] In this specification, unless otherwise expressly specified or limited in the embodiments, the techniques appearing in the embodiments are...

[0089] The terms "install," "connect," "join," and "fix" should be interpreted broadly. For example, "connect" can refer to a fixed connection, a detachable connection, or an integrated connection; it can also refer to a mechanical connection, an electrical connection, etc. Of course,

[0090] It can also be a direct connection, an indirect connection through an intermediate medium, or a connection within two components, or an interaction between two components. Those skilled in the art will be able to understand the specific meaning of the above terms in this specification based on the specific implementation.

[0091] In this specification, unless otherwise expressly specified and limited, the "above" or "below" of the second feature can mean that the first and second features are in direct contact, or that the first and second features are in indirect contact through an intermediate medium. Furthermore,

[0092] The first feature being "above," "above," or "over" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. The first feature being "below" the second feature...

[0093] "Below" and "below" can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal height than the second feature.

[0094] 5 Although embodiments of this specification have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting this specification. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this specification.

Claims

1. A method for training an image classification network, characterized in that, include: Determine the difficulty level of the sample data; The sample data is grouped based on the difficulty value and a preset ratio to obtain multiple sample data groups; wherein the difficulty value range of the sample data in each sample data group is different; The pre-constructed image classification network is trained for at least two rounds based on multiple sets of sample data to obtain the target image classification network. In each round of training, a different sample set is used, and the number and difficulty of sample data sets in the sample set used in the later round of training are greater than those in the sample set used in the previous round of training. The sample set includes at least one set of sample data. The image classification network trained in the previous round is used as the image classification network to be trained in the next round. When the image classification network trained in the previous round converges, the image classification network trained in the next round is trained until the image classification network trained in the last round is used as the target image classification network.

2. The method of claim 1, wherein, The pre-built image classification network is trained for at least two rounds based on multiple sets of sample data, including: The image classification network is trained in the first round using the first sample data group from the plurality of sample data groups as the first sample set. Then, a sample data group different from the first sample data group is added to the first sample set to train the image classification network trained in the first round. This process is repeated until the image classification network trained in the previous round is trained in the last round using the sample set composed of the plurality of sample data groups.

3. The method of claim 2, wherein, The difficulty of the newly added sample data groups in the sample set used in the next round of training is greater than the difficulty of the sample data groups used in the sample set used in the previous round of training.

4. The method of claim 1, wherein, The sample data includes benign sample data and poor sample data; the grouping of the sample data based on the difficulty value and a preset ratio includes: The benign sample data and the unfavorable sample data are sorted according to the difficulty value, respectively. Based on the preset ratio, the sorted benign sample data and the non-beneficial sample data are grouped to obtain a first preset number of benign sample data groups and a first preset number of non-beneficial sample data groups.

5. The method according to claim 4, characterized in that, After grouping the sample data, the method further includes: Determine the target benign sample data group among the first preset number of benign sample data groups, whose average difficulty value of the sample data reaches the first preset value; Determine the target group of defective sample data in the first preset number of defective sample data groups, where the average difficulty value of the sample data reaches the second preset value. Data augmentation is performed on the target benign sample data group and the target defective sample data group, respectively.

6. The method according to claim 1, characterized in that, Determine the difficulty value of the sample data, including: The initial image classification network is obtained by initially training a pre-built image classification network based on sample data. The loss value of the sample data is determined based on the initial image classification network, and the loss value is used as the difficulty value of the sample data.

7. The method according to any one of claims 1-6, characterized in that, The training phase of the pre-built image classification network for at least two rounds includes a first training phase and a second training phase; wherein, the method further includes: The learning rate of the second training phase is set to be less than that of the first training phase, and the learning rate of each round of training in the first training phase is equal.

8. A training device for an image classification network, characterized in that, include: The difficulty value determination module is used to determine the difficulty value of the sample data; The grouping module is used to group the sample data based on the difficulty value and a preset ratio to obtain multiple sample data groups; wherein the difficulty value range of the sample data in each sample data group is different; The training module is used to train a pre-constructed image classification network for at least two rounds based on multiple sets of sample data to obtain a target image classification network. In each round of training, a different sample set is used, and the number and difficulty of sample data sets in the sample set used in the later round of training are greater than the number and difficulty of sample data sets in the sample set used in the previous round of training. The sample set includes at least one set of sample data. The image classification network trained in the previous round is used as the image classification network to be trained in the next round. When the image classification network trained in the previous round converges, the image classification network trained in the next round is trained until the image classification network trained in the last round is used as the target image classification network.

9. An image classification method, characterized in that, include: Obtain the image to be classified; The image to be classified is input into a pre-trained target image classification network to obtain a classification result, wherein the target image classification network is trained according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by a processor, implements the training method of the image classification network as described in any one of claims 1-7 or the image classification method as described in claim 9.

11. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the training method of the image classification network according to any one of claims 1-7 or the image classification method according to claim 9.