Image classification and training method, device, electronic device and storage medium

By extending the structure of the image classification network and limiting the number of channels, the contradiction between training accuracy and speed of the image classification network is solved, and efficient image processing is achieved, which is suitable for scenarios such as industrial quality inspection and autonomous driving.

CN117173446BActive Publication Date: 2024-10-29BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310760193.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-26
Publication Date
2024-10-29
Estimated Expiration
2043-06-26

AI Technical Summary

Technical Problem

It is difficult for existing image classification networks to simultaneously improve accuracy and avoid speed decline during the training process, especially when computing resources are limited, which affects image processing efficiency.

Method used

By expanding the image classification network based on the first standard network structure and the channel number information of the first subnetwork, the expanded structure is limited and excessive expansion is avoided, thereby maintaining the classification speed during training and improving the image classification accuracy.

Benefits of technology

It improves the accuracy of the image classification network, avoids speed decline after training, saves computing resources, and is suitable for image processing on computer equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117173446B_ABST
    Figure CN117173446B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image classification and training method, device, electronic device and storage medium, which relate to the field of artificial intelligence technology, especially to the field of image processing and deep learning. The specific implementation scheme is: based on the structure of the first standard network, a first subnetwork is determined in the first image classification network; based on the structure of the first standard network and the channel number information of the first subnetwork, the first image classification network is expanded to obtain a second image classification network; using image training data, the second image classification network is trained to obtain a target image classification network. The technical solution of the present disclosure can improve the image classification accuracy while avoiding excessive decrease in image classification speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the field of image processing and deep learning. The present disclosure specifically relates to an image classification and training method, device, electronic device and storage medium. Background Art

[0002] In the field of image processing, some neural networks or models are usually used to process images, such as classifying images. Before using the image classification model to classify images, the image classification model needs to be trained. During training, the training data, training methods, and model structure used will affect the accuracy and efficiency of the final image classification model. Summary of the invention

[0003] The present disclosure provides an image classification and training method, device, electronic device and storage medium.

[0004] According to one aspect of the present disclosure, there is provided a training method for image classification, comprising:

[0005] Based on the structure of the first standard network, determining a first subnetwork in the first image classification network;

[0006] Based on the structure of the first standard network and the channel number information of the first sub-network, the first image classification network is expanded to obtain a second image classification network; and

[0007] The second image classification network is trained using the image training data to obtain a target image classification network.

[0008] According to one aspect of the present disclosure, there is provided an image classification method, comprising:

[0009] Based on the image classification network, the target image is classified to obtain a classification result of the target image, wherein the image classification network is a network trained according to any image classification training method of the embodiments of the present disclosure.

[0010] According to another aspect of the present disclosure, there is provided a training device for image classification, comprising:

[0011] A first sub-network determination module, used to determine a first sub-network in a first image classification network based on the structure of a first standard network;

[0012] An image classification network expansion module, used to expand the first image classification network based on the structure of the first standard network and the channel quantity information of the first sub-network to obtain a second image classification network; and

[0013] The image classification network training module is used to train the second image classification network using the image training data to obtain the target image classification network.

[0014] According to another aspect of the present disclosure, an image classification device is provided, wherein the image classification device is used to:

[0015] Based on the image classification network, the target image is classified to obtain a classification result of the target image, wherein the image classification network is a network trained according to any image classification training method of the embodiments of the present disclosure.

[0016] According to another aspect of the present disclosure, there is provided an electronic device, comprising:

[0017] at least one processor; and

[0018] a memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any image classification training method or any image classification method in the embodiments of the present disclosure.

[0020] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any image classification training method or any image classification method according to the embodiments of the present disclosure.

[0021] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements any image classification training method or any image classification method according to the embodiments of the present disclosure.

[0022] According to the technology disclosed in the present invention, the image classification network is expanded before training, which can improve the accuracy of the trained image classification network. In addition, the structure of the first standard network and the number of channels of the first sub-network are used to limit the expansion structure of the image classification network, so that when training the expanded image classification network, the image classification speed can be prevented from decreasing too quickly. Moreover, when the image classification network is applied to a computer device, the efficiency of the computer device in processing images can be improved when the processing resources of the computer device are limited.

[0023] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0025] Figure 1 is a flowchart of a training method for an image classification network according to an embodiment of the present disclosure;

[0026] Figure 2 is a schematic diagram of an image classification network according to an embodiment of the present disclosure;

[0027] Figure 3 is a structural block diagram of a training device for an image classification network according to an embodiment of the present disclosure;

[0028] Figure 4 is a structural block diagram of a training device for an image classification network according to another embodiment of the present disclosure;

