A neural network key parameter fine-tuning method based on data analysis
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-07
- Publication Date
- 2026-08-11
AI Technical Summary
但是随着神经网络结构复杂度的增加,训练神经网络模型需要海量标注数据以及强大的算力支撑,且模型训练过程复杂
[0029]本发明提供的一种基于数据分析的神经网络关键参数微调方法,采用不同背景的红外小目标图像子集构成的混合数据集,对神经网络模型进行训练,得到第一预训练神经网络模型;然后对第一预训练神经网络模型的除最后一层的网络参数以外的参数全部冻结,再采用不同背景参数对冻结参数的网络模型再次进行训练,然后根据两次训练的神经网络模型的权重参数的差异,确定对目标检测结果影响较大的关键参数,将该关键参数作为网络参数,该方法在现有基于深度学习的目标检测方法的基础上,通过少量样本数据训练出的小样本网络,找到关键参数并对其进行微调,得到适应不同场景且目标识别精确度更高的模型。
Smart Images

Figure CN118154952B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of target detection in digital image processing, specifically a method for fine-tuning key parameters of a neural network based on data analysis. Background Technology
[0002] With the development of artificial intelligence technology, intelligent target detection technology has been widely applied. After the performance of traditional target detection algorithms has stabilized, deep learning technology has brought profound changes to the field of target detection. Deep learning-based target detection algorithms have higher recognition and better target classification capabilities when identifying aerial targets, greatly improving the level of intelligent recognition of aerial infrared targets.
[0003] Currently, deep learning-based object detection algorithms can improve object detection accuracy. However, as the complexity of neural network structures increases, training neural network models requires massive amounts of labeled data and powerful computing capabilities, and the model training process is complex. If there are insufficient training samples, the trained neural network may be unable to estimate complex data distributions, leading to inaccurate parameter estimation and consequently poor generalization ability of the model in different scenarios.
[0004] Therefore, it is necessary to optimize the parameters of deep learning-based object detection algorithms to ensure that the model is robust and adaptable to new samples. Summary of the Invention
[0005] To address the problems existing in the prior art, this invention provides a method for fine-tuning key parameters of a neural network based on data analysis. By training a few-sample network and analyzing its performance in different scenarios, patterns are identified to adjust key parameters. Through parameter fine-tuning, the model achieves robustness and adaptability to new samples.
[0006] This invention is achieved through the following technical solution:
[0007] A method for fine-tuning key parameters of a neural network based on data analysis includes the following steps:
[0008] Step 1: Use a hybrid dataset consisting of subsets of infrared small target images with different backgrounds to train the neural network model and obtain the first pre-trained neural network model.
[0009] Step 2: Freeze all parameters in the first pre-trained neural network model and unfreeze the parameters of the last convolutional layer. Train the first pre-trained neural network model with frozen parameters using each subset of infrared small target images to obtain multiple second pre-trained neural network models.
[0010] Step 3: Determine the difference in weight parameters of the last convolutional layer of the first pre-trained neural network model and the multiple second pre-trained neural network models respectively. Determine the key parameters of the neural network model based on the difference in weight parameters, and use the key parameters as the network parameters of the neural network model.
[0011] Preferably, the infrared small target image subsets with different backgrounds mentioned in step 1 include infrared small target image subsets with sky background, earth background, and sky-ground background.
[0012] Preferably, the method for establishing the subset of infrared small target images with different backgrounds in step 1 is as follows:
[0013] Infrared small target images with different backgrounds are acquired and classified according to the background. Then, data augmentation operations are performed on each type of infrared small target image to expand the image data volume and obtain a subset of infrared small target images with different backgrounds.
[0014] Preferably, the neural network model described in step 1 is an infrared weak target detection network based on the segmentation paradigm.
[0015] Preferably, the parameters of the last convolutional layer in step 2 include weight parameters and bias parameters.
[0016] Preferably, the method for determining the key parameters in step 3 is as follows:
[0017] The difference between each second pre-trained neural network model is compared with a set threshold. The weight parameter corresponding to the difference greater than the threshold is taken as the key parameter, and multiple sets of key parameters are obtained.
[0018] Preferably, multiple sets of key parameters are multiplied to obtain the set of key parameters with the best performance as the network parameters of the neural network model.
[0019] Preferably, the method for multiplying the key parameters is as follows:
[0020] Based on the set multiplication factor, the weight parameters in each group of key parameters are multiplied.
[0021] Alternatively, multiply each weight parameter in each group of key parameters by its corresponding difference to obtain the multiplied key parameters.
[0022] Preferably, the method for obtaining the set of key parameters with optimal performance is as follows:
[0023] Substitute each set of key parameters into the first pre-trained neural network model, and determine the optimal set of key parameters based on the detection performance of the first pre-trained neural network model.
[0024] A system for fine-tuning key parameters of a neural network based on data analysis, comprising:
[0025] The first pre-training module is used to train the neural network model using a hybrid dataset consisting of subsets of infrared small target images with different backgrounds, to obtain the first pre-trained neural network model.
[0026] The second pre-training module is used to freeze all parameters in the first pre-trained neural network model and unfreeze the parameters of the last convolutional layer. It then uses each subset of infrared small target images to train the first pre-trained neural network model with frozen parameters, resulting in multiple second pre-trained neural network models.
[0027] The key parameter module is used to determine the difference in weight parameters of the last convolutional layer of the first pre-trained neural network model and multiple second pre-trained neural network models, respectively. Based on the difference in weight parameters, the key parameters of the neural network model are determined and used as the network parameters of the neural network model.
[0028] Compared with the prior art, the present invention has the following beneficial technical effects:
[0029] This invention provides a method for fine-tuning key parameters of a neural network based on data analysis. It uses a hybrid dataset composed of subsets of infrared small target images with different backgrounds to train a neural network model, obtaining a first pre-trained neural network model. Then, all parameters of the first pre-trained neural network model, except for the parameters of the last layer, are frozen. The model with frozen parameters is then trained again using different background parameters. Based on the difference in weight parameters between the two trained neural network models, key parameters that significantly affect the target detection results are determined and used as network parameters. This method, based on existing deep learning-based target detection methods, finds and fine-tunes key parameters using a small-sample network trained with a small amount of sample data, resulting in a model that adapts to different scenarios and has higher target recognition accuracy. Attached Figure Description
[0030] Figure 1 This is an example diagram of the dataset for this invention;
[0031] Figure 2 This is a diagram of the overall network structure of AGPCNet in this invention;
[0032] Figure 3 This is a graph showing the weight parameters of the pre-trained network and the few-shot network of this invention.
[0033] Figure 4 This is a graph showing the difference between the weight parameters of the small sample network and the weight parameters of the pre-trained network under different backgrounds. Detailed Implementation
[0034] The present invention will now be described in further detail with reference to the accompanying drawings. These descriptions are intended to explain the invention and not to limit it.
[0035] A method for fine-tuning key parameters of a neural network based on data analysis includes the following steps:
[0036] Step 1: Use a hybrid dataset consisting of subsets of infrared small target images with different backgrounds to train the neural network model and obtain the first pre-trained neural network model.
[0037] Step 2: Freeze all parameters in the first pre-trained neural network model and unfreeze the parameters of the last convolutional layer. Train the first pre-trained neural network model with frozen parameters using each subset of infrared small target images to obtain multiple second pre-trained neural network models.
[0038] Step 3: Determine the difference in weight parameters of the last convolutional layer of the first pre-trained neural network model and the multiple second pre-trained neural network models respectively. Determine the key parameters of the neural network model based on the difference in weight parameters, and use the key parameters as the network parameters of the neural network model.
[0039] This invention presents a data analysis-based method for fine-tuning key parameters of neural networks. Building upon existing deep learning-based object detection methods, it introduces a parameter fine-tuning strategy. By freezing and unfreezing parameters and combining a small number of training samples from different scenarios, it trains both the pre-trained network and the few-shot network. By comparing and analyzing the differences in weight parameters between the few-shot network and the pre-trained network, it identifies and determines the key parameters that significantly impact object detection results. This data analysis-based method effectively captures feature changes across different scenarios. Furthermore, by fine-tuning the key parameters, it achieves a model that is more adaptable to different scenarios and has higher object detection accuracy using a small number of samples.
[0040] Example 1
[0041] A data analysis-based method for fine-tuning key parameters of a neural network comprises three parts: the first part is the establishment of the dataset; the second part is the selection of key parameters; and the third part is the fine-tuning of the key parameters and the analysis of the network's performance after parameter tuning. Each part specifically includes the following:
[0042] The first part consists of two steps:
[0043] Step one involves acquiring infrared image data, which consists of real-world images of small infrared targets against a sky background, an earth background, and a sky-ground background. During data processing, data augmentation operations were performed on the sky and earth-ground background images. Specifically, this involved expanding the data volume by cropping and rotating the original images. Figure 1As shown. The image dataset Data = {(I s1 ,I l1 ,I sl1 ),(I s2 ,I l2 ,I sl2 ),...(I sn ,I ln ,I sln )}, where I s An image representing the sky background, I l An image representing the earth's background, I sl An image with a background of heaven and earth.
[0044] Step two, divide the dataset from step one into two groups. train and Data test Data train Data as training samples test As test samples, where both training and test samples contain data from three different scenarios, the dataset can be divided into:
[0045]
[0046] Among them, Data s,train Data l,train Data sl,train Training datasets for the sky, the earth, and the sky-ground background, respectively; Data s,test Data l,test Data sl,test The test training sets are respectively based on the sky, the earth, and the sky-ground background.
[0047] Part Two consists of two steps:
[0048] Step 3: Pre-trained network establishment. This invention uses AGPCNet as the pre-trained network, and its structure diagram is shown below. Figure 2 As shown, given an input image I, it is fed into a convolutional neural network, which divides it into three sampling layers to obtain a feature image. Then, X is passed through CPM to obtain the feature image C after information aggregation. Then, AFM is used to fuse deep and shallow semantics in the upsampling stage to obtain more accurate target localization. The final output binary image is the infrared small target detection result.
[0049] The network model has a total of 12,623,393 parameters. Since the parameters of the last layer in AGPCNet are closely related to the output and play a crucial role in target detection, key parameters are selected from the parameters of the last layer. This last layer has 33 parameters, of which 32 are weight parameters and 1 is a bias parameter. The 32 weight parameters are primarily considered. Data is selected. train The training process involves using a blended image containing a sky background, an earth background, and a sky-ground background to obtain a pre-trained model of the blended image and the pre-trained parameters ω for the final layer. pre (i)(i=1,2,...32).
[0050] Step four: few-shot network training. Freeze all parameters in the pre-trained network and unfreeze the parameters of the last layer. (In Data...) s,train Data l,train and Data sl,train We selected a small amount of data to train the pre-trained network with frozen parameters, obtaining small sample models with different backgrounds and optimal values ω for the weight parameters of the last layer. s (i), ω l (i), ω sl (i)(i=1,2,...32).
[0051] Where ω s (i) represents the optimal values of the weight parameters trained on the sky background image; ω l (i) represents the optimal values of the weight parameters trained on the background image; ω sl (i) represents the optimal values of the weight parameters trained on the background image. The results are as follows: Figure 3 As shown.
[0052] Step 5, Key Parameter Selection. The parameters ω of the pre-trained network obtained in Step 3 are... pre (i) Compare and analyze the optimal parameter values obtained in step 4 under different backgrounds to obtain the differences between them:
[0053]
[0054] Where, d s d l d sl The differences between the weight parameters of the small sample network trained on images with sky background, ground background, and sky-ground background, respectively, and the weight parameters of the pre-trained network are shown in the following figures. Figure 4 As shown in the figure, among the 32 weights, the 4th, 9th, 12th, 17th, 19th, 21st, 23rd, 24th, 27th, and 29th parameters have relatively large differences. Therefore, these parameters were selected as key parameters.
[0055] Part Three consists of two steps:
[0056] Step 6: Multiply the key parameters:
[0057] ω new (i)=k×ω pre (i)(i=4,9,12,17,19,21,23,24,27,29)
[0058] Where k is a multiple, ω new (i) The newly obtained network parameters are obtained using the Sky dataset Data. s,test Data set l,test and the data set Data sl,test The new network was tested, and its performance was analyzed. Pre represents the accuracy of object detection; AUC measures the overall performance of the algorithm in object detection; a higher value indicates better detection and superior overall algorithm performance; FPR represents the false alarm rate of object detection. The obtained metrics are shown in Tables 1, 2, and 3. The experimental results show that adjusting key parameters can significantly enhance the network's performance.
[0059] Step 7: Multiply the key parameters by the factors of the differences obtained in Step 5 to form new network parameters. First, use the mixed dataset Data... test Sky Dataset s,test Data set l,test and the data set Data sl,test The pre-trained network and the sky, earth, and sky-ground small sample networks were tested, and the resulting metrics are shown in Tables 4, 5, and 6.
[0060] The experimental results show that, for the three datasets, the Geodetic Network exhibits the highest AUC, indicating the best sample classification results. Although the false alarm rate is also relatively high, it is negligible compared to the increase in AUC. Therefore, the difference d between the key parameters of the Geodetic Network and the pre-trained network is chosen. l To adjust the parameters:
[0061] ω new (i)=ω pre (i)×kd l (i)
[0062] Using the Sky dataset respectively s,test Data set l,test and the data set Data sl,testThe new network was tested, and its performance was analyzed. The results are shown in Tables 7, 8, and 9.
[0063] Table 1 Sky Dataset
[0064]
[0065]
[0066] Table 2 Geodatabase
[0067] 0.3 0.4180 0.5331 0.0000173200 0.5 0.4344 0.5317 0.0000166919 0.8 0.4432 0.5298 0.0000165587 1.0 0.4462 0.5285 0.0000166633 1.2 0.4440 0.5270 0.0000171867 1.5 0.4366 0.5249 0.0000181289
[0068] Table 3: Dataset of Heaven and Earth
[0069] 0.3 0.2494 0.5407 0.0000274975 0.5 0.2679 0.5336 0.0000234257 0.8 0.2785 0.5232 0.0000210667 1.0 0.2842 0.5136 0.0000202770 1.2 0.2888 0.4930 0.0000201334 1.5 0.2950 0.4474 0.0000201026
[0070] Table 4 Sky Dataset
[0071]
[0072]
[0073] Table 5 Geodatabase
[0074] pre-trained networks 0.4462 0.5285 0.0000166633 Earth Network 0.3279 0.6005 0.0001311465 Sky Networks 0.4519 0.4875 0.0000366099 Tiandi Network 0.4919 0.5250 0.0000173485
[0075] Table 6: Dataset of Heaven and Earth
[0076] pre-trained networks 0.2842 0.5137 0.0000203180 Earth Network 0.0087 0.6420 0.0057187089 Sky Networks 0.2822 0.5351 0.0000773437 Tiandi Network 0.2864 0.5688 0.0000557334
[0077] Table 7 Sky Dataset
[0078]
[0079]
[0080] Table 8 Earth Dataset
[0081]
[0082]
[0083] Table 9: Data Set
[0084]
[0085]
[0086] This invention also provides a system for fine-tuning key parameters of a neural network based on data analysis, comprising:
[0087] The first pre-training module is used to train the neural network model using a hybrid dataset consisting of subsets of infrared small target images with different backgrounds, to obtain the first pre-trained neural network model.
[0088] The second pre-training module is used to freeze all parameters in the first pre-trained neural network model and unfreeze the parameters of the last convolutional layer. It then uses each subset of infrared small target images to train the first pre-trained neural network model with frozen parameters, resulting in multiple second pre-trained neural network models.
[0089] The key parameter module is used to determine the difference in weight parameters of the last convolutional layer of the first pre-trained neural network model and multiple second pre-trained neural network models, respectively. Based on the difference in weight parameters, the key parameters of the neural network model are determined and used as the network parameters of the neural network model.
[0090] The above content is only for illustrating the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solution based on the technical concept proposed in this invention shall fall within the scope of protection of the claims of this invention.
Claims
1. A method for fine-tuning key parameters of a neural network based on data analysis, characterized in that, Includes the following steps: Step 1: Using a hybrid dataset consisting of subsets of infrared small target images with different backgrounds, train the neural network model to obtain the first pre-trained neural network model; the neural network model is an infrared small target detection network based on the segmentation paradigm. Step 2: Freeze all parameters in the first pre-trained neural network model and unfreeze the parameters of the last convolutional layer. Train the first pre-trained neural network model with frozen parameters using each subset of infrared small target images to obtain multiple second pre-trained neural network models. Step 3: Determine the difference in weight parameters of the last convolutional layer of the first pre-trained neural network model and the multiple second pre-trained neural network models respectively. Determine the key parameters of the neural network model based on the difference in weight parameters, and use the key parameters as the network parameters of the neural network model. The method for determining the key parameters is as follows: The difference between each second pre-trained neural network model is compared with a set threshold, and the weight parameter corresponding to the difference greater than the threshold is used as the key parameter to obtain multiple sets of key parameters. The following multiplication operations are performed on multiple sets of key parameters: Based on the set multiplication factor, the weight parameters in each group of key parameters are multiplied. Alternatively, multiply each weight parameter in each group of key parameters by its corresponding difference to obtain the multiplied key parameters; The multiplied sets of key parameters are substituted into the first pre-trained neural network model. The optimal set of key parameters is determined based on the detection performance of the first pre-trained neural network model, and then used as the network parameters of the neural network model.
2. The method for fine-tuning key parameters of a neural network based on data analysis according to claim 1, characterized in that, The infrared small target image subsets with different backgrounds mentioned in step 1 include infrared small target image subsets with sky background, earth background, and sky-ground background.
3. The method for fine-tuning key parameters of a neural network based on data analysis according to claim 1, characterized in that, The method for establishing the infrared small target image subset with different backgrounds in step 1 is as follows: Infrared small target images with different backgrounds are acquired and classified according to the background. Then, data augmentation operations are performed on each type of infrared small target image to expand the image data volume and obtain a subset of infrared small target images with different backgrounds.
4. The method for fine-tuning key parameters of a neural network based on data analysis according to claim 1, characterized in that, The parameters of the last convolutional layer in step 2 include weight parameters and bias parameters.
5. A system for implementing the data analysis-based neural network key parameter fine-tuning method according to any one of claims 1-4, characterized in that, include: The first pre-training module is used to train the neural network model using a hybrid dataset consisting of subsets of infrared small target images with different backgrounds, to obtain the first pre-trained neural network model. The second pre-training module is used to freeze all parameters in the first pre-trained neural network model and unfreeze the parameters of the last convolutional layer. It then uses each subset of infrared small target images to train the first pre-trained neural network model with frozen parameters, resulting in multiple second pre-trained neural network models. The key parameter module is used to determine the difference in weight parameters of the last convolutional layer of the first pre-trained neural network model and multiple second pre-trained neural network models, respectively. Based on the difference in weight parameters, the key parameters of the neural network model are determined and used as the network parameters of the neural network model.