A convolutional neural network structure design method for image classification
The TCRNet network, designed with interleaved coupled residual connections, solves the problem that convolutional neural networks fail to fully utilize information in image classification, achieving better generalization performance and classification accuracy.
Patent Information
- Application Number
- CN202310128358.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-13
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2043-02-13
AI Technical Summary
Existing convolutional neural networks fail to fully utilize the information between convolutional layers in image classification tasks, leading to network performance degradation and overfitting problems.
A convolutional neural network is designed using an interleaved coupling residual connection approach. By constructing the basic Unit and selecting the connection method and depth, the TCRNet network is built, including dual-path residual connections and overall dual-channel residual connections, which utilizes the information of the convolutional layers and prevents performance degradation.
This improved the network's generalization performance, reduced overfitting, and enhanced the accuracy and stability of image classification.
Smart Images

Figure CN116151332B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of neural network architecture design, and more particularly to a method for designing a convolutional neural network architecture for image classification. Background Technology
[0002] Image classification is a core task in the field of computer vision and the foundation for many other research areas. The quality of image classification directly affects other tasks in computer vision. Therefore, image classification has been extensively studied as a fundamental task, and one of the mainstream methods is deep convolutional neural networks.
[0003] In recent years, with the continuous development of deep learning, a large number of models based on convolutional neural networks have emerged for image classification tasks. Current research focuses on designing lightweight networks for deployment on less powerful platforms or to improve computational speed, paying more attention to the construction of convolutions and convolutional blocks, but neglecting the design of the network structure itself. ResNet, which pioneered network structure design and proposed residual structures, achieved great success. Most subsequent networks have referenced ResNet's design, incorporating residual structures into their own structures. This can improve network performance and deepen the network structure without increasing parameters. However, many networks have simply adopted this strategy without in-depth research. Although ResNet innovatively proposed and used the idea of residuals, it failed to effectively utilize the information between convolutional layers in practical applications. Summary of the Invention
[0004] To address the technical problem of poor image classification capabilities due to insufficient research in existing network architecture design, this invention proposes a convolutional neural network architecture design method for image classification, comprising the following steps:
[0005] S1, the basic unit for constructing a convolutional neural network;
[0006] S2. Select the connection method of the convolutional neural network and construct the corresponding Block;
[0007] S3. Select the depth of the convolutional neural network according to the corresponding block;
[0008] S4. Add the input and output layers of the convolutional neural network to obtain the completed TCRNet network.
[0009] The beneficial effects provided by this invention are: compared with traditional network structures, it has better generalization performance and is less prone to overfitting. Attached Figure Description
[0010] Figure 1This refers to the ResNet network connection method;
[0011] Figure 2 This is a basic structural diagram of the TCRNet network proposed in this invention;
[0012] Figure 3 This is a schematic diagram of the method flow of the present invention;
[0013] Figure 4 This is a schematic diagram of the basic unit structure of the present invention;
[0014] Figure 5 This is the Block structure diagram under the first connection method;
[0015] Figure 6 This is a schematic diagram of the Block series connection method;
[0016] Figure 7 This is the second form of the TCRNet architecture diagram;
[0017] Figure 8 This is a comparison chart of experiments with different network structures. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0019] To clearly illustrate the inventive points of this invention, this invention first describes the traditional ResNet network connection method, and then further describes the network structure of this application.
[0020] Please refer to Figure 1 , Figure 1 This is the ResNet network connection method.
[0021] ResNet's Block architecture innovatively introduced a residual structure, which can essentially be seen as a feedforward mechanism. ResNet propagates information processed by each convolutional layer forward, skipping one convolutional layer at a time. This allows subsequent convolutional layers to combine information processed by previous layers, improving network stability. The core idea is that the number of layers in a convolutional neural network is directly related to its performance. Generally, deeper convolutional networks have stronger performance and higher image recognition accuracy. However, research has shown that blindly increasing the number of convolutional layers can lead to network degradation; that is, deeper networks may actually have lower performance compared to shallower convolutional networks. To address this issue, ResNet pioneered the concept of residuals, with a structure similar to the one described above. Figure 1 As shown,
[0022] When adding a convolutional layer degrades network performance, gradient descent can be used to learn the parameters of that convolutional layer to be 0. Here, f is the residual connection. When the parameters of a certain layer are 0, the residual connection is equivalent to short-circuiting the convolutional layer, ensuring that the performance of the deeper network is at least the same as that of the shallower network, thus preventing network performance degradation as the number of network layers increases.
[0023] Based on the above, this invention argues that although ResNet's approach effectively prevents network performance degradation, it doesn't fully utilize the true performance of residual connections or make better use of information from preceding convolutional layers. For details, please refer to... Figure 2 , Figure 2 This is a basic structural diagram of the TCRNet network proposed in this invention;
[0024] right Figure 2 The connection method can be analyzed as a combination of several special cases of ResNet:
[0025] When f3 = 0, the TCRNet Block degenerates into the ResNet Block, so ResNet can be regarded as a special form of TCRNet.
[0026] When f3≠0, and Unit1=0, the input of f3 is 0, so the output is also 0. In this case, f3 can be considered equivalent to 0.
[0027] When Unit4 = 0, this can be seen as meaning that no matter what value f3 outputs, it will not have any effect on Unit4. Therefore, f3 can also be considered equivalent to 0.
[0028] In these special cases, TCRNet can be regarded as ResNet. That is, in some of the special cases mentioned above, the original ResNet can be regarded as a special form of TCRNet.
[0029] The connection between ResNet and TCRNet networks is not a simple matter of direct addition, but rather requires consideration of different scenarios.
[0030] Generally speaking, when the number of channels and the width and height of the two convolutional layers connected by residuals are the same, it is a simple superposition.
[0031] When two convolutional layers have the same number of channels, but their width and height are halved, the connection needs to undergo a pooling transformation.
[0032] When two convolutional layers have the same length and width but different number of channels, the connection needs to use a 1×1 convolutional kernel to transform the preceding convolutional layer to have the same number of channels as the following convolutional layer.
[0033] When the number of channels and the width and height are not the same, the connection needs to perform two transformations. First, use a 1×1 convolution kernel to perform a convolution operation to convert the number of channels to the same number, and then use a pooling operation to reduce the width and height.
[0034] Please refer to Figure 3 , Figure 3 This is a schematic diagram of the method flow of the present invention.
[0035] Based on the above analysis, this application proposes a convolutional neural network structure design method for image classification, which specifically includes the following steps:
[0036] S1, the basic unit for constructing a convolutional neural network;
[0037] S2. Select the connection method of the convolutional neural network and construct the corresponding Block;
[0038] S3. Select the depth of the convolutional neural network according to the corresponding block;
[0039] S4. Add the input and output layers of the convolutional neural network to obtain the completed TCRNet network.
[0040] Step 1 constructs Unit structure units through convolutional layers, batch normalization, activation functions, and pooling operations;
[0041] Step 2 constructs Blocks by stacking Units, and bypass connections are required during the Block construction process;
[0042] Step 3: Construct the main structure of TCRNet by stacking blocks;
[0043] Step four involves adding an input layer and applying TCRNet to a real-world problem. This completes one form of TCRNet construction process.
[0044] In addition, this patent proposes two forms of network connection. The first form of TCRNet is a dual-path residual connection, but this dual-path residual connection only exists within each block. The other form of structure abandons the block design and performs dual-path residual design directly on the entire TCRNet network. The second form should be a more complete dual-path coupled residual design.
[0045] The following section provides a detailed explanation of the two forms of TCRNet and their specific implementation steps:
[0046] Step 1: Building the Unit of the TCRNet Convolutional Neural Network
[0047] This patent incorporates current mainstream design concepts and designs a Unit, each consisting of four parts: a convolutional layer, normalization, an activation function, and a pooling layer. The specific Unit structure is as follows: Figure 4 As shown, Figure 4 This is a schematic diagram of the basic unit structure of the present invention.
[0048] (1) Convolutional layer:
[0049] The convolutional layer can be selected according to the actual situation. This part can be a single convolutional layer or a stack of multiple convolutional layers. However, this patent suggests using a single convolutional layer because the network depth can be increased by stacking units to improve network performance.
[0050] (2) Standardization:
[0051] The standardization part uses batch normalization (BN). Batch normalization serves the same purpose as general data standardization: to change the distribution of data. The specific process is as follows:
[0052] First, use Formula 1 to calculate the average value μ of a batch of data. B Then, use Formula 2 to calculate the variance σ of a batch. B Then, the data is standardized using Formula 3. The standardized data is as follows: Finally, two hyperparameters γ and β are defined for... Further processing into y i Formula 4 when β=μ B When This is equivalent to x, which represents a series of operations performed on the data without standardization, preserving the possibility of it becoming the original data. Batch standardization is recommended to be performed after the convolutional layer and before the activation function.
[0053]
[0054]
[0055]
[0056]
[0057] (3) Activation function
[0058] For the activation function, this patent chose the Rectified Linear Unit (ReLU) function because ReLU is simple to calculate and can effectively avoid gradient vanishing and gradient exploding. The calculation method of ReLU function is shown in Equation 5:
[0059] f(x) = max(0,x) (5)
[0060] (4) Pooling layer
[0061] Finally, regarding the selection of the pooling layer, this patent uses max pooling because max pooling can effectively preserve texture features. In a Unit, Maxpool(Y,N) indicates that not every Unit has a pooling layer added. Whether to add a pooling layer depends on the actual situation. Y indicates adding, and N indicates not adding.
[0062] (5) Unit construction process:
[0063] x = Input
[0064] x1=Cov i (x)
[0065] x2 = BN(x1)
[0066] x3 = Relu(x2)
[0067] x4 = {Maxpool(x3), x3}
[0068] Output = x4
[0069] Input is the input, and a convolution operation is performed first. In the formula, Cov... i This means there may be more than one convolutional layer; then it goes through a batch normalization (BN) layer to pull the feature distribution of this layer back to a standard normal distribution, which can speed up convergence; after data normalization, the ReLU activation function is used, and finally, it is decided whether to use max pooling to compress the image, and the output of the unit is obtained. Here, both the input and output are high-dimensional tensors.
[0070] Step 2: Select Network Connection Structure
[0071] Based on the proposed new connection method, this patent designs two forms of TCRNet. The first form uses a block-based serial connection, where each block consists of four units connected using the interleaved coupling method proposed in this patent. The block structure diagram is as follows. Figure 5 As shown, Figure 5 This is the Block structure diagram under the first connection method;
[0072] x = Input
[0073] x1 = Unit1(x)
[0074] x2 = Unit2(x1) + f1(x)
[0075] x3 = Unit3(x2) + f2(x1)
[0076] x4 = Unit4(x3) + f3(x2)
[0077] Output = x4
[0078] The above is the corresponding Figure 5 The calculation of a block is constructed by interleaving two residuals, where f i This represents a transformation based on the difference between two convolutional layers connected by residuals; the "+" sign indicates that the transformed convolutional layer is added to the current convolutional layer, and both the input and output are high-dimensional tensors. When increasing network depth, multiple blocks can be sequentially connected. These concatenated blocks constitute the main body of the convolutional neural network designed in this patent. The concatenation method for these blocks is as follows: Figure 6 As shown, Figure 6 This is a schematic diagram of the Block series connection method.
[0079] x = Input
[0080] x1 = Block1(x)
[0081] x2 = Block2(x1) ...
[0083] x n =Block n (x n-1 )
[0084] Output = x n
[0085] The above is the corresponding Figure 6 The block connection process first defines the Input as x, and then passes x through 1 to N blocks to obtain the Output. i This represents the i-th block. The relationship between blocks is simply data transfer, and the input and output are both high-dimensional tensors.
[0086] In summary, in the Block cascading method, each Block consists of four Units connected in sequence, namely Unit1-Unit4;
[0087] The parameter f1 between Unit1 and Unit2 is used to perform corresponding transformations based on whether there are differences between the two convolutional layers connected by the residuals;
[0088] There is a parameter f2 between Unit3 and Unit4 that performs a corresponding transformation based on whether there are differences between the two convolutional layers connected by the residuals;
[0089] There is a parameter f3 between Unit2 and Unit3 that performs a corresponding transformation based on whether there are differences between the two convolutional layers connected by the residuals;
[0090] Different blocks are connected in a series manner, with Unit4 of the previous block connected to Unit1 of the next block.
[0091] In addition to the first form of TCRNet, this patent also designs a second form of TCRNet. The second form treats the entire network as a block, performing dual-channel residual connections on all units. This is a more complete form of the dual-channel coupled residual network. Figure 7 Here is the second form of the TCRNet architecture diagram:
[0092] The second form can be seen as a variation of the first. The first form has only 4 units per block, while the second form treats all units as a special case of a single block. Therefore, overall, the second form has a higher degree of coupling and can better utilize information processed by different convolutional layers, but it is also slightly more complex to implement. Based on the structure diagram of the second form of TCRNet, the corresponding computation flow can be written as follows:
[0093] x = Input
[0094] x1 = Unit1(x)
[0095] x2 = Unit2(x1) + x ...
[0097] x i =Unit i (x i-1 )+x i-2 ...
[0099] x n =Unit n (x n-1 )+x n-2
[0100] Output = xn
[0101] First, the input is considered as x. After the first Unit 1 operation, the result is x1. x2 is the result of adding x1 after Unit 2 and x, and so on. i It is x i-1 After Unit i The result and x i-2 The result of the superposition is that x is the final value. n It is x n-1 After Unit n The result and x n-2 The result of the summation, where the input and output are equal to x. n The inputs and outputs here are both high-dimensional tensors. The two forms of TCRNet each have their advantages and disadvantages. The first form is easier to implement. In the programming process, you only need to define the Block and then implement it through multiple calls. The second form is slightly more complicated to implement because it requires dual-channel residual design on all Units.
[0102] In summary, in dual-channel coupled residual connections, the entire network is treated as a single block, comprising N basic units.
[0103] Among them, Unit i With Unit i+1 There is a parameter f between them that performs a transformation based on whether there are differences between the two convolutional layers connected by the residuals. i , i = 1, 2, ... N-1.
[0104] Step 3: Select Network Depth
[0105] After selecting the network type, the network depth also needs to be determined. The network depth directly affects the network performance. For simple classification problems, a shallow network can be selected, while for complex problems such as high-resolution and multi-class classification problems, a deep network is required.
[0106] For the first form, without considering the input and output layers, the network depth is generally 4M layers, where M is the number of blocks. For simple classification tasks, N can be 4 or less.
[0107] For the second form, since all convolutional layers are treated as a single block, the depth of any number of layers can be selected.
[0108] Step 4: Design Input / Output Layers
[0109] The above three steps constitute the main body of the TCRNet designed in this patent. However, in order to achieve different classification tasks, separate input and output layers need to be designed. The input layer is responsible for processing the input images. First, it is necessary to ensure that the input images have a consistent resolution and are either grayscale or color images. Then, the input layer can be designed. The input layer is essentially a convolutional layer, which is responsible for transforming the image to the required number of channels.
[0110] The output layer is designed to further integrate the results processed by the convolutional neural network with the image classification task. It is typically implemented using a combination of 1x1 convolutional kernels and a fully connected network.
[0111] As an example, to verify the effectiveness of the method proposed in this patent, an experiment was conducted to compare the method with existing methods. The specific experiments designed for comparison are as follows:
[0112] This experiment selected the CIFAR-10 dataset, which is commonly used in the field of image classification. This dataset contains 10 categories and the image size is 3*32*32, where 3 refers to the presence of 3 color layers and 32*32 refers to the size of each image being 32 pixels wide and 32 pixels high. This dataset contains a total of 6000 images, of which 5000 are used for training and 1000 are used for testing. This dataset is widely used to test the image classification performance of different convolutional neural networks.
[0113] Network Design:
[0114] Based on the method proposed in this patent, a network specifically designed for the CIFAR-10 dataset was used in the experiment. In order to compare the effects of different networks, the dataset was placed on different networks for comparative experiments. Two forms of VGGNet, ResNet and the network of this patent were selected for comparison.
[0115] To ensure experimental rigor, the number of layers and parameters in the networks was kept consistent throughout the design process, with the only difference between the networks being their structural differences. ResNet can be viewed as a special form of TCRNet with some connections removed, while VGGNet can be seen as a special form of ResNet with connections removed. Therefore, the network structure was designed using a step-by-step degradation process from TCRNet to ResNet and then to VGGNet. The specific experimental results are shown in Table 1 below:
[0116] Table 1. Experimental results of different network structures at CIFAR-10.
[0117]
[0118] Please refer to Figure 8 , Figure 8 This is a comparison chart of experiments with different network structures.
[0119] Table 1 and Figure 8 In this context, TCRNet-1 represents the first form of the TCRNet network, and TCRNet-2 represents the second form. Experiments show that the dual-channel residual coupling strategy proposed in this patent improves performance compared to other classic convolutional neural networks on the same dataset. Table 1 and... Figure 7 The data consists of the results of training four different network structures 200 times on the CIFAR-10 dataset. Comparing the accuracy on the test set, it can be found that both forms of the TCRNet proposed in this patent have certain improvements compared to traditional network structures, and the more complete second form of TCRNet performs better.
[0120] Meanwhile, a comparison with the training set reveals that the two forms of TCRNet proposed in this patent still did not reach the best level after 200 training iterations, indicating that there is still room for improvement in the two forms of the TCRNet network.
[0121] Finally, the error between the training set and the test set was compared. Figure 8 It can be intuitively observed that the error between the training and test sets of the two forms of TCRNet networks is smaller, indicating that the network structure proposed in this patent has better generalization performance than traditional network structures and is less prone to overfitting, thus proving the effectiveness of this patent.
[0122] Finally, the key technical point of this patent is the use of a new connection method to build a convolutional neural network. This connection method can better utilize the information of the convolutional layers. It receives the information processed by the previous convolutional layers through an interleaved coupling residual connection method and passes the information processed by the current convolutional neural network to the next convolutional layer. This connection method improves the image classification ability of the convolutional neural network without increasing the amount of computation on the original basis.
[0123] In summary, the beneficial effects of this invention are: it has better generalization performance than traditional network structures and is less prone to overfitting.
[0124] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1.A method for designing a convolutional neural network structure for image classification, characterized in that: The method comprises the following steps: S1, constructing a Unit basic unit of a convolutional neural network; The Unit basic unit in step S1 is composed of four sequentially connected parts, which are a convolutional layer, a normalization layer, an activation function, and a pooling layer; S2, selecting a connection mode of the convolutional neural network and constructing a corresponding Block; The connection mode of the convolutional neural network in step S2 includes two kinds, which are Block series connection and double-channel coupled residual connection; In the Block series connection mode, each Block is composed of four sequentially connected Unit units, which are Unit1-Unit4; wherein Unit1 and Unit2 are provided with parameters for corresponding transformation according to whether there is a difference in the two convolution layers connected according to the residual connection f 1; The parameters of the two convolutional layers according to the residual connection between Unit 3 and Unit 4 are transformed according to whether there is a difference f 2; Unit 2 and Unit 3 are provided with parameters for corresponding transformation according to whether there is a difference in two convolution layers connected according to a residual connection f 3; Different Blocks adopt a series connection mode, and Unit4 of a previous Block is connected to Unit1 of a next Block; Parameter f1 connects the input of Unit1 and the output of Unit2, parameter f2 connects the input of Unit3 and the output of Unit4, and parameter f3 connects the input of Unit2 and the output of Unit3; In the double-channel coupled residual connection mode, the entire network is taken as a whole Block, which includes N Unit basic units; where Unit i is connected to Unit i+1 with parameters that are transformed according to whether there is a difference between the two convolutional layers connected by the residual connection f i , i =1,2,...N-1; Parameter f 1 connects the input of Unit 1 and the output of Unit 2; Parameter f 2 connects the input of Unit 2 and the output of Unit 3; correspondingly, up to Parameter f N-1 connects the output of Unit N-1 and Unit N; S3, selecting the depth of the convolutional neural network according to the corresponding Block; S4, adding an input layer and an output layer of the convolutional neural network to obtain a constructed TCRNet network. 2.The method of claim 1, wherein: The network depth in the Block series connection mode is 4M layers, and M is the number of Blocks. 3.The method of claim 2, wherein: The network depth in the double-channel coupled residual connection mode is N layers, and N is a positive integer greater than or equal to 4. 4.The method of claim 1, wherein: In step S4, the input layer adopts a convolutional layer, and the output layer adopts a convolutional kernel combined with a fully connected network.
Citation Information
Patent Citations
Adaptive image steganalysis method and system based on deep convolutional neural network
CN111507884A
Multi-channel neural network model training method, device and computer storage medium
CN111667045A
Multi-source domain adaptive method based on dynamic residual
CN113610219A