[0029] Figure 5 It is a block diagram of an electronic device used to implement the training method of the image classification network or the image classification method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0031] The solution disclosed herein can be applied to a variety of application scenarios, such as industrial quality inspection scenarios, autonomous driving scenarios, etc.

[0032] For example, in an industrial quality inspection scenario, since there are too many images that need to be inspected, the image classification method and image classification training method disclosed in the present invention can be used to improve the accuracy and efficiency of image classification, thereby improving the accuracy and efficiency of industrial quality inspection.

[0033] For example, in an autonomous driving scenario, during the driving process of the main vehicle, some traffic objects such as traffic signs, obstacle vehicles and static obstacles on the road, as well as the behaviors of these traffic objects need to be identified or classified. Therefore, the image classification method and image classification training method disclosed in the present invention can improve the accuracy and efficiency of image classification, thereby improving the accuracy and efficiency of autonomous driving decision-making.

[0034] Figure 1 It is a flowchart of a training method of an image classification network according to an embodiment of the present disclosure.

[0035] like Figure 1As shown, the training method of the image classification network may include:

[0036] S110, determining a first subnetwork in a first image classification network based on a structure of a first standard network;

[0037] S120, based on the structure of the first standard network and the channel quantity information of the first sub-network, expanding the first image classification network to obtain a second image classification network; and

[0038] S130, using the image training data to train a second image classification network to obtain a target image classification network.

[0039] Exemplarily, the first standard network may be a pre-set network. The first standard network may include multiple branch networks in parallel. The branch network includes at least one of a convolutional layer (Convolutional Layer, Conv layer) and a batch normalization layer (Batch Normalization, BN layer). When the branch network includes a convolutional layer and a batch normalization layer, the convolutional layer is connected in series with the batch normalization layer. The batch normalization layer may be located before or after the convolutional layer. The convolution kernel sizes of different convolutional layers may be the same or different.

[0040] The branch network may also include a serial convolution layer and a pooling layer (pool layer), and the convolution layer may be located before or after the pooling layer. The pooling layer may include a maximum pooling layer, an average pooling layer, a global average pooling layer, a global maximum pooling layer, and the like.

[0041] Exemplarily, the first standard network can be used to determine the first sub-network structure, and the first sub-network structure can be used to find the corresponding first sub-network in the first image classification network. The first standard network can be an extended target of the extended object. The first sub-network can be an extended object.

[0042] Exemplarily, the first image classification network may be a trained image classification network or an untrained image classification network.

[0043] Exemplarily, when the image classification accuracy of the first image classification network is lower than a set threshold, the method of steps S110-S130 is performed to improve the image classification accuracy of the image classification network.

[0044] Exemplarily, the first image classification network may include one or more layers of networks, each layer of the network including one or more parallel sub-networks. The number of channels of networks in different layers may be the same or different.

[0045] Exemplarily, the first sub-network may be an extension object targeted when the first image classification network is extended.

[0046] Exemplarily, the channel quantity information of the first sub-network includes the input channel quantity and the output channel quantity of the network layer where the first sub-network is located.

[0047] Exemplarily, the above-mentioned expansion of the first image classification network includes: expanding the first subnetwork in the first image classification network to achieve expansion of the first image classification network.

[0048] Exemplarily, the second image classification network is an expanded first image classification network.

[0049] In practical applications, the first standard network is used to determine the first subnetwork of the image classification network, and when the first image classification network is expanded with the first standard network as the expansion target, the channel number information of the first subnetwork is used to limit the expanded structure of the first subnetwork, thereby avoiding excessive expansion of the image classification network. Furthermore, when the second image classification network obtained after expansion is trained, the image classification speed can be prevented from decreasing too much.

[0050] Exemplarily, the image classification data includes one or more labeled training samples, wherein the training samples include a first image and labeling information for the first image.

[0051] Exemplarily, using image training data to train a second image classification network to obtain a target image classification network can include: inputting the first image in the training sample into the second image classification network to obtain a classification result; adjusting the second image classification network based on the annotation information and classification result for the first image in the training sample until the image classification accuracy of the adjusted second image classification network meets a set threshold, and using the adjusted second image classification network as the target image classification network.

[0052] In practical applications, when there is too much training data, the image classification speed of the expanded second image classification network will drop too much. Therefore, before training, the channel number information of the first sub-network and the structure of the first standard network are used to limit the expansion of the first image classification network. Thus, under the premise of improving the accuracy of the image classification network, the image classification speed of the image classification network can be prevented from dropping too much.

[0053] According to the above implementation, the image classification network is expanded before training, which can improve the accuracy of the trained image classification network. In addition, the structure of the first standard network and the number of channels of the first sub-network are used to limit the expansion structure of the image classification network, so that when training the expanded image classification network, the image classification speed can be prevented from decreasing too quickly.

