An automatic identification method for damaged agricultural greenhouses under power transmission lines

Through the automated identification method, the improved YOLOv8 detection model and TinyCD change detection model are used to solve the problems of low efficiency of manual inspection and major safety hazards in the existing technology, and the rapid response and timely treatment of damage to agricultural greenhouses under the transmission line are achieved, and the safety and maintenance efficiency of power facilities are improved.

CN119380340BActive Publication Date: 2025-03-14JIANGSU ELECTRIC POWER INFORMATION TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411944788.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-03-14
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

The existing technology relies on manual inspection, which is inefficient and has great safety risks, making it difficult to achieve rapid response and timely handling of damage to agricultural greenhouses under transmission lines.

Method used

An automated recognition method is proposed, by obtaining scene images from diversified transmission lines, pre-noted using the fine-tuned SAM model, converting it into object detection rectangular box labeling, building a training data set, and identifying and alerting based on the improved YOLOv8 detection model and TinyCD change detection model.

Benefits of technology

It has achieved rapid response and timely handling of damage to agricultural greenhouses, improved the safety and maintenance efficiency of power facilities, and reduced the risks and costs of manual inspections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119380340B_ABST
    Figure CN119380340B_ABST
Patent Text Reader

Abstract

The present invention discloses an automatic identification method for damaged agricultural greenhouses under power transmission lines. The method marks scene images under various power transmission lines to form a data set and train a damaged agricultural greenhouse identification model, thereby solving many drawbacks of traditional manual inspections, achieving rapid response and timely warning to damaged agricultural greenhouses, and effectively improving the safety and maintenance efficiency of power facilities. The method has important application value and promotion prospects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of intelligent operation and inspection of power transmission lines, and in particular relates to an automatic identification method for damaged agricultural greenhouses under power transmission lines. Background Art

[0002] In vast fields and rural areas, power transmission lines often need to cross farmland, orchards and other areas. The widespread agricultural greenhouse facilities (such as greenhouses, vegetable greenhouses, etc.) in these areas have become one of the important environmental factors under the power transmission lines. If the agricultural greenhouse is damaged, some plastic films will be produced, which can easily be blown onto the power transmission lines in windy weather, forming a short circuit and causing harm.

[0003] For a long time, the monitoring and damage detection of agricultural greenhouses under power transmission lines have mainly relied on manual inspections. This method is not only inefficient, requires a lot of human resources and time costs, but also has safety hazards. For example, inspectors need to frequently enter complex and changeable field environments, facing risks such as electric shock and falling. In addition, manual inspections are often limited by factors such as weather and time, making it difficult to achieve all-weather, real-time monitoring, and it is difficult to promptly discover and deal with minor damage or potential safety hazards in greenhouses.

[0004] The prior art with publication number CN118608509A discloses a lightweight PCB defect detection method based on an improved YOLOv8 algorithm, which includes the following steps: Step 1, obtain a public PCB defect data set, and divide the data set into a training set, a validation set, and a test set; Step 2, establish a PCB defect detection model based on the improved YOLOv8 algorithm; Step 3, use the improved PCB defect detection model to train the training set samples; Step 4, use the trained optimal model to detect the test set data, and then evaluate the model complexity and detection results. However, when performing multi-scale feature fusion, this method only uses SFPN to extract the features of the bottom layer and the top layer for fusion, and loses the feature information of the middle layer, which will lose part of the feature information of the target, thereby affecting the accuracy of target classification and positioning. However, this method cannot achieve rapid response and timely processing of damage to agricultural greenhouses. Summary of the invention

[0005] In order to solve the problems existing in the prior art, the present invention proposes an automatic identification method for damaged agricultural greenhouses under power transmission lines.

[0006] The technical solution of the present invention is as follows:

[0007] An automatic identification method for damaged agricultural greenhouses under power transmission lines, comprising:

[0008] Step 1) obtaining scene images under various transmission lines;

[0009] Step 2) pre-labeling the scene image based on the fine-tuned SAM large model, generating mask labels corresponding to different categories of targets in the scene image, and obtaining scene images in which agricultural greenhouse targets are suspected to exist and their corresponding mask labels;

[0010] Step 3) converting the mask annotation of the agricultural greenhouse target in the scene image where the agricultural greenhouse target is suspected to exist into a target detection rectangular frame annotation, and manually reviewing the target detection rectangular frame annotation of the agricultural greenhouse target; constructing a training data set based on the scene image with the target detection rectangular frame annotation of the agricultural greenhouse target;

