Multi-branch convolution structure, neural network model and determination method and determination device thereof
By using a multi-branch convolution structure and merging convolution units in the neural network model, the balance problem between branch diversity and expressive ability is solved, and the model performance is improved, such as improving accuracy in image classification and target detection tasks. .
Patent Information
- Application Number
- CN202210100259.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-27
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-01-27
AI Technical Summary
Existing neural network models have difficulty balancing the diversity and expressiveness of branches in the convolutional layer, resulting in limited performance improvement.
By using a multi-branch convolution structure in the training phase, where the second convolution units of different branches have different parameters, only the parameters of the first convolution unit are updated and merged into a single convolution unit in the testing phase to maintain the expression of the branches Ability and boost trait diversity.
Improved the performance of the neural network model, such as improving the accuracy in the ImageNet image classification task and improving the average accuracy in the target detection task of the COCO dataset.
Smart Images

Figure CN116562338B
Abstract
Description
Technical Field
[0001] The present disclosure relates to but is not limited to the field of machine learning, and more specifically, to a multi-branch convolution structure, a neural network model, and a determination method and device thereof. Background Art
[0002] Deep learning can automatically learn useful features, breaking away from the reliance on feature engineering, and has achieved results that surpass other algorithms in tasks such as images and speech. This success is largely due to the emergence of new neural networks, such as the convolutional neural network (CNN) model, such as the residual (ResNet) network model, the Inception network model, the DenseNet network model, and so on. The convolution layer is the most commonly used operator in the convolutional neural network model. However, the performance of the current model still has room for improvement. Summary of the invention
[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0004] An embodiment of the present disclosure provides a method for determining a neural network model, comprising:
[0005] Acquire a first neural network model used in a training phase, wherein the first neural network model includes a multi-branch convolution structure, wherein the multiple branches of the convolution structure each include a first convolution unit and a second convolution unit connected to each other, and at least some parameters of the second convolution units in different branches are different;
[0006] During the training of the first neural network model, the parameters of the first convolution unit are updated, and the parameters of the second convolution unit remain unchanged;
[0007] After the training is completed, the convolution structure is merged into a single convolution unit based on the first convolution unit in the convolution structure to obtain a second neural network model used in the inference stage.
[0008] An embodiment of the present disclosure further provides a neural network model determination device, comprising a processor and a memory storing a computer program, wherein when the processor executes the computer program, it can implement the neural network model determination method as described in any embodiment of the present disclosure.
[0009] The neural network model determination method and device of the above-mentioned embodiments of the present disclosure can maintain the expressive power of the branches, thereby improving the performance of the neural network model.
[0010] An embodiment of the present disclosure also provides a multi-branch convolution structure, which includes multiple branches. The multiple branches of the convolution structure each include a first convolution unit and a second convolution unit connected to each other, and at least some parameters of the second convolution units in different branches are different.
[0011] An embodiment of the present disclosure further provides a neural network model for training, comprising a plurality of convolution structures, some or all of which adopt the multi-branch convolution structure as described in any embodiment of the present disclosure.
[0012] The neural network model of the above-mentioned embodiment of the present disclosure can be used for training to improve the diversity of features learned between branches while maintaining the expressiveness of the branches.
[0013] An embodiment of the present disclosure further provides a computer program product, including a computer program, which can be stored on a non-volatile computer-readable storage medium. When the computer program is executed by a processor, it can implement the neural network model determination method as described in any embodiment of the present disclosure.
[0014] An embodiment of the present disclosure further provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it can implement the neural network model determination method as described in any embodiment of the present disclosure.
[0015] Other aspects will be apparent upon reading and understanding the drawings and detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are used to provide an understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solutions of the present disclosure and do not constitute a limitation to the technical solutions of the present disclosure.
[0017] Figure 1 It is a schematic diagram of a multi-branch convolutional structure;
[0018] Figure 2 is a flow chart of a method for determining a neural network model according to an embodiment of the present disclosure;
[0019] Figure 3 is a schematic diagram of a multi-branch convolution structure according to an embodiment of the present disclosure;
[0020] Figure 4A is a schematic diagram of a network structure including a multi-branch convolution structure and a ReLU operator according to an embodiment of the present disclosure;
[0021] Figure 4B Yes Figure 4A Schematic diagram of the network structure after the multi-branch convolutional structure is merged into a single convolutional unit;
[0022] Figure 5A is a schematic diagram of a local network structure of a ResNet network model of an embodiment of the present disclosure, including a multi-branch convolutional structure of an embodiment of the present disclosure;
[0023] Figure 5B Yes Figure 5A Schematic diagram of the local network structure obtained by merging the multi-branch convolutional structure into a single convolutional unit;
[0024] Figure 6 It is a schematic diagram of a neural network structure determination device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] The present disclosure describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present disclosure.
[0026] In the description of the present disclosure, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment described as "exemplary" or "for example" in the present disclosure should not be interpreted as being more preferred or advantageous than other embodiments. "And / or" in this article is a description of the association relationship of associated objects, indicating that there may be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. "Multiple" refers to two or more than two. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present disclosure, the words "first", "second" and the like are used to distinguish between the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not limit them to be necessarily different.
[0027] When describing representative exemplary embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps in the specific order described. As will be appreciated by those of ordinary skill in the art, other orders of steps are also possible. Therefore, the specific order of the steps set forth in the specification should not be interpreted as a limitation on the claims. In addition, the claims for the method and / or process should not be limited to the steps that are performed in the order written, and those skilled in the art can easily understand that these orders can be changed and still remain within the spirit and scope of the disclosed embodiments.
[0028] In order to maintain the diversity of branches in multi-branch convolution and maintain the expressiveness of its branches, an embodiment of the present disclosure provides a neural network model determination method, such as Figure 2 As shown, the following steps are included:
[0029] Step 110, obtaining a first neural network model used in the training phase;
[0030] The first neural network model includes a multi-branch convolution structure, and the multiple branches of the convolution structure each include a first convolution unit and a second convolution unit connected to each other, and at least some parameters of the second convolution units in different branches are different.
[0031] The first neural network model used in the training phase can be artificially created or obtained through a neural network structure search method, or part of the structure can be artificially created and the other part can be obtained through a neural network structure search method.
[0032] Step 120, during the training of the first neural network model, the parameters of the first convolution unit are updated, and the parameters of the second convolution unit remain unchanged;
[0033] Step 130: After training, the convolution structure is merged into a single convolution unit based on the first convolution unit in the convolution structure to obtain a second neural network model used in the testing phase.
[0034] The multi-branch convolution of this embodiment expands a single convolution into a multi-branch convolution in the training phase, and merges the multi-branch convolution in the testing phase. By merging a large number of microstructures into different convolution structures while maintaining the original macrostructure, the performance of the model is improved without changing the original model structure.
[0035] Figure 1The figure shows another multi-branch convolution structure, which includes four branches, wherein the first branch includes a 1×1Conv operator and a BN operator connected in sequence; the second branch includes a 1×1Conv operator, a BN operator, a K×K Conv operator, and a BN operator connected in sequence; the third branch includes a 1×1Conv operator, a BN operator, an AVG operator, and a BN operator connected in sequence; and the fourth branch includes a K×K Conv operator and a BN operator. Among them, K≥2, "Conv" represents convolution, BN represents batch normalization, and "AVG" represents average pooling. Other operators can also be used on the multi-branch convolution, for example, a 1×K Conv operator, a K×1Conv operator, and so on. The input of each branch is the same, which is the input of the convolution structure. The output of all branches is added together to obtain the output of the convolution structure. In order to increase the diversity of features learned between branches, this multi-branch convolutional structure uses different types of operators in different branches, such as the AVG operator. However, research has found that the use of different types of operators also reduces the expressive power of the neural network model, and in some cases will cause the performance of the neural network model to decay.
[0036] The neural network model determination method of the above-mentioned embodiment of the present disclosure modifies the convolution structure in the training model, and adds a second convolution unit for increasing branch diversity before the first convolution unit in the branch, and the parameters of these second convolution units are at least partially different. During training, only the parameters in the first convolution unit, such as weight parameters and / or bias parameters, are updated. After training, multiple branches are merged based on the first convolution unit to obtain a model used in subsequent stages (such as testing and deployment stages). The addition of a second convolution unit with different parameters can enhance the diversity of features learned between branches. At the same time, the multi-branch convolution structure does not add other types of operators, so the expressive power of the branches can be maintained, thereby improving the performance of the neural network model.
[0037] In an exemplary embodiment of the present disclosure, the second convolution unit in the branch is set upstream, and its output is used as the input of the first convolution unit. Figure 3 In the multi-branch convolution structure shown in the figure, the first group of K×KConv operators and BN operators in each branch constitute the second convolution unit (represented as K×K Conv-BN in the figure), and the second group of K×K Conv operators and BN operators in each branch constitute the first convolution unit. That is to say, in this embodiment, the input of the second convolution unit in multiple branches is the input of the convolution structure, and the output of the first convolution unit in multiple branches is added to obtain the output of the convolution structure.
[0038] In an exemplary embodiment of the present disclosure, see Figure 3 In the multi-branch convolution structure shown, the first convolution unit and the second convolution unit each include a K×K Conv operator and a BN operator. However, in other embodiments, one of the convolution units may include a K×K Conv operator and a BN operator, while the other may include a K×K convolution operator, etc.; wherein K≥2, for example, K=3 or 4 or 5, and K×K represents the convolution kernel size of the convolution operator.
[0039] In one example of this embodiment, the weight parameter and / or bias parameter of the K×K convolution operator in the second convolution unit is randomly generated. In another example of this embodiment, the weight parameter and / or bias parameter of the K×K convolution operator in the second convolution unit can also be generated using different parameter initialization methods.
[0040] The parameters in the neural network are optimized based on the gradient descent method. Through step-by-step iteration, the minimum loss function and the optimal model weight are obtained. Before network training, an initial value is assigned to the weight parameter and / or bias parameter. For deep learning, the appropriate initial value of the parameter will affect the convergence of the model. Different parameter initialization methods in this embodiment can be selected from the following initialization methods:
[0041] Pre-training initialization means first pre-training on a large-scale dataset to get a good parameter; then use the parameter as the initialization parameter of the model on the new task (fine-tuning). Pre-training initialization can improve the generalization ability of the model and accelerate training.
[0042] All zero initialization, that is, initializing the weights to 0.
[0043] Random initialization: If the initialization value is too large, saturation will occur, which will lead to gradient diffusion on some activation functions. If the initial value is too small, it will also lead to gradient diffusion. In order to obtain a suitable initialization value, you can choose a suitable activation function and train under the BN constraint.
[0044] Xavier initialization is divided into Xavier uniform distribution initialization and Xavier Gaussian distribution initialization.
[0045] He initialization, based on Xavier initialization, assumes that half of the neurons in each layer of the network are turned off, so the variance of its distribution will also become smaller. It has been verified that the best effect is achieved when the initialization value is reduced by half, so He initialization can be considered as the result of Xavier initialization / 2. The influence of ReLU on the output data distribution is taken into account, so that the variance of input and output data is consistent.
[0046] Since the convolution operation is homogeneous and additive, multi-branch convolution structures can be merged. Figure 1 Taking the multi-branch convolution structure shown in FIG. 1 as an example, the 1×1Conv operator and BN operator in the multi-branch convolution structure can be losslessly converted to one Conv operator, the K×K Conv operator and BN operator can also be losslessly converted to one Conv operator, and the AVG operator can also be losslessly converted to one Conv operator. In addition, two parallel K×K Conv operators can also be converted to one K×KConv operator. Through these conversions, Figure 1 The multi-branch convolutional structure shown is merged into a single Conv operator, and this merger is lossless.
[0047] In an exemplary embodiment of the present disclosure, the first convolution unit includes a K×K convolution operator and a BN operator, and multiple branches of a convolution structure can be merged in the following manner: remove the second convolution units in the multiple branches; merge the K×KConv operators and BN operators of the first convolution units in the multiple branches respectively to obtain multiple parallel intermediate convolution operators; and merge the multiple parallel intermediate convolution operators into a single convolution operator to obtain a single convolution unit of the present embodiment. In the present embodiment, the intermediate convolution operator is still a K×K Conv operator, and the method of converting two parallel K×K Conv operators into a K×K Conv operator can be applied multiple times to merge more than two intermediate convolution operators into one K×K Conv operator. These mergers are all lossless. The single convolution unit obtained after the merger in the present embodiment includes a K×K Conv operator, see Figure 4B .
[0048] In another exemplary embodiment of the present disclosure, the first convolution unit includes a K×K convolution operator and a BN operator, and multiple branches of a convolution structure can be merged in another way: the second convolution units in the multiple branches of the convolution structure are removed; the K×K Conv operator and the BN operator of the first convolution unit in the M-1 branches of the convolution structure are merged respectively to obtain M-1 parallel intermediate convolution operators; the M-1 parallel intermediate convolution operators and the K×K Conv operator in an unmerged branch are merged into a single convolution operator, and the single convolution operator and the BN operator in an unmerged branch constitute a single convolution unit of this embodiment. The single convolution unit merged into the convolution structure in this embodiment includes a K×K Conv operator and a BN operator, see Figure 5B The above M is the number of branches of the convolution structure, for example, M = 2, 3 or 4.
[0049] In this embodiment, a main branch is first specified during merging, and the K×K Conv operator and BN operator of the main branch are not merged, while the K×K Conv operator and BN operator of other branches are merged, and multiple intermediate Conv operators obtained by merging other branches are merged with the K×K Conv operator of the main branch while the BN operator of the main branch is retained, thereby obtaining a merged structure including the K×K Conv operator and the BN operator. Of course, the merged structure of the K×K Conv operator and the BN operator obtained by this method can also be further merged into one K×K Conv operator.
[0050] In an exemplary embodiment of the present disclosure, the first neural network model and the second neural network model are convolutional neural network models, such as ResNet network model, Inception network model or DenseNet network model. However, the present disclosure is not limited to this. For other types of neural network models, as long as they include convolutional layers, a multi-branch network structure can be constructed in the manner of the embodiments of the present disclosure, and trained and merged. It should be noted that when a neural network model includes multiple convolutional structures, it is not required that all convolutional structures must adopt the multi-branch convolutional structure of the embodiments of the present disclosure (see Figure 3 ), a part of the multi-branch convolution structure of the embodiment of the present disclosure may be adopted, and the other convolution structures may be Figure 1 The multi-branch convolution structure shown, or other types of multi-branch convolution structures, may also be a single-branch convolution structure, such as sequentially connecting a K×K Conv operator and a BN operator.
[0051] In an exemplary embodiment of the present disclosure, the number N of branches of the multiple convolutional structures included in the network model can be the same or different. Generally speaking, 2≤N≤4 is used to balance the complexity of the model, the training time, and the performance improvement of the model. However, the present disclosure is not limited to this. For example, N can also be equal to 5, equal to 6, or other larger values.
[0052] When the tasks to be performed by the neural network model are different, the training methods are also different. For example, in supervised machine learning, the collected sample training set can be input into the neural network model, the output of the neural network model can be compared with the target data, the training loss can be calculated by the loss function, and then the parameters in the neural network model, such as the weight parameters and bias parameters of the Conv operator, can be optimized by algorithms such as gradient descent according to the training loss. The goal of the optimization is to reduce the loss so that the output of the neural network model converges with the target data. The parameters of some operators can also be frozen during training. For example, in this embodiment, the parameters of the added second convolution unit are frozen and not updated during training to reduce the training time. Moreover, the second convolution unit is not used during the merging, and the update of the parameters of the second convolution unit cannot be used in the subsequent test phase and the model of some phases. However, the existence of the second convolution unit, because its weight parameters and bias parameters can be generated randomly or in different ways, different branches are different, and thus the diversity of each branch of the convolution structure can be increased to train a better model.
[0053] In an exemplary embodiment of the present disclosure, the second neural network model can be tested, or verified. If it passes, the second neural network can be determined as the neural network model used in the deployment phase. The test or verification here can be performed using a test sample set. Taking the use of the second neural network model for target recognition as an example, whether the test passes can be determined based on the recognition accuracy of the second neural network model. If the recognition accuracy is greater than a preset threshold, it is considered that the accuracy requirement has been met and the test passes, otherwise the test fails. When the test fails, the first neural network model can continue to be trained using the training sample set, or different initialization parameters can be used to modify the local network structure and train and test again. Deploying the second neural network here means that the second neural network has been trained and can be used to perform actual tasks, such as image classification, purpose recognition, and so on.
[0054] An embodiment of the present disclosure also provides a neural network model determination device, such as Figure 6 As shown, the device includes a processor 60 and a memory 50, the memory 50 stores a computer program, and when the processor 60 executes the computer program, it can implement a neural network model determination method as in any embodiment of the present disclosure.
[0055] The processor 60 in this embodiment can be a general-purpose processor, for example, a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The various methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor, or the processor can also be any conventional processor, etc. The neural network model determination device of the above-mentioned embodiment of the present disclosure uses a first convolution unit and a second convolution unit connected to each other as a branch structure, and the parameters of the second convolution unit are at least partially different. During the training process, only the parameters of the first convolution unit are updated, which can improve the diversity of features learned between branches, while maintaining the branch expression ability, and improving the performance of the neural network model.
[0056] The memory 50 in this embodiment may include RAM, ROM, EEPROM, CD-ROM, or other optical disk storage devices, magnetic disk storage devices, or other magnetic storage devices, flash memory, or any other medium that can store the required program code in the form of instructions or data structures and can be accessed by the computer.
[0057] An embodiment of the present disclosure also provides a multi-branch convolution structure, which includes multiple branches. The multiple branches of the convolution structure each include a first convolution unit and a second convolution unit connected to each other, and at least some parameters of the second convolution units in different branches are different.
[0058] In an exemplary embodiment of the present disclosure, the input of the second convolution unit in the multiple branches is the input of the convolution structure, and the output of the first convolution unit in the multiple branches is added to obtain the output of the convolution structure.
[0059] Figure 3The figure shows an example of the above-mentioned convolution structure. As shown in the figure, the convolution structure includes 4 branches, and can also be 3 branches, 2 branches, 5 branches or more branches. The first group of K×K Conv operators and BN operators in each branch constitute the second convolution unit. Although the K×K Conv operator and BN operator are drawn in a box in the figure, it is only for the convenience of distinction when expressing, and still represents the K×K Conv operator and BN operator connected in sequence. The weight parameters and / or bias parameters of the K×K Conv operator in the second convolution unit are randomly generated, or generated by different parameter initialization methods, K≥2. The second group of K×K Conv operators and BN operators in each branch constitute the first convolution unit. The "Input" in the figure is represented by a box, but it does not mean that an operator is to be set here. The representation of the input signal to the second convolution unit can also be the same as Figure 1 As shown in the figure, the outputs of the first convolutional units of the four branches are added together to obtain the output of the convolutional structure, namely Output.
[0060] This embodiment also provides a neural network model for training (corresponding to the first neural network model in the neural network model determination method), including multiple convolution structures, wherein some or all of the convolution structures adopt the multi-branch convolution structure described in any embodiment of the present disclosure.
[0061] When actually constructing a neural network model for training, the first convolution unit in each convolution structure can be constructed first, and then a second convolution unit can be added between the input of each branch of the convolution structure and the first convolution unit. The number of channels, convolution kernel size, step size, padding, etc. of the K×K Conv operator in the second convolution unit can be the same or partially the same as the K×K Conv operator in the first convolution unit, but the present disclosure is not limited to this. The weight parameters and / or bias parameters of the K×K Conv operator in the second convolution unit can be generated randomly, or generated by different initialization parameter methods, so the added K×K Conv operator and BN operator can also be called adding a random convolution layer and BN layer. By setting this random convolution layer, the diversity of branches in multi-branch convolution can be increased. At the same time, no other types of operators are introduced, so the expression ability of the model will not be reduced, causing the attenuation of model performance. Since the parameters of the two added layers are not updated during training, the parameters of other layers are updated normally during training. Therefore, the complexity and training time during training will not be increased too much.
[0062] In an exemplary embodiment of the present disclosure, the output of the multi-branch convolution structure can be connected to a nonlinear operator, such as Figure 4AAs shown in the figure, the ReLU operator is taken as an example. The ReLU operator, also known as the Rectified Linear Units (ReLU) operator, is a commonly used activation function in neural networks. The ReLU operator performs the following operation on the input element sequence element by element: for each element x, if x is greater than 0, then output x; if x is less than or equal to 0, then output 0. However, the present disclosure is not limited to this, and the nonlinear operator here can also be other activation functions such as the Sigmoid function, or other types of nonlinear operators. Figure 4A The network structure obtained after merging the convolutional networks shown in Figure 4B As shown in the figure, the multi-branch convolution structure is merged into a K×K Conv operator, and the output of the K×KConv operator is connected to a ReLU operator. Figure 4B In the example shown, the multi-branch convolution structure is merged into a K×K Conv operator.
[0063] exist Figure 5A The figure shows a local network structure of a ResNet network model for training, which includes 4 multi-branch convolution structures, each of which includes 4 branches, corresponding to Figure 3 The specific structure in the network. Each convolution structure is connected to a nonlinear operator (taking the ReLU function as an example). Among them, the input of the first convolution structure 10 is added to the output of the second convolution structure 20, and then used as the input of the third convolution structure after passing through the ReLU function, and the input of the third convolution structure 30 is added to the output of the fourth convolution structure 40. This is the structural feature of the ResNet network. After training the ResNet network model for training, each multi-branch convolution structure is merged into a convolution unit. The merged convolution units include a K×K Conv operator and a BN operator, such as Figure 5B As shown, after merging, a ResNet network model for testing is obtained. After the test passes, the ResNet network model for testing can perform actual tasks such as image classification, target recognition, etc. in the deployment stage. In another embodiment, the BN operator can also be set between the multi-branch convolution structure and the nonlinear operator in the ResNet network model for training. In this way, when merging, each multi-branch convolution structure can be merged into a K×K Conv operator, and the BN operator set after the convolution structure is still retained, and it can also be obtained. Figure 5B The multi-branch convolution structure and the method for determining the neural network model of the disclosed embodiment can also be used for other forms of neural network models, such as the Inception network model, the DenseNet network model, etc. No further details will be given here.
[0064] The neural network model of the embodiment of the present disclosure has a multi-branch convolution structure proposed in the embodiment of the present disclosure, so that the neural network model of the embodiment of the present disclosure can be used for training, and can maintain the expressive power of its branches without losing the diversity of branches in the multi-branch convolution.
[0065] In the ImageNet image classification task, using the ResNet50 model as a reference (Baseline), the best accuracy (Top1 accuracy) of the ResNet50 model is 76.40%, while the Top1 accuracy of the ResNet model trained using the neural network model determination method disclosed in the present invention can reach 77.73%.
[0066] In the object detection task (Object Detection) based on the COCO dataset, taking the ResNet-18 version of the object detection network CenterNet model as the reference (Baseline), the average accuracy (AP) of the CenterNet model is 29.83, while the AP of the CenterNet model trained using the neural network model determination method disclosed in the present invention is 31.64.
[0067] In the image classification task based on the CityScapes dataset, taking the ResNet-18 version of the PSPNet model as a reference, the Top1 accuracy of the PSPNet model is 70.18%, while the Top1 accuracy of the PSPNet model trained using the disclosed neural network model determination method can reach 72.24%.
[0068] The above-mentioned embodiment of the present disclosure improves the diversity of branches in a multi-branch convolution structure through a random convolution layer, and this method does not need to change the operator (Kx K conv) for feature learning within the branch, thereby improving the model performance.
[0069] An embodiment of the present disclosure further provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the neural network model determination method provided by the above-mentioned method embodiments, the method including: obtaining a first neural network model used in a training phase, wherein the first neural network model includes a multi-branch convolution structure, and the multiple branches of the convolution structure each include a first convolution unit and a second convolution unit connected to each other, and at least some parameters of the second convolution units in different branches are different; during the training of the first neural network model, the parameters of the first convolution unit are updated, and the parameters of the second convolution unit remain unchanged; after training, based on the first convolution unit in the convolution structure, the convolution structure is merged into a single convolution unit to obtain a second neural network model used in a testing phase.
[0070] In any one or more of the above exemplary embodiments, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on a computer-readable medium or transmitted via a computer-readable medium as one or more instructions or codes, and executed by a hardware-based processing unit. A computer-readable medium may include a computer-readable storage medium corresponding to a tangible medium such as a data storage medium, or a communication medium that facilitates a computer program, such as any medium transmitted from one place to another according to a communication protocol. In this way, a computer-readable medium may generally correspond to a non-temporary tangible computer-readable storage medium or a communication medium such as a signal or carrier wave. A data storage medium may be any available medium that can be accessed by one or more computers or one or more processors to retrieve instructions, codes, and / or data structures for implementing the technology described in the present disclosure. A computer program product may include a computer-readable medium.
[0071] By way of example and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage, flash memory, or any other medium that can be used to store the desired program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection may also be referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio and microwave are included in the definition of medium. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transient (transient) media, but are directed to non-transient tangible storage media. As used herein, disks and optical disks include compact disks (CDs), laser disks, optical disks, digital versatile disks (DVDs), floppy disks, or Blu-ray disks, etc., where disks typically reproduce data magnetically, while optical disks use lasers to reproduce data optically. Combinations of the above should also be included within the scope of computer-readable media.
[0072] Instructions may be executed by one or more processors, such as one or more digital signal processors (DSPs), general-purpose microprocessors, application-specific integrated circuits (ASICs), field-programmable logic arrays (FPGAs), or other equivalent integrated or discrete logic circuits. Thus, the term "processor" as used herein may refer to any of the above structures or any other structures suitable for implementing the techniques described herein. Additionally, in some aspects, the functionality described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or incorporated in a combined codec. Also, the techniques may be fully implemented in one or more circuits or logic elements.
[0073] The technical solutions of the embodiments of the present disclosure can be implemented in a wide variety of devices or equipment, including wireless mobile phones, integrated circuits (ICs) or a group of ICs (e.g., chipsets). Various components, modules or units are described in the embodiments of the present disclosure to emphasize the functional aspects of the devices configured to perform the described techniques, but they do not necessarily need to be implemented by different hardware units. Instead, as described above, the various units can be combined in a codec hardware unit or provided by a collection of interoperable hardware units (including one or more processors as described above) in combination with suitable software and / or firmware.
Claims
1. A method for determining a neural network model, comprising: Acquire a first neural network model used in a training phase, wherein the first neural network model includes a multi-branch convolution structure, and each of the multiple branches of the convolution structure includes a first convolution unit and a second convolution unit connected to each other; In the process of training the first neural network model based on the collected training image sample set, the parameters of the first convolution unit are updated, and the parameters of the second convolution unit remain unchanged; wherein the training image sample set includes samples for image classification or target detection, and at least part of the parameters of the second convolution units in different branches are different, so as to improve the diversity of features learned from the training image samples between the branches; After training, the convolution structure is merged into a single convolution unit based on the first convolution unit in the convolution structure to obtain a second neural network model used in the testing phase, wherein the second neural network is tested based on a test image sample set, and the test image sample set includes a sample set for image classification or target detection; Testing the second neural network model, and after the test passes, determining the second neural network as the neural network model used in the deployment phase; The convolution structure is combined into a single convolution unit including a convolution operator, or including a Convolution operator and a BN operator; Wherein, the first neural network model includes a plurality of convolution structures, wherein some or all of the convolution structures adopt the multi-branch convolution structure; the multi-branch convolution structure is obtained by expanding a single convolution unit during the training stage; Among them, the input of the second convolution unit in the multiple branches is the input of the convolution structure, and the output of the first convolution unit in the multiple branches is added to obtain the output of the convolution structure.
2. The method according to claim 1, characterized in that: The first convolution unit includes a convolution operator, or including a Convolution operator and a batch normalization BN operator; The second convolution unit includes a convolution operator, or including a Convolution operator and a BN operator, where .
3. The method according to claim 2, characterized in that: The second convolution unit The weight parameters and / or bias parameters of the convolution operator are randomly generated; or, the weight parameters and / or bias parameters of the KÏK convolution operator in the second convolution unit are generated by using different parameter initialization methods.
4. The method according to claim 1, characterized in that: The first convolution unit includes a A convolution operator and a BN operator, wherein the convolution structure is merged into a single convolution unit based on the first convolution unit in the convolution structure, comprising: Removing all second convolution units in multiple branches of the convolution structure; The first convolution unit in the multiple branches of the convolution structure The convolution operator and the BN operator are merged separately to obtain multiple parallel intermediate convolution operators; The multiple parallel intermediate convolution operators are merged into a single convolution operator, and the single convolution operator constitutes the single convolution unit.
5. The method according to claim 1, characterized in that: The first convolution unit includes a A convolution operator and a BN operator, wherein the convolution structure is merged into a single convolution unit based on the first convolution unit in the convolution structure, comprising: Removing all second convolution units in multiple branches of the convolution structure; The first convolution unit in the M-1 branches of the convolution structure The convolution operator and the BN operator are respectively combined to obtain M-1 parallel intermediate convolution operators, where M is the number of branches in the convolution structure; The M-1 parallel intermediate convolution operators and the unmerged branch of the convolution structure are combined. The convolution operators are merged into a single convolution operator, and the single convolution operator and the BN operator in a branch of the convolution structure that is not merged constitute the single convolution unit.
6. The method according to claim 1, characterized in that: The first neural network model includes a plurality of the convolution structures, the number of branches N of the plurality of the convolution structures is the same or different, the number of channels, the convolution kernel size, the step size and the padding of the first convolution unit and the second convolution unit are at least partially the same, wherein, .
7. A neural network model determination device, characterized in that: It comprises a processor and a memory storing a computer program, wherein when the processor executes the computer program, it can implement the neural network model determination method as described in any one of claims 1 to 6.
8. A computer program product, comprising a computer program, the computer program being storable on a non-transitory computer-readable storage medium, characterized in that: When the computer program is executed by a processor, it can implement the neural network model determination method as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it can implement the neural network model determination method as described in any one of claims 1 to 6.