[0054] In practical applications, in the image classification process, GPU (graphics processing unit) is generally used to process the image. In order to improve the accuracy of image classification, GPU uses an expanded image classification network to classify images, which requires calling more resources. Since the present disclosure uses the structure of the first standard network and the channel number information of the first sub-network to limit the expanded structure of the image classification network, the excessive expansion of the image classification network is avoided. Therefore, when the GPU uses the image classification network with expansion restrictions to classify images, it does not need to call too many resources to classify the images to achieve the same image classification accuracy. Therefore, the above-mentioned implementation method can save the computing resources of the image processor.

[0055] In an exemplary embodiment, based on the structure of the first standard network, a first subnetwork is determined in the first image classification network, including: determining the first subnetwork structure based on at least one branch network in parallel in the first standard network; determining the first subnetwork in the first image classification network based on the first subnetwork structure.

[0056] Exemplarily, the first standard network includes a plurality of parallel branch networks.

[0057] Exemplarily, determining the first sub-network structure based on at least one branch network in parallel in the first standard network includes: determining the second standard network based on at least one branch network in the plurality of parallel branch networks, and determining the first sub-network structure based on the structure of the second standard network. For example, the second standard network is composed of one or more branch networks in the plurality of parallel branch networks.

[0058] Exemplarily, based on the structure of the second standard network, determining the first sub-network structure includes: using the structure of the second standard network as the first sub-network structure. The first sub-network structure is used to search for a corresponding first sub-network in the first image classification network. The structure of the first sub-network is the same as the first sub-network structure.

[0059] According to the above embodiment, the structure of at least one branch network in parallel in the first standard network is used as a reference to obtain the first sub-network structure, so that the corresponding first sub-network can be accurately found based on the first sub-network structure, thereby improving the speed of finding the first sub-network in the image classification network.

[0060] In an exemplary embodiment, the first standard network includes a first branch network, wherein the first branch network includes a first convolutional layer and a first batch of standardization layers in series, and the convolution kernel size of the first convolutional layer is N*N, where N is a positive integer.

[0061] In practical applications, a first branch network consisting of a Conv layer + a BN layer is set in the first standard network, and the convolution kernel size of the Conv layer is N*N. For example, the convolution kernel size is 3*3, 4*4 or 6*6. The first branch network is used to determine the first sub-network structure, that is, the network structure for determining the extended object.

[0062] Determining a first subnetwork structure based on at least one branch network in parallel in a first standard network includes: determining a second standard network based on the first branch network, or the first branch network and at least one branch network in the first standard network other than the first branch network; and determining a first subnetwork structure based on the structure of the second standard network.

[0063] Exemplarily, the first branch network is used as the second standard network. Alternatively, the first branch network and at least one branch network other than the first branch in the first standard network are used in parallel to form the second standard network.

[0064] According to the above implementation, the first subnetwork structure is determined by the first branch network composed of the Conv layer + BN layer in the first standard network, or by the first branch network and other branch networks in the first standard network, and the corresponding extended object, i.e., the first subnetwork, is searched in the first image classification network using the network structure. The structure of the extended object is not only the first subnetwork composed of the first branch network, but also the first subnetwork composed of the first branch network and other branch networks in parallel. In this way, since the extension target of the first subnetwork is the first standard network, the first subnetwork composed of the first branch network and other branch networks in parallel is expanded, and the branches of the expansion can be reduced compared to only expanding the first subnetwork composed of the first branch network.

[0065] Therefore, when training the expanded image classification network, not only can the accuracy of the image classification network be improved, but also the image classification speed can be prevented from decreasing too much.

[0066] After the expanded image classification network is trained using the image training data to obtain the target image classification network, the target image classification network can also be fused so that the classification speed of the target image classification network can be close to or higher than the classification speed of the first image classification network before the expansion.

[0067] Based on the above embodiments, a solution for fusing the target image classification network is introduced below.

[0068] In an exemplary embodiment, the above method may further include: determining the structure of the third standard network based on the structure of the first sub-network; and fusing the target image classification network based on the structure of the first standard network and the structure of the third standard network.

[0069] Exemplarily, the first sub-network is the network before expansion, and the structure of the third standard network is determined by using the network before expansion. The target image classification network is fused with the structure of the third standard network as the target.

[0070] Exemplarily, since the structure of the first standard network is the extended target, the structure of the extended network in the target image classification network is the same or similar to the structure of the first standard network, and the object can be found and fused. Therefore, based on the structure of the first standard network, the corresponding fusion object can be found in the target image classification network to achieve fusion of the target image classification network.

[0071] Exemplarily, fusing the target image classification network may include: fusing the fusion objects to achieve fusion of the target image classification network.