[0011] Step 4) constructing a damaged agricultural greenhouse recognition model, the damaged agricultural greenhouse recognition model comprising an improved YOLOv8 detection model for agricultural greenhouse detection and a TinyCD change detection model cascaded after the improved YOLOv8 detection model and used to detect changes in agricultural greenhouses; the improved YOLOv8 detection model has a network structure of a SFPN symmetric feature pyramid, adopts a metric loss function that considers the shape and scale of the border, and is trained based on the training data set;

[0012] Step 5) The agricultural greenhouse in the scene image is detected by the improved YOLOv8 detection model, and the scene image of the characteristic changes of the agricultural greenhouse in adjacent time is output based on the TinyCD change detection model, and the damaged agricultural greenhouse under the transmission line is located by the output scene image and an alarm is issued.

[0013] Furthermore, the diverse scene images under the transmission lines are periodically captured by visualization equipment mounted on transmission line towers, and the diverse scene images under the transmission lines include scene images in multiple regions, multiple shooting locations, multiple seasons, and multiple shooting time periods.

[0014] Furthermore, the specific method of step 2) includes:

[0015] Step 2-1) fine-tuning the SAM large model based on a scene image set formed by scene images with multiple categories of objects, so that the SAM large model can recognize and segment multiple categories of objects in the scene image;

[0016] Step 2-2) Pre-labeling the scene images under the diversified power transmission lines using the fine-tuned SAM large model, and generating mask labels corresponding to different categories of targets in the scene images.

[0017] Furthermore, the specific method of step 3) includes:

[0018] Step 3-1) converting the mask of the agricultural greenhouse target in the scene image where the agricultural greenhouse target is suspected to exist into a target detection rectangular frame label according to the minimum circumscribed rectangle;

[0019] Step 3-2) manually reviewing the target detection rectangular frame annotations of the agricultural greenhouse targets, and constructing a training data set based on the scene images with target detection rectangular frame annotations of the agricultural greenhouse targets.

[0020] Furthermore, the method for constructing the improved YOLOv8 detection model for agricultural greenhouse detection includes:

[0021] Step 4-1) For the YOLOv8 detection model, the original PAN feature pyramid is replaced with the SFPN symmetric feature pyramid in the feature extraction stage to learn the features of the agricultural greenhouse in the horizontal and vertical directions respectively; the network structure of the SFPN symmetric feature pyramid is implemented as follows: a layer matrix is ​​used to model objects of different sizes and aspect ratios, where each entry in the matrix , Presentation Layer , each layer have The width of the downsampled and The height of the downsampled, the upper left layer is the matrix ,layer It is the layer with the largest size. Every time you go to the right, the layer width is halved, and every time you go down, the layer height is halved. The diagonal layer is a square layer of different sizes, and the non-diagonal layer is a rectangular layer. The diagonal layer models objects with a square aspect ratio, and the non-diagonal layer models objects with extreme aspect ratios. The extreme aspect ratio is a rectangular box with a ratio of length to width greater than or equal to 5:1. Step 4-2) introduces the metric loss function Shape-IoU Loss that considers the shape and scale of the box to focus on the shape and scale of the real box and the predicted box to calculate the loss, and train the improved YOLOv8 detection model on the constructed training dataset.

[0022] Furthermore, the Shape-IoU Loss, a metric loss function that considers the shape and scale of the border, first calculates the true border when calculating the loss and prediction box The overlapping area between , and then calculate the true box and prediction box The total area after merging is ; Next, the overlap degree between the predicted box and the true box is obtained by calculating the ratio of the overlapping area to the total area, i.e., the IoU value; finally, the IoU value is converted into a loss value to guide the training and optimization of the model;

[0023] The specific method of calculating the loss is as follows:

[0024] The ratio of the overlapping area to the total area, i.e., the IoU value, is calculated as follows:

[0025] ;

[0026] In the formula, IoU represents the overlap between the predicted box and the real box. represents the prediction box, represents the real frame;

[0027] The horizontal weight coefficient is calculated as follows:

[0028] ;

[0029] In the formula, is the weight coefficient in the horizontal direction, is the width of the target real box, is the height of the target real box, is the scale factor;

[0030] The vertical weight coefficient is calculated as follows:

[0031] ;

