An unmanned aerial vehicle (UAV) inspection and intelligent detection method and system for a tower crane split pin defect

By using drones equipped with high-definition cameras and 3D model path planning, combined with an improved ResNet18 model, automated and high-precision defect detection of cotter pins on tower cranes was achieved. This solved the problems of high risk, low efficiency, and high false negative rate of manual inspection, and improved detection efficiency and accuracy.

CN122115333APending Publication Date: 2026-05-29NANJING TIANZHOU TESTING CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING TIANZHOU TESTING CO LTD
Filing Date
2026-01-28
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Current tower crane cotter pin inspection relies on manual inspection, which is high-risk, inefficient, and has a high rate of missed detection. Furthermore, drone inspection has failed to achieve automated and high-precision defect identification.

Method used

A multi-rotor drone equipped with a high-definition camera and a centimeter-level positioning module is used. Combined with a 3D model and path planning, it automatically acquires images of cotter pins and performs defect detection using an improved ResNet18 model, including image preprocessing and transfer learning training, to achieve automated and accurate defect identification.

Benefits of technology

It enables efficient and safe detection of cotter pin defects using drones, reducing the detection time to within 30 minutes, improving the detection accuracy to 97.8%, reducing the false negative rate to below 3%, and providing defect severity classification and differentiated operation and maintenance measures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122115333A_ABST
    Figure CN122115333A_ABST
Patent Text Reader

Abstract

The application discloses a kind of unmanned aerial vehicle inspection and intelligent detection method for tower crane split pin defect, and relates to the technical field of special equipment detection.The method is accurately photographed by high-definition camera carried by unmanned aerial vehicle on the split pin part of tower crane, and high-resolution detail images are obtained;Based on the pre-trained ResNet18_Weights model for transfer learning, a split pin defect detection model is constructed to automatically identify and determine defects such as split pin loss, wear and incomplete opening in the photographed images.The application solves the problems of low efficiency, high risk and high defect omission rate in traditional manual inspection, realizes automatic and high-precision detection of split pin defects, and ensures the safe operation of tower crane.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of special equipment safety inspection technology, specifically to a method and system for unmanned aerial vehicle (UAV) inspection and intelligent detection of cotter pin defects in tower cranes. Background Technology

[0002] This section provides only background information relevant to this disclosure and is not necessarily prior art.

[0003] As a core piece of equipment in construction, tower cranes rely heavily on cotter pins at their connection points to ensure structural stability. Defects such as missing, worn, or incompletely opened cotter pins can lead to loosening and detachment of the connection, potentially causing serious safety accidents.

[0004] Current cotter pin inspection mainly relies on manual inspection, requiring inspectors to climb to the height of a tower crane and check by visual inspection or handheld equipment. This method has three major problems: First, the inspection is risky, with falls being a common occurrence due to working at heights; second, it is inefficient, requiring 2-3 hours to inspect cotter pins on a single tower crane, which cannot meet the rapid inspection needs of large-scale construction scenarios; and third, the false negative rate is high, as factors such as visual fatigue and ambient lighting make it difficult to detect small defects.

[0005] Some existing technologies attempt to use drones for equipment inspection, but these only reach the image acquisition stage and still require manual interpretation of the captured images, failing to solve the core problem of automated defect identification. Meanwhile, traditional machine learning models lack sufficient accuracy in detecting defects in small targets and under complex background interference, making them unsuitable for defect detection needs of small parts such as cotter pins. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a drone-based inspection and intelligent detection method and system for cotter pin defects in tower cranes. This system solves the problems of high risk, low efficiency, and high rate of missed defects in existing manual inspections, enabling automated, high-precision detection and safety assessment of cotter pin defects, thereby improving the operational safety and maintenance efficiency of tower cranes.

[0007] A method for unmanned aerial vehicle (UAV) inspection and intelligent detection of cotter pin defects in tower cranes includes the following steps:

[0008] Step 1: Deployment of the UAV inspection system. Construct a scaled 3D model based on the tower crane model and establish a spatial coordinate system. Configure a multi-rotor UAV equipped with a high-definition camera and a centimeter-level positioning module. Based on the 3D model and the coordinate parameters of the cotter pins (including the spatial coordinates of the tower section, boom, and hook assembly), an appropriate inspection path is automatically generated through a path planning algorithm. The path planning process takes into account the coordinate parameters of the tower body's obstructed areas to avoid obstructions and covers the coordinate points of all cotter pin installation locations in a "from bottom to top, from outside to inside" order.

[0009] Step 2: Cotter pin image acquisition. The drone flies along the preset path from Step 1 and stops at the coordinates of each cotter pin installation location to acquire images of each cotter pin installation location of the tower crane at a vertical or 15-30° angle.

[0010] Step 3: Preprocess the images acquired in Step 2 to adapt them to the input requirements of the defect detection model;

[0011] Step 4: Construct and train a defect detection model based on a ResNet18 pre-trained model. The defect detection model is trained on cotter pin defect sample data through transfer learning. The performance metrics of this model are: cotter pin defect detection accuracy ≥ 97.8%, recall ≥ 96.3%, and inference time per image ≤ 0.55 seconds. The experimental comparison results with the ordinary ResNet50 model are: the detection accuracy of the ordinary ResNet50 model is 96.5%, and the inference time per image is 0.8 seconds. The defect detection model in this step has a better inference efficiency while maintaining similar accuracy.

[0012] Step 5: Input the preprocessed image from Step 4 into the trained detection model, and use the model to infer and identify the cotter pin defect status, and output the detection results.

[0013] In step 1, the planned path covers all cotter pin installation locations in sequence (lifting boom connection point, tower section connection point, hook assembly, etc.).

[0014] In some embodiments, step 2 specifically includes:

[0015] Step 2-1: Based on the preset path obtained in Step 1, generate a preset shooting point containing spatial coordinates for each cotter pin to be inspected;

[0016] Step 2-2: Control the drone to fly to each of the preset shooting points in sequence, and control the image acquisition device to acquire images at a shooting angle that is perpendicular to the cotter pin mounting plane or at an angle of 15° to 30° to avoid strong light reflection affecting image quality;

[0017] Steps 2-3: During the acquisition process, the acquired images are evaluated in real time based on an automatic image quality assessment standard. The evaluation items include image sharpness and cotter pin occlusion area. Specifically, the standard is an image sharpness score ≥ 80 points and a cotter pin occlusion area ≤ 10% obtained using the Tenengrad gradient algorithm. If an image does not meet the evaluation standard, the drone remains at the current shooting point and retakes the image until it meets the standard before flying to the next preset shooting point. This ensures that the cotter pin area of ​​each acquired image is unobstructed and that edge details are intact.

[0018] Image contrast is enhanced by using an adaptive histogram equalization algorithm with an enhancement coefficient set to 1.0-1.5 to avoid artifacts caused by over-enhancement and to highlight the grayscale difference between the cotter pin and the tower background.

[0019] In some embodiments, step 3 specifically includes:

[0020] Step 3-1: The image acquired in Step 2 is filtered to remove noise while preserving the cotter pin edge features; image denoising is performed using a 3×3 Gaussian filtering algorithm, and the noise includes environmental noise and equipment noise.

[0021] Step 3-2: Scale the denoised images from Step 3-1 to a preset standard size; the preferred standard size is 320×320 pixels, which is suitable for the input requirements of the ResNet18 model.

[0022] Step 3-3: Perform contrast enhancement processing on the scaled image from Step 3-2 to highlight the detailed features of the cotter pin area.

[0023] In some embodiments, step 4 specifically includes:

[0024] Step 4-1: Collect a dataset of tower crane cotter pin images. Collect a dataset of tower crane cotter pin images under real working conditions at the construction site. The working conditions cover mainstream tower crane models such as QTZ63 and QTZ80, covering the cotter pin status of new machines (usage time ≤ 3 months), machines in use (usage time 3 months - 5 years), and old machines (usage time > 5 years). It also includes common outdoor construction environments such as sunny days, cloudy days, and light dust.

