Agricultural machinery gear pitting image identification method based on KANs and U-Net + +
By constructing the image recognition method of agricultural machinery gear pitting corrosion of KANs and U-Net++, the problem of low accuracy of existing agricultural machinery gear pitting corrosion recognition is solved, and a higher precision pitting corrosion area recognition and diagnosis is achieved to meet the real-time needs of industrial testing.
Patent Information
- Application Number
- CN202510545916.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-08-12
AI Technical Summary
The existing agricultural machinery gear pitting recognition methods have low accuracy, traditional methods are unstable due to light and surface texture, and deep learning methods have room for optimization in fine-grained segmentation.
The agricultural machinery gear pitting image recognition method based on KANs and U-Net++ is adopted. The KAN-U-Net++ network model is constructed through image acquisition, preprocessing, and training, combining cross-entropy loss function and Adam optimizer, and using dense jump connections and nonlinear feature enhancement mechanisms to accurately locate the pitting area.
Improve the accuracy of gear pitting recognition, improve IoU and F1-Score indicators to achieve optimal results, and can more accurately measure and diagnose gear pitting conditions, reduce background interference, and alleviate category imbalance problems.
Smart Images

Figure CN120472313A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image recognition and fault diagnosis, and in particular relates to an image recognition method for pitting corrosion of agricultural machinery gears. Background Art
[0002] The transmission system of agricultural machinery is considered to be an important part of agricultural machinery. The gear transmission system of agricultural machinery is prone to wear, deformation and even pitting failure due to being in a complex working environment for a long time. Among them, gear pitting is a common form of fatigue damage. If it is not detected in time, it will cause equipment damage and economic losses. At present, the gear pitting detection methods mainly include: methods based on vibration signals, which have problems such as difficulty in feature extraction, large noise interference, and difficulty in identifying early pitting. Methods based on traditional image processing are affected by factors such as lighting and surface texture, and the detection effect is unstable. Methods based on deep learning, such as U-Net, U-Net++, etc., have room for optimization in fine-grained segmentation. Therefore, it is necessary to develop gear pitting detection technology based on computer vision, which is of great significance for the widespread application of agricultural machinery fault diagnosis.
[0003] KANs improves the model's ability to represent complex pitting patterns through learnable nonlinear mapping layers. U-Net++'s dense skip connections enhance the transfer of feature information at different scales, improving the ability to identify pitting areas. Depthwise separable convolution reduces computational overhead and increases inference speed. Combining these two models allows for the focus on local features in gear pitting detection, improving the segmentation accuracy of small pitting areas and meeting the real-time requirements of industrial inspection. Summary of the Invention
[0004] The purpose of this invention is to solve the problem of low accuracy of existing agricultural machinery gear pitting recognition methods, and to propose an agricultural machinery gear pitting image recognition method based on KANs and U-Net++.
[0005] A method for agricultural machinery gear pitting image recognition based on KANs and U-Net++. The specific process is as follows:
[0006] Step 1: Obtain an image of pitting corrosion of agricultural machinery gears through an image acquisition device;
[0007] Step 2: Preprocess the pitting corrosion images of agricultural machinery gears obtained in step 1 and use them as training sets;
[0008] Step 3: Build the KAN-U-Net++ network model;
[0009] Step 4: Input the training set into the KAN-U-Net++ network model, use the cross-entropy loss function to optimize the KAN-U-Net++ network model parameters, and combine the Adam optimizer to perform gradient updates until the cross-entropy loss function converges to obtain the trained KAN-U-Net++ network model;
[0010] Step 5: Input the pitting corrosion image of the agricultural machinery gear to be tested into the trained KAN-U-Net++ network model, and the trained KAN-U-Net++ network model outputs the classification result of the pitting corrosion image of the agricultural machinery gear to be tested.
[0011] Preferably, in step 2, the gear pitting images obtained in step 1 are preprocessed as a training set; the specific process is:
[0012] The resolution of the agricultural machinery gear pitting image obtained in step 1 was uniformly adjusted to 256×256;
[0013] The pitting corrosion images of agricultural machinery gears after adjusting the resolution were vertically flipped, horizontally flipped, and scaled in sequence to obtain the preprocessed pitting corrosion images of agricultural machinery gears as the training set.
[0014] Preferably, in step 3, a KAN-U-Net++ network model is constructed; the specific process is:
[0015] The KAN-U-Net++ network model includes a convolution block, a first KD module, a second KD module, a third KD module, a fourth KD module, a first KGD module, a second KGD module, a third KGD module, a fourth KGD module, a depth convolution block, and a Softmax activation function layer;
[0016] The working process of the KAN-U-Net++ network is as follows:
[0017] The image is input into the convolution block, and the convolution block outputs the feature X1;
[0018] Feature X1 is input into the first KD module, and the first KD module outputs feature X2;
[0019] Feature X2 is input into the second KD module, and the second KD module outputs feature X3;
[0020] Feature X3 is input into the third KD module, and the third KD module outputs feature X4;
[0021] Feature X4 is input into the fourth KD module, and the fourth KD module outputs feature X5;
[0022] The feature X1 and feature X2 are concatenated in channel dimension through Concat(·). After concatenation, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain feature X 0,1 ;
[0023] The feature X2 and feature X3 are concatenated in channel dimension through Concat(·). After concatenation, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain feature X 1,1 ;
[0024] The feature X 0,1 and feature X 1,1 The channel dimension is spliced by Concat(·). After splicing, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain the feature X 0,2 ;
[0025] The feature X3 and feature X4 are concatenated in channel dimension through Concat(·). After concatenation, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain feature X 2,1 ;
[0026] The feature X 2,1 and feature X 1,1 The channel dimension is spliced by Concat(·). After splicing, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain the feature X 1,2 ;
[0027] The feature X 1,2 and feature X 0,2 The channel dimension is spliced by Concat(·). After splicing, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain the feature X 0,3 ;
[0028] The fourth KD module output feature X5 is input into the first KGD module, and the first KGD module outputs feature X6;
[0029] The output feature X6 of the first KGD module and the output feature X4 of the third KD module are added element by element and then input into the second KGD module, and the second KGD module outputs feature X7;
[0030] The second KGD module output feature X7, the second KD module output feature X3 and feature X 2,1 After element-by-element addition, the result is input into the third KGD module, which outputs feature X8.
[0031] The third KGD module output feature X8, the first KD module output feature X2, feature X 1,1 , Feature X 1,2 After element-by-element addition, the result is input into the fourth KGD module, which outputs feature X9.
[0032] The fourth KGD module output feature X9, the convolution block output feature X1, and the feature X 0,1 , Feature X 0,2 , Feature X 0,3 After element-by-element addition, the deep convolution block is input, and the deep convolution block outputs the feature X 10 ;
[0033] The depth convolution block outputs the feature X 10 Input Softmax activation function layer, Softmax activation function layer output feature X output .
[0034] Preferably, the convolution block includes a convolution layer, a batch normalization layer, a ReLU activation function and a maximum pooling layer in sequence;
[0035] The convolution kernel size of the convolution layer is 3×3 and the stride is 1;
[0036] The stride of the max pooling layer is 2.
[0037] Preferably, each KD module in the first KD module, the second KD module, the third KD module, and the fourth KD module includes, in sequence: a KANLayer layer, a depth convolution layer (DwConv), a batch normalization layer BN, a ReLU activation function layer, and a layer normalization LN;
[0038] The KAN Layer layer includes a first spline function Φ1, a second spline function Φ2 and a third spline function Φ3 in sequence.
[0039] Preferably, the working process of the first KD module is:
[0040] Feature X1 inputs the first spline function Φ1, and the first spline function Φ1 outputs feature X 11 ;
[0041] The first spline function Φ1 outputs the feature X 11 Input the second spline function Φ2, the second spline function Φ2 outputs the feature X 12 ;
[0042] The second spline function Φ2 outputs the feature X 12Input the third spline function Φ3, the third spline function Φ3 outputs the feature X 13 ;
[0043] The third spline function Φ3 outputs the feature X 13 Input the deep convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization LN in sequence, and the layer normalization LN outputs the feature X2;
[0044] The working process of the second KD module is:
[0045] Feature X2 inputs the first spline function Φ1, and the first spline function Φ1 outputs feature X 21 ;
[0046] The first spline function Φ1 outputs the feature X 21 Input the second spline function Φ2, the second spline function Φ2 outputs the feature X 22 ;
[0047] The second spline function Φ2 outputs the feature X 22 Input the third spline function Φ3, the third spline function Φ3 outputs the feature X 23 ;
[0048] The third spline function Φ3 outputs the feature X 23 Input the deep convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization LN in sequence, and the layer normalization LN outputs the feature X3;
[0049] The working process of the third KD module is:
[0050] Feature X3 inputs the first spline function Φ1, and the first spline function Φ1 outputs feature X 31 ;
[0051] The first spline function Φ1 outputs the feature X 31 Input the second spline function Φ2, the second spline function Φ2 outputs the feature X 32 ;
[0052] The second spline function Φ2 outputs the feature X 32 Input the third spline function Φ3, the third spline function Φ3 outputs the feature X 33 ;
[0053] The third spline function Φ3 outputs the feature X 33Input the deep convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization LN in sequence, and the layer normalization LN outputs the feature X4;
[0054] The working process of the fourth KD module is:
[0055] Feature X4 inputs the first spline function Φ1, and the first spline function Φ1 outputs feature X 41 ;
[0056] The first spline function Φ1 outputs the feature X 41 Input the second spline function Φ2, the second spline function Φ2 outputs the feature X 42 ;
[0057] The second spline function Φ2 outputs the feature X 42 Input the third spline function Φ3, the third spline function Φ3 outputs the feature X 43 ;
[0058] The third spline function Φ3 outputs the feature X 43 Input the deep convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization LN in sequence, and the layer normalization LN outputs the feature X5.
[0059] Preferably, each KGD module in the first KGD module, the second KGD module, the third KGD module, and the fourth KGD module sequentially includes a convolution layer, a batch normalization layer BN, a ReLU activation function layer, an upsampling layer, a convolution layer, a batch normalization layer BN, a ReLU activation function layer, a flattening layer, a KAN Layer layer, a depth convolution layer, a batch normalization layer BN, a ReLU activation function layer, and layer normalization;
[0060] The KAN Layer layer includes a first spline function Φ1, a second spline function Φ2 and a third spline function Φ3 in sequence.
[0061] Preferably, the working process of the first KGD module is:
[0062] The output feature X5 of the fourth KD module is sequentially input into the convolution layer, batch normalization layer BN, ReLU activation function layer, upsampling, convolution layer, batch normalization layer BN, ReLU activation function layer, flattening layer, KANLayer layer, depth convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization, and layer normalization output feature X6;
[0063] The working process of the second KGD module is:
[0064] The output feature X6 of the first KGD module and the output feature X4 of the third KD module are added element by element and then input into the convolution layer, batch normalization layer BN, ReLU activation function layer, upsampling, convolution layer, batch normalization layer BN, ReLU activation function layer, flattening layer, KAN Layer layer, depth convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization, and layer normalization output feature X7;
[0065] The working process of the third KGD module is:
[0066] The second KGD module output feature X7, the second KD module output feature X3 and feature X 2,1 After element-by-element addition, the convolution layer, batch normalization layer BN, ReLU activation function layer, upsampling, convolution layer, batch normalization layer BN, ReLU activation function layer, flattening layer, KANLayer layer, depth convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization, and layer normalization output feature X8;
[0067] The working process of the fourth KGD module is:
[0068] The third KGD module output feature X8, the first KD module output feature X2, feature X 1,1 , Feature X 1,2 After element-by-element addition, the convolution layer, batch normalization layer BN, ReLU activation function layer, upsampling, convolution layer, batch normalization layer BN, ReLU activation function layer, flattening layer, KAN Layer layer, depth convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization, and layer normalization output feature X9 are input in sequence.
[0069] Preferably, the depth convolution block includes a convolution layer, a batch normalization layer and a ReLU activation function in sequence;
[0070] The working process of the depth convolution block is:
[0071] The fourth KGD module output feature X9, the convolution block output feature X1, and the feature X 0,1 , Feature X 0,2 , Feature X 0,3 After element-by-element addition, the convolution layer, batch normalization layer, and ReLU activation function layer are input in sequence. The ReLU activation function layer outputs the feature X 10 .
[0072] Preferably, the length, width and number of channels of the input image are H, W and C = 3 respectively;
[0073] The length, width, and number of channels of the feature X1 are H / 2, W / 2, and C=64 respectively;
[0074] The length, width, and number of channels of the feature X2 are H / 4, W / 4, and C=128 respectively;
[0075] The length, width, and number of channels of the feature X3 are H / 8, W / 8, and C=256 respectively;
[0076] The length, width, and number of channels of the feature X4 are H / 16, W / 16, and C=320 respectively;
[0077] The length, width, and number of channels of the feature X5 are H / 32, W / 32, and C=512 respectively;
[0078] The length, width, and number of channels of the feature X6 are H / 16, W / 16, and C=320 respectively;
[0079] The length, width, and number of channels of the feature X7 are H / 8, W / 8, and C=256 respectively;
[0080] The length, width, and number of channels of the feature X8 are H / 4, W / 4, and C=128 respectively;
[0081] The length, width and number of channels of the feature X9 are H / 2, W / 2 and C=64 respectively;
[0082] The feature X 10 The length, width and number of channels are H, W and C = 32 respectively;
[0083] The feature X output The length, width and number of channels are H, W and C=2 respectively.
[0084] The beneficial effects of the present invention are:
[0085] A pitting corrosion measurement method for agricultural machinery gears based on Kolmogorov–Arnold Networks (KANs) and U-Net++ improves the accuracy of gear pitting corrosion identification by integrating dense jump connections and nonlinear feature enhancement mechanism.
[0086] The present invention has high accuracy: in the collected gear pitting image dataset, the improved IoU and F1-Score indicators achieved optimal results, and the test performance was better than the current most advanced fault diagnosis method, which can more accurately measure and diagnose gear pitting conditions.
[0087] The present invention has powerful feature processing capabilities: it uses Kolmogorov-Arnold Networks (KANs) to effectively capture nonlinear patterns in complex data, achieves better feature fusion, and makes the model's understanding and processing of gear pitting-related features more comprehensive and in-depth.
[0088] This invention features an innovative modular design: the KD and KGD modules precisely locate pitting areas, reducing background interference. Adaptive adjustment of loss weights alleviates class imbalance. This improves the model's ability to segment and analyze gear pitting images, facilitating more accurate identification and measurement of gear pitting. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] Figure 1 Flow chart of the method of the present invention:
[0090] Figure 2 This is the network structure diagram of KAN-U-Net++ of the present invention;
[0091] Figure 3 This is the KANLayer structure diagram of the present invention;
[0092] Figure 4 This is the structural diagram of the KGD module of the present invention;
[0093] Figure 5 The comparison diagram of the segmentation results, (a) is the original image, (b) is the real label image, (c) is the segmentation result image obtained by traditional U-Net++, (d) is the segmentation result image obtained by traditional U-KAN, and (e) is the segmentation result image obtained by KAN-U-Net++ of the present invention. DETAILED DESCRIPTION
[0094] Specific embodiment 1: This embodiment is a method for agricultural machinery gear pitting image recognition based on KANs and U-Net++. The specific process is as follows:
[0095] Step 1: Obtain an image of pitting corrosion of agricultural machinery gears through an image acquisition device;
[0096] Step 2: Preprocess the pitting corrosion images of agricultural machinery gears obtained in step 1 and use them as training sets;
[0097] Step 3: Build the KAN-U-Net++ network model;
[0098] Step 4: Input the training set into the KAN-U-Net++ network model, use the cross-entropy loss function to optimize the KAN-U-Net++ network model parameters, and combine the Adam optimizer to perform gradient updates until the cross-entropy loss function converges to obtain the trained KAN-U-Net++ network model;
[0099] Step 5: Input the pitting corrosion image of the agricultural machinery gear to be tested into the trained KAN-U-Net++ network model, and the trained KAN-U-Net++ network model outputs the classification result of the pitting corrosion image of the agricultural machinery gear to be tested.
[0100] Specific embodiment 2: This embodiment differs from specific embodiment 1 in that: in step 2, the gear pitting image obtained in step 1 is preprocessed as a training set; the specific process is:
[0101] The resolution of the agricultural machinery gear pitting image obtained in step 1 was uniformly adjusted to 256×256;
[0102] The pitting corrosion images of agricultural machinery gears after adjusting the resolution were vertically flipped, horizontally flipped, and scaled in sequence to obtain the preprocessed pitting corrosion images of agricultural machinery gears as the training set.
[0103] Other steps and parameters are the same as those in the first embodiment.
[0104] Specific embodiment 3: This embodiment differs from specific embodiment 1 or 2 in that: in step 3, a KAN-U-Net++ network model is constructed; the specific process is as follows:
[0105] The KAN-U-Net++ network model includes a convolution block, a first KD module (KAN-Dense Block), a second KD module (KAN-DenseBlock), a third KD module (KAN-DenseBlock), a fourth KD module (KAN-Dense Block), a first KGD module (KAN-GDecoderBlock), a second KGD module (KAN-GDecoderBlock), a third KGD module (KAN-GDecoderBlock), a fourth KGD module (KAN-GDecoderBlock), a depth convolution block, and a Softmax activation function layer;
[0106] The working process of the KAN-U-Net++ network is as follows:
[0107] The image is input into the convolution block, and the convolution block outputs the feature X1;
[0108] Feature X1 is input into the first KD module, and the first KD module outputs feature X2;
[0109] Feature X2 is input into the second KD module, and the second KD module outputs feature X3;
[0110] Feature X3 is input into the third KD module, and the third KD module outputs feature X4;
[0111] Feature X4 is input into the fourth KD module, and the fourth KD module outputs feature X5;
[0112] The feature X1 and feature X2 are concatenated in channel dimension through Concat(·). After concatenation, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain feature X 0,1 ;
[0113] The feature X2 and feature X3 are concatenated in channel dimension through Concat(·). After concatenation, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain feature X 1,1 ;
[0114] The feature X 0,1 and feature X 1,1 The channel dimension is spliced by Concat(·). After splicing, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain the feature X 0,2 ;
[0115] The feature X3 and feature X4 are concatenated in channel dimension through Concat(·). After concatenation, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain feature X 2,1 ;
[0116] The feature X 2,1 and feature X 1,1 The channel dimension is spliced by Concat(·). After splicing, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain the feature X 1,2 ;
[0117] The feature X 1,2 and feature X 0,2 The channel dimension is spliced by Concat(·). After splicing, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain the feature X 0,3 ;
[0118] The fourth KD module output feature X5 is input into the first KGD module, and the first KGD module outputs feature X6;
[0119] The output feature X6 of the first KGD module and the output feature X4 of the third KD module are added element by element and then input into the second KGD module, and the second KGD module outputs feature X7;
[0120] The second KGD module output feature X7, the second KD module output feature X3 and feature X 2,1After element-by-element addition, the result is input into the third KGD module, which outputs feature X8.
[0121] The third KGD module output feature X8, the first KD module output feature X2, feature X 1,1 , Feature X 1,2 After element-by-element addition, the result is input into the fourth KGD module, which outputs feature X9.
[0122] The fourth KGD module output feature X9, the convolution block output feature X1, and the feature X 0,1 , Feature X 0,2 , Feature X 0,3 After element-by-element addition, the deep convolution block is input, and the deep convolution block outputs the feature X 10 ;
[0123] The depth convolution block outputs the feature X 10 Input Softmax activation function layer, Softmax activation function layer output feature X output .
[0124] Other steps and parameters are the same as those in the first or second embodiment.
[0125] Specific embodiment 4: This embodiment differs from any one of specific embodiments 1 to 3 in that: the convolution block includes a convolution layer, a batch normalization layer, a ReLU activation function and a maximum pooling layer in sequence;
[0126] The convolution kernel size of the convolution layer is 3×3 and the stride is 1;
[0127] The stride of the max pooling layer is 2.
[0128] The other steps and parameters are the same as those in the first to third embodiments.
[0129] Specific embodiment 5: This embodiment differs from any one of specific embodiments 1 to 4 in that: each KD module in the first KD module, the second KD module, the third KD module, and the fourth KD module sequentially includes: a KANLayer layer, a depth convolution layer (DwConv), a batch normalization layer BN, a ReLU activation function layer, and a layer normalization LN;
[0130] The KAN Layer layer includes a first spline function Φ1, a second spline function Φ2 and a third spline function Φ3 in sequence.
[0131] Other steps and parameters are the same as those in Specific Embodiments 1 to 4-1.
[0132] Specific embodiment 6: This embodiment differs from any one of specific embodiments 1 to 5 in that the working process of the first KD module is:
[0133] Feature X1 inputs the first spline function Φ1, and the first spline function Φ1 outputs feature X 11 ;
[0134] The first spline function Φ1 outputs the feature X 11 Input the second spline function Φ2, the second spline function Φ2 outputs the feature X 12 ;
[0135] The second spline function Φ2 outputs the feature X 12 Input the third spline function Φ3, the third spline function Φ3 outputs the feature X 13 ;
[0136] The third spline function Φ3 outputs the feature X 13 Input the deep convolution layer (DwConv), batch normalization layer BN, ReLU activation function layer, layer normalization LN in sequence, and the layer normalization LN outputs the feature X2;
[0137] The working process of the second KD module is:
[0138] Feature X2 inputs the first spline function Φ1, and the first spline function Φ1 outputs feature X 21 ;
[0139] The first spline function Φ1 outputs the feature X 21 Input the second spline function Φ2, the second spline function Φ2 outputs the feature X 22 ;
[0140] The second spline function Φ2 outputs the feature X 22 Input the third spline function Φ3, the third spline function Φ3 outputs the feature X 23 ;
[0141] The third spline function Φ3 outputs the feature X 23 Input the deep convolution layer (DwConv), batch normalization layer BN, ReLU activation function layer, layer normalization LN in sequence, and the layer normalization LN outputs the feature X3;
[0142] The working process of the third KD module is:
[0143] Feature X3 inputs the first spline function Φ1, and the first spline function Φ1 outputs feature X 31 ;
[0144] The first spline function Φ1 outputs the feature X 31 Input the second spline function Φ2, the second spline function Φ2 outputs the feature X 32 ;
[0145] The second spline function Φ2 outputs the feature X 32 Input the third spline function Φ3, the third spline function Φ3 outputs the feature X 33 ;
[0146] The third spline function Φ3 outputs the feature X 33 Input the deep convolution layer (DwConv), batch normalization layer BN, ReLU activation function layer, layer normalization LN in sequence, and the layer normalization LN outputs feature X4;
[0147] The working process of the fourth KD module is:
[0148] Feature X4 inputs the first spline function Φ1, and the first spline function Φ1 outputs feature X 41 ;
[0149] The first spline function Φ1 outputs the feature X 41 Input the second spline function Φ2, the second spline function Φ2 outputs the feature X 42 ;
[0150] The second spline function Φ2 outputs the feature X 42 Input the third spline function Φ3, the third spline function Φ3 outputs the feature X 43 ;
[0151] The third spline function Φ3 outputs the feature X 43 Input the deep convolution layer (DwConv), batch normalization layer BN, ReLU activation function layer, layer normalization LN in sequence, and the layer normalization LN outputs feature X5;
[0152] Other steps and parameters are the same as those in Specific Implementations 1 to 5-1.
[0153] Specific embodiment seven: This embodiment is different from any one of specific embodiments one to six in that: each KGD module in the first KGD module, the second KGD module, the third KGD module, and the fourth KGD module sequentially includes a convolution layer, a batch normalization layer BN, a ReLU activation function layer, an upsampling layer, a convolution layer, a batch normalization layer BN, a ReLU activation function layer, a flattening layer, a KANLayer layer, a depthwise convolution layer, a batch normalization layer BN, a ReLU activation function layer, and a layer normalization (LN);
[0154] The KAN Layer layer includes a first spline function Φ1, a second spline function Φ2 and a third spline function Φ3 in sequence.
[0155] Other steps and parameters are the same as those in Specific Implementations 1 to 6-1.
[0156] Specific embodiment eight: This embodiment differs from any one of specific embodiments one to seven in that the working process of the first KGD module is:
[0157] The output feature X5 of the fourth KD module is sequentially input into the convolution layer, batch normalization layer BN, ReLU activation function layer, upsampling, convolution layer, batch normalization layer BN, ReLU activation function layer, flattening layer, KAN Layer layer, depth convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization (LN), and layer normalization (LN) outputs feature X6;
[0158] The working process of the second KGD module is:
[0159] The output feature X6 of the first KGD module and the output feature X4 of the third KD module are added element by element and then input into the convolution layer, batch normalization layer BN, ReLU activation function layer, upsampling, convolution layer, batch normalization layer BN, ReLU activation function layer, flattening layer, KAN Layer layer, depth convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization (LN), layer normalization (LN) output feature X7;
[0160] The working process of the third KGD module is:
[0161] The second KGD module output feature X7, the second KD module output feature X3 and feature X 2,1 After element-by-element addition, the convolution layer, batch normalization layer BN, ReLU activation function layer, upsampling, convolution layer, batch normalization layer BN, ReLU activation function layer, flattening layer, KANLayer layer, depth convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization (LN), layer normalization (LN) output feature X8;
[0162] The working process of the fourth KGD module is:
[0163] The third KGD module output feature X8, the first KD module output feature X2, feature X 1,1 , Feature X 1,2 After element-by-element addition, the convolution layer, batch normalization layer BN, ReLU activation function layer, upsampling, convolution layer, batch normalization layer BN, ReLU activation function layer, flattening layer, KAN Layer layer, depth convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization (LN), and layer normalization (LN) output feature X9.
[0164] Other steps and parameters are the same as those in Specific Implementations 1 to 6-1.
[0165] Specific embodiment 9: This embodiment differs from any one of specific embodiments 1 to 8 in that: the depth convolution block includes a convolution layer, a batch normalization layer, and a ReLU activation function in sequence;
[0166] The working process of the depth convolution block is:
[0167] The fourth KGD module output feature X9, the convolution block output feature X1, and the feature X 0,1 , Feature X 0,2 , Feature X 0,3 After element-by-element addition, the convolution layer, batch normalization layer, and ReLU activation function layer are input in sequence. The ReLU activation function layer outputs the feature X 10 .
[0168] The other steps and parameters are the same as those in the specific implementation modes 1 to 8-1.
[0169] Specific embodiment 10: This embodiment differs from any one of specific embodiments 1 to 9 in that: the length, width, and number of channels of the input image are H, W, and C=3 respectively;
[0170] The length, width, and number of channels of the feature X1 are H / 2, W / 2, and C=64 respectively;
[0171] The length, width, and number of channels of the feature X2 are H / 4, W / 4, and C=128 respectively;
[0172] The length, width, and number of channels of the feature X3 are H / 8, W / 8, and C=256 respectively;
[0173] The length, width, and number of channels of the feature X4 are H / 16, W / 16, and C=320 respectively;
[0174] The length, width, and number of channels of the feature X5 are H / 32, W / 32, and C=512 respectively;
[0175] The length, width, and number of channels of the feature X6 are H / 16, W / 16, and C=320 respectively;
[0176] The length, width, and number of channels of the feature X7 are H / 8, W / 8, and C=256 respectively;
[0177] The length, width, and number of channels of the feature X8 are H / 4, W / 4, and C=128 respectively;
[0178] The length, width and number of channels of the feature X9 are H / 2, W / 2 and C=64 respectively;
[0179] The feature X 10 The length, width and number of channels are H, W and C = 32 respectively;
[0180] The feature X output The length, width and number of channels are H, W and C=2 respectively.
[0181] The other steps and parameters are the same as those in the specific implementation modes 1 to 9-1.
[0182] The following examples are used to verify the beneficial effects of the present invention:
[0183] Example 1:
[0184] The validation set is input into the trained KAN-U-Net++ network to segment the effective tooth surface and pitting area of the gear. The segmentation accuracy is evaluated by the modified Intersection over Union (mIoU) and F1-Score. The formulas are:
[0185]
[0186] in,
[0187] mIoU stands for mean intersection over union, which is used to evaluate the degree of overlap between model predictions and true labels in tasks such as semantic segmentation.
[0188] C represents the number of categories, which represents the number of target categories in the dataset;
[0189] TP c represents the true examples of category c, that is, the number of samples correctly predicted by the model as category c;
[0190] FP c Represents the false positive examples of category c, that is, the number of samples of other categories that the model mistakenly predicts as category c;
[0191] FN cRepresents the false negative examples of category c, that is, the number of samples of category c that the model mistakenly predicts as samples of other categories;
[0192] F1-Score represents the F1 score, which is an indicator used to measure the performance of the classification model;
[0193] Precision represents the accuracy rate, which indicates the proportion of true positive examples among the samples predicted by the model as positive examples;
[0194] Recall stands for recall rate, which indicates the proportion of samples that are actually positive examples that are correctly predicted as positive examples by the model;
[0195] Represents multiplication operation;
[0196] In summary, this is the proposed method for measuring pitting corrosion in agricultural machinery gears based on KANs and U-Net++. Next, we will conduct comparative tests using different models on the same dataset to demonstrate the effectiveness and accuracy of this method. The tests are as follows:
[0197] Experimental verification:
[0198] Dataset selection: We selected a dataset of gear pitting images. This dataset contains 814 images and their masks, with a resolution of 256×256, providing diverse data for model training and evaluation.
[0199] Training settings: NVIDIA A100 GPUs were used for training, with an initial learning rate of 0.0002, a batch size of 16, and a cosine annealing and early stopping strategy. The model converged within 50 epochs, and inference time for a single image was ≤ 0.1s, meeting real-time detection requirements.
[0200] Comparative experiments of different models on data sets:
[0201] Segmentation performance comparison: The comparative experiment on the same dataset (814 images) shows that KAN-U-Net++ achieves an mIoU of 96.2% and an F1-Score of 97.8%, which is better than U-KAN (93.92% IoU) and traditional U-Net++ (88.83% IoU). Figure 5 As shown in the figure, the pitting boundary is clearer and the small target missed detection rate is reduced by 43%.
[0202] Table 1 Segmentation results of different models in gear pitting image data
[0203]
[0204] The present invention may have many other embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art may make various corresponding changes and modifications based on the present invention, but these corresponding changes and modifications should all fall within the scope of protection of the claims attached to the present invention.
Claims
1. A method for agricultural machinery gear pitting image recognition based on KANs and U-Net++, characterized by: The specific process of the method is: Step 1: Obtain an image of pitting corrosion of agricultural machinery gears through an image acquisition device; Step 2: Preprocess the pitting corrosion images of agricultural machinery gears obtained in step 1 and use them as training sets; Step 3: Build the KAN-U-Net++ network; Step 4: Input the training set into the KAN-U-Net++ network, use the cross-entropy loss function to optimize the KAN-U-Net++ network model parameters, and combine the Adam optimizer to perform gradient updates until the cross-entropy loss function converges to obtain the trained KAN-U-Net++ network model; Step 5: Input the pitting corrosion image of the agricultural machinery gear to be tested into the trained KAN-U-Net++ network model, and the trained KAN-U-Net++ network model outputs the classification result of the pitting corrosion image of the agricultural machinery gear to be tested.
2. The method for agricultural machinery gear pitting image recognition based on KANs and U-Net++ according to claim 1 is characterized by: In step 2, the gear pitting images obtained in step 1 are preprocessed as a training set; the specific process is as follows: The resolution of the agricultural machinery gear pitting image obtained in step 1 was uniformly adjusted to 256×256; The pitting corrosion images of agricultural machinery gears after adjusting the resolution were vertically flipped, horizontally flipped, and scaled in sequence to obtain the preprocessed pitting corrosion images of agricultural machinery gears as the training set.
3. The method for agricultural machinery gear pitting image recognition based on KANs and U-Net++ according to claim 2, characterized in that: In step 3, the KAN-U-Net++ network is constructed; the specific process is as follows: The KAN-U-Net++ network includes a convolution block, a first KD module, a second KD module, a third KD module, a fourth KD module, a first KGD module, a second KGD module, a third KGD module, a fourth KGD module, a depth convolution block, and a Softmax activation function layer; The working process of the KAN-U-Net++ network is as follows: The image is input into the convolution block, and the convolution block outputs the feature X1; Feature X1 is input into the first KD module, and the first KD module outputs feature X2; Feature X2 is input into the second KD module, and the second KD module outputs feature X3; Feature X3 is input into the third KD module, and the third KD module outputs feature X4; Feature X4 is input into the fourth KD module, and the fourth KD module outputs feature X5; The feature X1 and feature X2 are concatenated in channel dimension through Concat(·). After concatenation, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain feature X 0,1 ; The feature X2 and feature X3 are concatenated in channel dimension through Concat(·). After concatenation, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain feature X 1,1 ; The feature X 0,1 and feature X 1,1 The channel dimension is spliced by Concat(·). After splicing, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain the feature X 0,2 ; The feature X3 and feature X4 are concatenated in channel dimension through Concat(·). After concatenation, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain feature X 2,1 ; The feature X 2,1 and feature X 1,1 The channel dimension is spliced by Concat(·). After splicing, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain the feature X 1,2 ; The feature X 1,2 and feature X 0,2 The channel dimension is spliced by Concat(·). After splicing, the features are sequentially passed through the convolution layer, ReLU activation function layer, convolution layer, and ReLU activation function layer to obtain the feature X 0,3 ; The fourth KD module output feature X5 is input into the first KGD module, and the first KGD module outputs feature X6; The output feature X6 of the first KGD module and the output feature X4 of the third KD module are added element by element and then input into the second KGD module, and the second KGD module outputs feature X7; The second KGD module output feature X7, the second KD module output feature X3 and feature X 2,1 After element-by-element addition, the result is input into the third KGD module, which outputs feature X8. The third KGD module output feature X8, the first KD module output feature X2, feature X 1,1 , Feature X 1,2 After element-by-element addition, the result is input into the fourth KGD module, which outputs feature X9. The fourth KGD module output feature X9, the convolution block output feature X1, and the feature X 0,1 , Feature X 0,2 , Feature X 0,3 After element-by-element addition, the deep convolution block is input, and the deep convolution block outputs the feature X 10 ; The depth convolution block outputs the feature X 10 Input Softmax activation function layer, Softmax activation function layer output feature X output .
4. The method for agricultural machinery gear pitting image recognition based on KANs and U-Net++ according to claim 3 is characterized by: The convolution block includes a convolution layer, a batch normalization layer, a ReLU activation function and a maximum pooling layer in sequence; The convolution kernel size of the convolution layer is 3×3 and the stride is 1; The stride of the max pooling layer is 2.
5. The method for agricultural machinery gear pitting image recognition based on KANs and U-Net++ according to claim 4 is characterized by: Each KD module in the first KD module, the second KD module, the third KD module, and the fourth KD module includes, in sequence: a KAN layer, a depth convolution layer, a batch normalization layer BN, a ReLU activation function layer, and a layer normalization LN; The KAN Layer layer includes a first spline function Φ1, a second spline function Φ2 and a third spline function Φ3 in sequence.
6. The method for agricultural machinery gear pitting image recognition based on KANs and U-Net++ according to claim 5, characterized in that: The working process of the first KD module is: Feature X1 inputs the first spline function Φ1, and the first spline function Φ1 outputs feature X 11 ; The first spline function Φ1 outputs the feature X 11 Input the second spline function Φ2, the second spline function Φ2 outputs the feature X 12 ; The second spline function Φ2 outputs the feature X 12 Input the third spline function Φ3, the third spline function Φ3 outputs the feature X 13 ; The third spline function Φ3 outputs the feature X 13 Input the deep convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization LN in sequence, and the layer normalization LN outputs the feature X2; The working process of the second KD module is: Feature X2 inputs the first spline function Φ1, and the first spline function Φ1 outputs feature X 21 ; The first spline function Φ1 outputs the feature X 21 Input the second spline function Φ2, the second spline function Φ2 outputs the feature X 22 ; The second spline function Φ2 outputs the feature X 22 Input the third spline function Φ3, the third spline function Φ3 outputs the feature X 23 ; The third spline function Φ3 outputs the feature X 23 Input the deep convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization LN in sequence, and the layer normalization LN outputs the feature X3; The working process of the third KD module is: Feature X3 inputs the first spline function Φ1, and the first spline function Φ1 outputs feature X 31 ; The first spline function Φ1 outputs the feature X 31 Input the second spline function Φ2, the second spline function Φ2 outputs the feature X 32 ; The second spline function Φ2 outputs the feature X 32 Input the third spline function Φ3, the third spline function Φ3 outputs the feature X 33 ; The third spline function Φ3 outputs the feature X 33 Input the deep convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization LN in sequence, and the layer normalization LN outputs the feature X4; The working process of the fourth KD module is: Feature X4 inputs the first spline function Φ1, and the first spline function Φ1 outputs feature X 41 ; The first spline function Φ1 outputs the feature X 41 Input the second spline function Φ2, the second spline function Φ2 outputs the feature X 42 ; The second spline function Φ2 outputs the feature X 42 Input the third spline function Φ3, the third spline function Φ3 outputs the feature X 43 ; The third spline function Φ3 outputs the feature X 43 Input the deep convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization LN in sequence, and the layer normalization LN outputs the feature X5.
7. The method for agricultural machinery gear pitting image recognition based on KANs and U-Net++ according to claim 6, characterized in that: Each KGD module in the first KGD module, the second KGD module, the third KGD module, and the fourth KGD module sequentially includes a convolution layer, a batch normalization layer BN, a ReLU activation function layer, an upsampling layer, a convolution layer, a batch normalization layer BN, a ReLU activation function layer, a flattening layer, a KAN Layer layer, a depth convolution layer, a batch normalization layer BN, a ReLU activation function layer, and layer normalization; The KAN Layer layer includes a first spline function Φ1, a second spline function Φ2 and a third spline function Φ3 in sequence.
8. The method for agricultural machinery gear pitting image recognition based on KANs and U-Net++ according to claim 7, characterized in that: The working process of the first KGD module is: The output feature X5 of the fourth KD module is sequentially input into the convolution layer, batch normalization layer BN, ReLU activation function layer, upsampling, convolution layer, batch normalization layer BN, ReLU activation function layer, flattening layer, KANLayer layer, depth convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization, and layer normalization output feature X6; The working process of the second KGD module is: The output feature X6 of the first KGD module and the output feature X4 of the third KD module are added element by element and then input into the convolution layer, batch normalization layer BN, ReLU activation function layer, upsampling, convolution layer, batch normalization layer BN, ReLU activation function layer, flattening layer, KANLayer layer, depth convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization, and layer normalization output feature X7; The working process of the third KGD module is: The second KGD module output feature X7, the second KD module output feature X3 and feature X 2,1 After element-by-element addition, the convolution layer, batch normalization layer BN, ReLU activation function layer, upsampling, convolution layer, batch normalization layer BN, ReLU activation function layer, flattening layer, KANLayer layer, depth convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization, and layer normalization output feature X8; The working process of the fourth KGD module is: The third KGD module output feature X8, the first KD module output feature X2, feature X 1,1 , Feature X 1,2 After element-by-element addition, the convolution layer, batch normalization layer BN, ReLU activation function layer, upsampling, convolution layer, batch normalization layer BN, ReLU activation function layer, flattening layer, KANLayer layer, depth convolution layer, batch normalization layer BN, ReLU activation function layer, layer normalization, and layer normalization output feature X9 are input in sequence.
9. The method for agricultural machinery gear pitting image recognition based on KANs and U-Net++ according to claim 8, characterized in that: The depth convolution block includes a convolution layer, a batch normalization layer and a ReLU activation function in sequence; The working process of the depth convolution block is: The fourth KGD module output feature X9, the convolution block output feature X1, and the feature X 0,1 , Feature X 0,2 , Feature X 0,3 After element-by-element addition, the convolution layer, batch normalization layer, and ReLU activation function layer are input in sequence. The ReLU activation function layer outputs the feature X 10 .
10. The method for agricultural machinery gear pitting image recognition based on KANs and U-Net++ according to claim 9, characterized in that: The length, width and number of channels of the input image are H, W and C=3 respectively; The length, width, and number of channels of the feature X1 are H / 2, W / 2, and C=64 respectively; The length, width, and number of channels of the feature X2 are H / 4, W / 4, and C=128 respectively; The length, width, and number of channels of the feature X3 are H / 8, W / 8, and C=256 respectively; The length, width, and number of channels of the feature X4 are H / 16, W / 16, and C=320 respectively; The length, width, and number of channels of the feature X5 are H / 32, W / 32, and C=512 respectively; The length, width and number of channels of the feature X6 are H / 16, W / 16 and C==320 respectively; The length, width, and number of channels of the feature X7 are H / 8, W / 8, and C=256 respectively; The length, width, and number of channels of the feature X8 are H / 4, W / 4, and C=128 respectively; The length, width and number of channels of the feature X9 are H / 2, W / 2 and C=64 respectively; The feature X 10 The length, width and number of channels are H, W and C = 32 respectively; The feature X output The length, width and number of channels are H, W and C=2 respectively.
Citation Information
Cited By
A method and system for verifying pitting corrosion of tooth flanks
CN122434947A