[0032] In the formula, is the weight coefficient in the vertical direction;

[0033] The distance weight coefficient between the predicted box and the real box is calculated as follows:

[0034] ;

[0035] In the formula, is the distance weight coefficient between the predicted box and the real box, and are the coordinate values ​​of the center point of the prediction box, and are the coordinate values ​​of the center point of the real frame, is the scaling factor;

[0036] The weight coefficient of the shape and size difference between the predicted box and the real box is calculated as follows:

[0037] ;

[0038] In the formula, is the weight coefficient of the shape and size difference between the predicted box and the real box; is the relative difference between the target prediction box and the real box, , , is the relative difference between the target prediction box and the real box width, The relative difference between the target prediction box and the real box height; is the difference parameter; is the width of the target prediction box, is the width of the target real box, is the height of the target prediction box, is the height of the target real frame;

[0039] The metric loss function Shape-IoU Loss that considers the shape and scale of the bounding box is calculated as follows:

[0040] ;

[0041] In the formula, Shape-IoU Loss is a metric loss function that considers the shape and scale of the border. is the overlap between the predicted box and the true box, and It is the distance weight coefficient between the predicted box and the real box and the shape size difference weight coefficient.

[0042] Furthermore, the input of the TinyCD change detection model is scene images with agricultural greenhouses at adjacent times, and the output is scene images with characteristic changes of agricultural greenhouses at adjacent times.

[0043] Compared with the prior art, the present invention has the following beneficial effects:

[0044] The present invention proposes an automated identification method for damaged agricultural greenhouses under power transmission lines. The method labels scene images under a variety of power transmission lines to form a data set and train a damaged agricultural greenhouse identification model, thereby solving many drawbacks of traditional manual inspections, achieving rapid response and timely warning to damaged agricultural greenhouses, and effectively improving the safety and maintenance efficiency of power facilities. The method has important application value and promotion prospects.

[0045] The method of the present invention uses diversified data set construction and automatic pre-labeling technology to construct a rich and diverse data set by widely collecting scene image data under the transmission channel from multiple tower positions (multiple shooting positions), different seasons, and different time period light conditions (multiple shooting time periods). The SAM large model is used for image pre-labeling to automatically screen out images suspected of containing agricultural greenhouses and convert them into target detection rectangular frame labels. This process not only improves the labeling efficiency, but also reduces the manual burden, ensures the accuracy of the labeling and the quality of the data set, and provides a solid foundation for subsequent model training.

[0046] The present invention improves the YOLOv8 greenhouse detection model based on SFPN and Shape-IoU Loss. Aiming at the characteristics of diverse agricultural greenhouses and complex scenes, the present invention makes customized improvements based on the YOLOv8 model. The SFPN (symmetric feature pyramid) is introduced to replace the original PAN feature pyramid module, and greenhouse features are learned from both horizontal and vertical directions to better adapt to the large aspect ratio characteristics of greenhouses. At the same time, Shape-IoU Loss is used to calculate the loss, focusing on the shape and scale of the bounding box, and improving the accuracy of the border regression. These improvements enable the model to more accurately detect greenhouse targets in complex scenes.

[0047] The present invention cascades a lightweight change detection model to achieve damage identification and alarm. In order to determine the state changes of agricultural greenhouses over a period of time, especially the damage, the present invention cascades a lightweight Tiny CD change detection model after the greenhouse detection model. The model can identify the state differences of agricultural greenhouses at different time points, that is, whether damage occurs, and issue effective alarms accordingly. This not only solves the problem of simply detecting agricultural greenhouses but failing to determine their safety status, but also improves the system's ability to promptly discover and handle potential safety hazards. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a flow chart of the method for automatically identifying damaged agricultural greenhouses under power transmission lines in the embodiment;

[0049] Figure 2 It is a diagram of the symmetrical characteristic pyramid structure in the embodiment;

[0050] Figure 3 This is a diagram of the Shape-IoU Loss structure in the embodiment;

[0051] Figure 4 This is an example diagram of a damaged greenhouse below the power transmission channel in the embodiment;

[0052] Figure 5 This is an example of a mask annotation obtained after pre-annotating a damaged greenhouse in a power transmission channel using a fine-tuned SAM large model in the embodiment;

[0053] Figure 6 This is an example diagram of the effect of using the improved YOLOv8 to identify the damaged greenhouse under the power transmission channel in the embodiment;