[0072] According to the above implementation, by taking the structure of the third standard network as the fusion target, that is, taking the network structure before expansion as the fusion target, the fused network structure can be made the same or similar to the network structure before expansion. Thus, when using the fused image classification network to perform image classification, its classification speed is similar to that of the first image classification network before expansion. Moreover, the precision of the fused image classification network is higher, that is, the accuracy of image classification is higher.

[0073] In an exemplary embodiment, the first standard network includes a first branch network, wherein the first branch network includes a serial first convolutional layer and a first batch of standardized layers, and the convolution kernel size of the first convolutional layer is N*N, where N is a positive integer; based on the structure of the first sub-network, the structure of the third standard network is determined, including: when the first sub-network includes a network with the same structure as the first branch network, the structure of the third standard network is determined based on the structure of the first branch network, wherein the convolution kernel size of the first convolutional layer is the same as the convolution kernel size of the convolution layer in the third standard network.

[0074] For example, N*N can be 3*3, 4*4, 8*8, etc.

[0075] According to the above implementation, since the first sub-network before expansion includes a first branch network consisting of a Conv layer and a BN layer, and the convolution kernel size of the Conv layer is N*N, the fusion target, that is, the third standard network, can also be a Conv layer, whose convolution kernel size is N*N, or the structure is the same as the first branch network. Therefore, the classification speed of the fused target image classification network is the same or similar to the classification speed of the first image classification network before expansion.

[0076] Therefore, by adopting the above implementation mode, it is possible not only to improve the image classification accuracy while avoiding excessive decrease in the image classification speed during the training process, but also to keep the prediction speed of the target image classification network obtained after the final fusion unchanged or even improve it.

[0077] In an exemplary embodiment, based on the structure of the first standard network and the structure of the third standard network, the target image classification network is fused, including: based on the structure of the first standard network, determining the second sub-network structure; based on the second sub-network structure, determining the second sub-network in the target image classification network; based on the structure of the third standard network, fusing the second sub-network to achieve fusion of the target image classification network.

[0078] Exemplarily, the structure of the first standard network is used as the second sub-network structure, or the structure of a partial branch network in parallel in the first standard network is used as the second sub-network structure.

[0079] Exemplarily, the second sub-network is a fusion object. The second sub-network structure is the structure of the fusion object.

[0080] Exemplarily, the second standard network includes a second branch network, wherein the second branch network includes a second convolution layer and a third convolution layer in series, the convolution kernel size of the second convolution layer is 1*1, and the convolution kernel size of the third convolution layer is M*M, where M is a positive integer. M may be the same as the aforementioned N or may be different.

[0081] Exemplarily, the second branch network is deleted in the second standard network, so that the structure of the second standard network after deleting the second branch network is used as the second sub-network structure. During expansion, if the number of input channels of the first sub-network is different from the number of output channels, the first sub-network is expanded into the second standard network after deleting the second branch network. Thus, a network with the same structure as the second standard network after deleting the second branch network is searched in the target image classification network as a fusion object, and fusion is performed on the fusion object.

[0082] According to the above implementation, since the structure of the first standard network is an extended target of the first sub-network in the image classification network, the structure of the fusion object, i.e., the second sub-network structure, can be determined based on the structure of the first standard network. Furthermore, using this structure, the fusion object can be accurately found and fused for the fusion object to improve the accuracy of the image classification network.

[0083] In the solution disclosed in the present invention, the first image classification network is expanded to obtain the second image classification network, and the second image classification network is trained to obtain the target image classification network, and then the target image classification network is fused. The above has described how to determine the expansion object in the first image classification network to achieve the expansion of the first image classification network. The following will introduce some implementation methods of the expansion process of the image classification network, as follows:

[0084] In an exemplary embodiment, based on the structure of the first standard network and the channel number information of the first sub-network, the first image classification network is expanded to obtain the second image classification network, including: when the number of input channels and the number of output channels of the first sub-network are the same, based on the structure of the first standard network, the first sub-network is expanded to achieve the expansion of the first image classification network; based on the expanded first image classification network, the second image classification network is determined.

[0085] Exemplarily, the number of input channels of the first subnetwork may be the number of input channels of the network layer where the first subnetwork is located, and the number of output channels of the first subnetwork may be the number of output channels of the network where the first subnetwork is located.

[0086] Exemplarily, since the first subnetwork is a subnetwork in the first image classification network, the first subnetwork can be expanded to achieve the expansion of the first image classification network.

[0087] Exemplarily, the first sub-network can be expanded into a network having the same structure as the first standard network to achieve the expansion of the first image classification network.

[0088] Exemplarily, the first subnetwork is replaced by the first standard network in the first image classification network to achieve expansion of the first image classification network.

