Petroleum and natural gas pipeline safety monitoring system based on AI visual learning and implementation method
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-02
- Publication Date
- 2026-08-11
AI Technical Summary
[0004]本发明的目的在于提供一种AI视觉学习的石油天然气管道安全监测系统及实施方法,旨在解决现有技术中的当管道所处环境发生季节性光照变化或设备老化导致的图像特征漂移时,固定模型的检测性能会显著下降,产生大量误报或漏报;现有系统缺乏一种能够利用海量无标注视频数据自学习管道正常动态模式,并能在线更新以适应环境变化的AI视觉学习监测方法的技术问题
[0015]本发明的一种AI视觉学习的石油天然气管道安全监测系统及实施方法,通过利用自监督学习框架,使用无标注的管道历史视频数据训练视频预测模型,使视频预测模型学习管道正常运行时的图像序列动态特征;将实时采集的管道视频流中的连续多帧图像输入训练好的视频预测模型,预测得到下一帧预测图像,并采集对应的真实下一帧图像;计算预测图像与真实图像之间的像素级差异,生成差异热力图,并根据差异热力图中差异值超过预设阈值的区域面积和最大差异值计算异常得分;当异常得分超过预设报警阈值时,判定为管道异常事件,触发报警并记录异常帧和异常发生时间;将异常帧回放并利用自监督学习对视频预测模型进行在线增量更新,使模型适应管道环境的缓慢变化;
Smart Images

