A multi-agent cooperative oil field unmanned aerial vehicle inspection visual defect intelligent identification method and system

By assessing defect density and dividing the load in oilfield drone inspections, constructing a dual-source dataset for standardized processing, employing multi-agent distributed feature extraction and weighted fusion, and combining the YOLO model for defect identification and image stitching, the problems of uneven task allocation, data scarcity, and insufficient feature fusion in oilfield drone inspections are solved, achieving efficient and accurate defect identification and an integrated inspection process.

CN122336600APending Publication Date: 2026-07-03DAQING ANRUIDA TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610429469.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-02
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing UAV inspection technologies in oilfield environments suffer from problems such as uneven task allocation, insufficient model generalization ability due to scarcity of defect data, inadequate single-view feature extraction and multi-UAV feature fusion capabilities, difficulty in adapting image stitching to complex scenarios, and lack of integrated inspection processes.

Method used

By performing defect density and risk weighted assessment based on historical defect information of the inspection area, load balancing is achieved. A dual-source dataset is constructed for standardized processing. Multi-agent distributed feature extraction and weighted fusion are adopted, combined with the YOLO model for defect identification, and image stitching and visualization are performed to form an integrated inspection process.

Benefits of technology

It achieves balanced distribution of multi-UAV mission load, improves the model's generalization ability and recognition accuracy in complex environments, reduces operational complexity, and improves the efficiency and reliability of oilfield inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122336600A_ABST
    Figure CN122336600A_ABST
Patent Text Reader

Abstract

The application discloses a kind of multi-agent collaborative oilfield unmanned aerial vehicle inspection visual defect intelligent identification method and system, belong to oilfield safety production intelligent operation and computer vision technical field, for the uneven task allocation in existing oilfield unmanned aerial vehicle inspection, defect data is scarce, single visual angle recognition precision is low, multi-machine feature fusion is insufficient and image splicing effect is poor, global fusion features are generated by distributed multi-agent feature extraction and feature fusion method based on attention mechanism, in combination with target detection model to realize the accurate identification of defect type and location, while splicing and invalid area removal are carried out on the images of multiple unmanned aerial vehicles, and visual display and result recording are completed, so as to form an integrated closed-loop process of inspection task allocation, data processing, feature fusion, defect identification and panoramic display, which can be applied to unmanned aerial vehicle inspection and safety operation management of oilfield well site, oil pipeline and oil production equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] It belongs to the field of intelligent operation and maintenance technology for oilfield safety production, specifically involving intelligent identification of visual defects in oilfield drone inspections through multi-agent collaboration. Background Technology

[0002] As oilfield safety production moves towards intelligent and unmanned operations, drone inspections have gradually become an important means of inspecting well sites, oil pipelines, and oil production equipment. In existing technologies, drone inspection systems typically combine computer vision and deep learning models to detect and identify defects in acquired images. For example, industrial inspection methods based on target detection models such as YOLO and Faster R-CNN have been widely used in power line inspections and wind power equipment inspections, and can automatically identify targets such as cracks, corrosion, and foreign objects. Meanwhile, multi-drone collaborative inspection technology is also gradually developing, enabling parallel operation of multiple drones through region division to improve inspection efficiency. In terms of data processing, existing methods typically rely on manually labeled real datasets for model training and expand the sample size through data augmentation. In terms of image processing, image stitching algorithms based on feature point matching and homography transformation are relatively mature and can achieve a certain degree of inspection area reconstruction.

[0003] However, for the specific scenario of oilfield inspection, existing technologies are mostly direct transfers of general industrial inspection or power inspection solutions, lacking specialized designs for the characteristics of the oilfield environment and the types of defects. For example, in multi-UAV collaboration, existing technologies generally use equidistant or regular area division for task allocation, without considering the differences in defect distribution density and safety risks in different areas of the oilfield, resulting in uneven task load and low resource utilization. In defect identification, due to the difficulty in obtaining real defect samples in the oilfield, existing models rely on limited data for training, resulting in insufficient generalization ability and low identification accuracy in environments with complex lighting and dust interference. In feature extraction and fusion, most existing methods are based on single-UAV single-view images for identification, or simply stitch together data from multiple UAVs, failing to achieve deep fusion of multi-view features and making it difficult to fully utilize the advantages of multi-agent collaboration. In image stitching, traditional stitching algorithms are prone to misalignment, ghosting, and black border problems in large-scale, texture-similar scenes in the oilfield, affecting the overall monitoring effect. In addition, existing systems mostly adopt a separate approach for task allocation, data processing, and defect identification modules, lacking an integrated platform for oilfield inspection processes, making operation complex and difficult to meet the needs of field applications.

[0004] In summary, existing technologies suffer from several drawbacks: multi-agent task allocation cannot match the distribution of defects in oilfields, leading to load imbalance; scarcity of defect data results in insufficient model generalization ability; single-view feature extraction and multi-machine feature fusion capabilities are insufficient; image stitching is difficult to adapt to the complex scenarios of oilfields in a wide area; and the inspection process lacks integrated functionality. Summary of the Invention

[0005] To address the shortcomings of existing technologies, such as the inability of multi-agent task allocation to match the distribution of defects in oilfields leading to load imbalance, insufficient model generalization ability due to scarce defect data, inadequate single-view feature extraction and multi-machine feature fusion capabilities, difficulty in adapting image stitching to the complex and wide-area scenarios of oilfields, and the lack of integrated processing in the inspection process, the technical solution provided by this invention is as follows: A multi-agent collaborative intelligent method for visual defect identification in oilfield UAV inspection includes: The steps are as follows: Based on the historical defect information of the inspection area, the defect density and risk weighted assessment of each spatial location is performed to generate defect density distribution data; based on the defect density distribution data, the total load of the inspection area is calculated and the load is balanced according to the number of drones participating in the inspection to obtain the inspection area data corresponding to each drone. The steps are as follows: acquiring corresponding inspection image data based on the inspection area data and constructing a dual-source dataset containing synthetic defect data and real inspection data; performing standardization processing on the dual-source dataset and generating image data and annotation data in a unified format. The steps are as follows: Based on the image data, multi-scale local features are extracted in a multi-agent distributed manner and then aggregated to generate a unified-dimensional multi-agent local feature set and global aggregated features; The steps are: performing feature dimension alignment and generating spatial attention weights based on the multi-agent local feature set and global summary features; and weighted fusing the multi-agent local features and global summary features according to the spatial attention weights to generate global fused features. The steps of performing defect detection based on the global fusion features to obtain defect category, location and confidence level and output defect identification result data; The steps are as follows: stitching together inspection images collected by multiple UAVs based on the defect identification results data and performing invalid region removal processing to generate a panoramic image of the inspection area; The steps involve visualizing and recording the panoramic images of the inspection area and the defect identification results to generate an inspection report.

[0006] Furthermore, in a preferred embodiment, when generating defect density distribution data based on historical defect information of the inspection area, the probability of occurrence of historical defects is weighted with the safety risk level corresponding to the defect type, and a defect density distribution map covering the inspection area is constructed based on the weighting result.

[0007] Furthermore, in a preferred embodiment, when performing load balancing, the basic load of a single agent is determined based on the total load of the inspection area and the number of drones, and the inspection area is gradually divided in a spatially continuous manner so that the deviation between the cumulative load of each drone's corresponding area and the basic load is controlled within a preset range, and the overall load calibration is achieved by adjusting the area boundaries.

[0008] Furthermore, in a preferred embodiment, when constructing the dual-source dataset, synthetic defect data is generated by selecting background templates, parameterizing defect modeling, and superimposing environmental interference. At the same time as generating the image, the corresponding defect annotation information is output. Meanwhile, label parsing, coordinate transformation, and image standardization processing are performed on the real inspection data to form a data input in a unified format.

[0009] Furthermore, in a preferred embodiment, when performing multi-agent distributed feature extraction, each UAV node extracts multi-scale features in parallel and uploads them to the scheduling node through a lightweight communication method. The scheduling node performs data verification, dimension unification, and numerical normalization on the features of each node to form a unified set of local features of the multi-agent and global summary features.