[0089] Exemplarily, determining the second image classification network based on the expanded first image classification network may include: using the expanded first image classification network as the second image classification network.

[0090] According to the above embodiment, when the number of input channels and the number of output channels of the first sub-network are the same, the first sub-network can be expanded into a network having the same structure as that of the first standard network to achieve the expansion of the second image classification network. Thus, training based on such a second image classification network can improve the accuracy of the trained target image classification network.

[0091] In an exemplary embodiment, the first standard network includes a second branch network, wherein the second branch network includes a second convolutional layer and a third convolutional layer in series, the convolution kernel size of the second convolutional layer is 1*1, and the convolution kernel size of the third convolutional layer is M*M, where M is a positive integer.

[0092] Exemplarily, the convolution kernel size of the third convolution layer can be 3*3, 5*5, etc.

[0093] Exemplarily, the convolution kernel size of the third convolution layer may be the same as or different from the convolution kernel size of the first convolution layer. The convolution kernel size of the third convolution layer may be the same as the convolution kernel size of the first convolution layer to facilitate subsequent network fusion.

[0094] In an exemplary embodiment, it also includes: when the number of input channels and the number of output channels of the first sub-network are different, deleting the second branch network in the first standard network to obtain a fourth standard network; based on the structure of the fourth standard network, expanding the first sub-network to achieve the expansion of the first image classification network; based on the expanded first image classification network, determining the second image classification network.

[0095] Exemplarily, the fourth standard network is an expansion target of the first sub-network when the number of input channels and the number of output channels of the first sub-network are different.

[0096] Exemplarily, the first sub-network is expanded into a network having the same network structure as that of the fourth standard network.

[0097] Exemplarily, the first sub-network is replaced with a fourth standard network to achieve an expansion of the first image classification network.

[0098] Exemplarily, since the first standard network is the expansion target of the first sub-network, when the first standard network includes the second branch network, if the first sub-network is directly expanded into the first standard network, the expanded structure also includes the second branch network. In this way, when the image classification network is subsequently trained, the accuracy of the trained image may not be greatly improved, but the image processing speed will be greatly reduced. Therefore, the input channel information of the first sub-network is used to determine whether to expand the first sub-network into a structure including the second branch network to improve the image processing speed during subsequent training.

[0099] According to the above implementation, when the number of input channels and the number of output channels of the first sub-network are different, the first standard network after deleting the second branch network is used as the expansion target, and the structure of the expanded first image classification network can be simplified. Therefore, when the expanded first image classification network is subsequently trained, the image classification speed can be improved.

[0100] In an exemplary embodiment, the first standard network may also include at least one of a third branch network, a fourth branch network, a fifth branch network, a sixth branch network and a seventh branch network in parallel; wherein the third branch network includes a fourth convolutional layer and a second batch of standardization layers in series, and the convolution kernel size of the fourth convolutional layer is 1*1; the fourth branch network includes a fifth convolutional layer and a third batch of standardization layers in series, and the convolution kernel size of the fifth convolutional layer is K*1, wherein K is a positive integer; the fifth branch network includes a sixth convolutional layer and a fourth batch of standardization layers in series, and the convolution kernel size of the sixth convolutional layer is 1*J, wherein J is a positive integer; the sixth branch network includes a seventh convolutional layer and a pooling layer in series, and the convolution kernel size of the seventh convolutional layer is 1*1, and the size of the pooling layer is H*H, wherein H is a positive integer; the seventh branch network includes a fifth batch of standardization layers.

[0101] Illustratively, the values ​​of N, M, K, J and H may be the same or different.

[0102] Exemplarily, the first standard network may include a first branch network, a second branch network, a third branch network, a fourth branch network, a fifth branch network, a sixth branch network, and a seventh branch network in parallel.

[0103] Figure 2 A schematic diagram of the structure of an image classification network according to an embodiment of the present disclosure is shown.

[0104] like Figure 2 As shown, the first standard network includes a first branch network, a second branch network, a third branch network, a fourth branch network, a fifth branch network, a sixth branch network and a seventh branch network in parallel.

[0105] The structure of the first branch network is Conv layer + BN layer, and the convolution kernel size of the Conv layer is 3*3.

[0106] The structure of the second branch network is Conv layer + Conv layer, and the convolution kernel sizes of the two Conv layers are 1*1 and 3*3 respectively.

[0107] The structure of the third branch network is Conv layer + BN layer, and the convolution kernel size of the Conv layer is 1*1.

[0108] The structure of the fourth branch network is Conv layer + BN layer, and the convolution kernel size of the Conv layer is 3*1.

[0109] The structure of the fifth branch network is Conv layer + BN layer, and the convolution kernel size of the Conv layer is 1*3.

