An unmanned aerial vehicle inspection hidden danger identification and disposal method and system for an oil production area
By combining multimodal data fusion and cross-modal attention modules with large models and the GRPO algorithm, the complexity of hazard identification and handling in UAV inspections of oil production areas has been solved, achieving efficient and accurate hazard identification and optimized handling.
Patent Information
- Application Number
- CN202611411077.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-11
- Publication Date
- 2026-11-27
AI Technical Summary
Existing drone inspection technology struggles to reliably identify hidden dangers in complex environments within oil production areas, particularly gas leaks and equipment overheating. Furthermore, it lacks a standardized expression of the severity of hazards and the appropriate timing for intervention. Traditional model training is inefficient and fails to meet the diverse and specialized needs of oil production areas.
Multimodal data acquisition and processing are employed, combining visible light images, infrared thermal imaging, and on-site sensor data. Structured identification results, including hazard type, risk level, and disposal recommendations, are generated through a cross-modal attention module and a pre-trained large model. The disposal strategy is then optimized using the GRPO algorithm.
It significantly improves the accuracy and flexibility of hazard identification in oil production areas, reduces the rate of missed detections and false alarms, provides clear decision-making basis, supports seamless integration with industrial information systems, adapts to complex working conditions, and optimizes the efficiency and safety of handling strategies.
Smart Images