[0025] The dataset is divided into five categories of cotter pin condition images based on the cotter pin standard. The original sample size and definition are as follows: no less than 400 images of normal condition (opening angle ≥ 60°, no wear or deformation), no less than 200 images of slight wear (wear depth < 0.5mm), no less than 200 images of moderate wear (0.5mm ≤ wear depth < 1mm), no less than 400 images of incomplete opening (opening angle < 60°), and no less than 400 images of missing cotter pins. The total size of the original sample is no less than 1600 images. Data augmentation techniques (random rotation 0-360°, horizontal flip probability 0.5, brightness ±20% adjustment, and addition of Gaussian noise) are used to expand the sample to 5000 images. Based on the cotter pin defect category, the dataset is divided into training set, validation set, and test set in a 7:2:1 ratio using stratified sampling for model training and performance verification, ensuring that the category ratio of each subset is consistent with the original dataset.

[0026] Step 4-2: Optimize the structure of the ResNet18 pre-trained model to build an initial defect detection model and improve the accuracy of small target defect detection;

[0027] In some embodiments, step 4-2 specifically includes:

[0028] Step 4-2-1: After the third-to-last convolutional layer of the ResNet18 pre-trained model, background interference is suppressed by inserting a CBAM attention module;

[0029] Step 4-2-2: Add a defect severity classification branch that runs parallel to the defect type classification branch before the fully connected layer of the ResNet18 pre-trained model.

[0030] Step 4-3: Use an optimized training strategy to perform transfer learning training on the initial defect detection model to obtain an optimized defect detection model.

[0031] In some embodiments, step 4-3 specifically includes:

[0032] Step 4-3-1: Using knowledge distillation technology, the ResNet50 pre-trained model is used as the teacher model to guide the training process of the initial defect detection model; by temperature scaling, with the temperature coefficient ranging from [2-5], the prediction distribution of the teacher model is softened, guiding the student model, i.e., the improved ResNet18, to learn the experience of defect feature extraction; a defect severity classification branch is added before the fully connected layer, which is output in parallel with the original defect type classification branch to achieve dual-task learning of "defect type + severity".

[0033] Step 4-3-2: Freeze the parameters of the first 8 convolutional layers of the ResNet18 pre-trained model; fine-tune only the last 5 convolutional layers, the CBAM attention module, and the fully connected layers;

[0034] Step 4-3-3: Using the training set, fine-tune the unfrozen network layers, convolutional block attention modules, and defect severity classification branches in the initial defect detection model;

[0035] Step 4-3-4: Optimize the model using a joint loss function that combines classification loss and hierarchical loss.

[0036] In some embodiments, in step 4-3-4, the Adam optimizer is selected, with an initial learning rate set to 0.001, which decays to 1 / 10 of its original value every 10 training epochs, for a total of 50 training epochs. Model performance is monitored in real-time using a validation set; training stops when the validation set accuracy shows no improvement for 5 consecutive epochs, and the optimal model parameters are saved.

[0037] In some embodiments, in step 4-3-4, the classification loss is the cross-entropy loss function, the hierarchical loss is the mean squared error loss function, and the weight ratio of the two in the joint loss function is 6:4.

[0038] The improved model, after testing, achieved an accuracy of ≥97.8% and a recall of ≥96.3% for cotter pin defect detection, with a single image inference time of ≤0.55 seconds. Compared with the ordinary ResNet50 model, the ordinary ResNet50 model had an accuracy of 96.5% and a single image inference time of 0.8 seconds. The defect detection model in this step showed a significant improvement in inference efficiency while maintaining similar accuracy.

[0039] In some embodiments, step 5 specifically includes:

[0040] Step 5-1: Input the preprocessed standard image into the defect detection model, and the model outputs the defect, severity, and corresponding confidence level;