[0054] Figure 7 This is a diagram showing the output effect of the greenhouse detection model after the change detection model TinyCD is cascaded in the embodiment. DETAILED DESCRIPTION

[0055] The present invention is further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, various equivalent modifications of the present invention by those skilled in the art all fall within the scope defined by the claims attached to this application.

[0056] Example:

[0057] The present invention provides an automatic identification method for damaged agricultural greenhouses under power transmission lines, such as Figure 1 As shown, the following steps are included:

[0058] Step 1) obtaining scene images under various transmission lines;

[0059] Step 2) Pre-label the scene image based on the fine-tuned SAM large model, generate mask labels corresponding to different categories of targets in the scene image, and obtain scene images with suspected agricultural greenhouse targets and their corresponding mask labels;

[0060] Step 3) converting the mask annotations of the agricultural greenhouse targets in the scene images where the agricultural greenhouse targets are suspected to exist into target detection rectangular frame annotations, and manually reviewing the target detection rectangular frame annotations of the agricultural greenhouse targets; constructing a training data set based on the scene images with target detection rectangular frame annotations of the agricultural greenhouse targets;

[0061] Step 4) constructing a damaged agricultural greenhouse recognition model, which includes an improved YOLOv8 detection model for agricultural greenhouse detection and a TinyCD change detection model cascaded after the improved YOLOv8 detection model and used to detect changes in agricultural greenhouses; the improved YOLOv8 detection model has a network structure of a SFPN symmetric feature pyramid, adopts a metric loss function that considers the shape and scale of the border, and is trained based on a training data set;

[0062] Step 5) The agricultural greenhouses in the scene image are detected through the improved YOLOv8 detection model, and the scene image of the characteristic changes of the agricultural greenhouses in adjacent time is output based on the TinyCD change detection model. The output scene image is used to locate the position of the damaged agricultural greenhouse under the transmission line and issue an alarm. The patrol personnel focus on patrolling this position, thereby achieving the ability to effectively issue an alarm and avoiding threats to the line.

[0063] Furthermore, the scene images under the diverse power transmission lines are periodically captured by the visualization equipment mounted on the power transmission line towers, for example Figure 4As shown in the figure, the diverse scene images under the power transmission lines include scene images in multiple regions, multiple shooting locations, multiple seasons, and multiple shooting time periods. These diverse scene images can more comprehensively reflect the complex situations in actual scenes, and thus help train a more robust model that adapts to a wide range of environmental conditions.

[0064] Furthermore, the specific method of step 2) includes:

[0065] Step 2-1) Based on a scene image set formed by scene images with multiple categories of targets, the SAM large model can be fine-tuned using a transmission channel image containing offline foreign objects such as greenhouses, plastic films, and dust-proof nets, so that the SAM large model can recognize and segment multiple categories of targets in the scene image;

[0066] Step 2-2) Use the fine-tuned SAM large model to pre-label the scene images under the diverse power transmission lines, and generate mask annotations corresponding to different categories of targets in the scene images. The annotation examples are as follows: Figure 5 shown.

[0067] Furthermore, the specific method of step 3) includes:

[0068] Step 3-1) Use an automated process to convert the mask of the agricultural greenhouse target in the scene image where the agricultural greenhouse target is suspected to exist into a target detection rectangular frame annotation according to the minimum bounding rectangle;

[0069] Step 3-2) Organize professionals to manually review the target detection rectangular frame annotations of agricultural greenhouse targets, and construct a training data set based on the scene images with target detection rectangular frame annotations of agricultural greenhouse targets.

[0070] Further,

[0071] According to the characteristics of greenhouses such as diversified shapes and complex scenes, the YOLOv8 model is used as the basic model, and improvements are made on the original model based on the characteristics of agricultural greenhouses; since greenhouses are generally long and have a large aspect ratio, the original PAN feature pyramid module is replaced with SFPN (Symmetric Feature Pyramid Network) in the feature extraction stage to learn the features of greenhouses in the horizontal and vertical directions respectively; considering the different shapes and sizes of greenhouses, Shape-IoU Loss is introduced to focus on the shape of the bounding box itself and the calculation loss of its own scale, so as to make the border regression more accurate. The construction method of the improved YOLOv8 detection model for agricultural greenhouse detection is as follows:

[0072] Step 4-1) It is difficult to identify greenhouses. For example, greenhouses vary in shape and size, some are arched, some are flat, and the area ranges from tens of square meters to thousands of square meters. This diversity increases the difficulty of identification because the detection algorithm needs to be able to handle targets of various shapes and sizes. The covering material of the greenhouse is mostly plastic film, but its color, transparency, reflectivity, etc. may change due to factors such as age and cleanliness. These changes may make the greenhouse features in the image unclear and affect the recognition effect. In actual scenes, greenhouses may be blocked by trees, other buildings or natural terrain to form shadows. These occlusions and shadows will interfere with the detection algorithm's accurate identification of the greenhouse. For the YOLOv8 detection model, the original PAN feature pyramid is replaced with the SFPN symmetric feature pyramid in the feature extraction stage to learn the features of agricultural greenhouses in the horizontal and vertical directions respectively; Figure 2 As shown, the implementation method of the network structure of the SFPN symmetric feature pyramid is as follows:

[0073] like Figure 2 As shown, a layer matrix is ​​used to model objects of different sizes and aspect ratios, where each entry in the matrix , Presentation Layer , each layer have Width Downsampling and Height Downsampling, the upper left layer (base layer) is the matrix ,layer is the largest layer. Each step to the right halves the layer width, and each step down halves the layer height. For example, . Diagonal layers are square layers of different sizes, equivalent to an FPN, and non-diagonal layers are rectangular layers, which are unique; diagonal layers model objects with square aspect ratios, and non-diagonal layers model objects with extreme aspect ratios; extreme aspect ratios are rectangular boxes with a length-to-width ratio greater than or equal to 5:1; layers close to the upper right or lower left corners of matrices model objects with very high or very low aspect ratios. The main advantage of SFPNs is that they allow square convolution kernels to accurately collect information about different aspect ratios;

[0074] Step 4-2) Introduce the metric loss function Shape-IoU Loss that considers the shape and scale of the bounding box to focus on the shape and scale of the real box and the predicted box to calculate the loss, and train the improved YOLOv8 detection model on the constructed training dataset.

[0075] Furthermore, considering the different shapes and sizes of greenhouses, Shape-IoU Loss is introduced to focus on the shape and scale of the bounding box itself to calculate the loss, so as to make the border regression more accurate; Shape-IoU Loss, a metric loss function that considers the shape and scale of the border, first calculates the true box when calculating the loss and prediction box The overlapping area between , and then calculate the true box and prediction box The total area after merging is ; Then, by calculating the ratio of the overlapping area to the total area, that is The IoU value is converted into a loss value (such as 1 minus the IoU value) to guide the training and optimization of the model.

[0076] like Figure 3 The specific method of loss calculation is as follows:

[0077] The ratio of the overlapping area to the total area, i.e., the IoU value, is calculated as follows:

[0078] ;

[0079] In the formula, IoU represents the overlap between the predicted box and the real box (GroundTruth, GT), represents the prediction box, represents the real frame;

[0080] The horizontal weight coefficient is calculated as follows:

[0081] ;

[0082] In the formula, is the weight coefficient in the horizontal direction, is the width of the target real box, is the height of the target real box, Scale factor, The value range is generally 0-1.5;

[0083] The vertical weight coefficient is calculated as follows:

[0084] ;

[0085] In the formula, is the weight coefficient in the vertical direction;

[0086] The distance weight coefficient between the predicted box and the real box is calculated as follows:

[0087] ;

[0088] In the formula, is the distance weight coefficient between the predicted box and the real box, and are the coordinate values ​​of the center point of the prediction box, and are the coordinate values ​​of the center point of the real frame, is the scaling factor;

[0089] The weight coefficient of the shape and size difference between the predicted box and the real box is calculated as follows:

[0090] ;

[0091] In the formula, is the weight coefficient of the shape and size difference between the predicted box and the real box; is the relative difference between the target prediction box and the real box, , , is the relative difference between the target prediction box and the real box width, The relative difference between the target prediction box and the real box height; is the difference parameter, which determines the importance of the difference, and the default value is 4; is the width of the target prediction box, is the width of the target real box, is the height of the target prediction box, is the height of the target real frame;

[0092] The metric loss function Shape-IoU Loss that considers the shape and scale of the bounding box is calculated as follows:

[0093] ;

[0094] In the formula, Shape-IoU Loss is a metric loss function that considers the shape and scale of the border. is the overlap between the predicted box and the true box, and It is the distance weight coefficient between the predicted box and the real box and the shape size difference weight coefficient.