Figure CN123180972A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent safety monitoring and automated operation and maintenance, and in particular to a method and system for identifying and handling potential hazards during unmanned aerial vehicle (UAV) inspections in oil production areas. Background Technology
[0002] Oil production areas typically include well sites, metering stations, gathering and transportation stations, combined stations, tank farms, and numerous pipelines, valves, flanges, pumping units, electrical equipment, and fire-fighting facilities. They are characterized by flammable and explosive media, numerous locations and wide distribution, complex environments, and serious consequences from potential hazards. Traditional safety inspections mainly rely on manual on-site inspections and paper records, which suffer from long inspection cycles, incomplete coverage, strong subjectivity, delayed detection, and high exposure risks for workers in hazardous areas. With the development of drones, computer vision, and large-scale model technology, using drones equipped with visible light and infrared thermal imaging equipment for automatic inspection of oil production areas and intelligent identification of safety hazards has become an important means to improve intrinsic safety levels. However, the stability of single visible light images is limited under on-site conditions such as backlighting, dust, nighttime, and obstruction, making it difficult to reliably detect hidden hazards such as gas leaks and equipment overheating.
[0003] Existing automated inspection solutions mostly employ traditional target detection or image classification models, which can only output fixed categories or detection boxes. This makes it difficult to provide a unified and actionable expression of the severity, impact range, and timing of hazard response. Furthermore, these solutions are ill-suited to the diverse forms of hazards, scarce samples, and specialized descriptions required in oil production areas. Existing models are typically trained using supervised fine-tuning or reinforcement learning alone. If reinforcement learning is used to train from scratch, the model is almost unable to generate qualified hazard descriptions in the early stages, resulting in extremely low exploration efficiency. On the other hand, the quality of hazard response often does not have a single standard answer but is closely related to the response effect, response cost, and safety constraints. Simple supervised fine-tuning cannot optimize these objectives. Summary of the Invention
[0004] This invention provides a method and system for identifying and handling potential hazards during unmanned aerial vehicle (UAV) inspections in oil production areas, overcoming the problem that existing technologies, which rely solely on monitoring and fine-tuning, cannot reasonably optimize objectives such as handling effectiveness, handling costs, and safety constraints.
[0005] To achieve the above objectives, the technical solution of the present invention is as follows: A method for identifying and handling potential hazards during unmanned aerial vehicle (UAV) inspections in oil production areas, comprising: S1. Collect multimodal input data of the target inspection points through the acquisition device; preprocess the multimodal input data to obtain preprocessed multimodal input data; The preprocessed multimodal input data includes spatially aligned visible light images, spatially aligned infrared thermal imaging images, and on-site sensing and process data in the form of structured feature vectors. S2. Based on the spatially aligned visible light image, obtain the visible light apparent features through the visible light feature extraction branch; based on the spatially aligned infrared thermal image, obtain the infrared thermal features through the infrared feature extraction branch. S3. Based on visible light apparent features and infrared thermal features, combined with preset task prompt text and on-site sensing and process data in the form of structured feature vectors, a multimodal state representation is obtained through a cross-modal attention module. S4. Based on the multimodal state representation and combined with the preset structured template, the structured recognition result is obtained through the pre-trained multimodal large model; The structured identification results include the type of hazard, risk level, scope of impact, warning name, and handling recommendations; S5. Generate a handling strategy based on the structured recognition results; and obtain an optimized handling strategy through the GRPO algorithm; S6. Based on the structured identification results and on-site sensing and process data, obtain the early warning level; based on the early warning level and optimized handling strategy, send early warning instructions and work orders to the corresponding objects to repair the equipment at the target inspection points.
[0006] Furthermore, the specific steps of the preprocessing are as follows: S11. Based on the visible light image, the visible light image is processed sequentially through white balance correction, brightness normalization, deblurring, distortion correction, cropping, and scale transformation to obtain the processed visible light image. S12. Based on the infrared thermal imaging image, the processed infrared thermal imaging image is obtained by sequentially performing temperature range normalization processing, bad pixel and noise filtering processing, and pseudo-color mapping processing. S13. Based on the processed visible light image and the processed infrared thermal imaging image, spatially aligned visible light image and infrared thermal imaging image are obtained through a spatial alignment method. S14. Convert the field sensing and process data into structured feature vector form, and combine it with spatially aligned visible light images and infrared thermal imaging images to form preprocessed multimodal input data.
[0007] Furthermore, the visible light feature extraction branch is used to complete the following feature extraction process, as follows: S211. Based on the spatially aligned visible light image, a standardized visible light image is obtained through scaling and normalization operations. S212. Based on the standardized visible light image, divide it into several image blocks by a preset size; perform linear projection mapping on each image block to obtain the visual word vector of each image block; superimpose position encoding on the visual word vector of each image block to obtain the visual word sequence. S213. Based on the visual word sequence, the visible light appearance features are obtained through multiple stacked Transformer encoding layers.
[0008] Furthermore, the infrared feature extraction branch is used to complete the following feature extraction process, as follows: S221. Based on the spatially aligned infrared thermal imaging image, a normalized infrared thermal imaging image is obtained through linear normalization. S222. Based on the normalized infrared thermal imaging image, calculate the difference between the temperature of each pixel in the image and the background temperature of its neighborhood, and the local temperature gradient to generate a thermal anomaly saliency map; stitch the thermal anomaly saliency map with the normalized infrared thermal imaging image to obtain a multi-channel input image. S223. Based on the multi-channel input image, divide it into several image blocks of the input image by a preset size; perform linear projection mapping on the image block of each input image to obtain the visual word vector of the image block of each input image; superimpose position encoding on the visual word vector of the image block of each input image to obtain the visual word sequence of the input image. S224. Based on the visual word sequence of the input image, infrared thermal features are obtained through multiple stacked Transformer coding layers.
[0009] Furthermore, the cross-modal attention module is used to obtain multimodal state representations, as follows: S31. Based on the visible light apparent features and infrared thermal features, combined with the preset task prompt text and on-site sensing and process data in the form of structured feature vectors, the corresponding features projected onto a unified-dimensional embedding space are obtained through feature projection alignment. The expression is:
[0010] In the formula, The visible light apparent features are projected onto a unified-dimensional embedding space and then represent the corresponding features. It is a learnable projection matrix of the visible light appearance features; Visible light appearance characteristics; The corresponding features after infrared thermal features are projected onto a unified-dimensional embedding space; A learnable projection matrix of infrared thermal features; Infrared thermal characteristics; The corresponding features of the task prompt template text after being projected into a unified-dimensional embedding space; Learnable projection matrix for the text of the task prompt template; The text for the task prompt template; The corresponding features after the on-site sensing and process data are projected onto a unified dimensional embedded space; A learnable projection matrix for field sensing and process data; For on-site sensing and process data; S32. Based on the corresponding features projected into the unified dimensional embedding space, through bidirectional cross-modal attention, we obtain the cross-modal enhancement features from visible light apparent feature aggregation information to infrared thermal features and the cross-modal enhancement features from infrared thermal feature aggregation information to visible light apparent features, expressed as follows:
[0011]
[0012] In the formula, This is a cross-modal enhancement feature that aggregates information from infrared thermal features to visible light apparent features; This is a cross-modal enhancement feature that aggregates information from visible light apparent features to infrared thermal features; For learnable query transformation matrix; The key transformation matrix is a learnable matrix. The transform matrix is a learnable value; S33. Based on the cross-modal enhancement features from visible light apparent feature aggregation information to infrared thermal features and the cross-modal enhancement features from infrared thermal feature aggregation information to visible light apparent features, through residual connection and layer normalization operations, the visible light enhancement features fused with infrared thermal features and the infrared thermal enhancement features fused with visible light apparent features are obtained, and their expressions are as follows:
[0013] In the formula, To enhance visible light features by integrating infrared thermal characteristics; Infrared thermal enhancement features are used to integrate visible light apparent features; For layer normalization; S34. Based on the visible light enhancement features obtained by fusing infrared thermal features and the infrared thermal enhancement features obtained by fusing visible light apparent features, the gated weighted visual fusion features are obtained through gated weighted fusion, and the expression is:
[0014]
[0015] In the formula, The gating coefficient; For the Sigmoid function; It is a learnable gated weight matrix; For feature splicing; The visual fusion features are obtained after gating and weighting. For element-wise multiplication; S35. Based on the gated weighted visual fusion features, the corresponding features of the task prompt template text projected into the unified dimension embedding space, and the corresponding features of the on-site sensing and process data projected into the unified dimension embedding space, a multimodal state representation is obtained through fusion operation, the expression of which is:
[0016] In the formula, For multimodal state representation; It is a fusion encoder composed of stacked self-attention layers and feedforward layers; The visual fusion features are weighted by gating.
[0017] Furthermore, the training process of the pre-trained multimodal large model is supervised fine-tuning training, and the specific steps are as follows: S41. Based on the multimodal input data, the security experts annotate the multimodal input data to obtain the original annotated sample set; S42. Based on the original labeled sample set, construct a domain sample set using a preset structured template; S43. Using a general multimodal large model as the initial model, freeze or partially freeze the visual encoder weights through a differentiated freezing strategy to obtain a frozen initial model. S44. Supervised training is performed on the frozen initial model using the domain sample set, and the parameters of the frozen initial model are updated using the low-rank adaptation method, finally obtaining the pre-trained multimodal large model.
[0018] Furthermore, in the process of obtaining the optimized disposal strategy through the GRPO algorithm, a candidate disposal scheme group is obtained by random sampling based on the disposal strategy. Based on each candidate disposal scheme in the candidate disposal scheme group, the comprehensive reward and relative advantage within the group of each candidate disposal scheme are calculated and obtained. Based on the relative advantage within the group, the disposal strategy is updated through the strategy update objective function to obtain the optimized disposal strategy. The expression for the comprehensive reward is:
[0019] In the formula, For the first The combined reward for each candidate solution; Rewards are given for accurate identification. To address the issue of reasonable reward items; In response to timeliness rewards; For disposal costs and considerations; For safety and compliance penalties; , , , and These are the weighting coefficients for each item; Index to candidate solutions; The expression for the relative advantage within the group is:
[0020] In the formula, For the first The relative advantage of each candidate solution within the group; The relative advantage within the group for the first candidate solution; The relative advantage within the group for the Gth candidate solution; This represents the average reward within the group. The standard deviation of the group's rewards; To prevent division by zero of small constants; The number of candidate solutions; The expression for the update objective function is:
[0021] In the formula, To update the objective function; To reflect the change in the probability of generating the same solution before and after the strategy update; The KL divergence between the current strategy and the reference strategy; The weighting coefficients for the KL divergence; To calculate the expectation of the sampled group; This is the current strategy; For reference strategy; Among them, the The expression is:
[0022] In the formula, For the first One candidate solution; This is a potential hazard situation; This is the old strategy used for random sampling.
[0023] A system for identifying and handling potential hazards during unmanned aerial vehicle (UAV) inspections in oil production areas includes: a data acquisition module, a dual-branch extraction module, a cross-modal attention module, a multimodal large model module, an optimization strategy module, and an early warning module; The data acquisition module is used to acquire multimodal input data of the target inspection points through the acquisition device; and to preprocess the multimodal input data to obtain preprocessed multimodal input data. The dual-branch extraction module is used to obtain visible light apparent features and infrared thermal features based on the preprocessed multimodal input data through visible light feature extraction branch and infrared feature extraction branch, respectively. The cross-modal attention module is used to obtain a multimodal state representation based on visible light appearance features and infrared thermal features, combined with preset task prompt text and on-site sensing and process data. The multimodal large model module is used to obtain structured recognition results based on multimodal state representations and preset structured templates through a pre-trained multimodal large model. The optimization strategy module is used to generate a treatment strategy based on the structured recognition results; and to obtain an optimized treatment strategy through the GRPO algorithm. The early warning module is used to obtain the early warning level based on the structured recognition results and on-site sensing and process data; and to send early warning instructions and work orders to the corresponding objects according to the early warning level and the optimized handling strategy, so as to repair the equipment at the target inspection point.
[0024] Beneficial effects: This invention simultaneously acquires visible light images, infrared thermal imaging images, and on-site sensing and process data, and extracts visible light appearance features (such as appearance deformation, corrosion, and leakage traces) and infrared thermal features (such as temperature anomalies and uneven heat distribution) to compensate for the insufficient sensing ability of a single mode in complex environments. Combined with on-site sensing data (such as pressure, flow rate, vibration, etc.), it can comprehensively determine the equipment operating status from three dimensions: "visual appearance - temperature field - process status", significantly reducing the missed detection rate and false alarm rate. It is especially suitable for inspection in oil production areas under harsh conditions such as changes in lighting, obstruction, and high temperature. By employing a cross-modal attention module, visible light appearance features, infrared thermal features, task prompt text, and on-site process data are dynamically and interactively weighted, rather than simply concatenated or added together. This mechanism can adaptively focus on the modal information most relevant to the current hazard identification task (e.g., focusing on visible light texture for leakage hazards and infrared hotspots for overload hazards), generating richer and more task-oriented multimodal state representations, effectively improving the ability of subsequent large models to understand complex hazard scenarios. By using a pre-set structured template to guide the large model to generate standardized outputs that include hazard type, risk level, impact range, warning name, and handling suggestions, the problem of redundant answers and inconsistent formats in general large models is overcome. The structured recognition results not only facilitate automatic system parsing and subsequent processing, but also provide clear and professional decision-making basis for operation and maintenance personnel. At the same time, it supports seamless integration with existing industrial information systems (such as ERP and MES), greatly reducing the cost of manual interpretation. By introducing the GRPO algorithm for strategy optimization, the optimal strategy ranking can be learned efficiently with limited simulation or historical case data, avoiding the dependence of traditional reinforcement learning (such as PPO) on large-scale environmental interactions. The optimized strategy can dynamically adjust the handling steps according to the actual working conditions (such as prioritizing the isolation of high-risk areas, adjusting the inspection route or shutdown sequence), which is more flexible and safer than fixed rule strategies, and is especially suitable for sudden and diverse hidden danger scenarios in oil production areas. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a flowchart illustrating the hazard identification and handling method of the present invention; Figure 2 This is a schematic diagram of the hazard identification and handling system of the present invention; Figure 3 This is a flowchart illustrating the closed-loop optimization process for hazard linkage and response decisions based on supervised fine-tuning and GRPO reinforcement learning in an embodiment of the present invention. Figure 4 This is a diagram illustrating the on-site inspection image hazard identification and structured output of Example 1 in this embodiment of the invention; Figure 5 This is a diagram illustrating the on-site inspection image hazard identification and structured output of Example 2 in this embodiment of the invention. Figure 6 This is a diagram illustrating the on-site inspection image hazard identification and structured output of Example 3 in this embodiment of the invention; Figure 7 This is a diagram illustrating the on-site inspection image hazard identification and structured output of Example 4 in this embodiment of the invention; Figure 8 This is a diagram illustrating the labeling of potential hazard areas and the display of risk levels for positive and negative samples in an embodiment of the present invention; Figure 9This is an example diagram showing the output of original on-site inspection images and structured recognition, early warning, and coordinated response in an embodiment of the present invention. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] This embodiment provides a method for identifying and handling potential hazards during unmanned aerial vehicle (UAV) inspections in oil production areas, such as... Figure 1 As shown, it includes: S1. Collect multimodal input data of the target inspection points through the acquisition device; preprocess the multimodal input data to obtain preprocessed multimodal input data; The preprocessed multimodal input data includes spatially aligned visible light images, spatially aligned infrared thermal imaging images, and on-site sensing and process data in the form of structured feature vectors. In this embodiment, the multimodal input data includes visible light images, infrared thermal imaging images, and on-site sensing and process data; At the target inspection points (well sites or stations), drones, fixed video surveillance, mobile inspection terminals, or data acquisition devices equipped with infrared thermal imaging equipment are set up to collect visible light images and infrared thermal images of the same point according to the preset inspection route and time interval. During the data acquisition, the point number, equipment type, geographical location, ambient temperature and humidity, wind speed, combustible gas concentration, pipeline pressure, process operating parameters, recent maintenance records, and historical hazard records are recorded simultaneously to ensure that the subsequent identification results can be interpreted in combination with the on-site conditions.
[0029] Specifically, the on-site sensing and process data includes location number, equipment type, geographical location, ambient temperature and humidity, wind speed, combustible gas concentration, pipeline pressure, process operating parameters, recent maintenance and repair records, and historical hazard records.
[0030] Preferably, the specific steps of the preprocessing are as follows: S11. Based on the visible light image, the visible light image is processed sequentially through white balance correction, brightness normalization, deblurring, distortion correction, cropping, and scale transformation to obtain the processed visible light image. In this embodiment, the acquired visible light images are processed sequentially as follows: To address image quality degradation caused by complex lighting conditions such as backlighting and dust, white balance correction and brightness normalization are performed to map pixel values to a uniform brightness range. Perform deblurring on motion blur caused by drone flight jitter, and perform distortion correction on lens distortion; Cropping or masking areas in images containing sensitive information such as shooting time and coordinate watermarks is used to protect the security of on-site data. The processed image is cropped to the target inspection area and scaled to the input size agreed upon by the subsequent encoder.
[0031] S12. Based on the infrared thermal imaging image, the processed infrared thermal imaging image is obtained by sequentially performing temperature range normalization processing, bad pixel and noise filtering processing, and pseudo-color mapping processing. In this embodiment, the acquired infrared thermal imaging images are processed sequentially as follows: Record the dynamic temperature range of the current inspection scene, and linearly normalize the temperature value of each pixel to... The interval is used to obtain a normalized heat map to eliminate the overall temperature drift caused by seasonal, diurnal and weather changes; For bad pixels that are outside the effective temperature range, the neighborhood mean is used to replace them, and median filtering is performed on the heatmap to suppress random noise; The difference between the temperature of each pixel and its neighborhood background and the local temperature gradient are calculated on the normalized thermal map to generate a thermal anomaly saliency map. The normalized thermal map is converted into a three-channel image through pseudo-color mapping. The thermal anomaly saliency map is then used as an additional channel and stitched with it in the channel dimension to obtain the processed infrared thermal imaging image.
[0032] S13. Based on the processed visible light image and the processed infrared thermal imaging image, spatially aligned visible light image and infrared thermal imaging image are obtained through a spatial alignment method. In this embodiment, the spatial alignment method is a matching method based on timestamps, positioning information, gimbal angles, or feature points; S14. Convert the field sensing and process data into structured feature vector form, and combine it with spatially aligned visible light images and infrared thermal imaging images to form preprocessed multimodal input data.
[0033] Specifically, the field sensing and process data in the form of structured feature vectors are directly transmitted to the cross-modal attention module as independent numerical modal inputs, without going through the visible light feature extraction branch or the infrared feature extraction branch. In the cross-modal attention module, the field sensing and process data in the form of structured feature vectors are mapped to a unified embedding space through an independent projection layer, and then fused together with the visible light apparent features and infrared thermal features to form a multimodal state representation.
[0034] S2. Based on the spatially aligned visible light image, obtain the visible light apparent features through the visible light feature extraction branch; based on the spatially aligned infrared thermal image, obtain the infrared thermal features through the infrared feature extraction branch. Preferably, the visible light feature extraction branch is used to complete the following feature extraction process, as follows: S211. Based on the spatially aligned visible light image, a standardized visible light image is obtained through scaling and normalization operations. S212. Based on the standardized visible light image, divide it into several image blocks by a preset size; perform linear projection mapping on each image block to obtain the visual word vector of each image block; superimpose position encoding on the visual word vector of each image block to obtain the visual word sequence. Specifically, the image blocks are fixed-size, non-overlapping image blocks; The position encoding is either learnable position encoding or fixed sine / cosine position encoding. By superimposing the position encoding vector with the corresponding visual word vector element by element, the encoder can perceive the spatial positional relationship between each image block, thereby obtaining the visual word sequence. S213. Based on the visual word sequence, the visible light appearance features are obtained through multiple stacked Transformer encoding layers.
[0035] In this embodiment, the visible light branch is used to extract appearance features such as color, texture, shape, rust spots, oil stains, equipment appearance, and markings; the feature extraction process includes the following steps: Image standardization: The preprocessed visible light image is scaled to the input size agreed upon by the encoder, and the pixel values are normalized according to the mean and variance of the encoder during pre-training to ensure that the input distribution is consistent with the pre-training conditions. Image segmentation and linear embedding: The standardized image is divided into fixed-size, non-overlapping image blocks. Each image block is mapped to a visual word vector through linear projection, and the superposition position of each word is encoded, so that the encoder can perceive the spatial positional relationship between image blocks. Multi-layer self-attention coding: Visual word sequences are fed into a multi-layer stacked Transformer coding layer. Each layer establishes a relationship between any two image blocks through a self-attention mechanism, allowing local details (such as the position of the pressure gauge pointer on a fire extinguisher, the texture of rust spots on a metal surface, and oil stains at flange connections) to interact with the global context (such as the overall layout of equipment and the placement of materials). Shallow coding layers mainly capture low-level appearance information such as edges, colors, and textures, while deep coding layers gradually form high-level semantic information such as equipment components and material categories. Multi-scale feature output: Features are extracted from different depths of the encoder to obtain a visible light feature sequence that combines fine-grained localization capability and high-level semantic discrimination capability, which is used as the output of this branch; the feature sequence retains the spatial structure that corresponds one-to-one with the image patch position, and can be used for subsequent hazard area localization and range description.
[0036] The encoder weights of the visible light branch are initialized by a pre-trained model with large-scale image-text pairs and adapted and trained on samples in the inspection domain to enhance its ability to represent targets specific to oil production areas (pumping units, wellhead equipment, fire-fighting equipment, instrument panels, etc.).
[0037] Preferably, the infrared feature extraction branch is used to complete the following feature extraction process, as follows: S221. Based on the spatially aligned infrared thermal imaging image, a normalized infrared thermal imaging image is obtained through linear normalization. S222. Based on the normalized infrared thermal imaging image, calculate the difference between the temperature of each pixel in the image and the background temperature of its neighborhood, and the local temperature gradient to generate a thermal anomaly saliency map; stitch the thermal anomaly saliency map with the normalized infrared thermal imaging image to obtain a multi-channel input image. S223. Based on the multi-channel input image, divide it into several image blocks of the input image by a preset size; perform linear projection mapping on the image block of each input image to obtain the visual word vector of the image block of each input image; superimpose position encoding on the visual word vector of the image block of each input image to obtain the visual word sequence of the input image. Specifically, the position encoding is a learnable position encoding or a fixed sine / cosine position encoding. By superimposing the position encoding vector with the visual word vector of the corresponding image block of the input image element by element, the encoder can perceive the spatial positional relationship between each image block, thereby obtaining the visual word sequence of the input image. S224. Based on the visual word sequence of the input image, infrared thermal features are obtained through multiple stacked Transformer coding layers.
[0038] In this embodiment, the infrared branch is used to extract thermal features such as temperature distribution, high-temperature hotspots, and temperature anomalies caused by gas leaks in the equipment and pipelines; the feature extraction process includes the following steps: Temperature normalization and channel adaptation: Each pixel value of the infrared thermal image corresponds to a temperature measurement value. First, it is linearly normalized to a uniform value range according to the current scene's temperature dynamic range to eliminate the overall temperature drift caused by season, day and night and weather. Since the infrared thermal image is single-channel data, it is copied and expanded to the number of input channels agreed upon by the encoder, or converted into a three-channel image through pseudo-color mapping before input. Enhanced thermal anomaly saliency: Before encoding, the difference between the temperature of each pixel and its neighboring background, as well as the local temperature gradient, are calculated to generate a thermal anomaly saliency map. This map is then used as an additional channel to stitch together with the normalized thermal map, making it easier for the encoder to focus on areas of sudden temperature changes (such as the evaporative cooling low-temperature zone of a leak, the hot spot of electrical equipment, and the interruption of temperature distribution caused by pipeline blockage). Block embedding and self-attention coding: Similar to visible light branching, the heat map is divided into image blocks and linearly embedded into word sequences. After superimposing positional encoding, the blocks are fed into a multi-layer Transformer coding layer. During the coding process, the self-attention mechanism establishes the correlation of temperature distribution across the entire heat map, thereby distinguishing between temperature gradients under normal operating conditions (such as regular temperature decay around the heating furnace) and abnormal temperature patterns (such as isolated hot spots and abnormally low temperature zones). Thermal feature output: The thermal feature sequence output by the encoder is extracted as the output of this branch. This sequence also retains the spatial correspondence and can characterize the temperature level, temperature gradient and thermal anomaly confidence information of each image block.
[0039] The encoder of the infrared branch is adapted and trained using inspection heat map samples with temperature labels on the basis of general pre-trained weights, so that it can master the typical heat distribution patterns of oil production equipment under normal and abnormal operating conditions.
[0040] S3. Based on visible light apparent features and infrared thermal features, combined with preset task prompt text and on-site sensing and process data in the form of structured feature vectors, a multimodal state representation is obtained through a cross-modal attention module. In this embodiment, since the encoder structures and pre-training sources of the two branches are different, the dimensions and distribution of their output features are inconsistent. Independent projection layers are set for the two features to map them to a unified embedding space of the same dimension and establish a pixel-level correspondence so that visible light words and infrared words at the same spatial location are aligned in the sequence. The aligned features then enter the cross-modal attention module for fusion. During the fusion process, features of one modality are used as queries and features of the other modality are used as keys and values. Attention calculation is performed bidirectionally so that apparent anomalies and thermal anomalies can corroborate and complement each other at the feature level to form the multimodal state representation used for subsequent state understanding.
[0041] Preferably, the cross-modal attention module is used to obtain multimodal state representations, specifically as follows: S31. Based on the visible light apparent features and infrared thermal features, combined with the preset task prompt text and on-site sensing and process data in the form of structured feature vectors, the corresponding features projected onto a unified-dimensional embedding space are obtained through feature projection alignment. The expression is:
[0042] In the formula, The visible light apparent features are projected onto a unified-dimensional embedding space and then represent the corresponding features. It is a learnable projection matrix of the visible light appearance features; Visible light appearance characteristics; The corresponding features after infrared thermal features are projected onto a unified-dimensional embedding space; A learnable projection matrix of infrared thermal features; Infrared thermal characteristics; The corresponding features of the task prompt template text after being projected into a unified-dimensional embedding space; Learnable projection matrix for the text of the task prompt template; The text for the task prompt template; The corresponding features after the on-site sensing and process data are projected onto a unified dimensional embedded space; A learnable projection matrix for field sensing and process data; For on-site sensing and process data; S32. Based on the corresponding features projected into the unified dimensional embedding space, through bidirectional cross-modal attention, we obtain the cross-modal enhancement features from visible light apparent feature aggregation information to infrared thermal features and the cross-modal enhancement features from infrared thermal feature aggregation information to visible light apparent features, expressed as follows:
[0043]
[0044] In the formula, This is a cross-modal enhancement feature that aggregates information from infrared thermal features to visible light apparent features; This is a cross-modal enhancement feature that aggregates information from visible light apparent features to infrared thermal features; For learnable query transformation matrix; The key transformation matrix is a learnable matrix. The transform matrix is a learnable value; S33. Based on the cross-modal enhancement features from visible light apparent feature aggregation information to infrared thermal features and the cross-modal enhancement features from infrared thermal feature aggregation information to visible light apparent features, through residual connection and layer normalization operations, the visible light enhancement features fused with infrared thermal features and the infrared thermal enhancement features fused with visible light apparent features are obtained, and their expressions are as follows:
[0045] In the formula, To enhance visible light features by integrating infrared thermal characteristics; Infrared thermal enhancement features are used to integrate visible light apparent features; For layer normalization; S34. Based on the visible light enhancement features obtained by fusing infrared thermal features and the infrared thermal enhancement features obtained by fusing visible light apparent features, the gated weighted visual fusion features are obtained through gated weighted fusion, and the expression is:
[0046]
[0047] In the formula, The gating coefficient; For the Sigmoid function; It is a learnable gated weight matrix; For feature splicing; The visual fusion features are obtained after gating and weighting. For element-wise multiplication; S35. Based on the gated weighted visual fusion features, the corresponding features of the task prompt template text projected into the unified dimension embedding space, and the corresponding features of the on-site sensing and process data projected into the unified dimension embedding space, a multimodal state representation is obtained through fusion operation, the expression of which is:
[0048] In the formula, For multimodal state representation; It is a fusion encoder composed of stacked self-attention layers and feedforward layers; The visual fusion features are weighted by gating.
[0049] In this embodiment, the attention mechanism adaptively allocates weights among different modalities and outputs a fused multimodal state representation. For points that only provide single-modal data, the missing modality can be masked through a masking mechanism, so that the method can still run when infrared or sensor data is lacking. This multimodal state representation serves as a unified input for subsequent large-scale model hazard understanding.
[0050] S4. Based on the multimodal state representation and combined with the preset structured template, the structured recognition result is obtained through the pre-trained multimodal large model; The structured identification results include the type of hazard, risk level, scope of impact, warning name, and handling recommendations; Specifically, after obtaining the fused multimodal state representation, it is input into a supervised, fine-tuned multimodal large model. The model outputs structured results based on a preset prompt template, including at least: whether a hazard exists, the type of hazard, the risk level, the suspected impact range, key anomaly areas, the warning name, the warning description, the source of the handling suggestions, and the suggested handling measures; The types of hazards include valve corrosion, flange leakage, missing fire extinguishers, equipment overheating, and flammable gas leakage. The warning name consists of a "warning level" and a "color identifier," used to convert the model recognition results into a response level that is easy for safety managers to understand, execute, and trace. The warning level is not an isolated output, but is determined jointly based on the suspected impact range, identification confidence, media hazard, environmental suitability, and historical evolution trend. In actual deployment, it can also be configured according to equipment type, hazard type, location, and management requirements. For example, no warning can be set as Level 1 (green), hazards that require attention but can be dealt with later can be set as Level 2 (yellow), hazards that need to be dealt with as soon as possible can be set as Level 3 (orange), and hazards that need to be dealt with immediately or require emergency response can be set as Level 4 (red). The above classification is a system default configuration example and is not intended to limit the scope of protection. In actual deployment, safety managers can adjust it according to safety procedures. The "Level 3 Warning (orange)" and "Level 4 Warning (red)" in subsequent examples are expressed according to this naming rule. The influence range is a key parameter connecting the identification results and the warning level. It represents the proportion or spatial scale of the suspected hazard area in the target inspection area, specifically the pixel area proportion, the area of the union of detection boxes, or the converted actual ground area. It is used to measure the spatial diffusion degree of the hazard and serves as an important basis for determining the warning level. Specifically, the target area is first determined, which can be the effective inspection area of a single device, a single image, a section of pipeline, or a station grid. Then, the suspected hazard area is determined, which can be given by segmentation mask, detection box, polygonal outline, or infrared thermal anomaly area. The implementation process is as follows: When the model outputs a pixel-level segmentation mask, the ratio of the number of pixels in the suspected region to the number of pixels in the target region can be used for calculation. The expression is:
[0051] In the formula, This represents the percentage of areas with suspected potential hazards within the target inspection area. This represents the number of pixels contained in the suspected potential hazard area. The number of pixels contained in the target inspection area; When only detection boxes or polygons are output, duplicate areas can be deduplicated and merged first, and then the area of the affected region can be approximated by the area of the box or polygon. The expression is as follows:
[0052] In the formula, The area of the hazard's influence range is approximated by the union area of the merged detection boxes or polygons. For the deduplication and merging of the first A detection box or polygon; The total number of bounding boxes or polygons; Union operation for regions; To calculate the area; When drone or site imagery has geographic coordinates or ground sampling distance, the pixel area can be converted into the actual area to obtain the equipment-level or site-level hazard impact range, expressed as:
[0053] In the formula, This refers to the actual area of impact obtained through conversion; This represents the number of pixels in the suspected hazardous area. This is the ground sampling distance, which is the actual ground size corresponding to a single pixel in the image; The affected area can be used to determine the warning level and for comparison of re-inspections before and after treatment; in the display diagram, red or orange rectangles, dividing masks, or polygons are used to mark suspected hazard areas, and green borders indicate hazard areas that did not detect any requiring treatment, such as... Figure 8 As shown.
[0054] Preferably, the training process of the pre-trained multimodal large model is supervised fine-tuning training, and the specific steps are as follows: S41. Based on the multimodal input data, the security experts annotate the multimodal input data to obtain the original annotated sample set; Specifically, visible light images, infrared thermal images, and synchronously collected sensor data from the oil production area are collected. Safety experts then label each sample with the type of hazard, risk level, scope of impact, warning name, and handling recommendations to form an original labeled sample set. S42. Based on the original labeled sample set, construct a domain sample set using a preset structured template; Specifically, the original labeled sample set is uniformly organized into "hint-reference answer" pairs according to a preset structured template, which is the domain sample set; the hint part includes task instructions, multimodal input descriptions and output field constraints, and the reference answer part is the complete structured text annotated by experts; The domain sample set is a supervised fine-tuning dataset customized for the task of identifying hidden dangers in oil production areas. Each sample consists of three parts: the prompt part includes task instructions, multimodal input descriptions (including image paths and sensor data fields), and output field constraints (specifying that five fields must be output: hidden danger type, risk level, impact range, warning name, and handling suggestions); the reference answer part is a complete structured text annotated by safety experts; the metadata part records the sample source location, collection time, equipment type, and annotation expert number for subsequent sample quality traceability; the domain sample set is divided into training set, validation set, and test set in a 7:1:2 ratio. During training, samples are collected from the training set in batches, the validation set is used to monitor overfitting, and the test set is used for final performance evaluation. S43. Using a general multimodal large model as the initial model, freeze or partially freeze the visual encoder weights through a differentiated freezing strategy to obtain a frozen initial model. In this embodiment, the general multimodal large model has been pre-fine-tuned on samples in the field of hidden danger identification in oil production areas before being used as a basic model. This enables it to master the basic visual and semantic representation capabilities of targets specific to oil production areas (including pumping units, wellhead devices, fire-fighting equipment, instrument panels, pipeline valves, etc.), thereby avoiding the problem of insufficient domain adaptation when the general model is directly applied to professional industrial scenarios.
[0055] Specifically, the initial model is a general multimodal large model, which consists of a visual encoder, a language model backbone, and a cross-modal projection layer; Differentiated freezing strategies are adopted for each module: all weights of the visual encoder are frozen to retain the general visual representation capability, the original weights of the language model backbone are frozen, low-rank adaptation matrices (LoRA) are injected only into each attention layer of the frozen language model backbone, and the cross-modal projection layer is set to be fully trainable; after the parameter freezing strategy is determined, the set of trainable parameters is output. S44. Supervised training is performed on the frozen initial model using the domain sample set, and the parameters of the frozen initial model are updated using the low-rank adaptation method, finally obtaining the pre-trained multimodal large model.
[0056] Specifically, samples are collected in batches from the domain sample set. Each sample contains a visible light image, an infrared thermal imaging image, sensor data, and prompt text. The visible light image is encoded into a visual word sequence by a frozen visual encoder, and then mapped into a visual embedding through a cross-modal projection layer. The infrared thermal imaging image is used to extract thermal feature sequences through an infrared branch encoder, and then mapped into an infrared embedding through a projection layer. The prompt text is lexicalized by a language model and mapped into a text embedding. The sensor data is mapped into a sensor embedding through a structured projection layer. The visual embedding, infrared embedding, text embedding, and sensor embedding are concatenated along the sequence dimension to obtain a unified input sequence. The concatenated unified input sequence is fed into the backbone of the language model, and the answer sequence is predicted word by word in an autoregressive manner; the set of trainable parameters is updated by the low-rank adaptation method to obtain the updated parameter set; After each training cycle, the updated parameter set is loaded into the model to obtain the updated model; based on the domain sample set, a new sequence of predicted answers is obtained through the updated model; based on the sequence of predicted answers and the reference answer sequence in the domain sample set, field parsing is performed using a comprehensive validation metric; if the field parsing success rate is lower than the threshold, the freezing strategy is adjusted and retraining is performed; if the field parsing success rate meets the threshold, the model weights are solidified into a supervised fine-tuned multimodal large model. The comprehensive verification metrics include field completeness rate, field accuracy rate, and semantic similarity between the output text and the reference answer.
[0057] S5. Generate a handling strategy based on the structured recognition results; and obtain an optimized handling strategy through the GRPO algorithm; In this embodiment, after determining the hazard status, warning name, and scope of impact, the identification results need to be transformed into an actionable response strategy. To improve the professionalism and traceability of the response recommendations, a response recommendation agent can be integrated. This agent uses the identification results as a trigger condition, combined with online retrieval, a safety production knowledge base, equipment maintenance procedures, hazardous chemicals and fire protection regulations, and meteorological data, to generate candidate response strategies, source basis, safety constraints, and manual confirmation items. The implementation process is as follows: first, the identification results are transformed into search questions; then, relevant data is retrieved and sorted according to equipment compatibility, hazard compatibility, timeliness, and safety; subsequently, actionable recommendations are generated, and constraints and verifications are performed on prohibition and restriction measures, safety intervals, applicable scope, operating conditions, and local management requirements. Finally, the recommended response method, recommended execution window, re-inspection cycle, precautions, cited sources, confidence statements, and a list of issues requiring manual confirmation are output. The agent's output does not directly replace the final judgment of safety management personnel, but rather provides verifiable auxiliary decision-making for on-duty personnel and platform operators.
[0058] In a specific embodiment, the decision-making process is further modeled as a Markov decision process, and the GRPO is used to optimize the disposal strategy. The implementation process is as follows: the status consists of the hazard type, risk level, impact range, identification confidence level, environmental and process parameters, and historical disposal records; the action is the structured identification results and disposal plan generated by the model, including whether to alarm, whether to shut down, what kind of work order to issue, the suggested disposal method, and the re-inspection cycle, etc.; the reward is comprehensively constructed by the identification accuracy, disposal rationality, response timeliness, disposal cost, and safety compliance, giving positive rewards for timely, effective, safe and economical disposal, and punishing behaviors such as missed reporting, false reporting, excessive disposal, or violation of safety constraints.
[0059] Preferred, such as Figure 3 As shown, in the process of obtaining an optimized disposal strategy through the GRPO algorithm, a candidate disposal scheme group is obtained by random sampling based on the disposal strategy. Based on each candidate disposal scheme in the candidate disposal scheme group, the comprehensive reward and relative advantage within the group of each candidate disposal scheme are calculated and obtained. Based on the relative advantage within the group, the disposal strategy is updated through the strategy update objective function to obtain the optimized disposal strategy. Specifically, the GRPO algorithm uses the current hazard status as input to control the current handling strategy. For the same hazard status, it generates a candidate solution group containing G candidate handling solutions at once. Each candidate handling solution in the group is independently sampled by the current strategy under the same input conditions. The role of the GRPO algorithm in this stage is reflected in the fact that it uses "groups" as the basic sampling unit, rather than stepwise single sampling, to ensure that all candidate solutions in the same round come from the same strategy and face the same potential state, thus providing a consistent basis for subsequent intra-group comparisons. This is one of the core mechanisms that distinguishes the GRPO algorithm from traditional single-step reinforcement learning methods. Instead of performing gradient updates immediately after each sampling step, it accumulates a set of samples and then performs unified optimization. The expression for the comprehensive reward is:
[0060] In the formula, For the first The combined reward for each candidate solution; Rewards are given for accurate identification. To address the issue of reasonable reward items; In response to timeliness rewards; For disposal costs and considerations; For safety and compliance penalties; , , , and These are the weighting coefficients for each item; Index to candidate solutions; After obtaining the combined reward of all G candidate solutions within the candidate solution group, the GRPO algorithm does not rely on an additional value network. Instead, it directly normalizes the reward of each candidate solution using the mean and standard deviation of the group reward and calculates the relative advantage of each candidate solution within the group. The expression for the relative advantage within the group is:
[0061] In the formula, For the first The relative advantage of each candidate solution within the group; The relative advantage within the group for the first candidate solution; The relative advantage within the group for the Gth candidate solution; This represents the average reward within the group. The standard deviation of the group's rewards; To prevent division by zero of small constants; The number of candidate solutions; The GRPO algorithm's role in this stage is reflected in the following: by replacing the absolute reward value with the relative ranking within the group as the optimization signal, the model can update the policy solely based on the relative goodness or badness relationship between candidate solutions in the same group without introducing an additional Critic network, which significantly reduces the value estimation bias and reduces the computational resources required for training. The GRPO algorithm updates the parameters of the current disposal strategy by gradient through the policy update objective function based on the relative advantages of each candidate disposal strategy within the candidate scheme group. The expression for the update objective function is:
[0062] In the formula, To update the objective function; To reflect the change in the probability of generating the same solution before and after the strategy update; The KL divergence between the current strategy and the reference strategy; The weighting coefficients for the KL divergence; To calculate the expectation of the sampled group; This is the current strategy; For reference strategy; Among them, the The expression is:
[0063] In the formula, For the first One candidate solution; This is a potential hazard situation; This is the old strategy used for random sampling.
[0064] The GRPO algorithm's participation in this stage is reflected in two aspects: First, by constraining the range of importance sampling ratio through a pruning mechanism, we can prevent drastic changes in the strategy caused by a single gradient update and ensure stable iteration of the handling strategy. Secondly, by using the KL divergence penalty term to constrain the deviation between the current strategy and the reference strategy, the problem of strategy collapse or excessive deviation from safety handling specifications during the optimization process is avoided, ensuring that the optimized handling strategy operates within the safety compliance constraints of the oil production area.
[0065] S6. Based on the structured identification results and on-site sensing and process data, obtain the early warning level; based on the early warning level and optimized handling strategy, send early warning instructions and work orders to the corresponding objects to repair the equipment at the target inspection points.
[0066] In this embodiment, after generating an optimized handling strategy, instructions and work orders are issued to the corresponding objects according to the warning level and the optimized handling strategy. The implementation process is as follows: For low-level hazards, a warning is pushed to the mobile terminal and a pending task is recorded; for medium- and high-level hazards, a maintenance work order is generated and a responsible team is assigned. If necessary, on-site equipment such as audible and visual alarms, emergency shutdowns, ventilation, or sprinklers are activated. At the same time, a manual confirmation step is set for major operations involving shutdowns and pressure reductions. After the handling is completed, images and data of the same location are re-collected within the set re-inspection cycle. Hazard identification is performed again using the aforementioned method. The impact range and status changes before and after handling are compared to determine whether the hazard has been eliminated. The re-inspection images, handling effects, handling costs, and safety compliance are converted into reward signals and fed back to the model for subsequent GRPO strategy optimization, thereby forming a closed loop from identification, warning, handling to re-inspection. Figure 4 , Figure 5 , Figure 6 and Figure 7 Examples of hazard identification and structured output from on-site inspection images at different locations are provided. Figure 9 Examples of outputs, including original on-site inspection images, structured recognition, early warning, and coordinated response suggestions, are provided.
[0067] The second embodiment provides a system for identifying and handling potential hazards during unmanned aerial vehicle (UAV) inspections in oil production areas, such as... Figure 2 As shown, it includes: a data acquisition module, a dual-branch extraction module, a cross-modal attention module, a multimodal large model module, an optimization strategy module, and an early warning module; The data acquisition module is used to acquire multimodal input data of the target inspection points through the acquisition device; and to preprocess the multimodal input data to obtain preprocessed multimodal input data. The dual-branch extraction module is used to obtain visible light apparent features and infrared thermal features based on the preprocessed multimodal input data through visible light feature extraction branch and infrared feature extraction branch, respectively. The cross-modal attention module is used to obtain a multimodal state representation based on visible light appearance features and infrared thermal features, combined with preset task prompt text and on-site sensing and process data. The multimodal large model module is used to obtain structured recognition results based on multimodal state representations and preset structured templates through a pre-trained multimodal large model. The optimization strategy module is used to generate a treatment strategy based on the structured recognition results; and to obtain an optimized treatment strategy through the GRPO algorithm. The early warning module is used to obtain the early warning level based on the structured recognition results and on-site sensing and process data; and to send early warning instructions and work orders to the corresponding objects according to the early warning level and the optimized handling strategy, so as to repair the equipment at the target inspection point.
[0068] The present invention has the following beneficial effects: This invention simultaneously acquires visible light images, infrared thermal images, and on-site sensing and process data, and extracts visible light appearance features (such as appearance deformation, corrosion, and leakage traces) and infrared thermal features (such as temperature anomalies and uneven heat distribution) to compensate for the insufficient sensing capability of a single mode in complex environments. Combined with on-site sensing data (such as pressure, flow rate, and vibration), it can comprehensively determine the equipment operating status from three dimensions: "visual appearance, temperature field, and process status," significantly reducing the missed detection rate and false alarm rate. It is especially suitable for inspection in oil production areas under harsh conditions such as changes in lighting, obstruction, and high temperatures. By employing a cross-modal attention module, visible light appearance features, infrared thermal features, task prompt text, and on-site process data are dynamically and interactively weighted, rather than simply concatenated or added together. This mechanism can adaptively focus on the modal information most relevant to the current hazard identification task (e.g., focusing on visible light texture for leakage hazards and infrared hotspots for overload hazards), generating richer and more task-oriented multimodal state representations, effectively improving the ability of subsequent large models to understand complex hazard scenarios. By using a pre-set structured template to guide the large model to generate standardized outputs that include hazard type, risk level, impact range, warning name, and handling suggestions, the problem of redundant answers and inconsistent formats in general large models is overcome. The structured recognition results not only facilitate automatic system parsing and subsequent processing, but also provide clear and professional decision-making basis for operation and maintenance personnel. At the same time, it supports seamless integration with existing industrial information systems (such as ERP and MES), greatly reducing the cost of manual interpretation. By introducing the GRPO algorithm for strategy optimization, the optimal strategy ranking can be learned efficiently with limited simulation or historical case data, avoiding the dependence of traditional reinforcement learning (such as PPO) on large-scale environmental interactions. The optimized strategy can dynamically adjust the handling steps according to the actual working conditions (such as prioritizing the isolation of high-risk areas, adjusting the inspection route or shutdown sequence), which is more flexible and safer than fixed rule strategies, and is especially suitable for sudden and diverse hidden danger scenarios in oil production areas.
[0069] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for identifying and handling potential hazards during unmanned aerial vehicle (UAV) inspections in oil production areas, characterized in that: include: S1. Collect multimodal input data of the target inspection points through the data acquisition device; The multimodal input data is preprocessed to obtain preprocessed multimodal input data; The preprocessed multimodal input data includes spatially aligned visible light images, spatially aligned infrared thermal imaging images, and on-site sensing and process data in the form of structured feature vectors. S2. Based on the spatially aligned visible light image, obtain the visible light apparent features through the visible light feature extraction branch; based on the spatially aligned infrared thermal image, obtain the infrared thermal features through the infrared feature extraction branch. S3. Based on visible light apparent features and infrared thermal features, combined with preset task prompt text and on-site sensing and process data in the form of structured feature vectors, a multimodal state representation is obtained through a cross-modal attention module. S4. Based on the multimodal state representation and combined with the preset structured template, the structured recognition result is obtained through the pre-trained multimodal large model; The structured identification results include the type of hazard, risk level, scope of impact, warning name, and handling recommendations; S5. Generate a handling strategy based on the structured recognition results; And through the GRPO algorithm, an optimized treatment strategy is obtained; S6. Based on the structured identification results and on-site sensing and process data, obtain the early warning level; Based on the warning level and optimized handling strategy, warning instructions and work orders are sent to the corresponding targets to repair the equipment at the target inspection points.
2. The method for identifying and handling potential hazards during unmanned aerial vehicle (UAV) inspections in oil production areas according to claim 1, characterized in that, The specific steps of the preprocessing are as follows: S11. Based on the visible light image, the visible light image is processed sequentially through white balance correction, brightness normalization, deblurring, distortion correction, cropping, and scale transformation to obtain the processed visible light image. S12. Based on the infrared thermal imaging image, the processed infrared thermal imaging image is obtained by sequentially performing temperature range normalization processing, bad pixel and noise filtering processing, and pseudo-color mapping processing. S13. Based on the processed visible light image and the processed infrared thermal imaging image, spatially aligned visible light image and infrared thermal imaging image are obtained through a spatial alignment method. S14. Convert the field sensing and process data into structured feature vector form, and combine it with spatially aligned visible light images and infrared thermal imaging images to form preprocessed multimodal input data.
3. The method for identifying and handling potential hazards during unmanned aerial vehicle (UAV) inspections in oil production areas according to claim 2, characterized in that, The visible light feature extraction branch is used to complete the following feature extraction process, as follows: S211. Based on the spatially aligned visible light image, a standardized visible light image is obtained through scaling and normalization operations. S212. Based on the standardized visible light image, divide it into several image blocks by a preset size; perform linear projection mapping on each image block to obtain the visual word vector of each image block; superimpose position encoding on the visual word vector of each image block to obtain the visual word sequence. S213. Based on the visual word sequence, the visible light appearance features are obtained through multiple stacked Transformer encoding layers.
4. A method for identifying and handling potential hazards during unmanned aerial vehicle (UAV) inspections in oil production areas according to claim 2, characterized in that, The infrared feature extraction branch is used to complete the following feature extraction process, as follows: S221. Based on the spatially aligned infrared thermal imaging image, a normalized infrared thermal imaging image is obtained through linear normalization. S222. Based on the normalized infrared thermal imaging image, calculate the difference between the temperature of each pixel in the image and the background temperature of its neighborhood, and the local temperature gradient to generate a thermal anomaly saliency map; stitch the thermal anomaly saliency map with the normalized infrared thermal imaging image to obtain a multi-channel input image. S223. Based on the multi-channel input image, divide it into several image blocks of the input image by a preset size; perform linear projection mapping on the image block of each input image to obtain the visual word vector of the image block of each input image; superimpose position encoding on the visual word vector of the image block of each input image to obtain the visual word sequence of the input image. S224. Based on the visual word sequence of the input image, infrared thermal features are obtained through multiple stacked Transformer coding layers.
5. A method for identifying and handling potential hazards during unmanned aerial vehicle (UAV) inspections in oil production areas according to claim 4, characterized in that, The cross-modal attention module is used to obtain multimodal state representations, as follows: S31. Based on the visible light apparent features and infrared thermal features, combined with the preset task prompt text and on-site sensing and process data in the form of structured feature vectors, the corresponding features projected onto a unified-dimensional embedding space are obtained through feature projection alignment. The expression is: In the formula, The visible light apparent features are projected onto a unified-dimensional embedding space and then represent the corresponding features. It is a learnable projection matrix of the visible light appearance features; Visible light appearance characteristics; The corresponding features after infrared thermal features are projected onto a unified-dimensional embedding space; A learnable projection matrix of infrared thermal features; Infrared thermal characteristics; The corresponding features of the task prompt template text after being projected into a unified dimensional embedding space; Learnable projection matrix for the text of the task prompt template; The text for the task prompt template; The corresponding features after the on-site sensing and process data are projected onto a unified dimensional embedded space; A learnable projection matrix for field sensing and process data; For on-site sensing and process data; S32. Based on the corresponding features projected into the unified dimensional embedding space, through bidirectional cross-modal attention, we obtain the cross-modal enhancement features from visible light apparent feature aggregation information to infrared thermal features and the cross-modal enhancement features from infrared thermal feature aggregation information to visible light apparent features, expressed as follows: In the formula, This is a cross-modal enhancement feature that aggregates information from infrared thermal features to visible light apparent features; This is a cross-modal enhancement feature that aggregates information from visible light apparent features to infrared thermal features; For learnable query transformation matrix; The key transformation matrix is a learnable matrix. The transform matrix is a learnable value. S33. Based on the cross-modal enhancement features from visible light apparent feature aggregation information to infrared thermal features and the cross-modal enhancement features from infrared thermal feature aggregation information to visible light apparent features, through residual connection and layer normalization operations, the visible light enhancement features fused with infrared thermal features and the infrared thermal enhancement features fused with visible light apparent features are obtained, and their expressions are as follows: In the formula, To enhance visible light features by incorporating infrared thermal characteristics; Infrared thermal enhancement features are used to integrate visible light apparent features; For layer normalization; S34. Based on the visible light enhancement features obtained by fusing infrared thermal features and the infrared thermal enhancement features obtained by fusing visible light apparent features, the gated weighted visual fusion features are obtained through gated weighted fusion, and the expression is: In the formula, The gating factor; For the Sigmoid function; It is a learnable gated weight matrix; For feature splicing; Visual fusion features after gating weighting; For element-wise multiplication; S35. Based on the gated weighted visual fusion features, the corresponding features of the task prompt template text projected into the unified dimension embedding space, and the corresponding features of the on-site sensing and process data projected into the unified dimension embedding space, a multimodal state representation is obtained through fusion operation, the expression of which is: In the formula, For multimodal state representation; It is a fusion encoder composed of stacked self-attention layers and feedforward layers; The visual fusion features are weighted by gating.
6. A method for identifying and handling potential hazards during unmanned aerial vehicle (UAV) inspections in oil production areas according to claim 1, characterized in that, The training process of the pre-trained multimodal large model is supervised fine-tuning training, and the specific steps are as follows: S41. Based on the multimodal input data, the security experts annotate the multimodal input data to obtain the original annotated sample set; S42. Based on the original labeled sample set, construct a domain sample set using a preset structured template; S43. Using a general multimodal large model as the initial model, freeze or partially freeze the visual encoder weights through a differentiated freezing strategy to obtain the frozen initial model. S44. Supervised training is performed on the frozen initial model using the domain sample set, and the parameters of the frozen initial model are updated using the low-rank adaptation method, finally obtaining the pre-trained multimodal large model.
7. A method for identifying and handling potential hazards during unmanned aerial vehicle (UAV) inspections in oil production areas according to claim 1, characterized in that, In the process of obtaining an optimized disposal strategy through the GRPO algorithm, a group of candidate disposal schemes is obtained by random sampling based on the disposal strategy. Based on each candidate disposal scheme in the candidate disposal scheme group, the comprehensive reward and relative advantage within the group of each candidate disposal scheme are calculated and obtained. Based on the relative advantages within the group, the disposal strategy is updated through the strategy update objective function to obtain an optimized disposal strategy; The expression for the comprehensive reward is: In the formula, For the first The combined reward for each candidate solution; Rewards are given for accurate identification. To address the issue of reasonable reward items; In response to timeliness rewards; For disposal costs and considerations; For safety and compliance penalties; , , , and These are the weighting coefficients for each item; Index to candidate solutions; The expression for the relative advantage within the group is: In the formula, For the first The relative advantage of each candidate solution within the group; The relative advantage within the group for the first candidate solution; The relative advantage within the group for the Gth candidate solution; This represents the average reward within the group. The standard deviation of the group's rewards; To prevent division by zero of small constants; The number of candidate solutions; The expression for the update objective function is: In the formula, To update the objective function; To reflect the change in the probability of generating the same solution before and after the strategy update; The KL divergence between the current strategy and the reference strategy; The weighting coefficients for the KL divergence; To calculate the expectation of the sampled group; This is the current strategy; For reference strategy; Among them, the The expression is: In the formula, For the first One candidate solution; This is a potential hazard situation; This is the old strategy used for random sampling.
8. A system based on the method for identifying and handling potential hazards during unmanned aerial vehicle (UAV) inspections in oil production areas as described in claims 1 to 7, comprising: The module includes a data acquisition module, a dual-branch extraction module, a cross-modal attention module, a multimodal large model module, an optimization strategy module, and an early warning module. The data acquisition module is used to acquire multimodal input data of the target inspection points through the acquisition device; and to preprocess the multimodal input data to obtain preprocessed multimodal input data. The dual-branch extraction module is used to obtain visible light apparent features and infrared thermal features based on the preprocessed multimodal input data through visible light feature extraction branch and infrared feature extraction branch, respectively. The cross-modal attention module is used to obtain a multimodal state representation based on visible light appearance features and infrared thermal features, combined with preset task prompt text and on-site sensing and process data. The multimodal large model module is used to obtain structured recognition results based on multimodal state representations and preset structured templates through a pre-trained multimodal large model. The optimization strategy module is used to generate a handling strategy based on the structured recognition results; And through the GRPO algorithm, an optimized treatment strategy is obtained; The early warning module is used to obtain the early warning level based on the structured recognition results and on-site sensing and process data; Based on the warning level and optimized handling strategy, warning instructions and work orders are sent to the corresponding targets to repair the equipment at the target inspection points.