[0010] Furthermore, in a preferred embodiment, when generating global fusion features, a unified dimensional mapping is performed on the local features of the multi-agent system and the global aggregated features, and the features are weighted and combined based on spatial attention weights, so that the features of the defect-related region are enhanced and the background interference is suppressed, and global fusion features are generated through feature aggregation and convolution optimization.

[0011] Based on the same inventive concept, this invention also provides a multi-agent collaborative intelligent visual defect recognition system for oilfield UAV inspection, including: Based on historical defect information of the inspection area, the module performs defect density and risk weighted assessment of each spatial location and generates defect density distribution data. Based on the defect density distribution data, the module calculates the total load of the inspection area and performs load balancing according to the number of drones participating in the inspection to obtain the inspection area data corresponding to each drone. Based on the inspection area data, the corresponding inspection image data is obtained and a dual-source dataset containing synthetic defect data and real inspection data is constructed. The dual-source dataset is then standardized and a module is used to generate image data and annotation data in a unified format. Based on the image data, a module extracts multi-scale local features in a distributed manner using a multi-agent approach and performs aggregation processing to generate a unified-dimensional set of multi-agent local features and global aggregated features. Based on the multi-agent local feature set and global summary features, feature dimension alignment is performed and spatial attention weights are generated. Based on the spatial attention weights, the multi-agent local features and global summary features are weighted and fused to generate global fused features. This module performs defect detection based on the global fusion features to obtain defect category, location, and confidence level, and outputs defect identification result data. A module that stitches together inspection images collected by multiple UAVs based on the defect identification results data and performs invalid region removal processing to generate a panoramic image of the inspection area; This module visualizes and records the inspection report data based on the panoramic image of the inspection area and the defect identification results.

[0012] Based on the same inventive concept, this invention also provides a computer storage medium for storing a computer program, which, when read by a computer, executes the method described thereon.

[0013] Based on the same inventive concept, this invention also provides a computer, including a processor and a storage medium, wherein when the processor reads a computer program stored in the storage medium, the computer executes the method.

[0014] Based on the same inventive concept, this invention also provides a computer program product, which, when executed, implements the method described herein.

[0015] Compared with the prior art, the advantages of the technical solution provided by the present invention are as follows: By using the multi-agent load balancing task allocation module to perform quantitative calculations based on historical defect density and safety risk levels, total load accounting, and dynamic area division and deviation calibration mechanisms, the inspection area division can be matched with the actual defect distribution characteristics. Compared with the existing equidistant division method, this significantly reduces the problem of overload in key areas and idleness in low-risk areas, and achieves a balanced distribution of task load among multiple UAVs. This ensures the inspection accuracy of key areas while improving overall inspection efficiency and resource utilization.

[0016] By combining the adaptive generation of synthetic defect data with the standardized loading of real inspection data in the dual-source data processing module, the training data has both scalability and consistency with the real scene. Compared with existing methods that rely solely on real data or simple data augmentation, this effectively alleviates the problem of scarce oilfield defect samples, significantly improves the model's generalization ability and robustness in complex environments, and reduces the cost of manual annotation.

[0017] By using parallel feature extraction on the edge side in the distributed feature extraction module, lightweight communication based on the UDP protocol, and unified aggregation and standardized processing by the master node, multiple UAVs can simultaneously complete multi-view feature extraction and achieve low-latency transmission. Compared with the traditional single-machine serial processing or centralized processing method, it effectively improves feature extraction efficiency and reduces communication latency, while providing a unified and standardized input basis for subsequent multi-agent feature fusion.

[0018] By aligning the feature dimensions of multiple agents, adaptively generating spatial attention weights, and implementing cross-agent weighted fusion mechanisms in the attention feature fusion module, local features from different perspectives can be accurately aligned in the spatial dimension and weighted according to their importance. Compared with existing simple splicing or average fusion methods, this effectively strengthens key features related to defects and suppresses background interference, fundamentally making up for the problem of missing information from a single perspective and significantly improving the accuracy of defect identification in complex scenarios.

[0019] By optimizing model parameters for oilfield scenarios, using a multi-scale detection head, and employing a confidence grading mechanism in the YOLO defect recognition module based on fused feature input, defect detection can simultaneously handle small-sized targets and complex background environments. Compared to traditional single-image input target detection methods, this improves defect localization accuracy and classification accuracy. Furthermore, risk grading is achieved through confidence thresholds, providing more reliable data support for operation and maintenance decisions.

[0020] By performing grayscale conversion, binarization, maximum contour detection, and cropping after image stitching in the intelligent image stitching module, the stitching result can automatically remove black borders and retain the complete and effective area. Compared with the black border, misalignment, and ghosting problems in traditional stitching algorithms, it significantly improves the integrity and usability of panoramic images, thus making it more conducive to the global analysis and defect location of oilfield inspection areas.

[0021] By unifying and integrating task allocation, data processing, feature fusion, defect identification, and splicing display in the whole-process integrated visualization and system integration mechanism, and designing an interactive interface, the originally scattered multiple processing links are transformed into a closed-loop collaborative process. Compared with the existing multi-tool separation implementation method, it significantly reduces the complexity of operation and improves the ease of use of the system, enabling front-line oilfield operation and maintenance personnel to complete inspection tasks without having a deep algorithm background, thereby improving the feasibility of practical engineering applications.

[0022] It is applicable to the intelligent identification of defects and safe operation and maintenance management of unmanned aerial vehicle (UAV) inspections of oilfield well sites, oil pipelines and oil production equipment. Attached Figure Description

[0023] Figure 1 This is a schematic diagram of the overall system architecture; Figure 2 This is a schematic diagram of the core processing flow. Detailed Implementation

[0024] To make the advantages and benefits of the technical solution provided by the present invention clearer, the technical solution provided by the present invention will now be described in further detail with reference to the accompanying drawings, specifically: Implementation Method 1: This implementation method provides a multi-agent collaborative intelligent identification method for visual defects in oilfield UAV inspections, including: The steps are as follows: Based on the historical defect information of the inspection area, the defect density and risk weighted assessment of each spatial location is performed to generate defect density distribution data; based on the defect density distribution data, the total load of the inspection area is calculated and the load is balanced according to the number of drones participating in the inspection to obtain the inspection area data corresponding to each drone. The steps are as follows: acquiring corresponding inspection image data based on the inspection area data and constructing a dual-source dataset containing synthetic defect data and real inspection data; performing standardization processing on the dual-source dataset and generating image data and annotation data in a unified format. The steps are as follows: Based on the image data, multi-scale local features are extracted in a multi-agent distributed manner and then aggregated to generate a unified-dimensional multi-agent local feature set and global aggregated features; The steps are: performing feature dimension alignment and generating spatial attention weights based on the multi-agent local feature set and global summary features; and weighted fusing the multi-agent local features and global summary features according to the spatial attention weights to generate global fused features. The steps of performing defect detection based on the global fusion features to obtain defect category, location and confidence level and output defect identification result data; The steps are as follows: stitching together inspection images collected by multiple UAVs based on the defect identification results data and performing invalid region removal processing to generate a panoramic image of the inspection area; The steps involve visualizing and recording the panoramic images of the inspection area and the defect identification results to generate an inspection report.

[0025] When generating defect density distribution data based on historical defect information of the inspection area, the probability of historical defect occurrence and the safety risk level corresponding to the defect type are weighted, and a defect density distribution map covering the inspection area is constructed based on the weighting result.

[0026] When performing load balancing, the basic load of a single agent is determined based on the total load of the inspection area and the number of drones. The inspection area is then divided step by step in a spatially continuous manner to keep the deviation between the cumulative load of each drone's corresponding area and the basic load within a preset range. Overall load calibration is achieved by adjusting the area boundaries.

[0027] When constructing a dual-source dataset, synthetic defect data is generated by selecting background templates, parameterizing defect modeling, and overlaying environmental interference. At the same time as generating images, corresponding defect annotation information is output. Meanwhile, label parsing, coordinate transformation, and image standardization processing are performed on real inspection data to form a data input with a unified format.

[0028] When performing multi-agent distributed feature extraction, each UAV node extracts multi-scale features in parallel and uploads them to the scheduling node through lightweight communication. The scheduling node performs data verification, dimension unification and numerical normalization on the features of each node to form a unified set of local features of multi-agents and global summary features.