[0041] Step 5-2: Determine if a defect exists based on the set confidence threshold; set the confidence threshold to 0.5-0.8. When the confidence level is greater than or equal to the threshold, a defect is determined to exist.

[0042] Step 5-3: Combine the positioning information of the UAV when collecting images to determine the installation location of the defective cotter pin, and trigger multi-terminal early warning for serious defects.

[0043] The specific classifications and corresponding measures for defects are as follows: Minor defects: Cotter pin wear depth < 0.5mm, or opening angle ≥ 45° and < 60° (not fully open but close to the safety threshold); the corresponding measure is to mark it on the tower crane's routine maintenance checklist and handle it concurrently with the equipment's periodic maintenance; Moderate defects: Cotter pin wear depth 0.5mm ≤ wear depth < 1mm, or opening angle ≥ 30° and < 45°, or slight deformation (deformation < 2mm); the corresponding measure is to send a deadline rectification notice to the maintenance personnel, requiring defect repair to be completed within 72 hours; Severe defects: Cotter pin wear depth ≥ 1mm, or opening angle < 30°, or severe deformation (deformation ≥ 2mm), or missing cotter pin; the corresponding measure is to trigger multi-terminal early warnings (audio-visual warning, SMS warning, and maintenance platform push warning), with a response time ≤ 10s.

[0044] Differentiated maintenance measures are applied to defects of varying severity: minor defects are included in the tower crane's routine maintenance plan, marked on the next maintenance list, and handled concurrently with periodic equipment maintenance; moderate defects are pushed out to the responsible personnel via the maintenance management platform with a deadline for rectification, requiring defect repair to be completed within 72 hours; severe defects trigger multi-terminal early warnings (audio-visual warnings, SMS warnings, and platform push warnings), with a response time of ≤10 seconds, reminding staff to handle the issue promptly.

[0045] A tower crane cotter pin defect detection system, which uses the above method to detect cotter pin defects, includes: a UAV inspection module, an image preprocessing module, a model training module, and a defect recognition module;

[0046] The drone inspection module controls the drone equipped with image acquisition equipment to fly along a preset path and acquire images of the cotter pin area of ​​the tower crane.

[0047] The image preprocessing module performs noise reduction, size normalization, and contrast enhancement on the acquired image to obtain a standard image that meets the input requirements of the detection model.

[0048] The model training module is built based on the ResNet18 pre-trained model to generate a detection model specifically designed to identify cotter pin defects and their severity.

[0049] The defect identification module inputs the standard image into the detection model for reasoning, identifies the defect type and severity of the cotter pin, and outputs the detection results.

[0050] Beneficial effects:

[0051] Compared with the prior art, the present invention has the following advantages:

[0052] Drones replace manual high-altitude inspections, completely eliminating the risks of working at heights and ensuring the safety of inspection personnel. The inspection time for cotter pins on a tower crane is reduced to less than 30 minutes, increasing efficiency by 3-4 times. The entire process, from image acquisition and preprocessing to defect identification, is automated, requiring no manual intervention and reducing labor costs.

[0053] The improved ResNet18_Weights model, through the CBAM attention module and knowledge distillation technique, achieves a small target defect detection accuracy of over 97.5%, and a false negative rate of ≤3% for minor wear defects.

[0054] The newly added severity grading branch can output defect handling priorities, helping maintenance personnel to develop targeted maintenance plans and reduce the problems of over-maintenance or untimely maintenance. Attached Figure Description

[0055] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments, and the advantages of the present invention in the above and / or other aspects will become clearer.

[0056] Figure 1 This is a schematic diagram of the overall process of the method of the present invention.

[0057] Figure 2 A schematic diagram of the path planning for a tower crane is taken for drone inspection.

[0058] Figure 3 This is a schematic diagram for the inspection of a single cotter pin on a tower crane. Detailed Implementation

[0059] The present invention will be further described in detail below with reference to specific embodiments:

[0060] like Figure 1 As shown, a method for unmanned aerial vehicle (UAV) inspection and intelligent detection of cotter pin defects in tower cranes includes the following steps:

[0061] like Figure 2 As shown, Step 1: Deployment of the drone inspection system. A drone equipped with a camera is configured and modeled based on the tower crane. The drone's path is planned based on the 3D model and cotter pin coordinate parameters. The drone used is a DJI M300RTK, equipped with a Zenmuse P1 full-frame camera (6100×4064 resolution, 30fps) and a D-RTK 2 high-precision positioning module, achieving centimeter-level positioning accuracy. The flight control software uses DJI GS Pro, planning the inspection path based on the 3D model of the QTZ63 tower crane, covering the cotter pin installation positions of the boom, tower sections, slewing bearing, and hook.

[0062] Step 2: Cotter pin image acquisition. The drone flies along the preset path from Step 1 and acquires images of the cotter pin installation locations of the tower crane at the coordinates of each cotter pin installation position, either vertically or at an angle of 15-30°.

[0063] Step 3: Preprocess the images acquired in Step 2 to adapt them to the input requirements of the defect detection model;

[0064] Step 4: Construct and train a defect detection model based on a ResNet18 pre-trained model. The defect detection model is trained on cotter pin defect sample data through transfer learning.

[0065] Step 5: Input the preprocessed image from Step 4 into the trained detection model, and use the model to infer and identify the cotter pin defect status, and output the detection results.

[0066] Step 2 specifically includes:

[0067] Step 2-1: Based on the preset path obtained in Step 1, generate a preset shooting point containing spatial coordinates for each cotter pin to be inspected;

[0068] Step 2-2: Control the drone to fly to each of the preset shooting points in sequence, and control the image acquisition device to acquire images at a shooting angle that is perpendicular to the cotter pin mounting plane or at an angle of 15° to 30°.

[0069] Steps 2-3: During the acquisition process, the acquired images are evaluated in real time based on the automatic image quality evaluation standard. The evaluation items include image sharpness and cotter pin area occlusion. If the image does not meet the evaluation standard, the drone stays at the current shooting point and reshoots until it acquires an image that meets the standard before flying to the next preset shooting point.

[0070] Step 3 specifically includes:

[0071] Step 3-1: Remove noise by filtering the image acquired in Step 2;

[0072] Step 3-2: Scale the denoised images from Step 3-1 to a preset standard size;

[0073] Step 3-3: Perform contrast enhancement processing on the scaled image from Step 3-2 to highlight the detailed features of the cotter pin area.

[0074] Step 4 specifically includes:

[0075] Step 4-1: Collect a dataset of cotter pin images of tower cranes, including images of cotter pins in normal and at least one defective state; divide the dataset into training, validation, and test sets using stratified sampling in a 7:2:1 ratio; for example... Figure 3 As shown, images of cotter pins from five tower crane models, including QTZ63 and QTZ80, were collected. The original sample consisted of 1,600 images, including 400 images in normal condition, 400 images with missing cotter pins, 200 images with slight wear, 200 images with moderate wear, and 400 images with incomplete cotter pins. Data augmentation techniques were used to expand the sample to 5,000 images.

[0076] Step 4-2: Optimize the structure of the ResNet18 pre-trained model to build an initial defect detection model and improve the accuracy of small target defect detection;

[0077] Step 4-3: Use an optimized training strategy to perform transfer learning training on the initial defect detection model to obtain an optimized defect detection model.

[0078] Step 4-2 specifically includes:

[0079] Step 4-2-1: After the third-to-last convolutional layer of the ResNet18 pre-trained model, background interference is suppressed by inserting a convolutional block attention module;

[0080] Step 4-2-2: Add a defect severity classification branch that runs parallel to the defect type classification branch before the fully connected layer of the ResNet18 pre-trained model.

[0081] Step 4-3 specifically includes:

[0082] Step 4-3-1: Use knowledge distillation technology, with the ResNet50 pre-trained model as the teacher model, to guide the training process of the initial defect detection model;

[0083] Step 4-3-2: Freeze the parameters of the first 8 convolutional layers of the ResNet18 pre-trained model;

