A method and system for detecting oil field oil theft events based on vision transformer action recognition
By using a time-series action recognition method based on Vision Transformer, combined with multi-target tracking and oilfield business rules, the problem of real-time identification and early warning of oil theft in oilfield security systems was solved, achieving high-precision, low-false-alarm detection of oil theft events.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XI'AN UNIVERSITY OF ARCHITECTURE AND TECHNOLOGY
- Filing Date
- 2026-04-16
- Publication Date
- 2026-07-21
AI Technical Summary
In existing oilfield security systems, traditional manual patrols are inefficient and costly, video surveillance cannot identify and warn of oil theft in real time, and existing motion recognition methods are not accurate enough in complex environments and require a large amount of computation, making them difficult to apply in real time.
A temporal action recognition method based on Vision Transformer is adopted. Video features are extracted through spatiotemporal segmentation and multi-head self-attention mechanism. Combined with multi-target tracking and oilfield business rules, oil theft events are judged and real-time alarms are generated.
It has achieved high-precision, low-false-alarm identification of oil theft in complex environments, reduced the cost of manual monitoring, improved the efficiency of abnormal event response, and promoted the development of video temporal understanding technology.
Smart Images

Figure CN122435673A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a method and system for detecting oil theft incidents in oil fields based on Vision Transformer action recognition. Background Technology
[0002] Oil theft is a critical issue that urgently needs to be addressed in oilfield security management. Traditional oilfield security measures typically rely on manual patrols or simple video surveillance. However, manual patrols suffer from low efficiency, high costs, and limited coverage, while ordinary video surveillance can only provide evidence after the fact and cannot achieve real-time and effective identification and early warning of oil theft. This not only increases the risk of economic losses for oilfields but also poses a serious threat to production safety and energy security.
[0003] In recent years, with the rapid development of computer vision and deep learning technologies, object detection-based methods have been widely applied in the field of video security. For example, the typical YOLO series algorithms have achieved relatively fast and accurate detection results in video surveillance. However, these two-dimensional detection methods mainly focus on the spatial location of static targets and are difficult to capture complex action patterns. For abnormal events with time-series characteristics, such as oil theft, two-dimensional detection methods can often only detect the presence of people or vehicles, but cannot effectively understand their action processes that change over time.
[0004] Therefore, some studies have begun to explore the use of video action recognition technology for abnormal behavior detection, such as models like C3D, I3D, and SlowFast. These methods can, to some extent, extract temporal features from videos and achieve action-level recognition. However, existing action recognition methods still have the following shortcomings when applied to oilfield scenarios: 1) The lack of accurate modeling of long-term action sequences makes it easy to overlook the fine-grained temporal characteristics of oil theft. 2) In complex environments (such as insufficient lighting at night, people obstructing the view, and changes in the monitoring angle), the accuracy of motion recognition is not high, and the false detection rate is relatively high; 3) Most models involve large amounts of computation and are difficult to deploy, which is not conducive to the real-time application needs of oilfields. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for detecting oil theft events in oil fields based on Vision Transformer action recognition, so as to solve the problems of insufficient detection accuracy, poor robustness and difficulty in real-time application in the prior art.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for detecting oil theft events in oil fields based on Vision Transformer action recognition, comprising: Acquire and preprocess video sequences from the oilfield monitoring area; A temporal action detection model is constructed and used to process video sequences, outputting detection results including action category, start and end time, and confidence level. The temporal action detection model includes a module that performs spatiotemporal segmentation of the input video to construct a serialized feature representation, a feature extraction backbone network that performs spatiotemporal modeling of the serialized features based on the Transformer structure, and an action detection head based on boundary modeling. Based on the detection results, combined with multi-target tracking, preset oilfield business time sequence rules and multi-dimensional scoring mechanisms, the behaviors in the video sequence are correlated and evaluated to determine whether an oil theft incident has occurred. When an oil theft incident is detected, an alarm message is generated and pushed out, while relevant video clips and metadata are stored.
[0007] Furthermore, the acquisition and preprocessing of video sequences from the oilfield monitoring area includes: In oil fields, fixed surveillance cameras are deployed at monitoring angles that can cover the working face and observe the interaction between personnel and pipelines; the cameras are synchronized in time; infrared or supplementary lighting devices can be equipped for nighttime or low-light areas. The video data captured by the camera undergoes basic processing such as noise reduction, gamma correction, and brightness or contrast normalization.
[0008] Furthermore, an oilfield behavior sample library was established for training the action detection model. Action categories and temporal boundaries were defined for the video data, and the dataset was partitioned. The collected video data was categorized into two types: normal behavior samples and oil theft-related behavior samples. Normal behavior samples include routine inspections, permitted operations, and activities where personnel do not touch the equipment. Oil theft-related behavior samples include behaviors such as personnel crouching or bending over to approach valves, connecting or disconnecting oil hoses, carrying oil drums, and carrying bags or similar items quickly. The behavioral events in the video are labeled in the form of time intervals. Each action is marked with "start time - end time". When there are multiple action segments in the same video, they are labeled separately. After the labeling is completed, the data is divided according to the scene and the collection time to ensure that the video collected by the same camera is used only for either the training set or the test set.
[0009] Furthermore, the constructed and used temporal action detection model processes the video sequence, outputting detection results including action category, start and end time, and confidence level, including: The input video is spatiotemporally segmented to construct a serialized feature representation suitable for the Transformer architecture; let the input video representation be: ,in, This indicates the total number of frames in the video. and These represent the spatial resolution height and width of the video frame, respectively. This represents the number of image channels. The input video is divided along the time dimension. If there are several consecutive and non-overlapping time segments (snippets), then the number of frames contained in each time segment is expressed as:
[0010] Get the first A time segment: Each time segment is divided into three-dimensional spatiotemporal segments; in the time dimension, a length of [missing information] is used. The time window, in the spatial dimension, adopts a size of The video is segmented using spatial windows to form three-dimensional spatiotemporal tubelets; the number of tubelets in the time dimension, spatial height dimension, and spatial width dimension are as follows:
[0011] The total number of spacetime blocks generated by each time segment is:
[0012] Each spacetime block is represented as: Then, each spatiotemporal block is flattened into a one-dimensional vector and projected onto a fixed-dimensional feature space through a linear mapping to obtain the corresponding embedded features; The obtained segment-level sequence features are input into a Transformer-based video feature extraction backbone network for spatiotemporal feature modeling. This backbone network consists of multiple Transformer Blocks stacked sequentially, each Block containing two main modules: a multi-head self-attention mechanism and a feedforward network (MLP). Let the input feature sequence be: ,in For the number of patches, The feature dimension is: first, the input features are normalized through layer normalization, and then the correlation between each patch in the sequence is calculated through a multi-head self-attention mechanism. After obtaining the attention output, the final attention features are obtained through linear projection:
[0013] The features are then fed into a feedforward network MLP for further nonlinear mapping:
[0014] Global attention residual branches are introduced in some Transformer Blocks. Specifically, the global attention mechanism is enabled for each Block by preset control parameters. When the corresponding position is true, only the standard Transformer attention structure is used for local feature modeling. When the corresponding position is attn_global_residual, after the local attention calculation is completed, the feature sequence is rearranged to restore its spatiotemporal structure. Then, global self-attention is calculated for the feature sequence and fused with the original feature through residual connection. The spatial dimension is compressed, transforming two-dimensional spatial features into a single spatial location to obtain a one-dimensional temporal feature representation. This compressed one-dimensional temporal feature... Input the action detection head to perform action category recognition and action time boundary localization; in the temporal action detection task, the action start boundary, end boundary and center position are jointly modeled through multiple prediction branches; First, the temporal features are further encoded using convolutional layers. Let the encoded features be represented as follows:
[0015] in, This represents a one-dimensional convolution operation. The encoded temporal features are then input into multiple prediction branches for action boundary modeling. First, the response values at each time position in a pre-set Bin set of size B are calculated using the initial boundary prediction branch as the action start boundary. The calculation process is as follows:
[0016] in This represents a one-dimensional convolutional layer used to predict action start boundaries. A one-dimensional convolutional kernel maps features to single-channel responses, compresses them into a one-dimensional array, and yields the response value at each time point as the action start boundary. Similarly, the response score for each time position is predicted as the action end boundary using the end boundary prediction branch. The calculation process is as follows:
[0017] in This represents a one-dimensional convolutional layer used to predict the end boundary of an action. This represents the response value at each time point in the time series as the action end boundary; furthermore, the action center position is modeled through a center position prediction branch, and its time offset is predicted. The calculation process is as follows:
[0018] in This represents a one-dimensional convolutional layer used to predict the offset of the action center position, and its output is... This represents the center offset corresponding to each time position in the Bin set; Based on the generated start and end response values and center offset, candidate action intervals are further generated, and the final action detection result prediction is completed; let the i-th time position in the time series be... The boundary response value at this location is added to the center offset, and then normalized using Softmax to obtain the relative probability of each Bin as the starting boundary. This is the key transformation from feature response to probability distribution. The specific calculation formula is as follows:
[0019]
[0020] The offset is calculated using the expected value of the probability distribution. The index and probability of each Bin are weighted and summed to obtain a unique average offset value, which gives the action interval value. After model training is complete, the optimal detection model is used to infer the input video. First, the video is spatiotemporally segmented and features extracted in the same manner as during training, obtaining candidate action intervals in the time series. All candidate action intervals are ranked according to confidence, and a non-maximum suppression (NMS) strategy is used to remove redundant detection results with high overlap, thus retaining the optimal action interval prediction. The filtered detection results are represented as follows:
[0021] in Indicates the start time of the action. Indicates the end time of the action. This represents the confidence level of the action detection. This indicates the action category label.
[0022] Furthermore, the calculation process for obtaining the corresponding embedded features is as follows:
[0023] in Indicates vectorization operation, For trainable embedding weight matrix, For bias parameters, This represents the feature representation of the k-th spatiotemporal block. This is to embed the feature dimensions. Finally, the embedding vectors of all spatiotemporal blocks are concatenated in spatiotemporal order to form the serialized feature representation of the video segment; The correlation between patches in a sequence is calculated using a multi-head self-attention mechanism; the calculation process is as follows:
[0024]
[0025] in , and For a trainable projection matrix, This represents the dimension of the attention head.
[0026] Furthermore, based on the detection results, combined with multi-target tracking, preset oilfield business timing rules, and a multi-dimensional scoring mechanism, the behavior in the video sequence is correlated and evaluated to determine whether an oil theft event has occurred, including: Based on the action detection results, the time periods in the input video are initially screened to extract candidate segments containing potential oil theft behavior; then, a spatial target detection mechanism is introduced into the frame sequence corresponding to the candidate segments to realize the association between actions and spatial targets. Based on the business logic of the oilfield scenario, specific time-series rules are constructed to compare the continuous action detection results with preset rules. When the detection sequence matches the logical pattern of oil theft behavior, a risk marker is triggered. To address the potential for noise or false alarms in single detection methods, a multi-dimensional scoring mechanism was designed to weight the detection results based on category confidence, duration, and spatial location rationality, thereby generating a comprehensive event risk score. When the risk score exceeds a threshold, it is determined to be an oil theft event.
[0027] Furthermore, when an oil theft incident is detected, an alarm message is generated and pushed out, while relevant video clips and metadata are stored, including: For suspected oil theft incidents detected, alarm information is generated and pushed in real time through local audio-visual devices, remote monitoring platforms, or mobile terminals; at the same time, the detected fragments and related metadata are stored locally or uploaded to the cloud for subsequent analysis and evidence collection.
[0028] Secondly, the present invention provides an oilfield oil theft event detection system based on action recognition, comprising: The data acquisition module is used to acquire and preprocess video sequences from the oilfield monitoring area; The detection result acquisition module is used to construct and use a temporal action detection model to process video sequences and output detection results including action category, start and end time, and confidence level. The temporal action detection model includes a module for spatiotemporal segmentation of the input video to construct a serialized feature representation, a feature extraction backbone network based on the Transformer structure for spatiotemporal modeling of the serialized features, and an action detection head based on boundary modeling. The judgment module is used to correlate and evaluate the behavior in the video sequence based on the detection results, combined with multi-target tracking, preset oilfield business time sequence rules and multi-dimensional scoring mechanism, to determine whether an oil theft event has occurred. The early warning module is used to generate alarm information and push it when an oil theft incident is detected, while storing relevant video clips and metadata.
[0029] Thirdly, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method for detecting oil theft events in oil fields based on Vision Transformer action recognition.
[0030] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method for detecting oil theft events in oil fields based on Vision Transformer action recognition.
[0031] Compared with the prior art, the present invention has the following technical effects: This invention presents a temporal modeling method based on video segments. Building upon traditional two-dimensional action detection techniques, it combines a Vision Transformer structure with a multi-scale temporal modeling mechanism. This allows action detection to move beyond local time windows and simultaneously capture short-term dynamics and long-term dependencies globally. Compared to traditional detection methods primarily based on convolutional or recurrent networks, this invention effectively solves the problem of two-dimensional methods struggling to model long-range dependencies, enabling more accurate characterization of action boundaries and semantic information in complex videos. Furthermore, this invention represents a significant application in the field of artificial intelligence video understanding. Its widespread application can promote the development and application of scenarios such as intelligent security, smart transportation, public safety, and human-computer interaction. It can not only reduce the cost of manual monitoring but also improve the efficiency of abnormal event response, reducing losses caused by false alarms and missed alarms. In addition, it can drive the development of video temporal understanding technology, bringing broader social and economic benefits.
[0032] This invention significantly improves detection accuracy and stability in open scenarios through refined video segmentation and a unified sampling strategy, an efficient Transformer backbone network structure, an advanced anchorless detection head and boundary regression mechanism, and a real-time temporal action detection inference process. The system can provide accurate action start and end times and category information in real time even in complex scenarios, providing strong support for security monitoring, behavior analysis, and intelligent management in smart cities.
[0033] In summary, the method proposed in this invention has high action detection accuracy and strong model structure scalability, enabling efficient and robust temporal action detection tasks in complex environments. Attached Figure Description
[0034] Figure 1 This is a flowchart of the oilfield oil theft event detection method based on Vision Transformer action recognition according to the present invention.
[0035] Figure 2 This is a network framework diagram for the timing action detection of the present invention.
[0036] Figure 3 This is a schematic diagram illustrating the working principle of a three-branch boundary sensing enhancement detection head.
[0037] Figure 4 This is a diagram showing the results of oilfield testing. Detailed Implementation
[0038] The present invention will be further described below with reference to the accompanying drawings: Example 1, please refer to Figure 1 This invention provides a method for detecting oil theft events in oil fields based on Vision Transformer action recognition, comprising: S1, Acquire and preprocess video sequences of the oilfield monitoring area; In high-risk areas for oil theft, such as storage tanks, valves, and pipeline inlets and outlets, fixed cameras are installed at angles that clearly capture details of personnel operations. Network Time Protocol (NTP) synchronization is used to ensure consistent timestamps across all video streams, guaranteeing the validity of the raw data in terms of spatial coverage and temporal reference. The acquired raw videos undergo denoising (e.g., reducing snow noise), gamma correction (improving uneven lighting), and brightness / contrast normalization to minimize interference from complex lighting conditions such as nighttime and rainy weather, thereby improving the quality of the model's input data. Based on oilfield operation procedures, categories such as "normal operations" (e.g., certified inspections, equipment maintenance) and "suspected oil theft" (e.g., illegal hose connections, concealed transport) are clearly defined. Behavioral segments in the videos are precisely labeled using the format <start time, end time>, forming a high-quality supervisory signal dataset.
[0039] IP cameras supporting the ONVIF protocol are deployed at key nodes in the oilfield. A central network video recorder (NVR) centrally aggregates, decodes, and standardizes the video streams (e.g., to H.264 encoding). Preprocessing algorithms are integrated as software modules into the NVR or edge servers for real-time processing of the video streams. Simultaneously, a dedicated video annotation platform is developed, supporting frame-by-frame viewing and interval annotation of playback videos. Annotation results are automatically linked to the original video files to generate an index. Centralized management ensures the standardization and stability of the data source; the automated preprocessing pipeline reduces environmental interference, providing a "cleaner" input for the model; and structured, high-quality datasets are prerequisites for training high-performance, high-generalization detection models.
[0040] S2, construct and use a temporal action detection model to process video sequences, and output detection results including action category, start and end time and confidence level; the temporal action detection model includes a module for spatiotemporal segmentation of input video to construct serialized feature representation, a feature extraction backbone network for spatiotemporal modeling of serialized features based on Transformer structure, and an action detection head based on boundary modeling; The video is segmented into a series of three-dimensional tubular blocks along the temporal and spatial dimensions. Each block is then flattened and mapped to a feature vector through a linear layer. This extends the visual Transformer's processing of image blocks to the video domain, transforming unstructured video data into sequence data, which the Transformer excels at. Secondly, the Transformer backbone network utilizes a stacked multi-layer Transformer encoder. Its core multi-head self-attention mechanism calculates the association weights between any two blocks in the sequence, thus modeling long-distance spatiotemporal dependencies in the video. Global attention residual branches introduced in some layers further capture global contextual information across segments. To address the challenge of ambiguous action start and end times, the detection head no longer predicts only one action bounding box but instead sets up three branches in parallel: one specifically predicting the confidence of the action start boundary, the other the confidence of the end boundary, and the offset of the center point. By jointly optimizing these three branches, the model can more accurately define the temporal boundaries of actions.
[0041] A three-branch action detection model based on the Vision Transformer (ViT) architecture is implemented. Using ViT-Base as the backbone network blueprint, its input is adapted to a 3D spatiotemporal block sequence. A lightweight three-branch one-dimensional convolutional detection head is connected to the backend of the backbone network. The model uses the dataset constructed in step S1 and is jointly trained end-to-end with action classification loss and boundary regression loss. The advantages of this implementation are: 1) Leveraging the powerful global modeling capabilities of the Transformer, it can better understand complex behaviors such as "connecting a hose" or "carrying an oil drum," which require combining multi-frame information and spatial context for recognition; 2) The specially designed detection head directly addresses the pain point of inaccurate boundary localization in action detection, significantly improving the accuracy of start and end time prediction through multi-branch collaboration, and reducing missed detections or excessive extension of action segments.
[0042] S3, based on the detection results, combined with multi-target tracking, preset oilfield business time sequence rules and multi-dimensional scoring mechanism, correlates and evaluates the behaviors in the video sequence to determine whether an oil theft event has occurred; Within the action time period output by S2, object detectors such as YOLO are invoked to identify objects such as people, oil drums, hoses, and vehicles, and the action categories appearing within the same time period are associated with object categories (e.g., squatting action occurring simultaneously with valves or hoses). Typical pattern sequences of oil theft behavior are predefined based on expert knowledge, such as the rule: "[Person approaches oil tanker] -> [Person squats and remains squatting for more than 10 seconds] -> [A container appears and quickly leaves]. The system matches continuously detected action and target sequences with this rule. A scoring model is established to weight and score multiple dimensions, including the confidence of a single detection result, the duration of the action, the reasonableness of the associated object, and the degree of matching with the preset rule, to obtain a comprehensive risk score. Only those exceeding a threshold are ultimately determined to be oil theft events.
[0043] The system receives action sequences from the S2 model and object sequences from the parallel target detection module. It has multiple pre-set configurable rule templates and a scorecard with configurable weights. The system compares the data stream with the rules in real time and calculates a comprehensive risk score. This significantly reduces false alarms that might occur with a single action recognition model. For example, a squatting action might simply be a worker tying shoelaces, but combining it with a valve target and the nighttime time will result in a higher risk score; events that conform to a complete logical chain (approaching, operating, carrying items away) will receive even higher scores. This makes the system's alarms more intelligent, accurate, and better suited to actual security business needs.
[0044] S4: When an oil theft incident is detected, an alarm message is generated and pushed out, while relevant video clips and metadata are stored.
[0045] Once S3 determines an oil theft incident, it automatically triggers a tiered alarm, such as flashing and sounding an on-site audible and visual alarm to deter criminals. Simultaneously, alarm information including camera location, time, risky footage, and overall score is pushed to the monitoring center's large screen and security personnel's mobile terminals. In parallel, metadata such as original video clips, motion detection results, and related target information for a period before and after the alarm is triggered is packaged, stored, and uploaded to central storage or a cloud server, forming an immutable chain of evidence.
[0046] Alarm posts with voice broadcast capabilities were deployed at the oilfield site, while a management platform integrating a real-time video wall and alarm list was deployed at the monitoring center. Once an alarm is triggered, the platform automatically displays the on-site footage and records the handling log. Relevant video evidence is cached locally on edge devices and simultaneously encrypted and uploaded to a cloud-based object storage service for long-term archiving via a dedicated network. This achieves full automation of the process from on-site deterrence to remote response to evidence preservation. Real-time alarms buy valuable time to prevent criminal activity.
[0047] This invention can efficiently model the temporal features in oilfield monitoring videos, enabling accurate identification and real-time early warning of abnormal oil theft behavior, and improving the intelligence and reliability of oilfield security systems. After the cameras in the oilfield working area are calibrated, the acquired video sequences are processed and input into a feature extraction network for feature interaction; the obtained features are then input into the detection head to output the action detection results.
[0048] Example 2, refer to Figure 1 and Figure 2 This invention provides a detailed description of the specific steps of an oilfield theft event detection method based on Vision Transformer action recognition.
[0049] Step 1: Deploy video acquisition equipment in the oilfield operation area, preprocess the acquired raw video data and set frame sampling to form video data suitable for subsequent action recognition model training.
[0050] The specific implementation steps are as follows: Step 1.1: Deploy fixed surveillance cameras in key operational areas of the oilfield, including storage tank areas, refueling points, valve clusters, and key locations such as oil pipeline inlets and outlets. When installing cameras, prioritize monitoring angles that cover the personnel operating area and clearly observe interactions between personnel and pipeline equipment, and synchronize the time of each camera. Set the video capture resolution to 1080p or 720p and the frame rate to 15–30fps to ensure image quality while meeting transmission bandwidth and storage requirements. In areas with low light conditions or at night, infrared supplementary lighting or auxiliary lighting equipment can be configured to ensure the visibility of the monitored images.
[0051] Step 1.2: Preprocess and sample frames from the raw surveillance video acquired in Step 1.1 to construct a data format suitable for the input of the temporal action detection model. First, randomly crop the video sequence along the time dimension, randomly selecting fixed-length time segments from the original video clips to enhance the model's ability to learn action segments at different time positions.
[0052] In the video decoding stage, a PyAV-based video decoding method is used to read the video frame by frame at a frame rate of 8fps, and the image data is converted into floating-point format. Then, spatial processing is performed on the decoded video frames. First, random spatial cropping is performed to obtain image regions of uniform size, thus ensuring consistent spatial resolution of the input model. Simultaneously, various data augmentation operations are introduced, including illumination enhancement processing such as brightness, contrast, saturation, and hue changes, as well as random rotation and random horizontal flip operations, to simulate scene changes under different shooting environments and camera angles.
[0053] After data augmentation, the images are normalized by mean and standard deviation to unify the pixel distribution across different video frames. Finally, the video frame sequence is padded to meet the model input requirements in both time and spatial dimensions. The processed image sequence is then encapsulated with the corresponding action time intervals and category labels to form the input data for model training.
[0054] Step 1.3: The collected video data is managed using a storage strategy that combines local caching and periodic uploading. Ordinary surveillance video clips are stored locally for short periods in a loop, while critical video clips containing abnormal behavior or triggering alarm conditions are uploaded to a centralized server for long-term storage. Each video clip records its corresponding acquisition time, camera number, and device location information to facilitate video data association, retrieval, and historical review during subsequent event analysis and system management.
[0055] An oilfield behavior sample library was established for training the action detection model. Action categories and time boundaries were defined for the video data, and the dataset was divided.
[0056] Step 2: Establish an oilfield behavior sample library for training the action detection model, define action categories and time boundary annotations for video data, and complete the dataset partitioning.
[0057] The specific implementation steps are as follows: Step 2.1: Classify the collected video data into behavioral categories, establishing two types of data: normal behavior samples and oil theft-related behavior samples. Normal behavior samples include routine inspections, permitted operations, and activities where personnel do not touch equipment; oil theft-related behavior samples include behaviors such as personnel crouching or bending over to approach valves, connecting or disconnecting oil hoses, carrying oil drums, and moving quickly while carrying bags or similar items.
[0058] Step 2.2: Label the behavioral events in the video using time intervals. Each action is marked with a "start time - end time". When there are multiple action segments in the same video, label them separately. After labeling, divide the data according to scene and acquisition time to ensure that videos captured by the same camera are used only in either the training set or the test set, thus avoiding the recurrence of the same scene data in different datasets.
[0059] Step 3: Input the oilfield dataset obtained in Step 2 into the temporal action detection model for training, parameter tuning and validation to obtain a deployable action detection model. Select the optimal detection model to output the action category and boundary information.
[0060] The specific implementation steps are as follows: Step 3.1: First, perform spatiotemporal segmentation on the input video to construct a serialized feature representation adapted to the Transformer structure. Let the input video be: ,in Indicates the total number of frames in the video. and These represent the spatial height and width of a video frame, respectively. Represents the number of image channels; divides the input video along the time dimension into A series of consecutive and non-overlapping time segments, with the number of frames in a single time segment being:
[0061] Then the i-th time segment is: Subsequently, a three-dimensional spatiotemporal division was performed on each time segment, with the time dimension using a length of [missing information]. The time window and spatial dimension are adopted as The video is segmented into three-dimensional spatiotemporal blocks using spatial windows. The number of blocks in the time, spatial height, and spatial width dimensions are as follows:
[0062] The total number of spacetime blocks in a single time segment is:
[0063] A single spacetime block is: Each spatiotemporal block is flattened into a one-dimensional vector, and then projected onto a fixed-dimensional feature space via a linear mapping to obtain the embedded features, calculated as follows:
[0064] in Indicates vectorization operation, To embed the weight matrix, For bias parameters, This represents the feature representation of the k-th spatiotemporal block. This is the embedding dimension. Finally, the embedding vectors of all spatiotemporal blocks are concatenated in spatiotemporal order to form the serialized feature representation of the video segment.
[0065] Step 3.2: Input the segment-level sequence features obtained in Step 3.1 into the video feature extraction backbone network based on the Transformer structure for spatiotemporal feature modeling. This backbone network is composed of multiple Transformer Blocks stacked sequentially, and each Block contains a multi-head self-attention mechanism and a feedforward network module. Let the input feature sequence be: , For the number of patches, The feature dimension is defined as follows: First, the input features are normalized using layer normalization. Then, the correlation between each patch in the sequence is calculated using a multi-head self-attention mechanism. The calculation formula is as follows:
[0066]
[0067] in , and For trainable projection matrices, This represents the attention head dimension. After obtaining the attention output, the final attention feature is obtained through linear projection, calculated as follows:
[0068] The features are then input into the feedforward network and nonlinearly mapped. The calculation formula is as follows:
[0069] To enhance the global spatiotemporal modeling capability of video features, a global attention residual branch is introduced in some Transformer Blocks. Whether to enable the global attention mechanism in each Block is determined by preset control parameters. When the parameter is true, only the standard Transformer attention structure is used for local feature modeling; when the parameter is attn_global_residual, after completing the local attention calculation, the feature sequence is rearranged to restore the spatiotemporal structure, and then global self-attention is calculated on this sequence. This is then fused with the original features via residual connections, achieving a balance between local computational efficiency and global dependency capture, thus improving the expressive power of video action features.
[0070] Step 3.3: Perform spatial dimension compression on the features, compressing the two-dimensional spatial features into a single spatial location to obtain a one-dimensional temporal feature representation; then, process the compressed one-dimensional temporal features... The input action detection head performs action category recognition and action temporal boundary localization. This invention improves upon the ViT-TAD algorithm by designing a three-branch detection head based on boundary modeling. This head jointly models the action start boundary, end boundary, and center position, improving the accuracy of action temporal localization. First, temporal features are encoded using convolutional layers to enhance feature representation capabilities. The encoded features are as follows:
[0071] in This is a one-dimensional convolution operation. The encoded temporal features are input into multiple prediction branches to model action boundaries. First, the response values at each time position in a pre-set Bin set of size B are calculated as the action start boundary using the initial boundary prediction branch. The calculation formula is:
[0072] in To predict the action start boundary, a one-dimensional convolutional layer maps features to single-channel responses using a one-dimensional convolutional kernel, compressing them into a one-dimensional array to obtain the response value at each time position as the action start boundary. Similarly, the response score for each time position, predicted by the termination boundary prediction branch as the action termination boundary, is calculated as follows:
[0073] in A one-dimensional convolutional layer for predicting the end boundary of an action. The response value at each time point in the time series is used as the action end boundary. The action center position and time offset are predicted by predicting the branch based on the center position; the calculation formula is:
[0074] A one-dimensional convolutional layer for predicting the offset of the action center position. This represents the center offset corresponding to each time position in the Bin dataset. By using a multi-branch structure to obtain the start and end boundaries of the action and the center offset information, the video action time interval is finely modeled, mitigating the positioning error caused by blurred action boundaries.
[0075] Step 3.4: Based on the action start response value, end response value, and center offset obtained in Step 3.3, generate candidate action intervals and predict the final action detection result; let the i-th time position in the time series be... The boundary response value at this location is added to the center offset, and the relative probability of each Bin as the starting boundary is obtained by Softmax normalization, as shown in the following formula:
[0076]
[0077] The next step is to calculate the offset using the expected value of the probability distribution, and then sum the index and probability of each Bin to obtain a unique average offset value. This gives us the action interval value.
[0078] During the model training phase, the classification loss and boundary regression loss are jointly optimized to update the network parameters, thereby improving the action category recognition capability and the accuracy of temporal boundary localization.
[0079] Step 3.5: After model training is complete, the optimal detection model is used for inference on the input video; the video is spatiotemporally segmented and features are extracted according to the training phase to obtain candidate action intervals in the time series; all candidate action intervals are sorted by confidence, and a non-maximum suppression strategy is used to remove redundant detection results with high overlap, retaining the optimal action interval prediction; the filtered detection results are as follows:
[0080] in The start time of the action. The end time of the action. For action detection confidence, For action category labels.
[0081] Step 4: Combine the motion detection results with multi-target tracking, timing rules, and scoring mechanisms to perform event-level judgment on behaviors in the video and trigger alarms, while realizing edge deployment and overall integration of the system.
[0082] The specific implementation steps are as follows: Step 4.1: Utilize the action detection results to filter candidate segments in the video that contain potential oil theft behavior; introduce spatial target detection in the corresponding frame sequence to realize the spatiotemporal correlation between actions and targets.
[0083] Step 4.2: Construct timing judgment rules based on oilfield business logic, compare the continuous action detection results with the rules, and mark the risk if it matches the oil theft behavior pattern.
[0084] Step 4.3: For detection noise and false alarms, a weighted score is given based on dimensions such as confidence, duration, and spatial rationality. If the score exceeds the threshold, it is determined to be an oil theft event.
[0085] Step 4.4: Generate alarm information for the determined event and push it in real time through local and remote terminals; synchronously store the detection fragments and metadata for subsequent analysis and evidence collection.
[0086] Please see Figure 4 This is a visual representation of the actual oilfield scene detection effect of the oilfield theft event detection method based on Vision Transformer action recognition of the present invention. It intuitively demonstrates the ability of the method to be applied in the real oilfield operating environment. The core of the screen presents the detection interface of key monitoring areas in the oilfield (high-risk points for oil theft such as valves, oil pipelines, and storage tanks), including core elements such as real-time monitoring screen, action detection box, behavior category label, confidence value, risk score and alarm prompts. It clearly reflects the full-process detection effect of the present invention from action recognition to event judgment to early warning triggering.
[0087] from Figure 4 The visualization results are directly observable: In complex oilfield environments (such as low light at night, equipment obstruction, and outdoor background interference), this invention can accurately define the time interval and spatial range of personnel's oil theft-related actions, accurately label oil theft behaviors such as crouching down to approach valves, connecting oil hoses, and moving oil drums, with a high confidence level. The alarm prompts triggered when the risk score exceeds the threshold are clear and conspicuous. Simultaneously, there are no false detections for normal behaviors such as routine inspections and equipment maintenance, fully verifying the method's detection accuracy, environmental adaptability, and anti-interference capabilities in actual oilfield scenarios. Combined with... Figure 4 Based on the actual testing results, the core advantages and practical benefits of this invention can be further discussed from three dimensions: technical performance, oilfield security implementation, and industry value. I. Technical Performance: Breaking through the bottlenecks of traditional testing technologies, detection accuracy and robustness are significantly improved. This invention, based on the Vision Transformer spatiotemporal feature extraction architecture, overcomes the shortcomings of traditional 2D object detection (such as YOLO) which only focuses on static spatial features, and traditional action recognition models (such as C3D and I3D) which struggle to capture long-range temporal dependencies. Figure 4It is evident that even for multi-step, continuous oil theft activities in oil fields (such as approaching a valve → connecting a hose → moving an oil drum), the method can accurately classify the start and end times and categories of each action, without any missed or incorrect detections. This solves the problem of traditional methods recognizing only objects but not actions in sequential behaviors.
[0088] Oilfield monitoring faces challenges such as low light at night, equipment obstruction, varying monitoring angles, and complex backgrounds. This invention addresses these issues through video preprocessing (denoising, gamma correction, brightness normalization), infrared illumination device adaptation, and data enhancement (illumination, rotation, and flipping). It also leverages the Transformer's global attention mechanism to filter features from complex backgrounds. Figure 4 In actual testing scenarios, even in outdoor environments with dense pipelines and uneven lighting, the system can still clearly identify the interaction between personnel and equipment, demonstrating stable detection confidence and far superior to the high false detection rate of traditional models in complex environments.
[0089] The three-branch boundary sensing detection head (start boundary, end boundary, and center position) designed in this invention achieves fine-grained localization of the action time interval through joint modeling and probability offset calculation. Figure 4 As can be seen from the time annotations of the action detection bounding boxes, the start and end times of each oil theft-related action have no significant deviations. This solves the pain points of traditional action detection models, such as blurred action boundaries and large time positioning errors, and provides accurate basic data for the subsequent determination of the timing rules of oil theft events.
[0090] II. Implementation of Oilfield Security: Tailored to the operational needs of oilfields, enabling real-time, intelligent early warning of oil theft incidents. This invention is not simply action recognition, but rather combines multi-target tracking, oilfield business timing rules, and a multi-dimensional scoring mechanism to achieve event-level determination. Figure 4 The risk scoring and alarm notifications reflect this approach. Instead of triggering an alarm upon detecting a single suspected action, it accurately identifies oil theft events by associating actions with spatial targets (e.g., crouching action + valve / hose target), matching action sequences to oil theft logic (e.g., approach → operation → handling), and using multi-dimensional weighted scoring (confidence + duration + location plausibility). This significantly reduces false alarm rates. This design aligns with the actual needs of oilfield security, avoiding the problems of excessive invalid alarms and overwhelming security personnel associated with traditional monitoring systems.
[0091] The model architecture of this invention features a lightweight design (e.g., spatiotemporal segmentation, a lightweight Transformer backbone, and a one-dimensional convolutional detection head), balancing detection accuracy and inference speed. It can be deployed on oilfield edge servers, NVRs, and other devices to achieve real-time detection, real-time judgment, and real-time alarm for video streams. Figure 4The real-time monitoring and detection interface shows that the detection results are synchronized with the video stream. An alarm is triggered immediately after an oil theft incident is determined. Compared with the traditional video surveillance mode of collecting evidence after the fact without real-time warning, it can buy time for oilfield security to deal with the situation and can even deter oil thieves on the spot, effectively reducing the economic losses of the oilfield.
[0092] This invention, upon triggering an alarm, automatically stores metadata such as relevant video clips, motion detection results, target association information, and risk scores. Figure 4 The detection interface displays real-time recordings and annotations of relevant data. This data forms an immutable chain of evidence, providing not only complete evidence for subsequent law enforcement in oil theft incidents but also data support for oilfield security management—by analyzing the action characteristics, locations, and time patterns of historical oil theft incidents, the deployment of oilfield monitoring points and security strategies can be optimized.
[0093] III. Industry Value: Enhancing the level of intelligent security in oilfields, combining cost reduction and efficiency improvement with technology promotion value. Traditional oilfield security relies on manual patrols and video surveillance, which suffers from high labor costs, limited coverage, and susceptibility to missed inspections due to fatigue. This invention achieves 24 / 7 fully automated intelligent monitoring of key oilfield areas. Figure 4 The detection results show that a single system can simultaneously perform real-time detection on multiple monitoring points, replacing the work of multiple manual monitoring personnel, significantly reducing the manpower and operating costs of oilfield security, and the detection efficiency and accuracy are far higher than those of manual monitoring.
[0094] This invention deeply integrates artificial intelligence technologies such as computer vision and deep learning with oilfield security operations, achieving an upgrade from passive monitoring to proactive early warning, and from manual judgment to intelligent decision-making. Combined with... Figure 4 The method has proven effective in practice, enabling large-scale deployment in all high-risk areas for oil theft, such as oilfield storage tanks, valve clusters, and oil pipeline inlets and outlets. This forms a comprehensive, intelligent, and interconnected oilfield security system, significantly improving the intelligence and reliability of the oilfield security system and providing core security technology support for the construction of smart oilfields.
[0095] This invention's temporal action detection architecture based on Vision Transformer is not only applicable to oilfield theft detection. Its core design principles of spatiotemporal feature modeling, refined boundary detection, and business rule fusion can be transferred to other scenarios such as intelligent transportation, public safety, and industrial security (e.g., traffic violation detection, abnormal behavior warning in industrial parks, and detection of unauthorized operation of industrial equipment). Furthermore, the model structure supports flexible parameter adjustment and expansion, allowing for rapid adaptation to the behavioral characteristics of different scenarios. It possesses broad technical promotion and application value, and can drive the implementation of artificial intelligence video understanding technology in various security industries.
[0096] In conclusion,Figure 4 The actual detection results in oil fields directly verify the technical feasibility and implementation capability of this invention. By breaking through the traditional detection bottlenecks in technical performance, meeting the actual needs of oil field security in implementation, and achieving cost reduction, efficiency improvement and technology promotion in the industry, this invention not only provides an efficient, accurate and intelligent solution for detecting oil theft incidents in oil fields, but also promotes the intelligent upgrading of oil field security and even the entire industrial security field, and has significant practical application value and social and economic benefits.
[0097] In summary, this invention provides a method for detecting oil theft incidents in oilfields based on Vision Transformer action recognition. This method involves deploying fixed monitoring cameras in key operational areas of the oilfield and preprocessing and sampling the acquired raw video footage. The video sequence is then input into an improved ViT-TAD temporal action detection network for training. After training, the optimal temporal action detection model is selected to detect abnormal behaviors in the oilfield operational area. Combined with spatial target detection algorithms and judgment rules, oil theft incidents are identified, alarm information is generated, and relevant abnormal behavior fragments are stored for subsequent manual analysis and evidence collection.
[0098] In another embodiment of the present invention, an oilfield theft event detection system based on action recognition is provided, which can be used to implement the above-mentioned oilfield theft event detection method based on Vision Transformer action recognition. Specifically, the system includes: The data acquisition module is used to acquire and preprocess video sequences from the oilfield monitoring area; The detection result acquisition module is used to construct and use a temporal action detection model to process video sequences and output detection results including action category, start and end time, and confidence level. The temporal action detection model includes a module for spatiotemporal segmentation of the input video to construct a serialized feature representation, a feature extraction backbone network based on the Transformer structure for spatiotemporal modeling of the serialized features, and an action detection head based on boundary modeling. The judgment module is used to correlate and evaluate the behavior in the video sequence based on the detection results, combined with multi-target tracking, preset oilfield business time sequence rules and multi-dimensional scoring mechanism, to determine whether an oil theft event has occurred. The early warning module is used to generate alarm information and push it when an oil theft incident is detected, while storing relevant video clips and metadata.
[0099] The module division in this embodiment of the invention is illustrative and represents only one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional modules in the various embodiments of the invention can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0100] In another embodiment of the present invention, a computer device is provided, comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in the computer storage medium to achieve a corresponding method flow or corresponding function. The processor described in this embodiment of the present invention can be used in the operation of an oilfield theft event detection method based on VisionTransformer action recognition.
[0101] In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the oil theft event detection method based on Vision Transformer action recognition in the above embodiments.
[0102] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0103] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0104] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a processFigure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0105] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0106] 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 it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for detecting oil theft events in oil fields based on Vision Transformer action recognition, characterized in that, include: Acquire and preprocess video sequences from the oilfield monitoring area; A temporal action detection model is constructed and used to process video sequences, outputting detection results including action category, start and end time, and confidence level. The temporal action detection model includes a module that performs spatiotemporal segmentation of the input video to construct a serialized feature representation, a feature extraction backbone network that performs spatiotemporal modeling of the serialized features based on the Transformer structure, and an action detection head based on boundary modeling. Based on the detection results, combined with multi-target tracking, preset oilfield business time sequence rules and multi-dimensional scoring mechanisms, the behaviors in the video sequence are correlated and evaluated to determine whether an oil theft incident has occurred. When an oil theft incident is detected, an alarm message is generated and pushed out, while relevant video clips and metadata are stored.
2. The oilfield oil theft event detection method based on Vision Transformer action recognition according to claim 1, characterized in that, The video sequences collected and preprocessed from the oilfield monitoring area include: In oil fields, fixed surveillance cameras are deployed at monitoring angles that can cover the working face and observe the interaction between personnel and pipelines; the cameras are synchronized in time; infrared or supplementary lighting devices can be equipped for nighttime or low-light areas. The video data captured by the camera undergoes basic processing such as noise reduction, gamma correction, and brightness or contrast normalization.
3. The method for detecting oil theft events in oilfields based on Vision Transformer action recognition according to claim 2, characterized in that, An oilfield behavior sample library was established for training the action detection model. Action categories and temporal boundaries were defined for the video data, and the dataset was partitioned. The collected video data was categorized into two types: normal behavior samples and oil theft-related behavior samples. Normal behavior samples include routine inspections, permitted operations, and activities where personnel do not touch the equipment. Oil theft-related behavior samples include behaviors such as personnel crouching or bending over to approach valves, connecting or disconnecting oil hoses, carrying oil drums, and carrying bags or similar items quickly. The behavioral events in the video are labeled in the form of time intervals. Each action is marked with a start time and an end time. When there are multiple action segments in the same video, they are labeled separately. After the labeling is completed, the data is divided according to the scene and the acquisition time to ensure that the video captured by the same camera is used only for either the training set or the test set.
4. The oilfield oil theft event detection method based on Vision Transformer action recognition according to claim 1, characterized in that, The constructed and used temporal action detection model processes the video sequence, outputting detection results including action category, start and end time, and confidence level, including: The input video is spatiotemporally segmented to construct a serialized feature representation suitable for the Transformer architecture; let the input video representation be: ,in, Indicates the total number of frames in the video. and These represent the spatial resolution height and width of the video frame, respectively. Represents the number of image channels; divides the input video along the time dimension into If there are several consecutive and non-overlapping time segments (snippets), then the number of frames contained in each time segment is expressed as: Get the first A time segment: Each time segment is divided into three-dimensional spatiotemporal segments; in the time dimension, a length of [missing information] is used. The time window, in the spatial dimension, adopts a size of The video is segmented using spatial windows to form three-dimensional spatiotemporal tubelets; the number of tubelets in the time dimension, spatial height dimension, and spatial width dimension are as follows: The total number of spacetime blocks generated by each time segment is: Each spacetime block is represented as: Then, each spatiotemporal block is flattened into a one-dimensional vector and projected onto a fixed-dimensional feature space through a linear mapping to obtain the corresponding embedded features; The obtained segment-level sequence features are input into a Transformer-based video feature extraction backbone network for spatiotemporal feature modeling. This backbone network consists of multiple Transformer Blocks stacked sequentially, each Block containing two main modules: a multi-head self-attention mechanism and a feedforward network (MLP). Let the input feature sequence be: ,in For the number of patches, The feature dimension is: first, the input features are normalized through layer normalization, and then the correlation between each patch in the sequence is calculated through a multi-head self-attention mechanism. After obtaining the attention output, the final attention features are obtained through linear projection: The features are then fed into a feedforward network MLP for further nonlinear mapping: Global attention residual branches are introduced in some Transformer Blocks. Specifically, the global attention mechanism is enabled for each Block by preset control parameters. When the corresponding position is true, only the standard Transformer attention structure is used for local feature modeling. When the corresponding position is attn_global_residual, after the local attention calculation is completed, the feature sequence is rearranged to restore its spatiotemporal structure. Then, global self-attention is calculated for the feature sequence and fused with the original feature through residual connection. The spatial dimension is compressed, transforming two-dimensional spatial features into a single spatial location to obtain a one-dimensional temporal feature representation. This compressed one-dimensional temporal feature... Input the action detection head to perform action category recognition and action time boundary localization; in the temporal action detection task, the action start boundary, end boundary and center position are jointly modeled through multiple prediction branches; First, the temporal features are further encoded using convolutional layers. Let the encoded features be represented as follows: in, This represents a one-dimensional convolution operation. The encoded temporal features are then input into multiple prediction branches for action boundary modeling. First, the response values at each time position in a pre-set Bin set of size B are calculated using the initial boundary prediction branch as the action start boundary. The calculation process is as follows: in, This represents a one-dimensional convolutional layer used to predict action start boundaries. A one-dimensional convolutional kernel maps features to single-channel responses, compresses them into a one-dimensional array, and yields the response value at each time point as the action start boundary. Similarly, the response score for each time position is predicted as the action end boundary using the end boundary prediction branch. The calculation process is as follows: in This represents a one-dimensional convolutional layer used to predict the end boundary of an action. This represents the response value at each time point in the time series as the action end boundary; furthermore, the action center position is modeled through a center position prediction branch, and its time offset is predicted. The calculation process is as follows: in, This represents a one-dimensional convolutional layer used to predict the offset of the action center position, and its output is... This represents the center offset corresponding to each time position in the Bin set; Based on the generated start and end response values and center offset, candidate action intervals are further generated, and the final action detection result prediction is completed; let the i-th time position in the time series be... The boundary response value at this location is added to the center offset, and then normalized using Softmax to obtain the relative probability of each Bin as the starting boundary. This is the key transformation from feature response to probability distribution. The specific calculation formula is as follows: The offset is calculated using the expected value of the probability distribution. The index and probability of each Bin are weighted and summed to obtain a unique average offset value, which gives the action interval value. After model training is complete, the optimal detection model is used to infer the input video. First, the video is spatiotemporally segmented and features extracted in the same manner as during training, obtaining candidate action intervals in the time series. All candidate action intervals are ranked according to confidence, and a non-maximum suppression (NMS) strategy is used to remove redundant detection results with high overlap, thus retaining the optimal action interval prediction. The filtered detection results are represented as follows: in, Indicates the start time of the action. Indicates the end time of the action. This represents the confidence level of the action detection. This indicates the action category label.
5. The method for detecting oil theft events in oilfields based on Vision Transformer action recognition according to claim 4, characterized in that, The calculation process for obtaining the corresponding embedded features is as follows: in Indicates vectorization operation, For trainable embedding weight matrix, For bias parameters, This represents the feature representation of the k-th spatiotemporal block. To embed the feature dimension; finally, the embedding vectors of all spatiotemporal blocks are concatenated in spatiotemporal order to form the serialized feature representation of the video segment; The correlation between patches in a sequence is calculated using a multi-head self-attention mechanism; the calculation process is as follows: in , and For a trainable projection matrix, This represents the dimension of the attention head.
6. The method for detecting oil theft events in oilfields based on Vision Transformer action recognition according to claim 1, characterized in that, Based on the detection results, and combined with multi-target tracking, preset oilfield business timing rules, and a multi-dimensional scoring mechanism, the behavior in the video sequence is correlated and evaluated to determine whether an oil theft event has occurred, including: Based on the action detection results, the time periods in the input video are initially screened to extract candidate segments containing potential oil theft behavior; then, a spatial target detection mechanism is introduced into the frame sequence corresponding to the candidate segments to realize the association between actions and spatial targets. Based on the business logic of the oilfield scenario, specific time-series rules are constructed to compare the continuous action detection results with preset rules. When the detection sequence matches the logical pattern of oil theft behavior, a risk marker is triggered. To address the potential for noise or false alarms in single detection methods, a multi-dimensional scoring mechanism was designed to weight the detection results based on category confidence, duration, and spatial location rationality, thereby generating a comprehensive event risk score. When the risk score exceeds a threshold, it is determined to be an oil theft event.
7. The method for detecting oil theft events in oilfields based on Vision Transformer action recognition according to claim 1, characterized in that, When an oil theft incident is detected, an alarm message is generated and pushed out, and relevant video clips and metadata are stored, including: For suspected oil theft incidents detected, alarm information is generated and pushed in real time through local audio-visual devices, remote monitoring platforms, or mobile terminals; at the same time, the detected fragments and related metadata are stored locally or uploaded to the cloud for subsequent analysis and evidence collection.
8. An oilfield oil theft detection system based on action recognition, characterized in that, include: The data acquisition module is used to acquire and preprocess video sequences from the oilfield monitoring area; The detection result acquisition module is used to construct and use a temporal action detection model to process video sequences and output detection results including action category, start and end time, and confidence level. The temporal action detection model includes a module for spatiotemporal segmentation of the input video to construct a serialized feature representation, a feature extraction backbone network based on the Transformer structure for spatiotemporal modeling of the serialized features, and an action detection head based on boundary modeling. The judgment module is used to correlate and evaluate the behavior in the video sequence based on the detection results, combined with multi-target tracking, preset oilfield business time sequence rules and multi-dimensional scoring mechanism, to determine whether an oil theft event has occurred. The early warning module is used to generate alarm information and push it when an oil theft incident is detected, while storing relevant video clips and metadata.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the oilfield oil theft event detection method based on Vision Transformer action recognition as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the oilfield oil theft event detection method based on VisionTransformer action recognition as described in any one of claims 1 to 7.