[0110] The structure of the sixth branch network is Conv layer + pool layer, and the convolution kernel size of the Conv layer is 1*1, and the pooling size of the pool layer is 3*3.

[0111] The structure of the seventh branch network is a BN layer.

[0112] 1. For the first subnetwork in the first image classification network, which has the same structure as the first branch network, or the first subnetwork which has the same structure as the network formed in parallel by the first branch network and at least one branch network in other branch networks, expand or convert it into a first standard network to achieve the expansion of the first image classification network. The expanded first image classification network is the second image classification network.

[0113] 2. In order to make the structure of the expanded image classification network as simple as possible and to improve the image processing speed during training, when the number of input channels and the number of output channels of the first sub-network are different, the network obtained by expanding the above-mentioned first sub-network does not include the above-mentioned second branch network, thereby simplifying the structure of the expanded image classification network.

[0114] 3. Use the image training data to train the second image classification network obtained after expansion to obtain the target image classification network.

[0115] 4. After the training is completed, in the target image classification network, determine the second subnetwork with the same structure as the first standard network, or the second subnetwork with the same structure as the first standard network with the second branch network deleted, and then fuse each second subnetwork into a Conv layer, and the convolution kernel size of the Conv layer is 3*3.

[0116] When fusing the second sub-networks, since the second sub-network includes multiple parallel branch networks, each branch network can be fused separately, and then all branch networks are fused into a Conv layer. The fused Conv layer is mathematically equivalent to the second sub-network. That is, for the same image, the image processing results obtained by inputting the Conv layer and the second sub-network are the same.

[0117] According to the above implementation, the image classification network is expanded before training, which can improve the accuracy of the trained image classification network. In addition, the structure of the first standard network and the channel number information of the first sub-network are used to limit the expansion structure of the image classification network, so that when training the expanded image classification network, the image classification speed can be prevented from decreasing too quickly. Moreover, the prediction speed of the fused target image classification network is similar to the prediction speed of the first image classification network before expansion, that is, the final prediction speed is kept unchanged.

[0118] The present disclosure also provides an image classification method, comprising: classifying a target image based on an image classification network to obtain a classification result of the target image, wherein the image classification network is a network trained according to the training method of the image classification network of any embodiment of the present disclosure.

[0119] The effect achieved by the image classification method provided in this embodiment is consistent with the effect achieved by the aforementioned embodiment and will not be described in detail here.

[0120] Figure 3 It is a structural block diagram of a training device for an image classification network according to an embodiment of the present disclosure.

[0121] like Figure 3 As shown, the training device of the image classification network includes:

[0122] A first sub-network determination module 310, configured to determine a first sub-network in a first image classification network based on a structure of a first standard network;

[0123] An image classification network expansion module 320, configured to expand the first image classification network based on the structure of the first standard network and the channel quantity information of the first sub-network to obtain a second image classification network;

[0124] The image classification network training module 330 is used to train the second image classification network using image training data to obtain a target image classification network.

[0125] Figure 4 It is a structural block diagram of a training device for an image classification network according to another embodiment of the present disclosure. Figure 4 The first sub-network determination module 410, the image classification network expansion module 420 and the image classification network training module 430 have the same structure or function as the first sub-network determination module 310, the image classification network expansion module 320 and the image classification network training module 330, respectively, and are not described in detail here.

[0126] In an exemplary implementation, the first sub-network determination module 410 includes:

[0127] A first structure determining unit 411 is configured to determine a first sub-network structure based on at least one branch network in parallel in the first standard network;

[0128] The first network determining unit 412 is used to determine a first sub-network in a first image classification network based on the first sub-network structure.

[0129] In an exemplary embodiment, the first standard network includes a first branch network, wherein the first branch network includes a first convolutional layer and a first batch of standardization layers in series, and a convolution kernel size of the first convolutional layer is N*N, where N is a positive integer;

[0130] The first structure determining unit 411 is specifically configured to:

[0131] Determine a second standard network based on the first branch network, or at least one branch network other than the first branch network among the first branch network and the first standard network;

[0132] Based on the structure of the second standard network, a first sub-network structure is determined.

[0133] In an exemplary embodiment, the above device further includes:

[0134] A fusion network structure determination module 440, configured to determine a structure of a third standard network based on the structure of the first sub-network;

[0135] The image classification network fusion module 450 is used to fuse the target image classification network based on the structure of the first standard network and the structure of the third standard network.

[0136] In an exemplary embodiment, the first standard network includes a first branch network, wherein the first branch network includes a first convolutional layer and a first batch of standardization layers in series, and a convolution kernel size of the first convolutional layer is N*N, where N is a positive integer;

[0137] The fusion network structure determination module 440 is specifically used to:

[0138] In the case where the first sub-network includes a network with the same structure as the first branch network, the structure of the third standard network is determined based on the structure of the first branch network, wherein the convolution kernel size of the first convolution layer is the same as the convolution kernel size of the convolution layer in the third standard network.

[0139] In an exemplary embodiment, the image classification network fusion module 450 includes:

[0140] A second structure determining unit 451 is used to determine a second sub-network structure based on the structure of the first standard network;

[0141] A second network determining unit 452, configured to determine a second sub-network in the target image classification network based on the second sub-network structure;

[0142] The network fusion unit 453 is used to fuse the second sub-network based on the structure of the third standard network to achieve fusion of the target image classification network.

[0143] In an exemplary implementation, the image classification network extension module 420 includes:

[0144] A first network expansion unit 421 is used to expand the first sub-network based on the structure of the first standard network when the number of input channels and the number of output channels of the first sub-network are the same, so as to expand the first image classification network;

[0145] The third network determining unit 423 is used to determine the second image classification network based on the expanded first image classification network.

[0146] In an exemplary embodiment, the first standard network includes a second branch network, wherein the second branch network includes a second convolutional layer and a third convolutional layer in series, the convolution kernel size of the second convolutional layer is 1*1, and the convolution kernel size of the third convolutional layer is M*M, where M is a positive integer.

[0147] In an exemplary implementation, the image classification network extension module 420 further includes:

[0148] A network deleting unit 424, configured to delete the second branch network from the first standard network to obtain a fourth standard network when the number of input channels and the number of output channels of the first sub-network are different;

[0149] A second network expansion unit 425, configured to expand the first sub-network based on the structure of the fourth standard network, so as to expand the first image classification network;

[0150] The fourth network determining unit 426 is used to determine the second image classification network based on the expanded first image classification network.

[0151] In an exemplary embodiment, the first standard network further includes at least one of a third branch network, a fourth branch network, a fifth branch network, a sixth branch network, and a seventh branch network in parallel;

[0152] The third branch network includes a fourth convolutional layer and a second batch normalization layer in series, and the convolution kernel size of the fourth convolutional layer is 1*1;

[0153] The fourth branch network includes a fifth convolutional layer and a third batch normalization layer in series, and the convolution kernel size of the fifth convolutional layer is K*1, where K is a positive integer;

[0154] The fifth branch network includes a sixth convolutional layer and a fourth batch normalization layer in series, and the convolution kernel size of the sixth convolutional layer is 1*J, where J is a positive integer;

[0155] The sixth branch network includes a seventh convolutional layer and a pooling layer in series, and the convolution kernel size of the seventh convolutional layer is 1*1, and the size of the pooling layer is H*H, where H is a positive integer;

[0156] The seventh branch network includes a fifth batch of standardized layers.

[0157] The present disclosure also provides an image classification device, wherein the device is used to:

[0158] Based on the image classification network, the target image is classified to obtain the classification result of the target image, wherein the image classification network is a network trained according to the training method of any image classification network in the embodiments of the present disclosure.

[0159] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.

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

[0161] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

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

[0163] like Figure 5 As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0164] A number of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0165] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as a training method or an image classification method for an image classification network. For example, in some embodiments, a training method or an image classification method for an image classification network may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the training method or the image classification method for an image classification network described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to execute an image classification network training method or an image classification method in any other appropriate manner (for example, by means of firmware).

[0166] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0167] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

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

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

[0170] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0171] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0172] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0173] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A training method for an image classification network, comprising: Determine a first sub-network structure based on at least one branch network in parallel in the first standard network; Based on the first sub-network structure, determining a first sub-network in a first image classification network; When the number of input channels and the number of output channels of the first sub-network are different, the second branch network is deleted from the first standard network to obtain a fourth standard network; Based on the structure of the fourth standard network, the first sub-network is expanded to achieve expansion of the first image classification network; Determine a second image classification network based on the expanded first image classification network; as well as The second image classification network is trained using the image training data to obtain a target image classification network.

2. The method according to claim 1, wherein: The first standard network includes a first branch network, wherein the first branch network includes a first convolutional layer and a first batch of standardized layers in series, and a convolution kernel size of the first convolutional layer is N*N, where N is a positive integer; The determining of the first sub-network structure based on at least one branch network in parallel in the first standard network includes: Determine a second standard network based on the first branch network, or at least one branch network other than the first branch network among the first branch network and the first standard network; Based on the structure of the second standard network, a first sub-network structure is determined.

3. The method according to claim 2, further comprising: Determining a structure of a third standard network based on the structure of the first sub-network; Based on the structure of the first standard network and the structure of the third standard network, the target image classification network is fused.