[0084] Step 4-3-3: Using the training set, fine-tune the unfrozen network layers, convolutional block attention modules, and defect severity classification branches in the initial defect detection model;

[0085] Step 4-3-4: Optimize the model using a joint loss function that combines classification loss and hierarchical loss.

[0086] In step 4-3-4, the Adam optimizer is selected, with an initial learning rate of 0.001, which decays to 1 / 10 of its original value every 10 training epochs, for a total of 50 training epochs. Model performance is monitored in real-time using a validation set; training stops when the validation set accuracy shows no improvement for 5 consecutive epochs, and the optimal model parameters are saved.

[0087] In step 4-3-4, the classification loss is the cross-entropy loss function, and the hierarchical loss is the mean squared error loss function. The weight ratio of the two in the joint loss function is 6:4.

[0088] After training, the model achieved an accuracy of 97.8% and a recall of 96.3% on the test set, with a single image detection time of 0.35 seconds. The accuracy rates for the three types of defects were: missing 99.2%, wear 94.8% (minor wear 93.5%), and incomplete opening 95.5%. The accuracy rate for severity grading was 92.7%.

[0089] Step 5 specifically includes:

[0090] Step 5-1: Input the preprocessed standard image into the defect detection model, and the model outputs the defect, severity, and corresponding confidence level;

[0091] Step 5-2: Determine if a defect exists based on the set confidence threshold;

[0092] Step 5-3: Combine the positioning information of the UAV when collecting images to determine the installation location of the defective cotter pin, and trigger multi-terminal early warning for serious defects.

[0093] A tower crane cotter pin defect detection system includes: a drone inspection module, an image preprocessing module, a model training module, and a defect recognition module. The drone inspection module controls a drone equipped with an image acquisition device to fly along a preset path and acquire images of the cotter pin portion of the tower crane. The image preprocessing module performs noise reduction, size normalization, and contrast enhancement on the acquired images to obtain a standard image that meets the input requirements of the detection model. The model training module builds a detection model based on a ResNet18 pre-trained model, specifically for identifying cotter pin defects and their severity. The defect recognition module inputs the standard image into the detection model for inference, identifies the defect type and severity of the cotter pin, and outputs the detection results.

[0094] This invention provides a method and system for UAV inspection and intelligent detection of cotter pin defects in tower cranes. Many methods and approaches exist for implementing this technical solution; the above description is merely a preferred embodiment. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this invention, and these improvements and modifications should also be considered within the scope of protection of this invention. All components not explicitly stated in this embodiment can be implemented using existing technologies.

Claims

1. A method for unmanned aerial vehicle (UAV) inspection and intelligent detection of cotter pin defects in tower cranes, characterized in that, Includes the following steps: Step 1: Deployment of the drone inspection system: Based on the three-dimensional structural model of the tower crane, plan an automatic drone inspection path covering all cotter pin installation locations; Step 2: Cotter pin image acquisition. Control the drone to fly along the preset path in Step 1 and acquire images of the cotter pin installation parts of the tower crane at a specific angle at the coordinate points of each cotter pin installation location. Step 3: Preprocess the images acquired in Step 2 to adapt them to the input requirements of the defect detection model; Step 4: Construct and train a defect detection model based on a ResNet18 pre-trained model. The defect detection model is obtained by structural optimization and training on cotter pin defect sample data through transfer learning. Step 5: Input the preprocessed image from Step 4 into the trained detection model, and use the model to infer and identify the cotter pin defect status, and output the detection results.

2. The method according to claim 1, characterized in that, Step 2 specifically includes: Step 2-1: Based on the preset path obtained in Step 1, generate a preset shooting point containing spatial coordinates for each cotter pin to be inspected; Step 2-2: Control the drone to fly to each of the preset shooting points in sequence, and control the image acquisition device to acquire images at a shooting angle that is perpendicular to the cotter pin mounting plane or at an angle of 15° to 30°. Steps 2-3: During the acquisition process, the acquired images are evaluated in real time based on the automatic image quality evaluation standard. The evaluation items include image sharpness and cotter pin area occlusion. If the image does not meet the evaluation standard, the drone stays at the current shooting point and reshoots until it acquires an image that meets the standard before flying to the next preset shooting point.