[0029] When generating global fusion features, a unified dimensional mapping is performed on the local features of the multi-agent system and the global aggregated features. The features are then weighted and combined based on spatial attention weights, which enhances the features of the defect-related regions and suppresses background interference. Global fusion features are then generated through feature aggregation and convolution optimization.

[0030] A multi-agent collaborative intelligent visual defect recognition system for oilfield UAV inspection is also provided, including: Based on historical defect information of the inspection area, the module performs defect density and risk weighted assessment of each spatial location and generates defect density distribution data. Based on the defect density distribution data, the module calculates the total load of the inspection area and performs load balancing according to the number of drones participating in the inspection to obtain the inspection area data corresponding to each drone. Based on the inspection area data, the corresponding inspection image data is obtained and a dual-source dataset containing synthetic defect data and real inspection data is constructed. The dual-source dataset is then standardized and a module is used to generate image data and annotation data in a unified format. Based on the image data, a module extracts multi-scale local features in a distributed manner using a multi-agent approach and performs aggregation processing to generate a unified-dimensional set of multi-agent local features and global aggregated features. Based on the multi-agent local feature set and global summary features, feature dimension alignment is performed and spatial attention weights are generated. Based on the spatial attention weights, the multi-agent local features and global summary features are weighted and fused to generate global fused features. This module performs defect detection based on the global fusion features to obtain defect category, location, and confidence level, and outputs defect identification result data. A module that stitches together inspection images collected by multiple UAVs based on the defect identification results data and performs invalid region removal processing to generate a panoramic image of the inspection area; This module visualizes and records the inspection report data based on the panoramic image of the inspection area and the defect identification results.

[0031] A computer storage medium is also provided for storing a computer program, which, when read by the computer, executes the method.

[0032] A computer is also provided, including a processor and a storage medium, wherein the computer executes the method when the processor reads a computer program stored in the storage medium.

[0033] A computer program product is also provided, which, when executed, implements the method described.

[0034] Implementation Method Two: This implementation method is a further detailed description of the technical solution provided in Implementation Method One, specifically: Step 1: Multi-agent Inspection Task Initialization and Load Balancing. Briefly, by inputting inspection task parameters and combining historical defect data, the defect density of the inspection area is assessed, dynamically dividing the inspection area for multiple drones and balancing the load. The inspection area range and communication initialization information for each drone are output. More specifically, the number of drones participating in the inspection and the geographic coordinate mapping range of the inspection area are first obtained. Historical inspection records for the corresponding area within a preset time period are read. The frequency of defect occurrence at each spatial location is weighted according to the risk level corresponding to the defect type. The probability of defect occurrence and the risk weight are combined to form a defect density distribution map covering the entire inspection area. Finally, the defect density at all locations within the inspection area is summed to obtain the total inspection load. The system first calculates the load and then divides the total load evenly among the drones to obtain the basic inspection load for each drone. Based on this, the inspection area is scanned sequentially in spatial order, and adjacent areas are gradually assigned to each drone according to their cumulative load values. This ensures that the deviation between the cumulative load of each drone's assigned area and its basic load is controlled within a preset range, while also guaranteeing continuity between areas without overlap or omission. After the initial area division, the first and last areas are calibrated to ensure that the load deviation of all drones meets the constraints by adjusting the area boundary positions. Finally, the coordinate range of the inspection area corresponding to each drone is output, and a master-slave communication structure centered on the edge scheduling node is established to complete the communication handshake between each drone node and the master node, providing a foundation for subsequent data processing and feature transmission.

[0035] Step two involves adaptive preparation and standardized loading of dual-source data. First, briefly, this involves constructing a synthetic defect data generation process and a standardized processing process for real inspection data to achieve unified input for both training and inference phases, outputting a standardized dataset and its annotation information. Then, in detail, during the data preparation phase, the data source is first determined based on user selection. When synthetic data is selected, a pre-built oilfield background template library is invoked, randomly selecting base images from background images of different scenes and lighting conditions. Based on preset parameters, parametric modeling is performed on three types of defects: pipeline damage, wellhead leakage, and equipment corrosion. The size, shape, color, and distribution location of the defects are randomly combined to generate... The system generates defect images and overlays environmental factors such as lighting changes, dust occlusion, motion blur, and oil pollution to enhance data realism. Simultaneously, it automatically outputs the corresponding defect category and bounding box annotation information. When real data is selected, the system automatically loads the inspection images and their annotation files from the specified folder, parses the annotation content, converts normalized coordinates to image pixel coordinates, performs image size unification, pixel value normalization, and channel standardization, and filters out abnormal data. Finally, it outputs standardized image data and corresponding annotation information that meet the model input requirements and distributes the data to the corresponding UAV nodes according to the inspection area determined in step one.

[0036] Step three involves multi-agent distributed parallel feature extraction. Briefly, this involves the edge scheduling node coordinating the parallel extraction of image features from various UAVs and then summarizing them to output a standardized multi-agent local feature set and global feature representation. More specifically, after data allocation, the edge scheduling node sends a feature extraction start command to each UAV node and simultaneously distributes model parameters for feature extraction. Each UAV node executes the feature extraction process in parallel based on its local computing resources, inputting the inspection image into the backbone network of the deep learning model. It extracts detailed features, semantic features, and global features from different levels and fuses these multi-layer features to generate a unified format of local feature representation. Subsequently, each UAV node encapsulates the extracted local features according to a preset data format and sends them to the edge scheduling node via a lightweight communication protocol. The edge scheduling node verifies, unifies, and normalizes the received features from each node, summarizing the features from different UAVs to form a standardized multi-agent local feature set and corresponding global summary features, providing input for subsequent feature fusion.

[0037] Step four involves multi-agent feature fusion based on an attention mechanism. Briefly, this involves dimensional alignment of multi-agent features and calculation of spatial attention weights to achieve weighted fusion of cross-agent features, outputting a global fused feature. More specifically, it first performs unified dimensional mapping on the local features uploaded by each UAV node and the global aggregated features, ensuring they are expressed within the same feature space. Then, each local feature is combined with the global feature along the channel dimension, and convolution operations are used to generate a weight distribution corresponding to the spatial location. This weight distribution characterizes the importance of each location for defect identification. After obtaining the weights, the local and global features of each UAV are weighted and combined to enhance key region features while suppressing background interference. The weighted features of all UAVs are then aggregated to form a unified global fused feature. Subsequently, the fused feature undergoes multi-layer convolution optimization to enhance semantic expressiveness while preserving spatial details, ultimately outputting a global feature representation for defect identification.

[0038] Step 5, Intelligent Defect Recognition Based on Fusion Features: Briefly, by inputting the fused global features into the detection model, the type and location of oilfield defects are identified, and the defect recognition results are output. More specifically, the global fused features obtained in Step 4 are input into the multi-scale detection structure of the target detection model to detect defects at different scales. The model outputs the category information, spatial location, and confidence score for each candidate target, and obtains the optimal detection result through a screening mechanism that removes overlapping prediction results. Subsequently, a confidence assessment is performed on each detection result, and defects are classified according to preset thresholds. Results reaching the basic threshold are recorded as valid defects, while results reaching higher thresholds are marked as high-risk defects and alarm information is generated. Finally, complete recognition result data including defect category, location coordinates, associated inspection area, and corresponding image information is output.

[0039] Step Six: Intelligent panoramic stitching of multi-UAV inspection images. Briefly, this involves stitching and removing black borders from images collected by multiple UAVs to generate a complete panoramic image of the inspection area, outputting a panoramic result without missing defect areas. More specifically, the images collected by each UAV are first sorted according to the spatial order of the inspection area and input into the image stitching module. Through feature point extraction and matching calculations of the spatial transformation relationship between the images, multiple images are gradually merged to generate an initial panoramic image. Based on this, the stitching result undergoes grayscale conversion and threshold segmentation to distinguish between valid image areas and invalid black border areas. Then, all external contours are extracted, and the contour with the largest area is selected as the boundary of the valid area. The image is then cropped based on this boundary to remove black borders and invalid areas generated during the stitching process, resulting in a complete and continuous panoramic inspection image. The defect identification results obtained in Step Five are then mapped to the corresponding locations to achieve global defect localization and display.

