Power transmission line image intelligent detection method and system based on AI intelligent agent
By using an AI-based intelligent detection method for transmission line images, dynamic parameter instructions are generated by fine-tuning a general large model based on transmission line scene data. Combined with an improved YOLOv8 model for defect detection, this method solves the problems of low efficiency and high misjudgment rate in traditional inspections under complex environments, and achieves high-precision adaptive detection and self-learning optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO
- Filing Date
- 2025-12-26
- Publication Date
- 2026-05-01
AI Technical Summary
Traditional manual inspections are inefficient, costly, and pose significant safety risks. Existing intelligent inspection technologies lack image detection accuracy in complex environments, especially in backlighting and tree shadow conditions, where the misjudgment rate is high and the technology lacks adaptability.
An AI-based intelligent detection method for transmission line images is adopted. By fine-tuning a general large model using transmission line scene data, dynamic parameter instructions are generated for preprocessing. An improved YOLOv8 model is used for defect detection, and the policy network is optimized through reinforcement learning to achieve adaptive environment adaptation.
It significantly improves detection accuracy, reduces the risk of missed detections and false judgments, achieves adaptive adaptation to all working conditions, has self-learning capabilities, saves computing resources, and improves processing efficiency.
Smart Images

Figure CN121962028A_ABST
Abstract
Description
Intelligent Detection Method and System for Transmission Line Images Based on AI Agent Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an intelligent detection method and system for power transmission line images based on AI agents. Background Technology
[0002] Transmission lines are a core component of the power system, and their operational status directly determines the security and stability of power supply. As the power grid extends its coverage to complex environments such as mountainous areas, forest areas, and areas with frequent fog and rain, traditional manual inspections suffer from problems such as low efficiency (average daily inspection mileage <50km), high cost (annual maintenance cost per person exceeding 100,000 yuan), and high safety risks (high accident rate for high-altitude operations), and can no longer meet the maintenance needs of large-scale transmission lines.
[0003] Intelligent inspection technology based on computer vision has become mainstream due to its "non-contact, wide coverage, and remote analysis capabilities," but it faces three major technical challenges in practical applications: First, the pixel density of small parts such as bolts and insulator pins is often lower than 300px / mm. 2 First, insufficient detailed information leads to missed detections; second, when the tree shadow occlusion rate exceeds 0.5 during forest patrols, the confusion between line components and the background causes misjudgments; third, in strong backlight scenes (backlight intensity > 0.6), the image brightness and darkness are unbalanced, causing the defect recognition rate to plummet to below 68%. Furthermore, existing technologies lack intelligent decision-making mechanisms, and the fixed preprocessing and detection parameters (such as a constant defogging intensity of 0.5 and a constant super-resolution scaling factor of 2.0) cannot adapt to image differences in different environments, further limiting detection performance. Summary of the Invention
[0004] Based on the above analysis, the present invention aims to disclose an intelligent detection method and system for transmission line images based on AI intelligent agents, thereby solving the problems described in the background art.
[0005] This invention discloses an intelligent detection method for transmission line images based on AI agents, comprising:
[0006] S1. Using a general large model fine-tuned and calibrated with power transmission line scene data, the input image is analyzed, and structured environmental feature data including backlight intensity, occlusion rate, pixel density of small parts, and importance of equipment are output.
[0007] S2. Input the environmental feature data into the AI agent, perform multi-dimensional feature fusion, and use reinforcement learning algorithm to generate dynamic parameter instructions. The dynamic parameters include at least super-resolution scaling factor, high dynamic range / wide dynamic range mode and defogging intensity.
[0008] S3. According to the dynamic parameter instructions, perform preprocessing on the image, including super-resolution reconstruction and dark channel dehazing, and then use an improved YOLOv8 model with fused attention mechanism to perform defect detection; obtain the type, location and risk level of the defect;
[0009] S4. Feed the accuracy and recall of the detection results as immediate rewards to the AI agent to update the reinforcement learning policy network.
[0010] Furthermore, the process of fine-tuning and calibrating the general large model using transmission line scenario data includes:
[0011] S101. Construct a dedicated dataset for power transmission lines covering small parts, tree shadow occlusion, strong backlight, and mixed scenes. After labeling four features—backlight intensity, occlusion rate, pixel density, and device weight—train the LoRA framework to fine-tune the general visual model.
[0012] S102. By standardizing prompt words, the general visual model is forced to output only a formatted numerical string consisting of backlight intensity, occlusion rate, small part pixel density and device importance weight in sequence.
[0013] S103, after professionally correcting and calibrating the pixel density and occlusion rate of small parts, outputs structured environmental feature data including backlight intensity, calibrated occlusion rate, calibrated pixel density of small parts, and device importance.
[0014] Furthermore, in S103,
[0015] Pixel density calibration includes: identifying a standard component with a known actual size in the image, extracting the number of pixels of the component through an edge detection algorithm, calculating the baseline pixel density based on the ratio of the actual physical area of the component to the number of pixels, and introducing a correction coefficient to compensate for image distortion and shooting angle error to obtain the calibrated pixel density.
[0016] Occlusion rate calibration includes: extracting shadow areas using image segmentation algorithms and calculating their pixel proportions, then combining this with scene correction coefficients for calibration to correct quantization errors in large models.
[0017] Further, S2 includes:
[0018] S201. Receive environmental feature data output from a general large model that has been fine-tuned and calibrated by power transmission line scene data, and perform data fitting to obtain fused features.
[0019] S202. Construct a discrete state space based on the fused features, and optimize the decision-making strategy through Q-learning to maximize the value of "state-action".
[0020] S203. Output dynamic parameter instructions based on the Q-value maximization strategy; the dynamic parameter instructions include super-resolution scaling factor, high dynamic range / wide dynamic range mode, and dark channel dehazing intensity.
[0021] Furthermore, in S202, the states include backlight intensity, calibrated occlusion rate, calibrated small part pixel density, and device importance level; the actions include the selected preprocessing algorithm combination and parameter configuration; among them,
[0022] The preprocessing algorithm combination includes the ESRGAN super-resolution reconstruction algorithm, dynamic range expansion algorithm, and dark channel prior dehazing algorithm;
[0023] Parameter configuration: super-resolution scaling factor, HDR / WDR mode type, dark channel dehazing intensity, and guided filter parameters;
[0024] The agent outputs the optimal action based on the principle of maximizing the Q value under the state, and determines the specific values of each parameter in the preprocessing algorithm combination.
[0025] Furthermore, in the dynamic parameter instructions output by S203,
[0026] 1) The super-resolution scaling factor is dynamically set based on the calibrated pixel density of small parts;
[0027] The super-resolution scaling factor is dynamically calculated based on the calibrated small part pixel density using a linear interpolation formula. The two are inversely correlated, causing the super-resolution scaling factor to increase as the calibrated small part pixel density decreases.
[0028] 2) High dynamic range / wide dynamic range mode switches based on backlight intensity and scene type;
[0029] High dynamic range mode is enabled in high backlight intensity and mountainous scenes, wide dynamic range mode is enabled in medium backlight intensity and plain scenes, and low dynamic range mode is enabled in low backlight intensity. The dynamic range expansion factor is positively correlated with the backlight intensity and is adjusted according to the scene type.
[0030] 3) The dark channel defogging intensity is dynamically calculated based on the calibrated shading rate and backlight intensity;
[0031] The dark channel defogging intensity is dynamically calculated based on the calibrated shading rate and backlight intensity using a weighted linear formula, and is clamped with a preset maximum value as the upper limit.
[0032] 4) The guide filter parameters should be adjusted accordingly based on the dark channel defogging intensity;
[0033] In the guided filter parameters, the regularization parameter decreases as the defogging intensity increases, while the filter window size increases as the defogging intensity increases.
[0034] Furthermore, in step S3, the adaptive preprocessing specifically includes the following steps:
[0035] 1) Perform ESRGAN super-resolution reconstruction, perform densely connected convolution operations on the input feature map and introduce residual connections, and enhance the resolution of the image according to the super-resolution scaling factor in the agent's instructions;
[0036] 2) Based on the high dynamic range / wide dynamic range mode in the agent's instructions, extend the dynamic range of the image accordingly;
[0037] 3) Perform dark channel prior dehazing, calculate atmospheric light value and transmittance based on atmospheric scattering model, restore image according to dehazing intensity in agent instruction, and eliminate fog and occlusion effects.
[0038] Furthermore, in S3, the YOLOv8 model is improved by adding a shallow P2 feature layer to enhance the feature representation capability of small targets; the CBAM attention mechanism is adopted to enhance feature representation through channel and spatial attention weights; the WIoUv3 loss function is adopted to replace the standard IoU loss, and a dynamic focusing coefficient is introduced to assign higher weights to small quality anchor boxes, while preventing gradient vanishing of simple samples.
[0039] Furthermore, the weighted calculation results of the detection accuracy and recall of the improved YOLOv8 model are quantified, and a processing time penalty term is introduced to obtain a reward value that is fed back to the AI agent to update the reinforcement learning policy network; so that the AI agent can output the optimal action.
[0040] The time reward r of the reinforcement learning policy network is:
[0041] r = w1 × Acc + w2 × Rec - β × T
[0042] Where Acc and Rec are the accuracy and recall of the detection results, respectively, T is the processing time, w1 and w2 are weighting coefficients, and β is the time penalty coefficient.
[0043] This invention also discloses an AI-based intelligent detection system for transmission line images, used to execute the AI-based intelligent detection method for transmission line images as described above, comprising:
[0044] The general large model module is a general large model that is finely tuned and calibrated using transmission line scene data. It is used to analyze input images and output structured environmental feature data including backlight intensity, occlusion rate, pixel density of small parts, and importance of equipment.
[0045] AI agent is used to perform multi-dimensional feature fusion on input environmental feature data and generate dynamic parameter instructions using reinforcement learning algorithms. The dynamic parameters include at least super-resolution scaling factor, high dynamic range / wide dynamic range mode and defogging intensity.
[0046] The preprocessing module is used to perform preprocessing on the image, including super-resolution reconstruction and dark channel dehazing, according to the dynamic parameter instructions.
[0047] The defect detection module is used to perform defect detection using an improved YOLOv8 model with a fusion attention mechanism.
[0048] The decision feedback module is used to feed the accuracy and recall of the defect detection module's detection results back to the AI agent as immediate rewards, thereby updating the reinforcement learning policy network.
[0049] This invention can achieve one of the following beneficial effects:
[0050] The intelligent detection method for power transmission line images based on AI agents disclosed in this invention significantly improves detection accuracy and reduces the risk of missed detections and misjudgments in complex scenarios through dynamic parameter adjustment and reinforcement learning optimization, achieving adaptive adaptation to all working conditions. The system has self-learning capabilities and can continuously iterate and optimize performance without human intervention, while effectively saving computing resources and improving processing efficiency. It innovatively solves the adaptation problem of general large models in vertical scenarios, providing stable and reliable feature inputs for intelligent decision-making. Attached Figure Description
[0051] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.
[0052] Figure 1 is a flowchart of the intelligent detection method for transmission line images based on AI intelligent agents in an embodiment of the present invention;
[0053] Figure 2 is a schematic diagram of the components and connections of the AI-based intelligent detection system for power transmission line images in an embodiment of the present invention. Detailed Implementation
[0054] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and, together with the embodiments of the present invention, serve to illustrate the principles of the present invention.
[0055] Example 1
[0056] One embodiment of the present invention discloses an intelligent detection method for transmission line images based on an AI agent, as shown in Figure 1, comprising:
[0057] S1. Using a general large model fine-tuned and calibrated with power transmission line scene data, the input image is analyzed, and structured environmental feature data including backlight intensity, occlusion rate, pixel density of small parts, and importance of equipment are output.
[0058] S2. Input the environmental feature data into the AI agent, perform multi-dimensional feature fusion, and use reinforcement learning algorithm to generate dynamic parameter instructions. The dynamic parameters include at least the super-resolution scaling factor, high dynamic range / wide dynamic range (HDR / WDR) mode, and dehazing intensity.
[0059] S3. According to the dynamic parameter instructions, perform preprocessing on the image, including super-resolution reconstruction and dark channel dehazing, and then use an improved YOLOv8 model with a fusion attention mechanism to perform defect detection; obtain the type, location and risk level of the defect; obtain the type, location and risk level of the defect;
[0060] S4. Feed the accuracy and recall of the detection results as immediate rewards to the AI agent to update the reinforcement learning policy network.
[0061] Specifically, the process of fine-tuning and calibrating a general large model using transmission line scenario data includes:
[0062] S101. Construct a dedicated dataset for power transmission lines covering small parts, tree shadow occlusion, strong backlight, and mixed scenes. After labeling four features—backlight intensity, occlusion rate, pixel density, and device weight—train a general-purpose visual model with fine-tuned framework. Ensure that the quantization error of the model's output features, scene recognition accuracy, and output format compliance rate meet the requirements.
[0063] Specifically, including:
[0064] 1) Establish a dedicated dataset for power transmission lines;
[0065] Sample size: 12,000+ images of power transmission lines in multiple scenes, covering core scenarios.
[0066] Small parts scenario: 4000 images (bolts, insulator pins, etc., pixel density 100-500px / mm) 2 );
[0067] Tree shadow scenes: 3000 images (shading rate 0.1-1.0, including mountainous / plain forest areas);
[0068] Strong backlighting scenes: 3000 photos (backlighting intensity 0.4-1.0, including strong sunlight at sunrise / sunset / midday);
[0069] Mixed scenes: 2000 images (including small parts, occlusion, and backlighting);
[0070] Labeling requirements: Each image should be labeled with precise numerical values for 4 core feature classes (labeling error ≤ 3%).
[0071] Backlight intensity L (0-1, rounded to 2 decimal places);
[0072] Occlusion rate S (0-1, rounded to 2 decimal places);
[0073] Small component pixel density D (px / mm) 2 (integer);
[0074] Equipment importance weight w (0.5 / 1.0, critical components are marked 1.0);
[0075] Data preprocessing: The image resolution was uniformly set to 1920×1080, and the data were divided into training, validation and test sets in a ratio of 8:1:1. Data augmentation was performed by random flipping and brightness adjustment (±10%) to avoid overfitting.
[0076] 2) Train the general-purpose large-scale visual model with fine-tuned framework.
[0077] The LoRA framework is used to fine-tune the general vision model. The general vision model includes GPT-4V, Tongyi Qianwen Visual Edition, Claude 3 Opus, etc. In the LoRA framework fine-tuning, only the low-rank matrix parameters of the model are trained, and the pre-trained weights are not changed.
[0078] Specifically, the core parameter range for training:
[0079] Learning rate α lr : 0.0001-0.001(α) lr When the α value is less than 0.0001, convergence is too slow, requiring more than 50 iterations; lr When the value is greater than 0.001, it is prone to oscillation, and the accuracy decreases after fine-tuning; when the value is between 0.0001 and 0.001, it can converge in 20-30 iterations, with an accuracy loss of ≤1%.
[0080] Batch size: 8-16 (8-16 can balance training speed and stability, and avoid memory overflow);
[0081] Number of iterations (epochs): 20-30 (the accuracy of the validation set tends to stabilize after 20 epochs, and overfitting is likely to occur after more than 30 epochs);
[0082] 3) Verification standards for fine-tuning effects of general-purpose large visual models;
[0083] Quantization error: The absolute error between the output value and the labeled value of each feature is ≤10%;
[0084] Scene recognition accuracy: Classification accuracy for small parts, occlusion, and backlit scenes ≥90%;
[0085] Output format compliance rate: Without post-processing, the structured output format compliance rate is ≥95%.
[0086] S102. The model is forced to output only a formatted numerical string consisting of backlight intensity, occlusion rate, small part pixel density and device importance weight in sequence by standardized prompt words; if the format verification fails, a retry prompt word is triggered, and the model can retry a maximum of 2 times.
[0087] The output format constraints for the large model are: prompt word engineering + format validation;
[0088] For the fine-tuned large model, a fixed prompt word is used to force the output format. The standardized prompt word template is as follows:
[0089] "You are an expert in the environmental feature analysis of transmission line images. Based on the input image and scene metadata, please strictly follow the following requirements to output the results, retaining only the numerical values and not adding any additional descriptions, explanations, or punctuation (except for the decimal point):"
[0090] Backlight intensity L (0-1, rounded to 2 decimal places);
[0091] Occlusion rate S (0-1, rounded to 2 decimal places);
[0092] Small component pixel density D (unit: px / mm) 2 (integer);
[0093] Equipment importance weight w (only 0.5 or 1.0); Output order: L, S, D, w
[0094] Retry mechanism: If any validation fails, the retry prompt will be automatically triggered: "Output format error. Please strictly follow the order of 'L,S,D,w' and only output the numerical value (L and S are rounded to 2 decimal places, D is an integer, and w is 0.5 or 1.0). Do not add any extra content." The retry will be repeated a maximum of 2 times (to avoid infinite loops).
[0095] S103, after professionally correcting and calibrating the pixel density and occlusion rate of small parts, outputs structured environmental feature data including backlight intensity, calibrated occlusion rate, calibrated pixel density of small parts, and device importance.
[0096] The pixel density calibration includes: identifying a standard component with a known actual size in the image, extracting the number of pixels of the component through an edge detection algorithm, calculating a reference pixel density based on the ratio of the actual physical area of the component to the number of pixels, and introducing a correction coefficient to compensate for image distortion and shooting angle error to obtain the calibrated pixel density.
[0097] Calibration formula:
[0098]
[0099] in,
[0100] D cal : calibrated pixel density (px / mm) 2 );
[0101] N pixe : The number of pixels of the reference component in the image; where the reference component is a standard component with known actual size in the transmission line (such as an M10 bolt, 10mm in diameter; an insulator pin, 5mm in diameter);
[0102] S actual : Actual area of the reference component (mm) 2 Bolt area = π × (d / 2) 2 (where d is a known diameter);
[0103] k: Correction factor (0.95-1.05, to compensate for errors caused by image distortion and shooting angle).
[0104] The occlusion rate calibration includes: extracting the shadow area through an image segmentation algorithm and calculating its pixel ratio, and then calibrating it in combination with the scene correction coefficient to correct the quantization error of the large model;
[0105] Calibration formula:
[0106]
[0107] in,
[0108] S cal : The occlusion rate after calibration (0-1);
[0109] N shadow : Number of pixels in the shadow area; for example, extracted using the Mask R-CNN segmentation algorithm;
[0110] N total Total number of pixels in the image;
[0111] λ: Scene correction coefficient;
[0112] Preferably, λ ranges from 0.9 to 1.1, and is selected according to the scene to compensate for the influence of terrain on shadows; for mountain scenes, λ = 1.0 to 1.1, and for plain scenes, λ = 0.9 to 1.0.
[0113] Specifically, S2 includes:
[0114] S201. Receive environmental feature data output from a general large model that has been fine-tuned and calibrated by power transmission line scene data, and perform data fitting to obtain fused features.
[0115] Specifically, core common factors are extracted through factor analysis to reduce data dimensionality while retaining key information, resulting in fused features.
[0116] The formula for factor analysis is:
[0117] X = AF + ε
[0118] Where X: the original data matrix; dimension 5×N, where N is the number of samples, and the column vector contains L, S cal D cal R, image complexity C;
[0119] Image complexity C can be calculated using any method known in the art, such as edge density, texture entropy, or gradient distribution, and is used to characterize the complexity of image content.
[0120] A: Factor loading matrix; 5×m in dimension, where m is the number of common factors, representing the correlation strength between the original dimensions and the common factors;
[0121] F: Common factor matrix; dimension m×N, m≤5, retaining core factors with a cumulative contribution rate ≥85%;
[0122] ε: Error term; dimension 5×N, representing the data fitting residual; ε∈[0,0.05].
[0123] Common factor calculation: F = A + X; A + Let be the pseudo-inverse matrix of A.
[0124] S202. Construct a discrete state space based on the fused features, and optimize the decision-making strategy through Q-learning to maximize the value of "state-action".
[0125] The states include backlight intensity, calibrated occlusion rate, calibrated small part pixel density, and device importance level; the actions include the selected preprocessing algorithm combination and parameter configuration.
[0126] The preprocessing algorithm combination selection includes ESRGAN super-resolution reconstruction algorithm, HDR / WDR dynamic range extension algorithm, and dark channel prior dehazing algorithm;
[0127] Parameter configuration: super-resolution scaling factor, HDR / WDR mode type, dark channel dehazing intensity, and guided filter parameters;
[0128] The agent outputs the optimal action a based on the principle of maximizing the Q value under state s, that is, determines the specific values of each parameter in the above algorithm combination.
[0129] Specifically, the Q-value update formula in the Q-learning optimization decision-making strategy is:
[0130] Q(s,a)=Q(s,a)+α[r+γ·max a′ Q(s′,a′)-Q(s,a)]
[0131] in,
[0132] Q(s,a): The long-term cumulative reward expectation of performing action a in state s;
[0133] α: Learning rate ∈ [0.1, 0.3], controls the step size of each Q-value update;
[0134] r: Immediate reward ∈ [0,1], representing the effect of the current decision;
[0135] γ: Discount factor ∈ [0.8, 0.95], which weighs the importance of immediate rewards versus future rewards;
[0136] s: Current state; including backlight intensity L and calibrated shading rate S cal , calibrated small part pixel density D cal The importance level of equipment (R) is discrete into 5 levels for each dimension;
[0137] a: Current action, current preprocessing algorithm combination and parameter configuration;
[0138] s′: The next state after performing action a;
[0139] a′: Next action;
[0140] max a′ Q(s′,a′): The maximum Q value of the next state.
[0141] Preferably, the instant reward number is:
[0142] r = w1 × Acc + w2 × Rec - β × T
[0143] Where Acc and Rec are the accuracy and recall of the detection results of the improved YOLOv8 model, respectively, T is the processing time (ms), w1 and w2 are weighting coefficients, and β is the time penalty coefficient;
[0144] w1 and w2 can be set to 0.4; β can be set to 0.0002.
[0145] S203. Output dynamic parameter instructions based on the Q-value maximization strategy; the dynamic parameter instructions include super-resolution scaling factor, high dynamic range / wide dynamic range mode, and dark channel dehazing intensity.
[0146] Specifically, in dynamic parameter instructions,
[0147] 1) The super-resolution scaling factor δ is dynamically set based on the calibrated pixel density of small parts;
[0148] Based on the calibrated small part pixel density D cal The super-resolution scaling factor δ is dynamically calculated using a linear interpolation formula. The two factors are inversely correlated, and the super-resolution scaling factor δ increases with the pixel density D of the calibrated small parts. cal Decrease and correspondingly increase;
[0149] The formula for calculating the super-resolution scaling factor in a specific example is as follows:
[0150]
[0151] δ∈[1.0,4.0]:300px / mm 2 This represents the upper limit of pixel density for small parts such as bolts and insulator pins;
[0152] D cal ≥300px / mm 2 When δ = 1.0-1.5 (no need for excessive amplification, to avoid redundant calculations);
[0153] 200≤D cal <300px / mm 2 At that time, δ = 2.0 (moderate magnification, balancing detail and speed);
[0154] D cal <200px / mm 2 At this time, δ = 3.0-4.0 (maximum magnification, ensuring that details of small parts are visible);
[0155] A value greater than 4.0 will result in image blurring (overfitting), while a value less than 1.0 will not have any super-resolution effect.
[0156] 2) HDR / WDR mode switches based on backlight intensity and scene type;
[0157] High dynamic range (HDR) mode is enabled in high backlight intensity and mountainous scenes, wide dynamic range (WDR) mode is enabled in medium backlight intensity and plain scenes, and low dynamic range mode is enabled in low backlight intensity. The dynamic range expansion factor is positively correlated with the backlight intensity and is adjusted according to the scene type.
[0158] In a specific example, the rules for dynamically switching modes according to the backlight intensity L ∈ [0, 1] and the scene type are as follows:
[0159] When L > 0.8 and it is a mountainous scene → HDR mode, the dynamic range is extended by 5 times;
[0160] When 0.4 < L ≤ 0.8 and it is a plain scene → WDR mode, the dynamic range is extended by 3 times;
[0161] When L ≤ 0.4 → low mode, the dynamic range is extended by 2 times;
[0162] According to the backlight intensity L ∈ [0, 1], the multiple of the extended dynamic range ∈ [2, 5] characterizes the brightness adaptation ability.
[0163] 3) The dark channel defogging intensity is dynamically calculated based on the calibrated occlusion rate and the backlight intensity;
[0164] The dark channel defogging intensity is dynamically calculated through a weighted linear formula based on the calibrated occlusion rate and the backlight intensity, and is clamped with a preset maximum value as the upper limit.
[0165] In a specific example, the dark channel defogging intensity formula is:
[0166] dehaze trength =min(1.0, 0.6S cal + 0.4L)
[0167] In the formula, the defogging intensity dehaze trength ∈ [0.2, 1], which characterizes the effect degree of the defogging algorithm.
[0168] 4) The guided filtering parameters are adjusted accordingly according to the dark channel defogging intensity;
[0169] The guided filtering parameters are dynamically adjusted according to the defogging intensity, where the regularization parameter decreases as the defogging intensity increases, and the filtering window size increases as the defogging intensity increases.
[0170] In a specific example, the calculation formula for the regularization parameter is:
[0171] ε = 0.00001 + (1 - dehaze trength ) × 0.00999
[0172] The calculation formula for the filtering window size (pixels) is
[0173] r = 30 + dehaze trength × 20
[0174] The parameters in the formula can be adjusted as necessary according to the specific implementation scenario.
[0175] Specifically, in S3, the adaptive preprocessing includes the following steps:
[0176] 1) Perform ESRGAN (Enhanced Super-Resolution Generative Adversarial Network) super-resolution reconstruction, perform densely connected convolution operations on the input feature map and introduce residual connections, and enhance the resolution of the image according to the super-resolution scaling factor in the agent's instructions;
[0177] Specifically, ESRGAN employs Residual Dense Blocks (RRDB) and Relativistic Average GAN (RaGAN) to improve the resolution of small part images;
[0178] In this embodiment, the residual dense block RRDB controls the strength of residual connections according to the super-resolution scaling factor and adjusts the output feature map.
[0179] The formula is:
[0180] F(x)=x+G(δ·[x+G(δ·[x+G(δ·x)])])
[0181] F(x): Output feature map of the RRDB module;
[0182] x: Module input feature map;
[0183] G: Densely connected convolutional layer (containing 3 convolutional kernels, size 3×3, stride 1);
[0184] δ: Super-resolution scaling factor ∈ [0.1, 0.3], which controls the strength of residual connections.
[0185] 2) Based on the HDR / WDR mode in the agent's instructions, expand the dynamic range of the image accordingly;
[0186] Depending on the mode, the dynamic range of the image is expanded by 2-5 times, solving the problem of brightness imbalance in strong backlight scenes and improving the defect recognition rate to over 90%.
[0187] 3) Perform dark channel prior dehazing, calculate atmospheric light value and transmittance based on atmospheric scattering model, restore image according to dehazing intensity in agent instruction, and eliminate fog and occlusion effects.
[0188] Specifically, the image restoration formula based on the atmospheric scattering model is as follows:
[0189]
[0190] J(x): The restored fog-free image;
[0191] I(x): The input foggy image;
[0192] A: Atmospheric light value (0-255, average of RGB three channels);
[0193] t(x): Transmittance 0-1, characterizing the ability of light to penetrate fog; the higher the defogging intensity in the agent's instructions, the lower the transmittance, and the lower the defogging intensity, the higher the transmittance.
[0194] t0: Minimum transmittance threshold ∈ [0.05, 0.15].
[0195] Specifically, in S3, in the improved YOLOv8 model,
[0196] A new shallow P2 feature layer is added to improve the feature representation capability of small targets; the CBAM attention mechanism is adopted to enhance feature representation through channel and spatial attention weights; the WIoUv3 loss function is adopted to replace the standard IoU loss, and a dynamic focusing coefficient is introduced to assign higher weights to small quality anchor boxes, while preventing gradient vanishing of simple samples.
[0197] Specifically, the WIoUv3 weighted intersection-union loss function version V3 introduces a non-monotonic focusing mechanism to improve the accuracy and convergence speed of small target detection.
[0198] The WIoUv3 loss function formula is:
[0199] L WIoUv3 =g·L WIoUv1
[0200] L WIoUv3 WIoUv3 total loss
[0201] g: Non-monotonic focusing coefficient ∈ [1.0, 1.5], controls the learning weights for ordinary quality anchor frames;
[0202] L WIoUv1 Base WIoU loss:
[0203] L WIoUv1 =1-V lou +R wlou
[0204] V lou The intersection-union ratio (IUU) of the predicted bounding box and the ground truth bounding box is in the range [0,1].
[0205] R wlou : Distance metric ∈ [0,2], combining the aspect ratio of the target and the Euclidean distance of the center point.
[0206] Specifically, the feature fusion formula for the CBAM attention module that executes the CBAM attention mechanism is as follows:
[0207] M = M c ⊙M s⊙I
[0208] Among them, M c For channel attention weights ∈ [0,1], M s Let I be the spatial attention weight ∈ [0,1], I be the original feature map, and ⊙ be the element-wise multiplication.
[0209] In the improved YOLOv8 model, the detection results are matched with the labeled ground truth values. Detections exceeding a preset threshold and matching the class are considered correct. The accuracy (Acc) and recall (Rec) are calculated by counting the number of correct detections, false positives, and false negatives.
[0210] Accuracy (Accel):
[0211]
[0212] Recall (Rec):
[0213]
[0214] The detection accuracy and recall of the improved YOLOv8 model are weighted and quantified, and a processing time penalty term is introduced to obtain a reward value which is fed back to the AI agent to update the reinforcement learning policy network. This enables the AI agent to output the optimal action.
[0215] In summary, the intelligent detection method for transmission line images based on AI agents disclosed in this embodiment has the following beneficial effects:
[0216] (1) Significantly improved detection accuracy: The rate of missed detection of small parts was reduced to below 13%, the recognition rate of strong backlight scenes was increased from 68% to over 90%, and the overall detection accuracy reached 93.2%;
[0217] (2) Enhanced scene adaptability: Dynamic parameters can be adapted to occlusion rate of 0-1, backlight intensity of 0-1, and pixel density of 100-500px / mm. 2 The entire scene;
[0218] (3) Outstanding self-learning ability: The Q-learning algorithm improves the system's accuracy by 0.5%-1% per month without human intervention;
[0219] (4) High efficiency in resource utilization: 40% of computing resources are saved in simple scenarios (L<0.4, S_cal<0.4), and the processing speed of complex scenarios is increased by 20%, with an average processing time of 0.9s;
[0220] (5) Excellent large model adaptation effect: Through three-level adjustment, the feature quantization error of the large model is ≤4% and the output format compliance rate is ≥99%, providing reliable input for intelligent agent decision-making and solving the core pain point of "scenario incompatibility" of general large models.
[0221] Example 2
[0222] One embodiment of the present invention discloses a system for implementing the AI-based intelligent detection method for transmission line images as described in the previous embodiment, as shown in Figure 2, comprising:
[0223] The general large model module is a general large model that is finely tuned and calibrated using transmission line scene data. It is used to analyze input images and output structured environmental feature data including backlight intensity, occlusion rate, pixel density of small parts, and importance of equipment.
[0224] AI intelligent agent is used to perform multi-dimensional feature fusion on input environmental feature data and generate dynamic parameter instructions using reinforcement learning algorithm. The dynamic parameters include at least super-resolution scaling factor, high dynamic range / wide dynamic range (HDR / WDR) mode and dehazing intensity.
[0225] The preprocessing module is used to perform preprocessing on the image, including super-resolution reconstruction and dark channel dehazing, according to the dynamic parameter instructions.
[0226] The defect detection module is used to perform defect detection using an improved YOLOv8 model with a fusion attention mechanism.
[0227] The decision feedback module is used to feed the accuracy and recall of the detection results as immediate rewards to the AI agent, updating the policy network of reinforcement learning.
[0228] The specific technical details and beneficial effects of this embodiment are the same as those of the previous embodiment. Please refer to the previous embodiment for details, and they will not be repeated here.
[0229] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for intelligent detection of transmission line images based on AI intelligent agents, characterized in that, include: S1. Using a general large model fine-tuned and calibrated with power transmission line scene data, the input image is analyzed, and structured environmental feature data including backlight intensity, occlusion rate, pixel density of small parts, and equipment importance is output. S2. The environmental feature data is input into the AI agent for multi-dimensional feature fusion, and a reinforcement learning algorithm is used to generate dynamic parameter instructions. The dynamic parameters include at least a super-resolution scaling factor, a high dynamic range / wide dynamic range mode, and dehazing intensity. S3. According to the dynamic parameter instructions, the image undergoes preprocessing including super-resolution reconstruction and dark channel dehazing. Subsequently, an improved YOLOv8 model with a fusion attention mechanism is used for defect detection; the type, location, and risk level of the defects are obtained. S4. Feed the accuracy and recall of the detection results as immediate rewards to the AI agent to update the reinforcement learning policy network.
2. The intelligent detection method for transmission line images based on AI intelligent agents according to claim 1, characterized in that, The process of fine-tuning and calibrating a general-purpose large model using power transmission line scene data includes: S101, constructing a dedicated dataset for power transmission lines covering small parts, tree shadow occlusion, strong backlight, and mixed scenes, and annotating four features: backlight intensity, occlusion rate, pixel density, and equipment weight, and then training the LoRA framework to fine-tune the general-purpose visual model; S102, forcing the general-purpose visual model to output only a formatted numerical string consisting of backlight intensity, occlusion rate, small part pixel density, and equipment importance weight in sequence through standardized prompt words; S103, after professionally correcting and calibrating the small part pixel density and occlusion rate, outputting structured environmental feature data containing backlight intensity, calibrated occlusion rate, calibrated small part pixel density, and equipment importance.
3. The intelligent detection method for transmission line images based on AI intelligent agents according to claim 2, characterized in that, In step S103, pixel density calibration includes: identifying a standard component with a known actual size in the image, extracting the number of pixels of the component using an edge detection algorithm, calculating a baseline pixel density based on the ratio of the actual physical area of the component to the number of pixels, and introducing a correction coefficient to compensate for image distortion and shooting angle errors to obtain the calibrated pixel density; occlusion rate calibration includes: extracting the shadow area using an image segmentation algorithm and calculating its pixel ratio, and then calibrating it in conjunction with a scene correction coefficient to correct the quantization error of the large model.
4. The intelligent detection method for transmission line images based on AI intelligent agents according to claim 1, characterized in that, S2 includes: S201, receiving environmental feature data output from a general large model that has been fine-tuned and calibrated by transmission line scene data, and performing data fitting to obtain fused features; S202, constructing a discrete state space based on the fused features, and optimizing the decision-making strategy through Q-learning to maximize the value of "state-action"; S203, outputting dynamic parameter instructions according to the Q-value maximization strategy; the dynamic parameter instructions include super-resolution scaling factor, high dynamic range / wide dynamic range mode, and dark channel defogging intensity.
5. The intelligent detection method for transmission line images based on AI intelligent agents according to claim 4, characterized in that, In S202, the state includes backlight intensity, calibrated occlusion rate, calibrated small part pixel density, and device importance level; the action includes the selected preprocessing algorithm combination and parameter configuration; the preprocessing algorithm combination includes ESRGAN super-resolution reconstruction algorithm, dynamic range expansion algorithm, and dark channel prior dehazing algorithm; the parameter configuration includes super-resolution scaling factor, HDR / WDR mode type, dark channel dehazing intensity, and guide filter parameters; the agent outputs the optimal action according to the Q-value maximization principle in the state, and determines the specific values of each parameter in the preprocessing algorithm combination.
6. The intelligent detection method for transmission line images based on AI intelligent agents according to claim 5, characterized in that, In the dynamic parameter instructions output by S203, 1) the super-resolution scaling factor is dynamically set according to the calibrated small part pixel density; the super-resolution scaling factor is dynamically calculated based on the calibrated small part pixel density through a linear interpolation formula, and the two are inversely correlated, so that the super-resolution scaling factor increases accordingly as the calibrated small part pixel density decreases. 2) The high dynamic range / wide dynamic range mode switches based on the backlight intensity and scene type; the high dynamic range mode is enabled in high backlight intensity and mountainous scenes, the wide dynamic range mode is enabled in medium backlight intensity and plain scenes, and the low dynamic range mode is enabled in low backlight intensity. The dynamic range expansion factor is positively correlated with the backlight intensity and is adjusted weighted according to the scene type; 3) The dark channel dehazing intensity is dynamically calculated based on the calibrated occlusion rate and backlight intensity; the dark channel dehazing intensity is dynamically calculated based on the calibrated occlusion rate and backlight intensity through a weighted linear formula, and clamped with a preset maximum value as the upper limit; 4) The guide filter parameters are adjusted accordingly based on the dark channel dehazing intensity; the regularization parameter in the guide filter parameters decreases as the dehazing intensity increases, and the filter window size increases as the dehazing intensity increases.
7. The intelligent detection method for transmission line images based on AI intelligent agents according to claim 4, characterized in that, In step S3, the adaptive preprocessing specifically includes the following steps: 1) Perform ESRGAN super-resolution reconstruction, perform densely connected convolution operations on the input feature map and introduce residual connections, and enhance the resolution of the image according to the super-resolution scaling factor in the agent's instructions; 2) According to the high dynamic range / wide dynamic range mode in the agent's instructions, expand the dynamic range of the image accordingly. 3) Perform dark channel prior dehazing, calculate atmospheric light value and transmittance based on atmospheric scattering model, restore image according to dehazing intensity in agent instruction, and eliminate fog and occlusion effects.
8. The intelligent detection method for transmission line images based on AI intelligent agents according to claim 7, characterized in that, In S3, the YOLOv8 model is improved by adding a shallow P2 feature layer to enhance the feature representation capability of small targets. The CBAM attention mechanism is adopted to enhance feature representation through channel and spatial attention weights; We adopt the WIoUv3 loss function to replace the standard IoU loss, introduce dynamic focusing coefficients, assign higher weights to small quality anchor boxes, and prevent gradient vanishing for simple samples.
9. The intelligent detection method for transmission line images based on AI intelligent agents according to claim 7, characterized in that, The weighted calculation results of the detection accuracy and recall of the improved YOLOv8 model are quantified, and a processing time penalty term is introduced to obtain a reward value which is fed back to the AI agent to update the reinforcement learning policy network, so that the AI agent can output the optimal action. The time reward r of the reinforcement learning policy network is: r = w1×Acc + w2×Rec - β×T, where Acc and Rec are the accuracy and recall of the detection results, respectively, T is the processing time, w1 and w2 are weighting coefficients, and β is the time penalty coefficient.
10. A transmission line image intelligent detection system based on AI intelligent agents, used to execute the transmission line image intelligent detection method based on AI intelligent agents as described in any one of claims 1-9, characterized in that, include: The general-purpose large model module is a general-purpose large model fine-tuned and calibrated using transmission line scene data. It is used to analyze the input image and output structured environmental feature data including backlight intensity, occlusion rate, pixel density of small parts, and equipment importance. The AI agent is used to perform multi-dimensional feature fusion on the input environmental feature data and generate dynamic parameter instructions using reinforcement learning algorithms. The dynamic parameters include at least a super-resolution scaling factor, a high dynamic range / wide dynamic range mode, and a dehazing intensity. The preprocessing module is used to perform preprocessing on the image according to the dynamic parameter instructions, including super-resolution reconstruction and dark channel dehazing. The defect detection module is used to perform defect detection using an improved YOLOv8 model that incorporates an attention mechanism; the decision feedback module is used to feed the accuracy and recall of the defect detection results to the AI agent as immediate rewards, updating the policy network of reinforcement learning.