Figure CN122551247A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pipeline monitoring technology, and in particular to an AI-based visual learning-based safety monitoring system and implementation method for oil and gas pipelines. Background Technology
[0002] Safety monitoring of oil and gas pipelines is a crucial link in ensuring the safety of energy transportation. Current technologies commonly use pipeline monitoring methods, including pressure monitoring based on fixed sensors, vibration monitoring based on fiber optic sensors, and visual inspection based on manual patrols. In recent years, with the development of computer vision technology, some solutions have begun to deploy surveillance cameras along pipelines, using object detection algorithms to identify external threats such as third-party construction and landslides, or using image segmentation algorithms to detect defects such as corrosion and cracks on the pipeline surface. These methods typically employ supervised learning frameworks, requiring a large number of labeled defect samples for model training. Simultaneously, some research has attempted to use video anomaly detection techniques to analyze the dynamic behavior of pipeline areas, such as detecting abnormal movements through optical flow or autoencoder reconstruction errors.
[0003] However, in the aforementioned existing technologies, when the pipeline environment experiences seasonal changes in lighting or image feature drift due to equipment aging, the detection performance of the fixed model will significantly decrease, resulting in a large number of false alarms or missed alarms. Existing systems lack an AI visual learning monitoring method that can learn normal dynamic patterns of pipelines using massive amounts of unlabeled video data and can be updated online to adapt to environmental changes. Therefore, there is an urgent need for a safety monitoring method for oil and gas pipelines based on self-supervised video prediction and online incremental learning in AI visual learning, so that the model can be trained with only normal video data and can continuously adapt to the dynamic changes in the pipeline environment through online updates. Summary of the Invention
[0004] The purpose of this invention is to provide an AI visual learning-based safety monitoring system and implementation method for oil and gas pipelines. This aims to address the technical problem that existing systems lack an AI visual learning monitoring method capable of learning normal dynamic patterns of pipelines using massive amounts of unlabeled video data and updating online to adapt to environmental changes. This method significantly reduces the detection performance of fixed models, resulting in numerous false alarms or missed alarms, when seasonal changes in the pipeline environment or image feature drift caused by equipment aging occur.
[0005] To achieve the above objectives, the present invention employs an AI visual learning-based method for safety monitoring of oil and gas pipelines, comprising the following steps: By utilizing a self-supervised learning framework, a video prediction model is trained using unlabeled historical video data of the pipeline, enabling the video prediction model to learn the dynamic features of image sequences when the pipeline is running normally. The system inputs multiple consecutive frames of images from the real-time captured pipeline video stream into the trained video prediction model to predict the next frame image and capture the corresponding real next frame image. Calculate the pixel-level differences between the predicted image and the real image, generate a difference heatmap, and calculate the anomaly score based on the area of the region where the difference value in the difference heatmap exceeds a preset threshold and the maximum difference value. When the abnormal score exceeds the preset alarm threshold, it is determined to be a pipeline abnormal event, triggering an alarm and recording the abnormal frame and the time of the abnormality. By replaying abnormal frames and using self-supervised learning to perform online incremental updates to the video prediction model, the model can be adapted to the slow changes in the pipeline environment.
[0006] In the step of using a self-supervised learning framework to train a video prediction model with unlabeled historical video data of the pipeline, enabling the video prediction model to learn the dynamic features of image sequences during normal pipeline operation: The video prediction model adopts the PredNet or SimVP architecture, with 8 consecutive frames of images as input and the next frame of predicted image as output. During training, the mean squared error loss function was used, the optimizer was Adam, the initial learning rate was 0.001, the training epochs were 50, no manual annotation was involved, and only historical video data under normal pipeline operation was used.
[0007] In the steps of inputting multiple consecutive frames of images from the real-time captured pipeline video stream into the trained video prediction model to predict the next frame image and then capturing the corresponding real next frame image: The real-time video stream frame rate is no less than 15 frames per second, and the time window length for consecutive multi-frame images is 8 frames. Each time a new image is received, the sliding window moves forward one frame to generate a new input sequence. The inference time of the video prediction model is no more than 50 milliseconds per frame, and it is deployed on edge computing devices or cloud servers.
[0008] In the steps of calculating the pixel-level difference between the predicted image and the real image, generating a difference heatmap, and calculating anomaly scores based on the area of regions in the difference heatmap where the difference value exceeds a preset threshold and the maximum difference value: Pixel-level differences are calculated using absolute difference or structural similarity index to obtain a difference matrix. After smoothing the difference matrix with Gaussian filtering, a difference heatmap is obtained. The preset threshold is set to 2.5 times the global mean of the differential heatmap or a fixed grayscale value of 30; The abnormal score is calculated as follows: the abnormal score equals the area of the region whose difference value exceeds the preset threshold multiplied by the average difference value of the region and then divided by the total area of the image. The abnormal score range is normalized to 0 to 1.
[0009] In the steps of calculating the pixel-level difference between the predicted image and the real image, generating a difference heatmap, and calculating anomaly scores based on the area of regions in the difference heatmap where the difference value exceeds a preset threshold and the maximum difference value: An alarm is triggered only when the abnormal score exceeds the alarm threshold for three consecutive frames, in order to avoid false alarms caused by noise in a single frame. The alarm threshold is initially set to 0.5 and is dynamically adjusted based on the average abnormal score of the past 100 frames when there are no abnormalities.
[0010] In the step of determining a pipeline anomaly event when the anomaly score exceeds a preset alarm threshold, triggering an alarm, and recording the anomaly frame and the time of anomaly occurrence: When an alarm is triggered, the system notifies supervisory personnel via audible and visual alarms, SMS push notifications, or platform pop-ups. Simultaneously, the image sequences of the 30 frames before and after the anomaly are compressed and saved to local storage or the cloud, and the time-series curve of the anomaly score is recorded.
[0011] Among them, the step of replaying abnormal frames and using self-supervised learning to perform online incremental updates to the video prediction model, so as to adapt the model to the slow changes in the pipeline environment: Online incremental updates employ an elastic weight consolidation algorithm to protect important parameters in the model and prevent catastrophic forgetting. The incremental update frequency is triggered once every 100 accumulated abnormal frames, or once a week at regular intervals. The updated model replaces the original model and continues to run.
[0012] Among them, the step of replaying abnormal frames and using self-supervised learning to perform online incremental updates to the video prediction model, so as to adapt the model to the slow changes in the pipeline environment: During online incremental updates, abnormal frames and their preceding and following normal frames are combined to form new training samples, which are then mixed with the original training dataset at a ratio of 1:10 for fine-tuning. The fine-tuning rounds are 5, and the learning rate is reduced to one-tenth of the initial learning rate.
[0013] Before the steps of inputting multiple consecutive frames of images from the real-time captured pipeline video stream into the trained video prediction model to predict the next frame image and then capturing the corresponding real next frame image: The acquired raw video frames are normalized to 256 by 256 pixels, and histogram equalization or adaptive gamma correction is used to enhance image contrast and eliminate the influence of illumination changes on prediction.
[0014] This invention also provides an AI-based visual learning-based safety monitoring system for oil and gas pipelines, comprising a self-supervised training module, a real-time prediction module, a difference analysis module, an alarm recording module, and an incremental update module; wherein: The self-supervised training module utilizes a self-supervised learning framework to train a video prediction model using unlabeled historical video data of the pipeline, enabling the video prediction model to learn the dynamic features of image sequences during normal pipeline operation. The real-time prediction module: inputs multiple consecutive frames of images from the real-time acquired pipeline video stream into the trained video prediction model, predicts the next frame image, and acquires the corresponding real next frame image. The difference analysis module calculates the pixel-level difference between the predicted image and the real image, generates a difference heatmap, and calculates anomaly scores based on the area of regions in the difference heatmap where the difference value exceeds a preset threshold and the maximum difference value. The alarm recording module: when the abnormal score exceeds the preset alarm threshold, it is determined to be a pipeline abnormal event, triggers an alarm, and records the abnormal frame and the time of abnormal occurrence; The incremental update module replays abnormal frames and uses self-supervised learning to perform online incremental updates to the video prediction model, enabling the model to adapt to the slow changes in the pipeline environment.
[0015] This invention discloses an AI-based visual learning-based safety monitoring system and implementation method for oil and gas pipelines. It utilizes a self-supervised learning framework to train a video prediction model using unlabeled historical pipeline video data, enabling the model to learn the dynamic features of image sequences during normal pipeline operation. Multiple consecutive frames of images from a real-time acquired pipeline video stream are input into the trained video prediction model to predict the next frame, while simultaneously acquiring the corresponding real next frame image. The pixel-level differences between the predicted and real images are calculated to generate a difference heatmap. An anomaly score is calculated based on the area of regions where the difference exceeds a preset threshold and the maximum difference value in the heatmap. When the anomaly score exceeds a preset alarm threshold, a pipeline anomaly event is identified, triggering an alarm and recording the anomaly frame and its occurrence time. The anomaly frame is replayed, and the video prediction model is incrementally updated online using self-supervised learning, allowing the model to adapt to the slow changes in the pipeline environment. Therefore, the prediction model can be trained using only unlabeled historical videos of normal pipelines through a self-supervised learning framework, completely eliminating the dependence on manual annotation of scarce defect samples. By generating difference heatmaps and calculating anomaly scores through real-time prediction and pixel-level difference analysis, it can sensitively capture early anomalies such as minor leaks and slow deformations, solving the problem that fixed thresholds are easily affected by environmental interference. By replaying anomaly frames and using self-supervised learning to update the model online incrementally, the system can continuously adapt to long-term slow changes in lighting, background, and corrosion levels, avoiding the performance degradation drawbacks of traditional fixed models after deployment. At the same time, the continuous multi-frame judgment and dynamic threshold adjustment mechanism effectively reduces the false alarm rate caused by single-frame noise, realizing all-weather low-latency autonomous monitoring, significantly reducing the cost of manual inspection and the risk of missed detection. Attached Figure Description
[0016] 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 only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating the steps of the AI visual learning-based safety monitoring method for oil and gas pipelines according to the present invention.
[0018] Figure 2 This is a flowchart of steps S100 of the present invention.
[0019] Figure 3 This is a flowchart of steps S200 of the present invention.
[0020] Figure 4 This is a flowchart of steps S300 of the present invention.
[0021] Figure 5 This is a flowchart of steps S400 of the present invention.
[0022] Figure 6 This is a flowchart of steps S500 of the present invention.
[0023] Figure 7 This is a schematic diagram of the structural principle of the AI visual learning-based oil and gas pipeline safety monitoring system of the present invention.
[0024] Figure 8 This is a schematic diagram of the electronic device of the present invention.
[0025] 601 - Self-supervised training module, 602 - Real-time prediction module, 603 - Difference analysis module, 604 - Alarm recording module, 605 - Incremental update module. Detailed Implementation
[0026] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application.
[0027] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0028] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0029] Please see Figures 1-6 This invention provides an implementation method for safety monitoring of oil and gas pipelines using AI visual learning, comprising the following steps: S100: Utilizing a self-supervised learning framework, a video prediction model is trained using unlabeled historical video data of the pipeline, enabling the video prediction model to learn the dynamic features of image sequences during normal pipeline operation. In this embodiment, a self-supervised learning framework is used to train a video prediction model using unlabeled historical video data of the pipeline, enabling the model to learn the dynamic features of image sequences during normal pipeline operation. Specifically, this includes: S101: The video prediction model adopts the PredNet or SimVP architecture, with 8 consecutive frames of images as input and the next frame of predicted image as output. S102: During training, the mean squared error loss function is used, the optimizer is Adam, the initial learning rate is 0.001, the training epochs are 50, no manual annotation is involved, and only historical video data under normal pipeline operation is used.
[0030] This step employs a self-supervised learning framework to train the video prediction model. Its core advantage lies in learning normal dynamic features using only historical video data from the pipeline's normal operating state, eliminating the need for manual annotation. The PredNet or SimVP architecture was chosen because both are specifically designed for video prediction. PredNet predicts differences layer by layer through recurrent units, while SimVP maps directly through convolutional blocks, both effectively capturing spatiotemporal dependencies. The input of eight consecutive frames is a trade-off based on a time window: a window that is too short makes it difficult to learn long-term motion patterns, while a window that is too long increases computational cost; eight frames cover common dynamic cycles (e.g., 0.5 seconds) in most pipeline scenarios. Training parameters are set as follows: mean squared error loss guides pixel-level reconstruction accuracy; the Adam optimizer adapts to sparse gradients; a learning rate of 0.001 serves as a general starting point for transfer learning; and 50 training epochs ensure convergence and avoid overfitting. The entire process requires no defect annotation, making it particularly advantageous for anomaly detection where samples are extremely scarce.
[0031] S200: Input the continuous multi-frame images from the real-time acquired pipeline video stream into the trained video prediction model to predict the next frame image and acquire the corresponding real next frame image. In this embodiment, multiple consecutive frames of images from the real-time acquired pipeline video stream are input into a trained video prediction model to predict the next frame image, and the corresponding real next frame image is acquired. Specifically, this includes: S201: The size of the acquired raw video frames is normalized to 256 by 256 pixels, and histogram equalization or adaptive gamma correction is used to enhance image contrast and eliminate the influence of illumination changes on prediction. S202: The real-time video stream frame rate is not less than 15 frames per second, the time window length for consecutive multi-frame images is 8 frames, and each time a new image is received, the sliding window moves forward one frame to generate a new input sequence. S203: The inference time of the video prediction model does not exceed 50 milliseconds per frame and is deployed on edge computing devices or cloud servers.
[0032] The process involves inputting real-time video streams into the model for prediction. In the preprocessing sub-step, size normalization to 256×256 pixels balances computational load with spatial detail; histogram equalization or adaptive gamma correction is used to offset the impact of varying illumination levels on prediction errors. A real-time frame rate of at least 15 frames per second ensures temporal resolution, and the sliding window length is 8 frames, consistent with training. The window slides once with each new frame to achieve frame-by-frame prediction. Inference time is controlled within 50 milliseconds, corresponding to a processing capacity of 20 frames per second, which can be adjusted based on the actual computing power of edge devices (e.g., using NVIDIA Jetson series devices can achieve even lower latency). Deployment options include edge computing to reduce bandwidth or centralized cloud processing to utilize stronger computing power, depending on the network conditions along the pipeline.
[0033] S300: Calculates the pixel-level difference between the predicted image and the real image, generates a difference heatmap, and calculates the anomaly score based on the area of the region where the difference value in the difference heatmap exceeds the preset threshold and the maximum difference value. In this embodiment, the pixel-level differences between the predicted image and the real image are calculated to generate a difference heatmap. An anomaly score is then calculated based on the area of regions in the difference heatmap where the difference value exceeds a preset threshold and the maximum difference value. Specifically, this includes: S301: Pixel-level differences are calculated using absolute difference or structural similarity index to obtain a difference matrix. After smoothing the difference matrix with Gaussian filtering, a difference heatmap is obtained. S302: The preset threshold is set to 2.5 times the global mean of the differential heatmap or a fixed gray value of 30; S303: The formula for calculating the anomaly score is: the anomaly score equals the area of the region whose difference value exceeds the preset threshold multiplied by the average difference value of the region and then divided by the total area of the image. The anomaly score range is normalized to 0 to 1. S304: An alarm is triggered only when the abnormal score exceeds the alarm threshold for 3 consecutive frames, in order to avoid false alarms caused by noise in a single frame; the alarm threshold is initially set to 0.5 and is dynamically adjusted based on the average abnormal score of the past 100 frames when there are no abnormalities.
[0034] The system calculates the difference between the predicted and actual frames and generates anomaly scores. Pixel-level differences can be calculated using absolute difference (faster computation) or structural similarity (more consistent with human vision and robust to lighting changes). After obtaining the difference matrix, Gaussian filtering (kernel size 5×5, σ=1.5) is applied to suppress isolated difference points caused by noise. Setting the preset threshold to 2.5 times the global mean is an adaptive thresholding strategy suitable for dynamic scenes; a fixed grayscale value of 30 is an empirical value suitable for indoor environments with stable lighting. The anomaly score is defined as the area of the region exceeding the threshold multiplied by the average difference value of that region divided by the total area of the image, with a score range of 0~1, showing sensitivity to both the range and intensity of anomalies. To prevent false alarms caused by short-term fluctuations in environmental noise, a mechanism is added that triggers only after three consecutive frames exceeding the alarm threshold; the alarm threshold is initially 0.5 and dynamically adjusted based on the average anomaly score of the past 100 frames without anomalies (e.g., set to 3 times the mean), allowing the system to adapt to long-term environmental changes.
[0035] S400: When the abnormal score exceeds the preset alarm threshold, it is determined to be a pipeline abnormal event, triggering an alarm and recording the abnormal frame and the time of abnormal occurrence; In this embodiment, when the anomaly score exceeds a preset alarm threshold, it is determined to be a pipeline anomaly event, triggering an alarm and recording the anomaly frame and the time of anomaly occurrence. Specifically, this includes: S401: When an alarm is triggered, the system notifies supervisory personnel via audible and visual alarms, SMS push notifications, or platform pop-ups. S402: Simultaneously compress and save the image sequences of the 30 frames before and after the anomaly to local storage or the cloud, and record the time-series curve of the anomaly score.
[0036] This step handles the actions taken after an alarm is triggered. Alarm notification methods can be combined according to actual needs: audible and visual alarms for on-site alerts, SMS notifications to on-duty personnel, and platform pop-ups for control center monitoring. Saving the anomaly frame sequence (the first 30 frames and the last 30 frames) provides a complete record of the event's evolution, facilitating post-event analysis; compressed storage saves space, and the format can be JPEG or H.264. Simultaneously, the anomaly score time-series curve is recorded to assess the anomaly's development and model response characteristics. All data is stored both locally (to prevent data loss due to network interruptions) and in the cloud (for remote diagnostics).
[0037] S500: Plays back abnormal frames and uses self-supervised learning to perform online incremental updates to the video prediction model, enabling the model to adapt to the slow changes in the pipeline environment.
[0038] In this implementation, abnormal frames are replayed and self-supervised learning is used to perform online incremental updates to the video prediction model, enabling the model to adapt to the slow changes in the pipeline environment. Specifically, this includes: S501: Online incremental updates employ an elastic weight consolidation algorithm to protect important parameters in the model and prevent catastrophic forgetting. S502: The incremental update frequency is triggered once every 100 accumulated abnormal frames, or once a week. The updated model replaces the original model and continues to run.
[0039] S503: During online incremental updates, abnormal frames and their preceding and following normal frames are combined to form new training samples, which are then mixed with the original training dataset at a ratio of 1:10 for fine-tuning. The fine-tuning rounds are 5, and the learning rate is reduced to one-tenth of the initial learning rate.
[0040] This step utilizes anomalous frames to perform online incremental updates to the model, allowing it to adapt to gradual environmental changes. The elastic weight consolidation algorithm estimates important parameters by calculating the Fisher information matrix and applies a secondary penalty to these parameters during updates, thus learning new information without forgetting existing normal patterns. Alternatively, a simpler hybrid fine-tuning strategy can be used: anomalous frames and their preceding and following normal frames are combined to form new samples, which are then mixed with the original training dataset at a 1:10 ratio and fine-tuned for 5 rounds, reducing the learning rate to one-tenth of the original. This method has low computational cost and is suitable for resource-constrained edge devices. The incremental update frequency is set to trigger once every 100 accumulated anomalous frames (ensuring sufficient samples) or once a week (to handle seasonal lighting changes). The updated model replaces the original model and continues to run, achieving continuous model evolution.
[0041] Corresponding to the aforementioned embodiments of the AI vision learning-based oil and gas pipeline safety monitoring method, this application also provides embodiments of an AI vision learning-based oil and gas pipeline safety monitoring system.
[0042] Figure 7 This is a block diagram illustrating an AI-based visual learning-based safety monitoring system for oil and gas pipelines, according to an exemplary embodiment. (Refer to...) Figure 7 The system may include a self-supervised training module 601, a real-time prediction module 602, a difference analysis module 603, an alarm recording module 604, and an incremental update module 605; wherein: The self-supervised training module 601: uses a self-supervised learning framework to train a video prediction model using unlabeled historical video data of the pipeline, so that the video prediction model learns the dynamic features of the image sequence when the pipeline is running normally. The real-time prediction module 602: inputs the continuous multi-frame images in the real-time acquired pipeline video stream into the trained video prediction model, predicts the next frame image, and acquires the corresponding real next frame image. The difference analysis module 603 calculates the pixel-level difference between the predicted image and the real image, generates a difference heatmap, and calculates an anomaly score based on the area of the region where the difference value in the difference heatmap exceeds a preset threshold and the maximum difference value. The alarm recording module 604: when the abnormal score exceeds the preset alarm threshold, it is determined to be a pipeline abnormal event, triggers an alarm and records the abnormal frame and the time of abnormal occurrence; The incremental update module 605 replays abnormal frames and uses self-supervised learning to perform online incremental updates on the video prediction model, enabling the model to adapt to the slow changes in the pipeline environment.
[0043] In this embodiment, the self-supervised training module 601 uses a self-supervised learning framework to train a video prediction model using unlabeled historical video data of the pipeline, enabling the video prediction model to learn the dynamic features of image sequences during normal pipeline operation; the real-time prediction module 602 inputs multiple consecutive frames of images from the real-time acquired pipeline video stream into the trained video prediction model to predict the next frame image and acquire the corresponding real next frame image; the difference analysis module 603 calculates the pixel-level difference between the predicted image and the real image, generates a difference heatmap, and calculates an anomaly score based on the area of the region where the difference value exceeds a preset threshold and the maximum difference value in the difference heatmap; the alarm recording module 604 determines a pipeline anomaly event when the anomaly score exceeds a preset alarm threshold, triggers an alarm, and records the abnormal frame and the time of the anomaly occurrence; the incremental update module 605 replays the abnormal frame and uses self-supervised learning to perform online incremental updates to the video prediction model, enabling the model to adapt to the slow changes in the pipeline environment.
[0044] Regarding the system in the above embodiments, the specific ways in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.
[0045] For the system embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0046] Accordingly, this application also provides an electronic device, including: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the AI visual learning-based oil and gas pipeline safety monitoring implementation method described above. Figure 8 The diagram shown is a hardware structure diagram of any device with data processing capabilities, used in an AI visual learning-based oil and gas pipeline safety monitoring system according to an embodiment of the present invention. (Except for...) Figure 8 In addition to the processor, memory, and network interface shown, any data processing device in the embodiment may also include other hardware depending on the actual function of the data processing device, which will not be described in detail here.
[0047] Accordingly, this application also provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the AI visual learning-based oil and gas pipeline safety monitoring method described above. The computer-readable storage medium can be an internal storage unit of any data processing device as described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., equipped on the device. Furthermore, the computer-readable storage medium can include both internal storage units of any data processing device and external storage devices. The computer-readable storage medium is used to store the computer program and other programs and data required by the data processing device, and can also be used to temporarily store data that has been output or will be output.
[0048] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0049] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.
Claims
1. An AI vision learning-based oil and gas pipeline safety monitoring method, characterized in that, Includes the following steps: By utilizing a self-supervised learning framework, a video prediction model is trained using unlabeled historical video data of the pipeline, enabling the video prediction model to learn the dynamic features of image sequences when the pipeline is running normally. The system inputs multiple consecutive frames of images from the real-time captured pipeline video stream into the trained video prediction model to predict the next frame image and capture the corresponding real next frame image. Calculate the pixel-level differences between the predicted image and the real image, generate a difference heatmap, and calculate the anomaly score based on the area of the region where the difference value in the difference heatmap exceeds a preset threshold and the maximum difference value. When the abnormal score exceeds the preset alarm threshold, it is determined to be a pipeline abnormal event, triggering an alarm and recording the abnormal frame and the time of the abnormality. By replaying abnormal frames and using self-supervised learning to perform online incremental updates to the video prediction model, the model can be adapted to the slow changes in the pipeline environment.
2. The AI vision learning-based oil and gas pipeline safety monitoring method of claim 1, wherein, In the step of training a video prediction model using unlabeled historical video data of the pipeline using a self-supervised learning framework, enabling the video prediction model to learn the dynamic features of image sequences when the pipeline is running normally: The video prediction model adopts the PredNet or SimVP architecture, with 8 consecutive frames of images as input and the next frame of predicted image as output. During training, the mean squared error loss function was used, the optimizer was Adam, the initial learning rate was 0.001, the training epochs were 50, no manual annotation was involved, and only historical video data under normal pipeline operation was used. 3.The AI vision learning-based oil and gas pipeline safety monitoring method of claim 1, wherein, In the steps of inputting multiple consecutive frames of images from a real-time captured pipeline video stream into a trained video prediction model to predict the next frame image and then capturing the corresponding real next frame image: The real-time video stream frame rate is no less than 15 frames per second, and the time window length for consecutive multi-frame images is 8 frames. Each time a new image is received, the sliding window moves forward one frame to generate a new input sequence. The inference time of the video prediction model is no more than 50 milliseconds per frame, and it is deployed on edge computing devices or cloud servers. 4.The AI vision learning-based oil and gas pipeline safety monitoring method of claim 1, wherein, In the steps of calculating the pixel-level difference between the predicted image and the real image, generating a difference heatmap, and calculating anomaly scores based on the area of regions in the difference heatmap where the difference value exceeds a preset threshold and the maximum difference value: Pixel-level differences are calculated using absolute difference or structural similarity index to obtain a difference matrix. After smoothing the difference matrix with Gaussian filtering, a difference heatmap is obtained. The preset threshold is set to 2.5 times the global mean of the difference heatmap or a fixed gray value of 30; The abnormal score is calculated as follows: the abnormal score equals the area of the region whose difference value exceeds the preset threshold multiplied by the average difference value of the region and then divided by the total area of the image. The abnormal score range is normalized to 0 to 1. 5.The AI vision learning-based oil and gas pipeline safety monitoring method of claim 1, wherein, In the steps of calculating the pixel-level difference between the predicted image and the real image, generating a difference heatmap, and calculating anomaly scores based on the area of regions in the difference heatmap where the difference value exceeds a preset threshold and the maximum difference value: An alarm is triggered only when the abnormal score exceeds the alarm threshold for three consecutive frames, in order to avoid false alarms caused by noise in a single frame. The alarm threshold is initially set to 0.5 and is dynamically adjusted based on the average abnormal score of the past 100 frames when there are no abnormalities.
6. The AI vision learning based oil and gas pipeline safety monitoring method of claim 1, wherein, In the steps of determining a pipeline anomaly event when the anomaly score exceeds the preset alarm threshold, triggering an alarm, and recording the anomaly frame and the time of anomaly occurrence: When an alarm is triggered, the system notifies supervisory personnel via audible and visual alarms, SMS push notifications, or platform pop-ups. Simultaneously, the image sequences of the 30 frames before and after the anomaly are compressed and saved to local storage or the cloud, and the time-series curve of the anomaly score is recorded.
7. The AI vision learning based oil and gas pipeline safety monitoring method of claim 1, wherein, In the steps of replaying abnormal frames and using self-supervised learning to perform online incremental updates to the video prediction model, thus adapting the model to the slow changes in the pipeline environment: Online incremental updates employ an elastic weight consolidation algorithm to protect important parameters in the model and prevent catastrophic forgetting. The incremental update frequency is triggered once every 100 accumulated abnormal frames, or once a week at regular intervals. The updated model replaces the original model and continues to run.
8. The AI vision learning based oil and gas pipeline safety monitoring method of claim 1, wherein, In the steps of replaying abnormal frames and using self-supervised learning to perform online incremental updates to the video prediction model, thus adapting the model to the slow changes in the pipeline environment: During online incremental updates, abnormal frames and their preceding and following normal frames are combined to form new training samples, which are then mixed with the original training dataset at a ratio of 1:10 for fine-tuning. The fine-tuning rounds are 5, and the learning rate is reduced to one-tenth of the initial learning rate.
9. The method for safety monitoring of oil and gas pipelines based on AI visual learning as described in claim 1, characterized in that, Before the steps of inputting multiple consecutive frames of images from the real-time captured pipeline video stream into the trained video prediction model to predict the next frame image and then capturing the corresponding real next frame image: The acquired raw video frames are normalized to 256 by 256 pixels, and histogram equalization or adaptive gamma correction is used to enhance image contrast and eliminate the influence of illumination changes on prediction.
10. An AI visual learning-based oil and gas pipeline safety monitoring system, employing the AI visual learning-based oil and gas pipeline safety monitoring implementation method as described in claim 1, characterized in that... It includes a self-supervised training module, a real-time prediction module, a difference analysis module, an alarm recording module, and an incremental update module; among which: The self-supervised training module utilizes a self-supervised learning framework to train a video prediction model using unlabeled historical video data of the pipeline, enabling the video prediction model to learn the dynamic features of image sequences during normal pipeline operation. The real-time prediction module: inputs multiple consecutive frames of images from the real-time acquired pipeline video stream into the trained video prediction model, predicts the next frame image, and acquires the corresponding real next frame image. The difference analysis module calculates the pixel-level difference between the predicted image and the real image, generates a difference heatmap, and calculates anomaly scores based on the area of regions in the difference heatmap where the difference value exceeds a preset threshold and the maximum difference value. The alarm recording module: when the abnormal score exceeds the preset alarm threshold, it is determined to be a pipeline abnormal event, triggers an alarm, and records the abnormal frame and the time of abnormal occurrence; The incremental update module replays abnormal frames and uses self-supervised learning to perform online incremental updates to the video prediction model, enabling the model to adapt to the slow changes in the pipeline environment.