[0040] Step 7: Visualization and Recording of the Entire Process Results. First, briefly, an integrated visual interface is built to display the inspection process and identification results, complete data recording and export, and output inspection reports and traceable data. Second, in detail, the unified visual interface centrally displays the task allocation of multiple UAVs, inspection progress, defect identification results, and panoramic images. Identified defects are displayed as overlaid bounding boxes, labeled with defect type, confidence level, and location information. High-risk defects are highlighted and alerted. Simultaneously, key parameters, data sources, identification result statistics, and alarm records from the inspection process are automatically saved, generating a structured inspection report. The system also supports the export and storage of result data and images, enabling complete recording and traceability of the inspection process, thus achieving closed-loop execution of oilfield UAV inspection tasks.

[0041] Implementation Method 3: This implementation method is described in detail with reference to the accompanying drawings. Specific embodiments are provided to further illustrate the technical solutions offered above. Specifically: The technical solution of this implementation is based on a closed-loop process of multi-agent task allocation → dual-source data processing → distributed feature extraction → attention feature fusion → YOLO defect recognition → image stitching and restoration → visual monitoring. It covers six core functional modules, and all modules have been improved to address the shortcomings of existing technologies. The core formula is derived from the core design logic of load balancing calculation, distributed feature fusion, and defect recognition confidence determination, realizing the integrated design of multi-agent collaborative inspection and intelligent defect recognition.

[0042] System Overall Architecture The system architecture of this implementation is centered on multi-agent collaboration, supported by deep learning and computer vision technologies, and uses full-process visualization as the operational platform. It constructs a six-layer closed-loop architecture, enabling data exchange and result feedback between each layer. The specific architecture layers are as follows: Task allocation layer: Implements dynamic region partitioning and load balancing task allocation for multiple agents based on defect density, and outputs the inspection area of ​​each UAV; Data processing layer: Enables adaptive generation of synthetic defect data and standardized loading of real inspection data, providing data support for defect identification; Feature extraction layer: Based on the YOLO model, local depth features of each UAV inspection image are extracted, providing a foundation for feature fusion; Feature fusion layer: Through distributed communication and attention mechanisms, it achieves accurate alignment and weighted fusion of local features of multiple agents to generate global fused features; Defect identification layer: Based on the fused global features, the YOLO prediction head is used to accurately determine the type, location, and confidence level of oilfield defects; Visualization layer: Enables integrated display and log recording of multi-agent task allocation results, defect identification results, and stitched global image.

[0043] Core module design (including improvements and core formulas) Multi-agent load balancing task allocation module Design Concept: Addressing the issue of uneven defect distribution in oilfield inspection areas leading to multi-UAV task load imbalance, this design utilizes historical inspection statistics on defect density as the core load factor. A comprehensive load balancing algorithm is constructed, encompassing "defect density quantification - total load calculation - basic load allocation - dynamic region division - load deviation calibration," replacing the traditional equidistant region division method. This achieves adaptive and balanced allocation of inspection tasks across multiple UAVs. Key Improvements: For the first time, defect density is directly quantified and bound to inspection load. Region division perfectly matches defect distribution characteristics, resolving the pain points of overload in densely defected areas and resource idleness in sparsely defected areas in traditional solutions. Task allocation balance is improved by over 40%, and overall inspection efficiency is improved by over 30%. The core formulas and algorithm steps are as follows: Step 1: Defect density quantification calculation The defect density of the oilfield inspection area is obtained through statistical analysis of historical inspection data. It represents the weighted value of the probability and severity of defects occurring within a unit pixel area. The calculation formula is as follows:

[0044] in: This represents the defect density value at coordinates (x, y), with a range of [0, 10]. A higher value indicates a higher inspection priority and workload for that area. The probability of a historical defect occurring at coordinate (x,y) is obtained by statistically analyzing the inspection defect records of this area over the past 12 months, and the value ranges from [0,1]. The weighting coefficients for the severity of defects are set according to the safety risk level of the oilfield defect type: pipeline damage is weighted at 10, wellhead leakage at 8, equipment corrosion at 5, and areas without historical defects at 1.

[0045] Step 2: Overall Inspection Load Calculation for Oilfield Areas Based on the defect density distribution, the total inspection load of the entire inspection area is calculated using the following formula:

[0046] in: This represents the total inspection load for the oilfield inspection area. W and H are the width and height of the oilfield inspection area, respectively, in pixels, corresponding to the geographic coordinate mapping range of the inspection area. The defect density value at coordinates (x, y) obtained in step 1.

[0047] Step 3: Determine the basic inspection load of a single agent Based on the number of drones participating in the inspection, the total load is evenly distributed, and the basic inspection load of a single drone is determined using the following formula:

[0048] in: This serves as the basic inspection payload for a single drone. N represents the number of drones participating in this inspection mission, with a value range of [2, 10], which can be adaptively adjusted according to the size of the inspection area.

[0049] Step 4: Dynamic region partitioning based on defect density Using a column-first approach, inspection areas are divided for each drone from left to right, ensuring that the deviation between the cumulative load and the base load of each drone's inspection area is within a set threshold. The area determination formula is as follows:

[0050]

[0051] in: Let i be the inspection area of ​​the i-th drone. ; , These are the starting and ending x-coordinates of the inspection area of ​​the i-th UAV; δ is the load balancing deviation threshold, which is set based on the following: the threshold is 0.05 in the case of routine oilfield inspection (i.e., allow ±5% load deviation), and the threshold is 0.02 in key prevention and control areas and areas with dense defects (i.e. allow ±2% load deviation) to ensure the balance of task allocation. The region division satisfies the continuity constraint: ,in This ensures that the inspection areas are completely uninterrupted and without omissions.

[0052] Step 5: Dynamic calibration of load deviation After the initial area division is completed, the load deviation of the first and last drones is calibrated a second time. If the load deviation of the remaining area of ​​the last drone from the basic load exceeds the threshold, the termination abscissa of all areas is finely adjusted globally to ensure that the load deviation of all drones is controlled within the threshold range. Finally, the geographic coordinate mapping parameters of the inspection area of ​​each drone are output.

[0053] Dual-source data processing module Design Concept: Addressing the industry pain points of scarce real-world defect samples and high annotation costs in oilfields, a dual-data source supply mechanism is constructed: "adaptive generation of synthetic defect data + standardized loading of real inspection data." This enables seamless data switching between training and inference phases, providing sufficient and standardized data support for the defect identification model and solving the problem of insufficient model generalization ability in small-sample scenarios. Core Improvements: Synthetic data can adaptively simulate samples from different oilfield inspection scenarios, lighting conditions, and defect types, achieving automated batch generation and annotation without manual intervention. Real-world data undergoes fully automated parsing, format conversion, and standardized preprocessing, improving data processing efficiency by over 50% and significantly reducing manual preprocessing costs. The specific implementation steps and key designs of the two data sources are as follows: Synthetic Defect Data Adaptive Generation Module To address three core defects in oilfields, a full-process adaptive generation mechanism is constructed, comprising "background template library construction - defect feature parameterization - adaptive overlay of scene interference - automatic tag generation." The specific execution steps are as follows: Oilfield background template library construction: Pre-collect defect-free background images of different oilfield scenarios, covering typical inspection scenarios such as sandy roads, pipeline laying areas, wellhead operation areas, and equipment stations. It also includes background templates under different lighting conditions such as sunny days, cloudy days, backlighting, and low light, and builds a background template library that supports random retrieval during the generation process.

[0054] Defect Feature Parametric Definition: Parametric modeling is performed for the three core safety defects in oilfields. The model can adaptively adjust parameters such as defect size, shape, color, and location. Specific definitions are as follows: Pipeline damage defects: Parametrically define the length (range 5~50 pixels, corresponding to actual size 0.5cm~5cm), width (range 2~20 pixels), shape (linear crack, blocky damage), and color (rust red, black) of the damaged area to simulate scenarios such as pipeline anti-corrosion layer damage and pipe wall cracking; Wellhead leakage defect: Parametrically define the area of ​​the leakage region (range 10×10~200×200 pixels), the diffusion shape (circular, irregular diffusion), and the color (bright yellow, dark brown) to simulate scenarios such as wellhead crude oil leakage and sewage seepage; Equipment rust defects: Parametrically define the distribution pattern of rust areas (flaking rust, pitting corrosion), area ratio (range 5%~80%), and color gradient (light brown, dark brown, blackish brown) to simulate the rust aging scenarios of equipment such as oil well trees, valves, and storage tanks.