[0095] Furthermore, the input of the TinyCD change detection model is the scene images with agricultural greenhouses at adjacent times, and the output is the scene images with characteristic changes of agricultural greenhouses at adjacent times. Change detection refers to the technology of identifying and analyzing the changes of objects in images over time by comparing image information at different time points. Therefore, the capabilities and characteristics of the lightweight change detection model Tiny CD can be used to output the results of whether characteristic changes have occurred in the greenhouse area based on the comparison of images transmitted before and after the visualization device. The output area is the area where the greenhouse is suspected to be damaged.

[0096] Table 1 below shows the ablation experiment results on the test set, which is used to show the impact of different models on improved performance. The size of the input image is 1280*1280. The basic YOLOv8x model has a Recall of 83.5% and a Precision of 86.7%. After adding SFPN, the Recall is improved by 0.7% and the Precision is improved by 1.4% compared with the basic YOLOv8X model. After adding Shape-IoU Loss, the Recall is improved by 1.8% and the Precision is improved by 0.9% compared with the basic YOLOv8x model. After adding SFPN and Shape-IoU Loss at the same time, the Recall is improved by 3.1% and the Precision is improved by 2.6% compared with the basic YOLOv8x model.

[0097]

[0098] Figure 6 This is an example of the effect of using the improved YOLOv8 detection model to identify agricultural greenhouses under the transmission channel. Figure 6 It can be seen that the YOLOv8 detection model can effectively identify and monitor the agricultural greenhouses in the scene. Figure 6 0.91 is the confidence level of agricultural greenhouses identified by the improved YOLOv8 detection model. Confidence level refers to the degree of trust in the detection results of the model. The higher the confidence level, the greater the trust level. Figure 6 This indicates that there is a 91% probability that the target in the red frame is an agricultural greenhouse.

[0099] Figure 7 Output renderings of the change detection model TinyCD. Places suspected of greenhouse changes are marked with red frames for inspection personnel to review.

[0100] The above description is only a specific implementation of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a technician familiar with the technical field within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention.

Claims

1. An automatic identification method for damaged agricultural greenhouses under power transmission lines, characterized in that: include: Step 1) obtaining scene images under various transmission lines; Step 2) pre-labeling the scene image based on the fine-tuned SAM large model, generating mask labels corresponding to different categories of targets in the scene image, and obtaining scene images in which agricultural greenhouse targets are suspected to exist and their corresponding mask labels; Step 3) converting the mask annotation of the agricultural greenhouse target in the scene image where the agricultural greenhouse target is suspected to exist into a target detection rectangular frame annotation, and manually reviewing the target detection rectangular frame annotation of the agricultural greenhouse target; constructing a training data set based on the scene image with the target detection rectangular frame annotation of the agricultural greenhouse target; Step 4) constructing a damaged agricultural greenhouse recognition model, the damaged agricultural greenhouse recognition model comprising an improved YOLOv8 detection model for agricultural greenhouse detection and a TinyCD change detection model cascaded after the improved YOLOv8 detection model and used to detect changes in agricultural greenhouses; the improved YOLOv8 detection model has a network structure of a SFPN symmetric feature pyramid, adopts a metric loss function that considers the shape and scale of the border, and is trained based on the training data set; The method for constructing the improved YOLOv8 detection model for agricultural greenhouse detection includes: Step 4-1) For the YOLOv8 detection model, the original PAN feature pyramid is replaced with the SFPN symmetric feature pyramid in the feature extraction stage to learn the features of the agricultural greenhouse in the horizontal and vertical directions respectively; the network structure of the SFPN symmetric feature pyramid is implemented as follows: a layer matrix is ​​used to model objects of different sizes and aspect ratios, where each entry in the matrix , Presentation Layer , each layer have The width of the downsampled and The height of the downsampled, the upper left layer is the matrix ,layer It is the largest layer. Every step to the right, the layer width is halved, and every step down, the layer height is halved. The diagonal layer is a square layer of different sizes, and the non-diagonal layer is a rectangular layer. The diagonal layer models objects with a square aspect ratio, and the non-diagonal layer models objects with an extreme aspect ratio. The extreme aspect ratio is a rectangular box with a length-to-width ratio greater than or equal to 5:

1. Step 4-2) introduces the metric loss function Shape-IoU Loss that considers the shape and scale of the frame to focus on the shape and scale of the real frame and the predicted frame to calculate the loss, and train the improved YOLOv8 detection model on the constructed training data set. Step 5) The agricultural greenhouse in the scene image is detected by the improved YOLOv8 detection model, and the scene image of the characteristic changes of the agricultural greenhouse in adjacent time is output based on the TinyCD change detection model, and the damaged agricultural greenhouse under the transmission line is located by the output scene image and an alarm is issued.

2. The automatic identification method of damaged agricultural greenhouses under power transmission lines according to claim 1 is characterized in that: The diverse scene images under the transmission lines are periodically captured by visualization equipment mounted on the transmission line towers, and the diverse scene images under the transmission lines include scene images in multiple regions, multiple shooting locations, multiple seasons, and multiple shooting time periods.

3. The method for automatically identifying damaged agricultural greenhouses under power transmission lines according to claim 1, characterized in that: The specific method of step 2) includes: Step 2-1) fine-tuning the SAM large model based on a scene image set formed by scene images with multiple categories of objects, so that the SAM large model can recognize and segment multiple categories of objects in the scene image; Step 2-2) Pre-labeling the scene images under the diversified power transmission lines using the fine-tuned SAM large model, and generating mask labels corresponding to different categories of targets in the scene images.

4. The automatic identification method of damaged agricultural greenhouses under power transmission lines according to claim 1 is characterized in that: The specific method of step 3) includes: Step 3-1) converting the mask of the agricultural greenhouse target in the scene image where the agricultural greenhouse target is suspected to exist into a target detection rectangular frame label according to the minimum circumscribed rectangle; Step 3-2) manually reviewing the target detection rectangular frame annotations of the agricultural greenhouse targets, and constructing a training data set based on the scene images with target detection rectangular frame annotations of the agricultural greenhouse targets.

5. The method for automatically identifying damaged agricultural greenhouses under power transmission lines according to claim 4, characterized in that: The Shape-IoU Loss metric loss function that considers the shape and scale of the border first calculates the real box when calculating the loss. and prediction box The overlapping area between , and then calculate the true box and prediction box The total area after merging is ; Next, the overlap degree between the predicted box and the true box is obtained by calculating the ratio of the overlapping area to the total area, i.e., the IoU value; finally, the IoU value is converted into a loss value to guide the training and optimization of the model; The specific method of calculating the loss is as follows: The ratio of the overlapping area to the total area, i.e., the IoU value, is calculated as follows: ; In the formula, IoU represents the overlap between the predicted box and the real box. represents the prediction box, represents the real frame; The horizontal weight coefficient is calculated as follows: ; In the formula, is the weight coefficient in the horizontal direction, is the width of the target real box, is the height of the target real box, is the scale factor; The vertical weight coefficient is calculated as follows: ; In the formula, is the weight coefficient in the vertical direction; The distance weight coefficient between the predicted box and the real box is calculated as follows: ; In the formula, is the distance weight coefficient between the predicted box and the real box, and are the coordinate values ​​of the center point of the prediction box, and are the coordinate values ​​of the center point of the real frame, is the scaling factor; The weight coefficient of the shape and size difference between the predicted box and the real box is calculated as follows: ; In the formula, is the weight coefficient of the shape and size difference between the predicted box and the real box; is the relative difference between the target prediction box and the real box, , , is the relative difference between the target prediction box and the real box width, The relative difference between the target prediction box and the real box height; is the difference parameter; is the width of the target prediction box, is the width of the target real box, is the height of the target prediction box, is the height of the target real frame; The metric loss function Shape-IoU Loss that considers the shape and scale of the bounding box is calculated as follows: ; In the formula, Shape-IoU Loss is a metric loss function that considers the shape and scale of the border. is the overlap between the predicted box and the true box, and It is the distance weight coefficient between the predicted box and the real box and the shape size difference weight coefficient.

6. The method for automatically identifying damaged agricultural greenhouses under power transmission lines according to claim 5, characterized in that: The input of the TinyCD change detection model is scene images with agricultural greenhouses at adjacent times, and the output is scene images with characteristic changes of agricultural greenhouses at adjacent times.

Citation Information

Patent Citations

  • Lightweight PCB defect detection method based on improved YOLOv8 algorithm

    CN118608509A

  • SAR image change detection method based on pyramid pooling twin network

    CN110533631A

  • General power equipment identification large model method and system

    CN117132914A