4. The method according to claim 3, wherein: The first standard network includes a first branch network, wherein the first branch network includes a first convolutional layer and a first batch of standardized layers in series, and a convolution kernel size of the first convolutional layer is N*N, where N is a positive integer; The determining the structure of the third standard network based on the structure of the first sub-network includes: In the case where the first sub-network includes a network with the same structure as the first branch network, the structure of the third standard network is determined based on the structure of the first branch network, wherein the convolution kernel size of the first convolution layer is the same as the convolution kernel size of the convolution layer in the third standard network.

5. The method according to claim 3, wherein: The step of fusing the target image classification network based on the structure of the first standard network and the structure of the third standard network includes: Determining a second sub-network structure based on the structure of the first standard network; Based on the second sub-network structure, determining a second sub-network in the target image classification network; Based on the structure of the third standard network, the second sub-network is fused to achieve fusion of the target image classification network.

6. The method according to any one of claims 1 to 5, wherein: The first image classification network is expanded based on the structure of the first standard network and the channel quantity information of the first sub-network to obtain a second image classification network, including: When the number of input channels and the number of output channels of the first sub-network are the same, the first sub-network is expanded based on the structure of the first standard network to achieve expansion of the first image classification network; Based on the expanded first image classification network, a second image classification network is determined.

7. The method according to claim 1, wherein: The second branch network includes a second convolutional layer and a third convolutional layer in series, the convolution kernel size of the second convolutional layer is 1*1, the convolution kernel size of the third convolutional layer is M*M, and M is a positive integer.

8. The method according to claim 1, wherein: The first standard network further includes at least one of a third branch network, a fourth branch network, a fifth branch network, a sixth branch network, and a seventh branch network in parallel; The third branch network includes a fourth convolutional layer and a second batch normalization layer in series, and the convolution kernel size of the fourth convolutional layer is 1*1; The fourth branch network includes a fifth convolutional layer and a third batch normalization layer in series, and the convolution kernel size of the fifth convolutional layer is K*1, where K is a positive integer; The fifth branch network includes a sixth convolutional layer and a fourth batch normalization layer in series, and the convolution kernel size of the sixth convolutional layer is 1*J, where J is a positive integer; The sixth branch network includes a seventh convolutional layer and a pooling layer in series, and the convolution kernel size of the seventh convolutional layer is 1*1, and the size of the pooling layer is H*H, where H is a positive integer; The seventh branch network includes a fifth batch of standardized layers.

9. An image classification method, comprising: Based on an image classification network, a target image is classified to obtain a classification result of the target image, wherein the image classification network is a network trained according to the method described in any one of claims 1 to 8.

10. A training device for an image classification network, comprising: A first sub-network determination module, used to determine a first sub-network in a first image classification network based on the structure of a first standard network; An image classification network expansion module, used to expand the first image classification network based on the structure of the first standard network and the channel quantity information of the first sub-network to obtain a second image classification network; as well as An image classification network training module, used to train the second image classification network using image training data to obtain a target image classification network; Wherein, the first sub-network determination module includes: A first structure determination unit, configured to determine a first sub-network structure based on at least one branch network in parallel in the first standard network; A first network determining unit, configured to determine a first subnetwork in a first image classification network based on the first subnetwork structure; Wherein, the image classification network extension module includes: a network deleting unit, configured to delete the second branch network in the first standard network to obtain a fourth standard network when the number of input channels and the number of output channels of the first sub-network are different; A second network expansion unit, configured to expand the first sub-network based on the structure of the fourth standard network, so as to expand the first image classification network; The fourth network determination unit is used to determine the second image classification network based on the expanded first image classification network.

11. The device according to claim 10, wherein: The first standard network includes a first branch network, wherein the first branch network includes a first convolutional layer and a first batch of standardized layers in series, and a convolution kernel size of the first convolutional layer is N*N, where N is a positive integer; The first structure determining unit is specifically configured to: Determine a second standard network based on the first branch network, or at least one branch network other than the first branch network among the first branch network and the first standard network; Based on the structure of the second standard network, a first sub-network structure is determined.

12. The apparatus according to claim 10, further comprising: A fusion network structure determination module, used to determine the structure of a third standard network based on the structure of the first sub-network; An image classification network fusion module is used to fuse the target image classification network based on the structure of the first standard network and the structure of the third standard network.

13. The device according to claim 10, wherein: The second branch network includes a second convolutional layer and a third convolutional layer in series, the convolution kernel size of the second convolutional layer is 1*1, the convolution kernel size of the third convolutional layer is M*M, and M is a positive integer.

14. An image classification device, wherein: The device is used for: Based on an image classification network, a target image is classified to obtain a classification result of the target image, wherein the image classification network is a network trained according to the method described in any one of claims 1 to 8.

15. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-8.

17. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 8.