[0055] Adaptive scene interference overlay: To address real-world environmental interference during oilfield inspections, adaptive overlay of factors such as lighting changes, dust obstruction, oil stains, and motion blur is applied to simulate real-world shooting conditions during drone inspections. This improves the fit between the synthesized data and the real-world scene, enhancing the model's generalization ability.

[0056] Automatic Defect Label Generation: While synthesizing defect images, the system automatically generates corresponding YOLO format annotation files for the defects, including defect category numbers and normalized coordinate information of bounding boxes. This achieves integrated output of "image generation - annotation generation", eliminating the need for manual annotation. It supports generating 10 to 10,000 samples in a single batch and can be adaptively adjusted according to model training needs.

[0057] Standardized loading module for real inspection data For real inspection images and labeled data collected by UAVs in oil fields, a full-process loading mechanism is constructed, consisting of "batch data loading - automatic label parsing - coordinate format conversion - image standardization preprocessing". The specific execution steps are as follows: Batch data loading: Supports users to select a folder of real inspection data and automatically load inspection images in mainstream formats such as .jpg, .png, and .bmp. At the same time, it automatically matches .txt format YOLO tag files with the same filename to achieve a one-to-one correspondence between images and tags.

[0058] Automatic label parsing and coordinate transformation: Automatically reads the contents of YOLO format label files, parses the defect category number, normalized center coordinates, and width and height information, and automatically converts the normalized coordinates into pixel-level bounding box coordinates (top left x, top left y, bottom right x, bottom right y) according to the pixel size of the corresponding image, achieving accurate mapping of defect locations.

[0059] Image normalization preprocessing: For the loaded real inspection image, automatic size normalization (scaling to 640×640 pixels as required by the model input, supporting adaptive adjustment in the range of 128×128~1920×1920), pixel value normalization (mapping pixel values ​​of 0~255 to the range of 0~1), and channel normalization are performed to output normalized tensor data that meets the input requirements of the YOLO model.

[0060] Data validation and anomaly filtering: Automatically validates the legality of loaded image and label data, filters out abnormal data such as damaged images, missing labels, and out-of-bounds coordinates, and outputs a data loading statistics report, including information such as the number of valid samples, the number of various defective samples, and the number of abnormal samples, to ensure the quality of input data.

[0061] Distributed feature extraction module Design Concept: Based on the backbone network feature extraction capabilities of the YOLO deep learning model optimized for oilfield scenarios, a parallel processing architecture of "edge-side distributed extraction - edge node communication aggregation - feature dimension standardization" is constructed. Through a multi-agent distributed communication protocol, independent extraction and synchronous aggregation of local deep features from each UAV inspection image are achieved, solving the perspective limitation problem of single-agent feature extraction and providing standardized feature input for cross-agent feature fusion. Core Improvements: A lightweight distributed communication mechanism based on the UDP protocol is adopted, combined with multi-process parallel computing, replacing the traditional single-process serial extraction scheme. The edge-side processing efficiency of feature extraction is improved by more than 2 times, and the latency of cross-agent feature aggregation is reduced by 60%. The extracted deep features are specifically optimized for three types of core defects in oilfields, significantly enhancing the defect feature representation capability. Key Design and Communication Protocol Description: Feature extraction target setting: The last three layers of the YOLO model backbone network optimized for oilfield scenarios are used as the feature extraction targets, namely shallow detail features (1 / 8 downsampling), mid-level semantic features (1 / 16 downsampling), and deep global features (1 / 32 downsampling). After fusing the three layers of features, the output is the local features of a single agent, and the output feature dimension is unified as follows. C is the number of feature channels, with a default value of 256, which can be adjusted within the range of 128 to 1024 depending on the complexity of the oilfield scenario; , The height and width of the feature map are matched to the size of the input image.

[0062] Distributed communication protocol specification: The lightweight User Datagram Protocol (UDP) is used to implement communication between multiple agents and edge scheduling nodes. The communication process and protocol definition are as follows: Communication architecture: The architecture adopts a master-slave structure of "1 edge scheduling master node + N UAV end-side slave nodes". The master node is responsible for task scheduling, feature aggregation and fusion calculation, while the slave nodes are responsible for feature extraction and data transmission of local images. Data frame format: Define a standardized feature transmission data frame. The frame header consists of a 2-byte node ID and a 2-byte feature dimension identifier. The frame body is the serialized local feature tensor data. The frame tail is a 1-byte checksum to ensure the accuracy of data transmission. Communication sequence: After the master node completes task allocation, it sends a feature extraction start command to all slave nodes; after each slave node completes local image feature extraction, it sends a feature data frame to the master node; after receiving the feature data from all slave nodes, the master node completes feature aggregation, sends an acknowledgment frame to the slave nodes, and completes one round of distributed feature extraction process.

[0063] Feature standardization processing: After receiving the local features from each slave node, the master node performs dimensional alignment and normalization on all features to ensure that the local features of each agent have the same dimensionality and numerical distribution, and outputs a local feature set and a global summary feature in a unified format to provide input for subsequent attention feature fusion.

[0064] Attention Feature Fusion Module Design Concept: As the core innovative module of this implementation method, this module addresses the perspective differences and information complementarity of local features across multiple agents by constructing a full-process feature fusion architecture: "multi-feature dimension alignment - adaptive spatial attention weight generation - cross-agent weighted fusion - global feature optimization." Through an attention mechanism, it automatically strengthens key defect-related features and suppresses irrelevant background and interference features, achieving precise complementary fusion of local features from multiple UAVs and completely resolving the problem of missing feature information caused by the limited perspective of a single agent. Core Improvement: Replacing the traditional simple multi-feature splicing and averaging fusion method, this module introduces a spatial attention weighted fusion mechanism optimized for oilfield scenarios. This achieves precise alignment and adaptive complementary fusion of features from multiple agents, improving the representation capability of key defect features by over 30% and reducing the false detection rate of defect identification in complex environments by over 25%. The specific execution steps and core formulas for multi-agent feature fusion are as follows: Step 1: Alignment of Feature Dimensions of Multiple Agents For the local features extracted by each agent, a convolutional alignment layer with shared weights maps all local features and the global aggregated features to the same hidden dimension space, ensuring a perfect match of feature dimensions and laying the foundation for subsequent fusion calculations. The feature alignment calculation formula is as follows:

[0065]

[0066] in: The original local features extracted by the i-th agent, i∈[1,N], where N is the number of drones participating in the inspection; The local features after alignment for the i-th agent; The global summary feature is the concatenation of local features from all agents. This is the aligned global summary feature; The weight matrix of the convolutional layer is aligned with the features, and the kernel size is 1×1 to achieve dimension mapping without changing the spatial size. This is the bias term for the feature-aligned convolutional layer.

[0067] Step 2: Adaptive Calculation of Spatial Attention Weights For the aligned local features and global aggregated features of a single agent, an attention weight is adaptively generated for each spatial location using a spatial attention convolution module. A higher weight value indicates a greater contribution of the feature at that location to defect identification. Emphasis is placed on strengthening the feature weights of oilfield defect areas while suppressing the weights of irrelevant areas such as sandy background and lighting interference. The formula for calculating the attention weight is as follows:

[0068] in: Let be the spatial attention weight matrix corresponding to the local features of the i-th agent. The weight values ​​range from [0,1] and perfectly match the spatial size of the feature map. σ is the Sigmoid activation function, used to map the convolution output to the [0,1] interval to normalize the weights; The weight matrix of the attention convolutional layer uses a 1×1 convolutional kernel to perform channel compression and weight mapping on the concatenated features; This refers to the bias term of the attention convolutional layer; This is a feature concatenation operation for the channel dimension.

[0069] Step 3: Cross-agent attention weighted fusion Based on the generated spatial attention weights, the local and global features of each agent are weighted and fused to achieve complementarity between local detail features and global semantic features. Then, the fused features of all agents are globally aggregated to generate the final global fused feature. The weighted fusion calculation formula is as follows:

[0070]

