A network compression method for object detection on edge devices
Through optimized cropping, quantification and merging of the SkyNet network, the problem of low operating efficiency of the target detection network on edge devices is solved, and efficient detection on low-power devices is achieved with limited accuracy loss.
Patent Information
- Application Number
- CN202210038592.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-13
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-01-13
AI Technical Summary
The existing target detection network runs inefficiently on edge devices, consumes a lot of power, and is bulky, making it difficult to achieve real-time detection.
Through optimized cropping, quantification and merging of the SkyNet network, including removal of bypass branch structures, pruning, weight and feature map quantization, merging convolutional layers and normalization layers, using maximum quantization and saturation quantization, fixed-point quantization Bias and scaling coefficients, and activation processing are combined to reduce the amount of calculations and parameters.
It significantly reduces the network model size and calculation amount, is suitable for low-power edge devices, and the accuracy loss is within a reasonable range, achieving efficient target detection on low-cost edge devices.
Smart Images

Figure CN114372565B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of edge device target detection, and in particular, relates to a target detection network compression method for edge devices. Background Art
[0002] At present, the task of target detection is to find and mark the targets of interest in the image. They are widely used in scenarios such as autonomous driving, face detection and video surveillance. In recent years, target detection algorithms based on convolutional neural networks have achieved better performance than traditional methods. However, due to their huge amount of computation and parameters, most convolutional neural networks are deployed on general-purpose CPUs or general-purpose GPUs, which consume high power and are large in size. At the same time, it is difficult to achieve real-time detection on edge devices. There is an urgent need for a lightweight network or compressed network method to enable convolutional neural networks to perform reasoning directly on edge devices.
[0003] To solve this problem, prior art 1 proposed a lightweight network of Mobilenet, and prior art 2 proposed a lightweight network of Xception. Such networks use depthwise separable convolution (DSC) to replace standard convolution to reduce the amount of calculation and parameters, which improves the operating efficiency of the target detection network on edge devices to a certain extent. Based on the depthwise separable convolution, prior art 3 designs a hardware-friendly network Skynet for edge devices. Compared with MobileNet and Xception, Skynet has a more regular structure and a higher module reuse rate, but it still has high computing power requirements for the deployment platform.
[0004] In order to meet the needs of edge application scenarios, many neural network optimization technologies have been proposed, among which network compression is the main one, which can be roughly divided into network quantization and network pruning. The quantization part is to use low-precision numbers instead of high-precision numbers to participate in convolution calculations, and use the loss of some precision to avoid floating-point operations, or use clustering to replace part of the weights with a central value; pruning is to use network sparsity. Since the smaller the weight in the neural network, the smaller the impact on the final prediction result, the network calculation can be skipped by judging whether the network weight is zero.
[0005] Through the above analysis, the problems and defects of the existing technology are: the existing target detection network operates inefficiently on edge devices, has high requirements on equipment, consumes large power and has a large size, and cannot perform real-time detection of edge devices.
[0006] The difficulty of solving the above problems and defects is: convolutional neural networks can be used to achieve high-precision target detection tasks, but their large number of parameters and large amount of calculation make it difficult to implement on edge devices.
[0007] The significance of solving the above problems and defects is: through this set of compression methods, the number of network parameters and calculations can be reduced, and network deployment can be carried out on low-power and low-cost edge devices, with the accuracy loss within a reasonable range. Summary of the invention
[0008] In view of the problems existing in the prior art, the present invention provides a target detection network compression method for edge devices.
[0009] The present invention is implemented as follows: a target detection network compression method for edge devices, comprising:
[0010] The network structure of SkyNet is optimized, and the feature maps and weight parameters are quantified. The forward reasoning structure is reconstructed to merge some computational processing in the depthwise separable convolution.
[0011] Further, the target detection network compression method for edge devices includes the following steps:
[0012] Step 1: Optimize and trim the SkyNet network by removing the bypass branch structure in the SkyNet network and deleting some channels of the first layer output to obtain an optimized SkyNet network;
[0013] Step 2: Compress the retrained SkyNet network by quantizing the weights to 7 bits, quantizing the feature maps to 8 bits, fusing the bias parameters and scaling factors, and fixing them to 32 bits;
[0014] Step 3: Merge the SkyNet network structure by merging the convolutional layer and the normalization layer, and merging the activation processing, quantization, dequantization, and saturation truncation processing into FETCH processing.
[0015] Further, the optimization and pruning of the SkyNet network includes the following steps:
[0016] First, the Skynet branch is pruned off; each depth-wise separable convolution is used as the minimum unit layer, and the first layer output is pruned to 32 channels;
[0017] Secondly, pooling is added after the sixth layer, and the last layer is modified to a depthwise separable convolution, and the overall network structure is optimized to a straight cylindrical type.
[0018] Furthermore, the optimized SkyNet network includes:
[0019] 3-channel input layer CHL3, intermediate layers CHL32, CHL96, CHL192, CHL384, CHL512, CHL96 and regression layer CHL30;
[0020] The convolution between each layer of the optimized SkyNet network uses depth-separable convolution.
[0021] Further, the compression of the retrained SkyNet network comprises the following steps:
[0022] (1) Select the maximum value of the convolution kernel corresponding to each output channel as the maximum value of quantization, and use the maximum value quantization method to quantize the weight:
[0023]
[0024] q_w = w × scale_w;
[0025] Among them, w represents the vector of original weights corresponding to each channel; q_w represents the vector of quantized weights; scale_w represents the scaling factor as a scalar;
[0026] (2) The KL relative entropy is used to select the threshold and the saturation quantization is used to quantize the feature map: the threshold T is selected, the values of the original distribution within the range of ±T are proportionally scaled to -127 to +127, the parts outside the range are saturated, and the saturated value is directly used to represent the value of the part outside the range.
[0027] Further, the method of selecting a threshold by using KL relative entropy and quantizing the feature map by using saturation quantization includes:
[0028] 1) Use KL relative entropy to select the threshold:
[0029]
[0030]
[0031]
[0032] Where p represents the original distribution before quantization, q represents the distribution after quantization using the threshold T, H(p) represents the information entropy of the original distribution, H(p,q) represents the cross entropy between the original distribution and the quantized distribution, and DKL(p||q) represents the KL relative entropy.
[0033] 2) Calculate the scaling factor scale_fm:
[0034]
[0035] 3) Fixed-point bias and scaling coefficients, merge floating-point units that appear in forward reasoning, enlarge and round, and use 32-bit integers to save the final coefficients;
[0036] 4) Calculate the dequantized coefficients after merging and enlarging and rounding:
[0037] Bias_merge=int(bias×scale_next_fm×shift_coe);
[0038]
[0039] Among them, scale_w represents the weight quantization coefficient; scale_fm represents the quantization coefficient of the previous layer feature map; bias represents the bias; scale_next_fm represents the quantization coefficient of the next layer; Scale_merge represents the dequantization coefficient after merging and amplifying and rounding; Bias_merge represents the bias coefficient; shift_coe represents the magnification factor.
[0040] Further, the merging of the SkyNet network structure includes:
[0041] (1) Combine the convolution layer and the normalization layer to obtain the combined output y3:
[0042]
[0043] in:
[0044]
[0045]
[0046] Among them, y1 represents the convolution output; x represents the input; w represents the weight; b represents the bias; x, w and b are all vectors; μ represents the mean; σ represents the standard deviation; γ represents the scaling factor; β represents the scaling offset; ε = 1e-6; W represents the fused weight; B represents the fused bias;
[0047] (2) merging activation processing, quantization, dequantization and saturation truncation into FETCH processing; the FETCH processing converts 32 bits into 8 bits; and performing ReLu activation and saturation truncation.
[0048] Further, the ReLu activation and saturation truncation include:
[0049] The positive or negative of the input data is judged. If it is positive, saturation truncation is performed; if it is negative, the output value after activation is 0.
[0050] Another object of the present invention is to provide a target detection network compression system for edge devices, comprising:
[0051] The network pruning module is used to optimize and prune the SkyNet network by removing the bypass branch structure in the SkyNet network and deleting some channels of the first layer output to obtain the optimized SkyNet network;
[0052] The network compression module compresses the retrained SkyNet network by quantizing the weights to 7 bits, quantizing the feature maps to 8 bits, fusing the bias parameters and scaling factors, and fixing them to 32 bits;
[0053] The network structure merging module is used to merge the SkyNet network structure by merging the convolution layer and the normalization layer, and merging the activation processing, quantization, dequantization and saturation truncation processing into FETCH processing.
[0054] Combining all the above technical solutions, the advantages and positive effects of the present invention are as follows:
[0055] The present invention proposes a compression processing technology for target detection network from the perspective of algorithm optimization, taking SkyNet as an example, which reduces the difficulty of deploying the target detection network on edge devices. The present invention prunes the network to make it more suitable for edge devices. The present invention performs quantization processing to significantly reduce the size of the network model. The present invention performs merging processing to significantly reduce the amount of network calculations. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 It is a flow chart of a target detection network compression method for edge devices provided by an embodiment of the present invention.
[0057] Figure 2 This is a diagram of the optimized Skynet network structure provided by an embodiment of the present invention.
[0058] Figure 3 It is a schematic diagram of saturation truncation scaling quantization provided by an embodiment of the present invention.
[0059] Figure 4 It is a schematic diagram of merging convolutional layers and normalization layers provided in an embodiment of the present invention.
[0060] Figure 5 It is a schematic diagram of the FETCH operation provided by an embodiment of the present invention.
[0061] Figure 6 It is a schematic diagram of the calculation process of each layer before fixed-pointing provided by an embodiment of the present invention.
[0062] Figure 7 It is a schematic diagram of the calculation process of each layer after fixed-point provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0064] In view of the problems existing in the prior art, the present invention provides a target detection network compression method for edge devices, and the present invention is described in detail below with reference to the accompanying drawings.
[0065] The target detection network compression method for edge devices provided by an embodiment of the present invention includes:
[0066] The network structure of SkyNet is optimized, and the feature maps and weight parameters are quantified. The forward reasoning structure is reconstructed to merge some computational processing in the depthwise separable convolution.
[0067] like Figure 1 As shown, the target detection network compression method for edge devices provided by an embodiment of the present invention includes the following steps:
[0068] S101, optimizing and pruning the SkyNet network by removing the bypass branch structure in the SkyNet network and deleting some channels of the first layer output, thereby obtaining an optimized SkyNet network;
[0069] S102, compressing the retrained SkyNet network by quantizing the weights to 7 bits, quantizing the feature maps to 8 bits, fusing the bias parameters and scaling coefficients, and fixing them to 32 bits;
[0070] S103, merging the SkyNet network structure by merging the convolution layer and the normalization layer, and merging the activation process, quantization, dequantization, and saturation truncation process into a FETCH process.
[0071] The optimization and pruning of the SkyNet network provided in the embodiment of the present invention comprises the following steps:
[0072] First, the Skynet branch is pruned off; each depth-wise separable convolution is used as the minimum unit layer, and the first layer output is pruned to 32 channels;
[0073] Secondly, pooling is added after the sixth layer, and the last layer is modified to a depthwise separable convolution, and the overall network structure is optimized to a straight cylindrical type.
[0074] The optimized SkyNet network provided by the embodiment of the present invention includes:
[0075] 3-channel input layer CHL3, intermediate layers CHL32, CHL96, CHL192, CHL384, CHL512, CHL96 and regression layer CHL30;
[0076] The convolution between each layer of the optimized SkyNet network uses depth-separable convolution.
[0077] The compression of the retrained SkyNet network provided in the embodiment of the present invention comprises the following steps:
[0078] (1) Select the maximum value of the convolution kernel corresponding to each output channel as the maximum value of quantization, and use the maximum value quantization method to quantize the weight:
[0079]
[0080] q_w = w × scale_w;
[0081] Among them, w represents the vector of original weights corresponding to each channel; q_w represents the vector of quantized weights; scale_w represents the scaling factor as a scalar;
[0082] (2) The KL relative entropy is used to select the threshold and the saturation quantization is used to quantize the feature map: the threshold T is selected, the values of the original distribution within the range of ±T are proportionally scaled to -127 to +127, the parts outside the range are saturated, and the saturated value is directly used to represent the value of the part outside the range.
[0083] The method of selecting a threshold by using KL relative entropy and quantizing a feature map by using saturation quantization provided by the embodiment of the present invention includes:
[0084] 1) Use KL relative entropy to select the threshold:
[0085]
[0086]
[0087]
[0088] Where p represents the original distribution before quantization, q represents the distribution after quantization using the threshold T, H(p) represents the information entropy of the original distribution, H(p,q) represents the cross entropy between the original distribution and the quantized distribution, and DKL(p||q) represents the KL relative entropy.
[0089] 2) Calculate the scaling factor scale_fm:
[0090]
[0091] 3) Fixed-point bias and scaling coefficients, merge floating-point units that appear in forward reasoning, enlarge and round, and use 32-bit integers to save the final coefficients;
[0092] 4) Calculate the dequantized coefficients after merging and enlarging and rounding:
[0093] Bias_merge=int(bias×scale_next_fm×shift_coe);
[0094]
[0095] Among them, scale_w represents the weight quantization coefficient; scale_fm represents the quantization coefficient of the previous layer feature map; bias represents the bias; scale_next_fm represents the quantization coefficient of the next layer; Scale_merge represents the dequantization coefficient after merging and amplifying and rounding; Bias_merge represents the bias coefficient; shift_coe represents the magnification factor.
[0096] The merging of SkyNet network structures provided in the embodiment of the present invention includes:
[0097] (1) Combine the convolution layer and the normalization layer to obtain the combined output y3:
[0098]
[0099] in:
[0100]
[0101]
[0102] Among them, y1 represents the convolution output; x represents the input; w represents the weight; b represents the bias; x, w and b are all vectors; μ represents the mean; σ represents the standard deviation; γ represents the scaling factor; β represents the scaling offset; ε = 1e-6; W represents the fused weight; B represents the fused bias;
[0103] (2) merging activation processing, quantization, dequantization and saturation truncation into FETCH processing; the FETCH processing converts 32 bits into 8 bits; and performing ReLu activation and saturation truncation.
[0104] The ReLu activation and saturation truncation provided in the embodiment of the present invention include:
[0105] The positive or negative of the input data is judged. If it is positive, saturation truncation is performed; if it is negative, the output value after activation is 0.
[0106] The technical solution of the present invention is further described below in conjunction with specific embodiments.
[0107] Embodiment 1:
[0108] The target detection network compression method for edge devices provided by an embodiment of the present invention includes:
[0109] (1) Optimized cutting
[0110] The present invention first prunes the Skynet branch, then takes each depthwise separable convolution as the minimum unit layer, prunes the first layer output to 32 channels, then adds a pooling operation after the sixth layer, and finally, modifies the last layer to a depthwise separable convolution, and optimizes the overall network structure to a straight cylinder type.
[0111] The optimized Skynet is as follows Figure 2 As shown in the figure, the whole network consists of 8 layers, namely 3-channel input layer (CHL3), intermediate layer (CHL32, CHL96, CHL192, CHL384, CHL512, CHL96), regression layer (CHL30). The convolution between each layer is implemented using depthwise separable convolution (DSC). The network structure is regular, which facilitates module reuse and forms an efficient computing structure.
[0112] The input image size used in the present invention is 160×160, and the image size of each layer is shown in Table 1:
[0113] Table 1 Specific dimensions of each layer
[0114]
[0115] (2) Compress the model
[0116] The quantization part is the quantization of weights, the quantization of feature maps, and the fixed-point quantization of bias and scaling coefficients.
[0117] The weights are quantized using the maximum value, and the maximum value is the maximum value of the convolution kernel corresponding to each output channel.
[0118] Assume that the original weight corresponding to each channel is vector w, the quantized weight is vector q_w, and the scaling factor is scalar scale_w. The corresponding relationship is shown in equations (1) and (2). For ease of calculation, the boundary is set to 63, and the final q_w is evenly distributed between -63 and 63.
[0119]
[0120] q_w=w×scale_w (2)
[0121] The feature map quantization adopts saturation quantization and uses KL relative entropy to select the threshold, which significantly reduces the accuracy loss.
[0122] Saturation quantization Figure 3 As shown, a threshold T is selected, and the values of the original distribution within the range of ±T are proportionally scaled to -127 to +127. The red value table in the figure is out of the range after scaling, and saturation processing is performed, and the saturated value is directly used to represent the value of this part.
[0123] Suppose the original distribution before quantization is p, the distribution after quantization using threshold T is q, the information entropy of the original distribution is H(p), the cross entropy between the original distribution and the quantized distribution is H(p,q), and the KL relative entropy is DKL(p||q), then we have the following formula:
[0124]
[0125]
[0126]
[0127] The scaling factor is scale_fm, where:
[0128]
[0129] The bias and scaling coefficients are fixed-point, the floating-point units that appear in the forward reasoning are merged, and the final coefficients are saved as 32-bit integers. Let the weight quantization coefficient be scale_w, the current layer feature map quantization coefficient be scale_fm, the bias be bias, and the next layer quantization coefficient be scale_next_fm.
[0130] Assume that the dequantization coefficient after merging and enlarging is Scale_merge, the bias coefficient is Bias_merge, and the magnification is shift_coe, then:
[0131] Bias_merge=int(bias×scale_next_fm×shift_coe) (7)
[0132]
[0133] (3) Merge network structure
[0134] Merge the convolution layer and the normalization layer. Depthwise separable convolution includes a normalization layer. When training a network model, the normalization layer can accelerate network convergence, control overfitting, and solve the problems of gradient vanishing and gradient exploding. When the model training is completed, all parameters have been fixed. At this time, the convolution layer parameters and the normalization layer parameters in the network are merged, such as Figure 4 As shown, the network structure can be effectively simplified, the amount of calculation can be reduced, and the calculation efficiency can be improved.
[0135] Suppose the convolution output is y1, the input is x, the weight is w, the deviation is b, x, w and b are all vectors, the normalization layer output is y2, the mean is μ, the standard deviation is σ, the scaling factor is γ, the scaling offset is β, and ε=1e-6, then the convolution calculation formula is:
[0136] y1=wx+b (9)
[0137] The calculation formula of the normalization layer is:
[0138]
[0139] in:
[0140]
[0141]
[0142] Substitute equation (10) into equation (11), let W be the weight after fusion, B be the bias after fusion, and the output y3 after merging is:
[0143]
[0144] in:
[0145]
[0146]
[0147] After fusion, there is no more normalization layer calculation, which reduces the model size, saves computing resources, and improves the performance of forward reasoning.
[0148] Merge activation operations, quantization, dequantization, and saturation truncation into a FETCH operation, such as Figure 5 shown.
[0149] The fetch operation converts 32bit to 8bit, which essentially completes the two processes of ReLu activation and saturation truncation. After calculating with the fixed-point data, the result needs to be reduced to the previous 1 / shift_coe. For edge devices, since shift_coe is a power of 2, it can be directly fetched. In the middle, the positive and negative of the input data needs to be judged. If it is positive, saturation truncation is performed; if it is negative, the output value after activation is 0.
[0150] Figure 6 It shows the reasoning steps before the localization and network structure merging. Figure 7 The optimized inference steps are shown.
[0151] Embodiment 2:
[0152] (1) Optimize pruning and retraining
[0153] The Skynet network structure is optimized to a straight cylinder model and retrained. Table 2 shows the accuracy comparison of Skynet before and after pruning. Taking the average precision (AP, as shown in Formula 23) as the evaluation index, the accuracy drops by less than 0.03, which greatly improves the efficiency of Skynet's real-time computing on edge devices while meeting the actual application requirements.
[0154] Table 2 Comparison of Skynet accuracy before and after pruning
[0155] Model Type Average precision Complete Model 0.797 Model after pruning 0.770
[0156] (2) Compress the model and merge the network structure
[0157] The pruned and retrained model is quantized, and activation operations, quantization, dequantization, and saturation truncation operations are combined. Compared with the uncompressed model, the accuracy only drops by 2.34%, while the network model size is reduced by 74.5%.
[0158] The comparison table of model size, average accuracy and accuracy loss before and after model compression optimization is as follows
[0159] As shown in Table 3.
[0160] Before compression After compression Data Types 32-bit floating point 7bit / 8bit / 32bit fixed-point type Model size (MB) 1.41 0.359 Average Precision (AP) 0.770 0.752 Loss of precision --- 2.34% Compression ratio --- 74.5%
[0161] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.
Claims
1. A target detection network compression method for edge devices, characterized in that: The target detection network compression method for edge devices includes: Optimize the network structure of SkyNet, quantize the feature maps and weight parameters; reconstruct the forward reasoning structure and merge some calculations in the depth-separable convolution; The target detection network compression method for edge devices comprises the following steps: Step 1: Optimize and trim the SkyNet network by removing the bypass branch structure in the SkyNet network and deleting some channels of the first layer output to obtain an optimized SkyNet network; Step 2: Compress the retrained SkyNet network by quantizing the weights to 7 bits, quantizing the feature maps to 8 bits, fusing the bias parameters and scaling factors, and fixing them to 32 bits; Step 3: Merge the SkyNet network structure by merging the convolutional layer and the normalization layer, and merging the activation processing, quantization, dequantization, and saturation truncation processing into FETCH processing.
2. The target detection network compression method for edge devices according to claim 1, characterized in that: The optimization and pruning of the SkyNet network includes the following steps: First, the Skynet branch is pruned off; each depth-wise separable convolution is used as the minimum unit layer, and the first layer output is pruned to 32 channels; Secondly, pooling is added after the sixth layer, and the last layer is modified to a depthwise separable convolution, and the overall network structure is optimized to a straight cylindrical type.
3. The target detection network compression method for edge devices according to claim 1, characterized in that: The optimized SkyNet network includes: 3-channel input layer CHL3, intermediate layers CHL32, CHL96, CHL192, CHL384, CHL512, CHL96 and regression layer CHL30; The convolution between each layer of the optimized SkyNet network uses depth-separable convolution.
4. The target detection network compression method for edge devices according to claim 1, characterized in that: The compression of the retrained SkyNet network includes the following steps: (1) Select the maximum value of the convolution kernel corresponding to each output channel as the maximum value of quantization, and use the maximum value quantization method to quantize the weight: q_w = w × scale_w; Among them, w represents the vector of original weights corresponding to each channel; q_w represents the vector of quantized weights; scale_w represents the scaling factor as a scalar; (2) The KL relative entropy is used to select the threshold and the saturation quantization is used to quantize the feature map: the threshold T is selected, the values of the original distribution within the range of ±T are proportionally scaled to -127 to +127, the parts outside the range are saturated, and the saturated value is directly used to represent the value of the part outside the range.
5. The target detection network compression method for edge devices according to claim 4, characterized in that: The method of selecting a threshold by using KL relative entropy and quantizing the feature map by using saturation quantization includes: 1) Use KL relative entropy to select the threshold: Where p represents the original distribution before quantization, q represents the distribution after quantization using the threshold T, H(p) represents the information entropy of the original distribution, H(p,q) represents the cross entropy between the original distribution and the quantized distribution, and DKL(p||q) represents the KL relative entropy. 2) Calculate the scaling factor scale_fm: 3) Fixed-point bias and scaling coefficients, merge floating-point units that appear in forward reasoning, enlarge and round, and use 32-bit integers to save the final coefficients; 4) Calculate the dequantized coefficients after merging and enlarging and rounding: Bias_merge=int(bias×scale_next_fm×shift_coe); Among them, scale_w represents the weight quantization coefficient; scale_fm represents the quantization coefficient of the previous layer feature map; bias represents the bias; scale_next_fm represents the quantization coefficient of the next layer; Scale_merge represents the dequantization coefficient after merging and amplifying and rounding; Bias_merge represents the bias coefficient; shift_coe represents the magnification factor.
6. The target detection network compression method for edge devices according to claim 1, characterized in that: The merging of the SkyNet network structure includes: (1) Combine the convolution layer and the normalization layer to obtain the combined output y3: in: Among them, y1 represents the convolution output; x represents the input; w represents the weight; b represents the bias; x, w and b are all vectors; μ represents the mean; σ represents the standard deviation; γ represents the scaling factor; β represents the scaling offset; ε = 1e-6; W represents the fused weight; B represents the fused bias; (2) merging activation processing, quantization, dequantization and saturation truncation into FETCH processing; the FETCH processing converts 32 bits into 8 bits; performing ReLu activation and saturation truncation; the performing ReLu activation and saturation truncation includes: The positive or negative of the input data is judged. If it is positive, saturation truncation is performed; if it is negative, the output value after activation is 0.
7. A target detection network compression system for edge devices implementing the target detection network compression method for edge devices according to any one of claims 1 to 6, characterized in that: The target detection network compression system for edge devices includes: The network pruning module is used to optimize and prune the SkyNet network by removing the bypass branch structure in the SkyNet network and deleting some channels of the first layer output to obtain the optimized SkyNet network; The network compression module is used to compress the retrained SkyNet network by quantizing the weights to 7 bits, quantizing the feature maps to 8 bits, fusing the bias parameters and scaling factors, and fixing them to 32 bits; The network structure merging module is used to merge the SkyNet network structure by merging the convolution layer and the normalization layer, and merging the activation processing, quantization, dequantization and saturation truncation processing into FETCH processing.
