KANs-based agricultural machinery gear pitting corrosion measurement method
Through the KANs-based agricultural machinery gear pitting measurement method, image acquisition and U-KAN+ network training are used to solve the efficient and accurate problem of agricultural machinery gear pitting detection, and high-precision gear fault diagnosis is achieved.
Patent Information
- Application Number
- CN202510269500.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-07-04
AI Technical Summary
The prior art is difficult to detect pitting failures of agricultural machinery gears efficiently and accurately. The traditional methods are inefficient, costly and without early warning. The methods based on vibration monitoring have problems with difficult to identify early pitting failure characteristics and noise interference.
The agricultural machinery gear pitting measurement method based on Kolmogorov-Arnold Networks (KANs) is adopted, and through image acquisition, preprocessing, data set division and U-KAN+ network training, iterative update is performed using the cross entropy loss function that considers the category weight to achieve high-precision segmentation of the gear pitting image.
It improves the segmentation accuracy of gear pitting images, can detect gear failure more accurately, enhances feature processing capabilities, and achieves more efficient fault diagnosis.
Smart Images

Figure CN120259194A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a method for measuring pitting corrosion of agricultural machinery gears based on KANs. Background Art
[0002] The transmission system of agricultural machinery is considered an important part of agricultural machinery. Due to the influence of the environment, terrain, etc., agricultural machinery is prone to component loosening, deformation or damage. Among them, gear transmission has a relatively wide range of faults in the agricultural transmission system. Gear fatigue pitting is one of the most common failure forms of gears. Under the repeated action of alternating contact stress on the tooth surface, the fatigue cracks on the surface continue to expand, and finally form pitted pits, which are pitting corrosion. If not discovered and treated in time, the small pitted pits on the tooth surface will further expand, and even lead to broken teeth, causing serious economic losses and equipment failures. Traditional agricultural machinery fault diagnosis methods rely on experience and regular maintenance, and have problems such as low efficiency, high cost, and no early warning. Although the gear pitting corrosion measurement technology based on vibration monitoring is widely used, there are problems such as difficult identification of early pitting corrosion fault characteristics, complex and non-stationary vibration signals, noise on site, and obvious energy attenuation during fault signal acquisition. At present, there are very few detection methods for agricultural machinery gear pitting corrosion based on deep learning. Therefore, it is necessary to develop gear pitting corrosion detection technology based on computer vision, which is of great significance for the wide application of agricultural machinery fault diagnosis. Summary of the Invention
[0003] To solve the above problems, a method for measuring pitting corrosion of agricultural machinery gears based on KANs can effectively improve the segmentation accuracy of gear pitting corrosion images, thus solving the problem of efficiently and accurately detecting gear failures in gear contact fatigue tests.
[0004] To achieve the above object, the technical solution adopted by the present invention is:
[0005] A method for measuring pitting corrosion of agricultural machinery gears based on KANs, comprising the following steps:
[0006] S1. Obtain gear pitting corrosion images through an image acquisition device;
[0007] S2. Unify the resolution of the gear pitting corrosion images and perform preprocessing;
[0008] S3. Make segmentation labels for the processed gear pitting corrosion images and divide the data set into a training set and a validation set;
[0009] S4. Combine the P-KAN module and the D-KAN module with the convolutional block, and construct the U-KAN+ network;
[0010] S5. Input the training set into the U-KAN+ network, and use the cross-entropy loss function considering class weights to iteratively update and train the U-KAN+ network;
[0011] S6. Input the validation set into the trained U-KAN+ network, segment the effective tooth surface and pitting area of the gear, and perform detection on the gear through segmentation metrics.
[0012] Preferably, in S2, adjust the resolution of all gear pitting images to 256×256; then, perform preprocessing on the collected gear pitting images, including rotating 90 degrees, horizontal flipping, and image scaling.
[0013] Preferably, in S3, use the Labelme image annotation tool in Pycharm to make corresponding segmentation labels; randomly divide the images into an 80% training set and a 20% validation set.
[0014] Preferably, in S4, construct the U-KAN+ network based on the encoding-decoding structure of KANs, which includes a convolutional module, a Patchembed-KAN module, and a Decoder-KAN module;
[0015] The encoder is composed of two convolutional modules and three P-KAN modules. Each convolutional block consists of a convolutional layer, a batch normalization layer, and a ReLU activation function, and activation and max pooling operations are performed after each convolutional block;
[0016] The convolutional output feature map is divided into blocks through Patch embedding operation, flattened and transposed after changing the channel dimension, then passed into the KAN layers, and finally through a depth convolutional layer and a normalization layer; where the size of each Patch is p×p, and the channel dimension of the feature map is changed by setting the appropriate number of convolutional kernel channels. For the calculation of the output positions B, H, W in the channel dimension, the feature map ZL after the image is projected by convolution is flattened to change its dimension to B, C, H×W, and then transposed to change the dimension to B, H×W, C; after passing through the KAN layer, the feature will pass through an efficient depth convolutional layer, and then a layer normalization is applied to enable the feature to pass through the next module.
[0017] Preferably, in S4, the decoder is composed of three D-KAN modules and two convolutional modules. After deconvolutional upsampling of the output features in the bottleneck stage and fusing them with the original features, it passes through the KAN layer, the depth convolutional layer, and the normalization layer; first, perform deconvolutional upsampling operation on the output features Z k to obtain Z k+1 and then fuse it with Z kFeature fusion is performed by addition; after the features pass through the KAN layer, they will pass through an efficient depth convolution layer, and then a layer normalization is applied to enable the features to pass through the next module until the final convolution layer.
[0018] Preferably, in S5, class weights w are introduced into the cross-entropy loss function, and the original cross-entropy loss is weighted according to the weight w corresponding to the target class y. y Weight the original cross-entropy loss.
[0019] Preferably, in S6, the gear pitting image segmentation accuracy metrics are IoU and Dice.
[0020] The beneficial effects of using the present invention are:
[0021] 1. High accuracy: In the collected gear pitting image dataset, multiple metrics reach the optimal results, and the test performance is better than the current state-of-the-art fault diagnosis methods, enabling more accurate measurement and diagnosis of gear pitting conditions.
[0022] 2. Powerful feature processing ability: Utilize Kolmogorov-Arnold Networks (KANs) to effectively capture non-linear patterns in complex data, achieve better feature fusion, and enable the model to understand and process gear pitting-related features more comprehensively and deeply.
[0023] 3. Innovative module design: Through two different modules, Patchembed-KAN and Decoder-KAN, features can be effectively extracted and transformed during the encoding stage, and the feature resolution can be restored and multi-layer information can be fused during the decoding stage, further enhancing information interaction and improving the model's ability to segment and analyze gear pitting images, which helps to more accurately identify and measure gear pitting conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a flowchart of the method of the present invention.
[0025] Figure 2 It is the network structure diagram of U-KAN+;
[0026] Figure 3 It is the segmentation result diagram of different models on the gear pitting image dataset. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0027] To make the objectives, technical solutions, and advantages of the present technical solution clearer and more understandable, the present technical solution will be further described in detail below in conjunction with specific embodiments. It should be understood that these descriptions are exemplary and are not intended to limit the scope of the present technical solution.
[0028] Combined with Figure 1As shown, the present invention is a method for measuring pitting corrosion of agricultural machinery gears based on Kolmogorov - Arnold Networks (KANs), specifically including the following steps:
[0029] 1: Fix the RER - USB12MP01 intelligent pan - tilt image collector to the test bench through an adjustable bracket to flexibly adjust the shooting angle of the camera; 814 gear pitting corrosion images are obtained through devices such as the image collector, LED light source, and laptop computer.
[0030] 2: Adjust the resolution of all gear pitting corrosion images to 256×256; then, perform pre - processing methods such as inverting 90 degrees, horizontal flipping, and image scaling on the collected gear pitting corrosion images.
[0031] 3: Use the Labelme image annotation tool in Pycharm to make corresponding segmentation labels; randomly divide the images into an 80% training set and a 20% validation set.
[0032] 4: The constructed U - KAN+ network is based on the encoding - decoding structure of KANs, including a convolutional module, a Patchembed - KAN module, and a Decoder - KAN module.
[0033] Specifically as Figure 2 shown, the proposed network structure consists of an encoder and a decoder. The encoder consists of two convolutional modules and three P - KAN modules. Each convolutional block is composed of a convolutional layer (kernel size 3×3, stride 1), a batch normalization layer, and a ReLU activation function. And activation and max - pooling operations are performed after each convolutional block. The stride of the max - pooling layer is 2. Specifically, when an input picture is The output result of each convolutional block can be expressed by the following formula:
[0034] X l =Relu(MaxPool(Conv(X l-1 )))
[0035] where represents the output feature map of the l - th layer, L is the number in the convolutional module, and the final output is X L .
[0036] After the convolutional output feature map is divided into patches through the Patch embedding operation, flattened and transposed after changing the channel dimension, it is then fed into the KAN layers (N = 3), and finally passes through the depth convolutional layer and the normalization layer. The size of each patch is p×p. The channel dimension of the feature map is changed by setting the appropriate number of channels of the convolutional kernel. For the calculation of each output position (B, H, W) in the channel dimension. The feature map Z of the image after convolutional projection L , and then undergoes a flattening operation to change its dimension to (B, C, H×W), and then through a transpose operation, the dimension becomes (B, H×W, C). After passing through the KAN layer, the feature will pass through an efficient depth convolutional layer (DwConv), and then a layer normalization (LN) is applied to enable the feature to pass through the next module. It can be expressed by the following formula:
[0037]
[0038] Z b ' ,c,n = Z b,c,h,w
[0039] Z b " ,n,c = Z b,c,n
[0040] Z k = LN(DwConv(KAN(Z k-1 )))
[0041] where (K h = P h , K w = P w ), W c,i,j,k is the weight parameter corresponding to the output channel c, input channel i, and convolutional kernel spatial position (j, k) in the convolutional kernel. b is the batch index, c is the channel index, n is the flattened position index, n = h×W + w, and h and w are the original spatial dimension positions. The feature map of Z k is (H k , W k , C k ), and k is the number of P-KAN modules, k = 3.
[0042] The decoder consists of three D-KAN modules and two convolutional modules. After deconvolutional upsampling of the output features in the bottleneck stage and fusing with the original features, it passes through the KAN layer, depth convolutional layer, and normalization layer. First, perform a deconvolutional upsampling operation on the output features Z k of the bottleneck stage to obtain Z k+1 , and then fuse it with Z kFeature fusion is performed by addition. After the features pass through the KAN layer, they will go through an efficient depth convolution layer (DwConv), and then a layer normalization (LN) is applied to enable the features to pass through the next module until the final convolution layer. It can be expressed by the following formula:
[0043] Z k+1 = DConv(Z k )
[0044] Z' k = Cat(Z k+1 ,(Z k ))
[0045] where Cat(,) is the feature concatenation operation.
[0046] 5: Input the training set into the U-KAN+ network, and use the cross-entropy loss formula considering class weights to iteratively update and train the U-KAN+ network;
[0047] 6: Input the validation set into the trained U-KAN+ network, segment the effective tooth surface and pitting area of the gear, and perform detection on the gear through segmentation metrics.
[0048] In summary, this is the proposed method for measuring pitting of agricultural machinery gears based on Kolmogorov-Arnold Networks (KANs). Next, through comparative experiments of different models in the same dataset, the effectiveness and accuracy of this method are demonstrated. The experiments are as follows:
[0049] Experimental verification:
[0050] Dataset selection: Select the collected gear pitting image dataset. There are 814 images and their masks in total, with a resolution of 256×256, providing diverse data for model training and evaluation.
[0051] Training settings: Implemented using Pytorch on an NVIDIA RTX 4090D GPU, with an initial learning rate of 0.0001, a batch size of 8, an Adam optimizer, a cosine annealing learning rate scheduler, a minimum learning rate of 0.00001, and image enhancement methods are adopted. The gear pitting dataset is trained for 50 epochs.
[0052] Comparative experiments of different models on the dataset:
[0053] Comparison of segmentation performance: Compare the Dice coefficient and IoU metrics on the gear pitting dataset. As shown in Table 1 below, U-KAN+ performs excellently in the later stage of training. The IoU on the gear pitting dataset is 0.9497, and the Dice Coeff is 0.9735. As Figure 3As shown, the segmentation result map is closer to the true label, indicating its strong feature expression and segmentation performance.
[0054] Table 1 Segmentation results of different models in gear pitting image data
[0055]
[0056] The above content is only a preferred embodiment of the present invention. For those of ordinary skill in the art, many changes can be made in the specific implementation manners and application scopes according to the idea of the technical content of the present application. As long as these changes do not depart from the concept of the present invention, they all fall within the protection scope of this patent.
Claims
1. A method for measuring pitting corrosion of agricultural machinery gears based on KANs, characterized in that: It includes the following steps: S1. Obtain the gear pitting image through an image acquisition device; S2. Unify the resolution of the gear pitting image and perform preprocessing; S3. Make the segmentation labels for the processed gear pitting image and divide the dataset, which is divided into a training set and a validation set; S4. Combine the P-KAN module and the D-KAN module with the convolutional block and construct the U-KAN+ network; S5. Input the training set into the U-KAN+ network, and use the cross-entropy loss function considering class weights to iteratively update and train the U-KAN+ network; S6. Input the validation set into the trained U-KAN+ network, segment the effective tooth surface and pitting area of the gear, and make detections on the gear through segmentation metrics.
2. The method for measuring pitting corrosion of agricultural machinery gears based on KANs according to claim 1, wherein: In S2, adjust the resolution of all gear pitting images to 256×256; then, perform preprocessing on the collected gear pitting images, including rotating 90 degrees, horizontal flipping, and image scaling.
3. The method for measuring pitting corrosion of agricultural machinery gears based on KANs according to claim 1, wherein: In S3, use the Labelme image annotation tool in Pycharm to make corresponding segmentation labels; randomly divide the images into an 80% training set and a 20% validation set.
4. The method for measuring pitting corrosion of agricultural machinery gears based on KANs according to claim 1, characterized in that: In S4, construct the U-KAN+ network based on the encoding-decoding structure of KANs, which includes a convolutional module, a Patchembed-KAN module, and a Decoder-KAN module; The encoder consists of two convolutional modules and three P-KAN modules. Each convolutional block is composed of a convolutional layer, a batch normalization layer, and a ReLU activation function, and activation and max pooling operations are performed after each convolutional block; The convolutional output feature map is divided into blocks through Patch embedding operation, flattened and transposed after changing the channel dimension, then passed into the KAN layers, and finally through a depth convolutional layer and a normalization layer; where the size of each Patch is p×p, and the channel dimension of the feature map is changed by setting the appropriate number of convolutional kernel channels. For the calculation of the channel dimension at each output position B, H, W, the feature map ZL after the image is projected by convolution is then flattened to change its dimension to B, C, H×W, and then transposed to change the dimension to B, H×W, C; after passing through the KAN layer, the feature will pass through an efficient depth convolutional layer, and then a layer normalization is applied to make the feature pass through the next module.
5. The method for measuring pitting corrosion of agricultural machinery gears based on KANs according to claim 3, wherein: In S4, the decoder consists of three D-KAN modules and two convolutional modules. After deconvolutional upsampling of the output features in the bottleneck stage and fusing them with the original features, it goes through a KAN layer, a depth convolutional layer, and a normalization layer. First, the feature Z output in the bottleneck stage k undergoes a deconvolutional upsampling operation to obtain Z k+1 , and then it is added to Z k for feature fusion; After the feature passes through the KAN layer, it will pass through an efficient depth convolutional layer, and then a layer normalization is applied to make the feature pass through the next module until the last convolutional layer.
6. The method for measuring pitting corrosion of agricultural machinery gears based on KANs according to claim 1, characterized in that: In S5, the class weight w is introduced into the cross-entropy loss function, and the original cross-entropy loss is weighted according to the weight w corresponding to the target class y. y The original cross-entropy loss is weighted.
7. The pitting measurement method of agricultural machinery gears based on KANs according to claim 1, characterized in that: In S6, the gear pitting image segmentation accuracy metrics are IoU and Dice.
Citation Information
Cited By
Method and system for solving geometric distortion of astronomical image
CN122115388A