[0071] in: The local branch fusion feature of the i-th agent; To optimize the feature distribution after fusion, a 1×1 convolution kernel is used as the weight matrix of the fused convolutional layers. This refers to the bias term for merging convolutional layers; The complementary weights of the global features ensure that the sum of the weights of the local features and the global features is 1, thus avoiding feature value shift. The final global fusion feature, which is the aggregator of features from all agents, serves as the input for the subsequent defect identification module.

[0072] Step 4: Feature Fusion Optimization The final global fusion features are optimized using two layers of residual convolutional blocks to further enhance the semantic representation capability of the defect features while preserving detailed location information. The optimized feature map is then fed into the detection head of the YOLO defect recognition module for defect prediction.

[0073] YOLO Defect Detection Module Design Concept: This design employs a YOLO series model specifically optimized for oilfield inspection scenarios. It uses global features fused from multi-agent attention as input to the model's detection head, replacing the traditional single-image local feature input method. This enables accurate type determination, sub-pixel-level location detection, and quantitative confidence assessment of three core oilfield defect types, outputting complete defect identification results and providing precise data support for oilfield operation and maintenance decisions. Core Improvements: Transfer learning and specialized optimization of the model are performed based on oilfield defect samples. Combined with multi-agent fusion feature input, this compensates for the information loss problem of single-agent local features. The defect identification accuracy in complex oilfield scenarios is improved by over 20%, and the false negative rate for small defects is reduced by over 35%. Model parameter optimization, core formulas, and inference flow are as follows: Oilfield Scenario-Specific Model Optimization and Parameter Range: This module uses the YOLOv8 / YOLOv9 architecture and performs the following specific optimizations for oilfield inspection scenarios. All core parameters are set to adjustable ranges to adapt to different oilfield operating conditions and hardware specifications: Model input size: The default setting is 640×640 pixels, which can be adaptively adjusted within the range of 128×128~1920×1920 pixels according to the inspection accuracy requirements; Anchor frame parameters: Based on the statistical results of the size distribution of the three types of defects in the oilfield, nine sets of anchor frame sizes were re-clustered and optimized to adapt to the three types of defects: small, medium and large. The anchor frame size can be fine-tuned according to the defect characteristics of the target oilfield. Model depth and width coefficients: For edge deployment scenarios, the default depth coefficient is 0.33 and the width coefficient is 0.50. They can be adjusted within the range of 0.25 to 1.0 according to the computing power of the deployed hardware to balance recognition accuracy and inference speed. Non-maximum suppression (NMS) parameters: The default Intersection over Union (IoU) threshold is 0.45 and the confidence threshold is 0.25. It can be adaptively adjusted within the range of 0.1 to 0.7 according to the false detection tolerance of the inspection scenario.

[0074] Defect identification reasoning process The global optimized features output by the attention feature fusion module are input into the three detection heads of the YOLO model, corresponding to the detection of small, medium and large-sized defects respectively; Each detection head outputs three types of results: defect category prediction, bounding box location prediction, and target confidence prediction. The NMS algorithm is used to remove duplicate prediction boxes from overlapping ones, and the optimal defect prediction result is selected.

[0075] For each defect prediction result, the final identification confidence score is calculated using the Sigmoid function, with the following formula:

[0076] in: C is the overall confidence value of defect identification, which ranges from [0,1]. The higher the value, the stronger the reliability of the defect identification result. S is the product of the target confidence score and the class confidence score output by the YOLO detection head. This implementation scheme is designed for oilfield inspection scenarios and sets up two levels of confidence score determination rules: Warning threshold: C≥0.5, is judged as a valid defect, included in the inspection results statistics, and marked and displayed on the visualization interface; Alarm threshold: C≥0.8, which is judged as a serious defect in high reliability, triggering a system alarm and pushing it to oilfield operation and maintenance personnel for key review and handling.

[0077] Intelligent image stitching module Design Concept: Based on OpenCV's image stitching engine, this system automatically stitches together images from multiple UAV inspections. Then, through a grayscale-binarization-contour detection process, it automatically identifies and removes black borders in the stitched image, restoring the complete global view of the oilfield inspection area. Core Improvement: Replacing the traditional image stitching method without black border processing, a maximum contour detection mechanism is introduced to automatically remove black borders, solving the problem of incomplete stitched images and increasing the effective area ratio of the stitched image to 100%. Key Design: The stitched image is processed by grayscale and binarization to generate a black and white mask image, with black border areas set to 0 and effective image areas set to 255. Detect the outer contour of the mask image and select the contour with the largest area as the valid image contour; Based on the boundary coordinates of the largest outline, the image is cropped and stitched together, and the black border area is removed.

[0078] Core Implementation Steps Core Implementation Steps The multi-agent collaborative oilfield UAV inspection visual defect intelligent identification method of this embodiment is implemented in steps S1-S7. Each step is executed sequentially, data is exchanged, and results are fed back, forming a complete closed loop of "inspection task allocation - data processing - feature extraction and fusion - defect identification - panoramic stitching - visualization display". The specific steps are as follows: S1: Multi-agent inspection task initialization and load balancing allocation Input the basic parameters for this inspection task: the number of drones N participating in the inspection, the geographic coordinate mapping size (W,H) of the oilfield inspection area, the historical defect density map M(x,y) of the area, and the load balancing deviation threshold δ. Based on the defect density calculation formula, the defect density value of each coordinate point in the inspection area is calculated, and a standardized defect density distribution map is generated. Based on the total inspection load formula, the total inspection load Ltotal of the entire inspection area is calculated, and the basic inspection load Lbase of a single UAV is determined. Following the column-priority dynamic area division rule, inspection areas are divided for each drone in sequence to ensure that the deviation between the cumulative load and the basic load in each area is within the set threshold range, thus completing the initial area division. The initially divided areas are calibrated for load deviation to ensure that the inspection areas of all UAVs are non-overlapping and non-omitted, and that the load deviations are all controlled within the threshold range. Finally, the geographic coordinate mapping parameters of the inspection areas of each UAV are output. Initialize the distributed communication architecture of "master node + slave node" and complete the communication handshake between each UAV slave node and the edge scheduling master node to prepare for subsequent distributed feature extraction and fusion.

[0079] S2: Adaptive Preparation and Normalized Loading of Dual-Source Data Through a visual interactive interface, users can choose the data source: synthetic defect data or real inspection data. If synthetic defect data is selected: the user sets parameters such as the number of samples to be generated, the proportion of defect types, and the type of scene interference. The system starts the adaptive generation process, generates synthetic oilfield defect images with standardized YOLO format labels in batches, outputs the synthetic image path and the corresponding defect annotation information, and assigns them to the corresponding UAV processing nodes according to the inspection area. If real inspection data is selected: The user selects the storage folder for the real inspection data, and the system automatically loads the inspection images and corresponding YOLO format label files in batches, automatically completes label parsing, coordinate format conversion, image standardization preprocessing, and abnormal data filtering, outputs a standardized real dataset, and matches it to the corresponding UAV processing node according to the inspection area; After the data loading is complete, the system outputs a data loading statistics report, including information such as the number of valid samples, the distribution of various defective samples, and abnormal data, to ensure the quality of the input data.

[0080] S3: Multi-agent distributed parallel feature extraction The edge scheduling master node sends a feature extraction start command to all UAV slave nodes and simultaneously distributes the YOLO model feature extraction weight parameters optimized for the oilfield scenario. Each slave node initiates an independent feature extraction process based on a multi-process parallel computing mechanism to process the assigned local inspection image. It extracts shallow, medium, and deep multi-scale local features through the YOLO backbone network, and then merges them to generate local standardized local features. Each slave node sends the extracted local features to the edge scheduling master node in a standardized data frame format via a preset lightweight UDP communication protocol. After receiving feature data from all slave nodes, the master node performs data verification, dimension alignment and normalization, and summarizes and generates local feature sets and global summary features for all agents, which are then output to the subsequent feature fusion module.