3. The method according to claim 1, characterized in that, Step 3 specifically includes: Step 3-1: Remove noise by filtering the image acquired in Step 2; Step 3-2: Scale the denoised images from Step 3-1 to a preset standard size; Step 3-3: Perform contrast enhancement processing on the scaled image from Step 3-2 to highlight the detailed features of the cotter pin area.

4. The method according to claim 1, characterized in that, Step 4 specifically includes: Step 4-1: Collect a dataset of cotter pin images of tower cranes. The dataset includes images of cotter pins in normal condition and at least one defective condition. Based on the defect category of the cotter pin, the dataset is divided into a training set, a validation set, and a test set using stratified sampling in a ratio of 7:2:

1. Step 4-2: Optimize the structure of the ResNet18 pre-trained model to build an initial defect detection model and improve the accuracy of small target defect detection; Step 4-3: Use an optimized training strategy to perform transfer learning training on the initial defect detection model to obtain an optimized defect detection model.

5. The method according to claim 4, characterized in that, Step 4-2 specifically includes: Step 4-2-1: After the third-to-last convolutional layer of the ResNet18 pre-trained model, background interference is suppressed by inserting a convolutional block attention module; Step 4-2-2: Add a defect severity classification branch that runs parallel to the defect type classification branch before the fully connected layer of the ResNet18 pre-trained model.

6. The method according to claim 4, characterized in that, Step 4-3 specifically includes: Step 4-3-1: Use knowledge distillation technology, with the ResNet50 pre-trained model as the teacher model, to guide the training process of the initial defect detection model; Step 4-3-2: Freeze the parameters of the first 8 convolutional layers of the ResNet18 pre-trained model; Step 4-3-3: Using the training set, fine-tune the unfrozen network layers, convolutional block attention modules, and defect severity classification branches in the initial defect detection model; Step 4-3-4: Optimize the model using a joint loss function that combines classification loss and hierarchical loss.

7. The method according to claim 6, characterized in that, In step 4-3-4, the Adam optimizer is selected, the initial learning rate is set to 0.001, and it decays to 1 / 10 of the original rate every 10 training rounds, with a total of 50 training rounds. The model performance is monitored in real time using the validation set, and training is stopped when the validation set accuracy does not improve for 5 consecutive rounds, and the optimal model parameters are saved.

8. The method according to claim 6, characterized in that, In step 4-3-4, the classification loss is the cross-entropy loss function, and the hierarchical loss is the mean squared error loss function. The weight ratio of the two in the joint loss function is 6:

4.

9. The method according to claim 1, characterized in that, Step 5 specifically includes: Step 5-1: Input the preprocessed standard image into the defect detection model, and the model outputs the defect, severity, and corresponding confidence level; Step 5-2: Determine if a defect exists based on the set confidence threshold; Step 5-3: Combine the positioning information of the UAV when collecting images to determine the installation location of the defective cotter pin and trigger an early warning for serious defects.

10. A tower crane cotter pin defect detection system, which uses the method of any one of claims 1-9 to detect cotter pin defects, characterized in that, include: The module includes a drone inspection module, an image preprocessing module, a model training module, and a defect recognition module. The drone inspection module controls the drone equipped with image acquisition equipment to fly along a preset path and acquire images of the cotter pin area of ​​the tower crane. The image preprocessing module performs noise reduction, size normalization, and contrast enhancement on the acquired image to obtain a standard image that meets the input requirements of the detection model. The model training module is built based on the ResNet18 pre-trained model to generate a detection model specifically designed to identify cotter pin defects and their severity. The defect identification module inputs the standard image into the detection model for reasoning, identifies the defect type and severity of the cotter pin, and outputs the detection results.