[0081] S4: Multi-agent feature fusion based on attention mechanism Feature alignment processing: Through a 1×1 convolutional alignment layer with shared weights, the local features of all agents and the global summary features are mapped to the same hidden dimension space, thus achieving accurate dimensional alignment of multiple features. Adaptive generation of attention weights: The local features and global summary features aligned by each agent are concatenated along the channel dimension, and the attention weight matrix corresponding to the spatial location is adaptively generated through attention convolutional layers and sigmoid activation function. Cross-agent weighted fusion: Based on the generated attention weight matrix, the local features and global features of each agent are weighted and fused to achieve complementarity between local detailed features and global semantic features, and generate local branch fusion features for each agent; Global feature aggregation and optimization: The local branch fusion features of all agents are globally averaged and aggregated to generate initial global fusion features. Then, the fusion features are optimized through residual convolutional blocks to enhance the semantic representation ability of defect features. Finally, the optimized global fusion features are output and sent to the defect recognition module.

[0082] S5: YOLO Intelligent Identification of Oilfield Defects Based on Fusion Features The optimized global fusion features output by the attention feature fusion module are input into the YOLO model detection head specifically optimized for oilfield scenarios to start defect identification inference calculation; The YOLO inspection head outputs the defect category prediction, bounding box position prediction, and confidence prediction results. The overlapping prediction boxes are deduplicated using the non-maximum suppression algorithm to select the optimal defect prediction results. Based on the confidence level determination formula, the comprehensive confidence level of each defect prediction result is calculated, and the result is determined according to the preset two-level threshold rule: a confidence level ≥ 0.5 is determined as a valid defect and included in the result statistics; a confidence level ≥ 0.8 is determined as a high-risk serious defect and triggers a system alarm. The final output includes complete defect identification results, including the inspection area to which the defect belongs, the defect type (pipeline damage / wellhead leakage / equipment corrosion), the pixel coordinates of the defect bounding box, the identification confidence level, and the corresponding original image.

[0083] S6: Intelligent panoramic stitching of multi-drone inspection images Collect all raw high-definition images of the drone inspections, sort them according to the geographical coordinates of the inspection areas, and import them into the intelligent image stitching module; The optimized image stitching engine is launched to extract feature points, match features, calculate homography matrix, transform and fuse multiple images to generate an initial panoramic stitched image. To address the black border issue in the initial stitched image, an automated processing flow is implemented: first, the stitched image is converted to grayscale, and then an adaptive threshold binarization is used to generate a black and white mask image to distinguish between the effective image area and the black border area. The contour detection algorithm extracts all external contours from the mask image, selects the contour with the largest area as the boundary contour of the valid image, and crops the initial stitched image according to the boundary coordinates of the contour to completely remove the black border area. The final output is a global panoramic image of the oilfield inspection area without black borders or misalignments. Simultaneously, the defect identification results are mapped to the corresponding positions in the panoramic image to achieve global positioning of the defect locations.

[0084] S7: Visualization and traceability of end-to-end results The integrated visual interactive interface displays the multi-agent task allocation results, the inspection progress of each drone, detailed defect identification results, and a global panoramic image of the inspection area in modules. On the original inspection images and panoramic stitched images, the bounding boxes of defects are automatically drawn, and information such as defect type, confidence level, and location coordinates are marked. High-risk and serious defects are highlighted in red and given an alarm. Automatically record the entire process operation log and result data of this inspection task, including inspection task parameters, number of drones involved, inspection area range, data source, total number of identified defects, number of various defects, alarm information, etc., and generate a standardized inspection report. It supports local saving and export of inspection reports, defect identification results, and panoramic images, enabling full lifecycle traceability of inspection data and providing complete data support for oilfield safe production, operation and maintenance, and defect handling.

[0085] (III) Innovation Points This implementation method addresses the unique pain points of unmanned aerial vehicle (UAV) inspection scenarios in oil fields, and incorporates technological innovations throughout the entire process. All innovations differ significantly from existing technologies, possessing outstanding substantive features and significant progress. The core innovations are reflected in the following six aspects: A pioneering multi-agent load balancing task allocation method based on oilfield defect density and safety risk weighting was developed. For the first time, historical oilfield defect density and defect safety risk level were used as core calculation factors for inspection load, replacing the traditional equidistant area division method. This method enables dynamic adaptive division of inspection areas for multiple agents, ensuring the balance of inspection load for each UAV. It fundamentally solves the problem of mismatch between traditional solutions and the characteristics of oilfield defect distribution, improving task allocation balance by more than 40% and overall inspection efficiency by more than 30%.

[0086] A dual-data source adaptive generation and loading mechanism specifically designed for oilfield scenarios was developed: addressing the industry pain point of scarce real defect samples in oilfields, a dual-data source supply mode was constructed, which adaptively generates synthetic defect data and standardizes the loading of real inspection data. Synthetic data can simulate different scenarios, lighting conditions, and types of defect samples in oilfields in batches and automatically generate annotations. Real data achieves fully automated preprocessing, effectively solving the problem of insufficient model generalization ability in small sample scenarios, and significantly improving the robustness of the model in complex oilfield scenarios.

[0087] A distributed multi-agent feature fusion architecture with an attention mechanism adapted to multi-drone inspection in oilfields was constructed. To address the limitations of single-drone perspective, a full-process feature fusion system of "distributed edge extraction - lightweight communication aggregation - attention-weighted fusion" was built. This system achieves accurate alignment and adaptive complementary fusion of local features from multiple perspectives of multiple agents, replacing the traditional simple splicing and average fusion methods. The representation capability of key defect features is improved by more than 30%, and the false detection rate in complex scenarios is reduced by more than 25%.

[0088] A specific optimization scheme for the YOLO model in oilfield scenarios based on multi-agent fusion features is proposed: the global features after multi-agent attention fusion are used as the input of the YOLO model, replacing the traditional single-image local feature input method. At the same time, specific optimizations are completed for the model anchor boxes, loss functions, and inference parameters for three types of core defects in oilfields, which completely makes up for the problem of missing information in single-view local features. The accuracy of oilfield defect recognition is improved by more than 20%, and the false negative rate of small-sized defects is reduced by more than 35%.

[0089] The intelligent image stitching and automatic black border removal technology adapted to the wide-area inspection scenario of oilfields has been optimized: Based on the traditional image stitching technology, the feature matching and stitching process has been optimized to address the characteristics of uneven lighting and high texture similarity in open oilfield scenes. At the same time, an automated black border processing process of "grayscale conversion-binarization-maximum contour detection" has been introduced, realizing the automated removal of stitching black borders and misalignment problems. The effective area ratio of the stitched image reaches 100%, which can completely restore the global picture of the oilfield inspection area and provide support for the overall management and control of oilfield operation and maintenance.

[0090] A multi-agent collaborative full-process integrated visualization system for oilfield inspection has been developed. Addressing the fragmentation of existing technical processes, it is specifically designed for front-line oilfield operation and maintenance scenarios. It integrates core functions for the entire process, including task allocation, data processing, feature fusion, defect identification, image stitching, and result display. It constructs an intuitive and easy-to-use visual interactive interface, enabling one-click operation and real-time result display throughout the entire process. This solves the problems of cumbersome operation and high usage threshold of traditional solutions, significantly reducing the operating costs for oilfield operation and maintenance personnel, and has strong value for on-site promotion and application.

[0091] Beneficial effects and experimental verification This implementation method addresses the actual production needs of oilfield drone inspections by constructing a closed-loop technology system for multi-agent collaborative inspection and intelligent defect identification. Compared to existing mainstream drone inspection defect identification technologies, it exhibits significant advantages in inspection efficiency, identification accuracy, scenario adaptability, and ease of use, as detailed below: Significantly improved inspection efficiency and task balance: Compared with the traditional equidistant area division scheme, the load balancing task allocation method of this implementation improves the task allocation balance by more than 40% and reduces the total operation time of a single round of inspection by more than 30%. At the same time, it can ensure the inspection sampling density of key prevention and control areas with dense defects, thus balancing inspection efficiency and prevention and control accuracy of key areas.

[0092] Significantly enhanced defect recognition accuracy and robustness: This implementation method, through multi-agent feature fusion and oilfield scenario-specific model optimization, achieves an average recognition accuracy of 95.8% for the three core defects—pipeline damage, wellhead leakage, and equipment corrosion—in actual oilfield inspection scenarios. Compared to traditional single-UAV single-image recognition solutions, this represents an improvement of over 15% in recognition accuracy, a reduction of over 25% in false detection rate, and a reduction of over 35% in missed detection rate for small-sized defects. Even under complex conditions such as backlighting, dust storms, and partial obstruction, it maintains a recognition accuracy of over 92%, demonstrating extremely strong scenario robustness.

[0093] This solution addresses the industry pain point of scarce oilfield defect data: The adaptive generation mechanism for synthetic defect data in this implementation can achieve batch automated generation and labeling of defect samples without manual intervention. Tens of thousands of labeled samples can be generated in a single batch, significantly reducing the data cost of model training. At the same time, through joint training of synthetic and real data, the generalization ability of the model is significantly improved, solving the problem of model overfitting caused by the scarcity of real defect samples in oilfields.

[0094] The integrated design of the entire process significantly reduces the application threshold: This implementation method constructs a closed-loop technical system and an integrated visualization system, which integrates functions such as multi-machine task allocation, data processing, defect identification, and panoramic stitching. The operation process is simplified by more than 80%, and maintenance personnel do not need to master complex algorithm operations to complete the entire process inspection and identification work, which has extremely strong value for on-site promotion and application.

[0095] Reduce safety risks and maintenance costs of oilfield inspections: This implementation method replaces traditional manual foot inspections with multi-agent collaborative automated inspections, completely avoiding the safety risks of manual entry into high-risk work areas. At the same time, the labor cost of a single round of inspections is reduced by more than 70%, and the manual review cost of defect identification is reduced by more than 60%, which can bring significant economic benefits to oilfield operation and maintenance.

[0096] Oilfield field experimental verification data To verify the practical application effect of the technical solution of this embodiment, a field comparative experiment was conducted in a well site inspection scenario of an onshore oilfield in China. The experimental area covered three typical oilfield inspection scenarios: wellhead area, pipeline laying area, and equipment station. Four drones participated in the experiment. The core indicators were compared with the existing mainstream single-drone inspection scheme and multi-drone equidistant zone inspection scheme. The results are as follows:

[0097] Experimental results show that, in actual oilfield inspection scenarios, the technical solution of this implementation method has significant advantages over existing mainstream technical solutions in terms of inspection efficiency, defect identification accuracy, and robustness in complex scenarios. It fully meets the actual needs of oilfield safety production inspection and has extremely high industrial application value.

[0098] Combination Figure 1 The display is arranged from top to bottom as follows: visualization layer, defect identification layer, feature fusion layer, feature extraction layer, data processing layer, and task allocation layer. The data flow between each layer is marked by arrows, realizing a closed loop of "task allocation → data processing → feature extraction → feature fusion → defect identification → visualization".

[0099] Combination Figure 2 The process is presented as follows: S1 Multi-agent task allocation → S2 Dual-source data processing → S3 Distributed feature extraction → S4 Attention feature fusion → S5 YOLO defect identification → S6 Intelligent image stitching → S7 Visualization. The specific content of data output and input is labeled between each step.

[0100] The above description of several specific embodiments further details the technical solution provided by the present invention in order to highlight the advantages and benefits of the technical solution provided by the present invention. However, the above-described specific embodiments are not intended to limit the present invention. Any reasonable modifications and improvements to the present invention, combinations of embodiments, and equivalent substitutions based on the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A multi-agent cooperative oilfield unmanned aerial vehicle inspection visual defect intelligent identification method, characterized in that, include: The steps are as follows: Based on the historical defect information of the inspection area, the defect density and risk weighted assessment of each spatial location is performed to generate defect density distribution data; based on the defect density distribution data, the total load of the inspection area is calculated and the load is balanced according to the number of drones participating in the inspection to obtain the inspection area data corresponding to each drone. The steps are as follows: acquiring corresponding inspection image data based on the inspection area data and constructing a dual-source dataset containing synthetic defect data and real inspection data; performing standardization processing on the dual-source dataset and generating image data and annotation data in a unified format. The steps are as follows: Based on the image data, multi-scale local features are extracted in a multi-agent distributed manner and then aggregated to generate a unified-dimensional multi-agent local feature set and global aggregated features; The steps are: performing feature dimension alignment and generating spatial attention weights based on the multi-agent local feature set and global summary features; and weighted fusing the multi-agent local features and global summary features according to the spatial attention weights to generate global fused features. The steps of performing defect detection based on the global fusion features to obtain defect category, location and confidence level and output defect identification result data; The steps are as follows: stitching together inspection images collected by multiple UAVs based on the defect identification results data and performing invalid region removal processing to generate a panoramic image of the inspection area; The steps involve visualizing and recording the panoramic images of the inspection area and the defect identification results to generate an inspection report. 2.The multi-agent collaborative oilfield unmanned aerial vehicle inspection visual defect intelligent identification method according to claim 1, characterized in that, When generating defect density distribution data based on historical defect information of the inspection area, the probability of historical defect occurrence and the safety risk level corresponding to the defect type are weighted, and a defect density distribution map covering the inspection area is constructed based on the weighting result. 3.The multi-agent collaborative oilfield unmanned aerial vehicle inspection visual defect intelligent identification method according to claim 1, characterized in that, When performing load balancing, the basic load of a single agent is determined based on the total load of the inspection area and the number of drones. The inspection area is then divided step by step in a spatially continuous manner to keep the deviation between the cumulative load of each drone's corresponding area and the basic load within a preset range. Overall load calibration is achieved by adjusting the area boundaries.

4. The multi-agent collaborative oilfield unmanned aerial vehicle inspection visual defect intelligent identification method according to claim 1, characterized in that, When constructing a dual-source dataset, synthetic defect data is generated by selecting background templates, parameterizing defect modeling, and overlaying environmental interference. At the same time as generating images, corresponding defect annotation information is output. Meanwhile, label parsing, coordinate transformation, and image standardization processing are performed on real inspection data to form a data input with a unified format.

5. The multi-agent collaborative oilfield unmanned aerial vehicle inspection visual defect intelligent identification method according to claim 1, characterized in that, When performing multi-agent distributed feature extraction, each UAV node extracts multi-scale features in parallel and uploads them to the scheduling node through lightweight communication. The scheduling node performs data verification, dimension unification and numerical normalization on the features of each node to form a unified set of local features of multi-agents and global summary features.

6. The intelligent identification method for visual defects in oilfield UAV inspection using multi-agent collaborative methods as described in claim 1, characterized in that, When generating global fusion features, a unified dimensional mapping is performed on the local features of the multi-agent system and the global aggregated features. The features are then weighted and combined based on spatial attention weights, which enhances the features of the defect-related regions and suppresses background interference. Global fusion features are then generated through feature aggregation and convolution optimization.

7. A multi-agent collaborative intelligent visual defect recognition system for oilfield UAV inspection, characterized in that, include: Based on historical defect information of the inspection area, the module performs defect density and risk weighted assessment of each spatial location and generates defect density distribution data. Based on the defect density distribution data, the module calculates the total load of the inspection area and performs load balancing according to the number of drones participating in the inspection to obtain the inspection area data corresponding to each drone. Based on the inspection area data, the corresponding inspection image data is obtained and a dual-source dataset containing synthetic defect data and real inspection data is constructed. The dual-source dataset is then standardized and a module is used to generate image data and annotation data in a unified format. Based on the image data, a module extracts multi-scale local features in a distributed manner using a multi-agent approach and performs aggregation processing to generate a unified-dimensional set of multi-agent local features and global aggregated features. Based on the multi-agent local feature set and global summary features, feature dimension alignment is performed and spatial attention weights are generated. Based on the spatial attention weights, the multi-agent local features and global summary features are weighted and fused to generate global fused features. This module performs defect detection based on the global fusion features to obtain defect category, location, and confidence level, and outputs defect identification result data. A module that stitches together inspection images collected by multiple UAVs based on the defect identification results data and performs invalid region removal processing to generate a panoramic image of the inspection area; This module visualizes and records the inspection report data based on the panoramic image of the inspection area and the defect identification results.

8. A computer storage medium for storing computer programs, characterized in that, When the computer program is read by the computer, the computer executes the method of claim 1.

9. A computer, comprising a processor and a storage medium, characterized in that, When the processor reads the computer program stored in the storage medium, the computer executes the method of claim 1.

10. A computer program product, as a computer program, is characterized by: When the computer program is executed, it implements the method of claim 1.