Oil field site violation behavior identification method based on TimeSform network
The oilfield on-site violation identification method based on TimeSformer network solves the problems of low efficiency and high cost of traditional monitoring, achieves rapid and accurate identification and early warning of oil production work sites, reduces costs and improves safety.
Patent Information
- Application Number
- CN202410834896.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-10-29
AI Technical Summary
At oil production sites, traditional all-weather monitoring is inefficient and consumes a lot of manpower and material resources, making it difficult to effectively identify and warn potential safety hazards.
An oil field on-site violation identification method based on the TimeSformer network is adopted. By producing data sets, building models, training and optimizing the recognition model, the video stream is analyzed in real time and violations are judged, thereby reducing manpower and material costs.
It achieves accurate and rapid identification of violations on oil field sites, reduces labor and material costs, improves production safety and management efficiency, and does not require additional hardware equipment.
Smart Images

Figure CN118865231A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of computer vision, and in particular relates to an oil field on-site illegal behavior recognition method based on a TimeSformer network. Background Art
[0002] In the oil field, the operating environment is complex and personnel face high risks. Traditional all-weather monitoring requires a lot of manpower and material resources and is inefficient. Therefore, it is of great significance to use automated intelligent technology to conduct intelligent analysis of potential safety hazards at the operation site.
[0003] In recent years, with the advancement of computer hardware, its data processing capabilities have been significantly improved. Artificial intelligence technologies such as machine learning and deep learning have become increasingly common. At the same time, with the full deployment of software facilities such as neural networks and cameras at oil production sites, it has become possible to use computers to automatically process real-time monitoring videos on a large scale, and intelligent detection at the operation site has also been achieved. Deep neural networks are cutting-edge technologies in the field of machine learning, which can automatically learn deep feature information. Therefore, using deep learning models to process monitoring videos at oil production sites in real time and returning the results in a visual way can improve the efficiency of oil production site management, significantly reduce manpower and material costs, and optimize the quality of production management at oil production sites. Summary of the invention
[0004] The purpose of the present invention is to use a behavior recognition model to realize automatic recognition and early warning of illegal behaviors on the oil field site, and provide an oil field illegal behavior recognition method based on the TimeSformer network, which automatically extracts features, analyzes and warns, and reduces manpower and material costs.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] (1) Produce a dataset for identifying violations at oilfield sites;
[0007] (2) Build an oilfield violation behavior recognition model based on the TimeSformer network under the PyTorch framework;
[0008] (3) Select training samples to train and optimize the oilfield violation behavior recognition model;
[0009] (4) Segmenting the video stream to be detected and inputting it into the trained oilfield violation behavior recognition detection model to obtain oilfield violation behavior recognition detection data;
[0010] (5) Determine the violation behavior based on the obtained detection data;
[0011] (6) The real-time analysis results of violations at the oil field site are stored and visualized for supervisory personnel to review and handle.
[0012] A further improvement of the present invention is that the specific implementation steps of step (1) are:
[0013] (101) Segmenting the video stream data of the oil field operation site according to the start and end time of each behavior;
[0014] (102) Using via3, we calibrate various behaviors in the segmented data, mainly including six types of illegal behaviors: smoking in the production area, crossing the guardrail, going up and down the stairs without holding the railing, stepping on the gas cylinder, stepping on the clamp frame, and using a mobile phone in the production area, and obtain the video and the corresponding label file;
[0015] (103) Each type of behavioral data is divided into training set and test set in a ratio of 8:2.
[0016] A further improvement of the present invention is that the specific implementation steps of step (2) are:
[0017] (201) A coding network is used to process the video clips by frames, divide each frame into S patches of the same size, and then encode the patch sequence into a token sequence according to a certain time rhythm;
[0018] (202) Feature extraction network, which uses the separated spatiotemporal attention mechanism in the TimeSformer network to realize the information interaction between tokens, and then extract the spatiotemporal information features of the entire video;
[0019] (203) Classification network, classifies the video according to the spatiotemporal information obtained by the extraction network.
[0020] A further improvement of the present invention is that the specific implementation steps of step (3) include:
[0021] (301) Setting network training parameters;
[0022] (302) The oilfield on-site violation behavior recognition data set is used to train an oilfield on-site violation behavior recognition model based on the TimeSformer network.
[0023] A further improvement of the present invention is that in step 301), the number of detected categories is modified to the number of violations on the oil field site, and the number of categories is set to 8; the maximum number of iterations is set to 10000; the learning rate is initialized to 0.01, reduced to 0.001 in the 8th round, and reduced to 0.0001 in the 11th round; the momentum is set to 0.9, and the weight decay is 0.0001; the pre-trained model uses ImageNet-1K.pt.
[0024] A further improvement of the present invention lies in that the specific implementation steps of step (5) are as follows:
[0025] (501) Set a detection threshold T;
[0026] (502) According to the detection confidence level S obtained in claim 4, when S > T or S = T, it is determined that the detection of illegal behaviors at the oilfield site is accurate; on the contrary, when S < T, it is determined that the detection is inaccurate.
[0027] The present invention has at least the following beneficial technical effects:
[0028] First, in terms of time efficiency, the present invention uses a computer and cameras at the oil production operation site to determine in real time whether there are illegal behaviors of workers at the oilfield site. Compared with the process of manually checking the cameras and then giving feedback after confirmation, it is more accurate and fast, thus reducing a large amount of human and material costs.
[0029] Second, in terms of production efficiency, the present invention not only reduces the time cost, but also enables the supervisors to conveniently check the safety conditions of workers at each oil production site in the monitoring room. Through the alarm column for illegal behaviors at the oilfield site, the supervisors can conveniently understand the production conditions of workers at the operation site and make a quick response according to the actual situation, improving the safety of production operations.
[0030] In terms of application cost, the present invention does not require additional installation of hardware devices such as sensors, reducing the hardware cost. By using computer vision and deep learning technologies, only a server needs to be added at the server side and the corresponding software needs to be installed to conveniently and quickly realize the intelligent detection of the oil production operation site.
[0031] In addition, the present invention can record the code of conduct that workers at the oilfield site are prone to violate and the pictures of workers' illegal behaviors, including recording in the form of text tables and multimedia forms such as images and videos. In this way, richer and more reliable archival materials can be obtained, which is helpful for the subsequent search and filing work of supervisors.
[0032] The present invention also has other aspects and advantages, some of which will be given in the following description and will be further manifested in practice. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0034] Figure 1The present invention is a flowchart of a method for identifying illegal behaviors on the oil field site based on the TimeSformer network according to an embodiment of the present invention.
[0035] Figure 2 The present invention is a schematic diagram of a model structure in a method for identifying oilfield on-site illegal behaviors based on a TimeSformer network according to an embodiment of the present invention.
[0036] Figure 3 The present invention is a schematic diagram of a feature extraction network structure in an oilfield on-site violation behavior identification method based on a TimeSformer network according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] To facilitate understanding of the present invention, the present invention is further explained below with reference to specific embodiments in conjunction with the accompanying drawings, and the specific embodiments do not constitute a limitation on the embodiments of the present invention.
[0038] Those skilled in the art should understand that the drawings are merely schematic diagrams of embodiments, and the components in the drawings are not necessarily necessary for implementing the present invention.
[0039] like Figure 1 As shown, the present invention provides a method for identifying oil field on-site illegal behaviors based on a TimeSformer network, comprising the following steps:
[0040] (1) Create a dataset for identifying illegal behaviors on the oil field site. First, segment the video data stream according to the start and end time of each behavior. Then, use via3 to calibrate each type of behavior in the segmented data to obtain the video and the corresponding label file. Finally, divide the data of each type of behavior into a training set and a test set in a ratio of 8:2.
[0041] (2) Build an oilfield on-site violation behavior identification model based on the TimeSformer network under the PyTorch framework.
[0042] (3) Select training samples to train and optimize the oilfield on-site violation behavior recognition model. The specific steps are as follows:
[0043] (a) Set the network training parameters;
[0044] (b) Use the oilfield on-site violation behavior recognition dataset to train the oilfield on-site violation behavior recognition model.
[0045] (4) The video stream to be detected is input into the trained behavior recognition model to obtain the oil field on-site illegal behavior detection data.
[0046] (5) Determine the violation behavior based on the obtained detection data. The specific steps include:
[0047] (a) Set the detection threshold T;
[0048] (b) According to the detection confidence S in the detection data, when S > T or S = T, it is determined that the detection of illegal behaviors at the oilfield site is accurate; on the contrary, when S < T, it is determined that the detection is inaccurate.
[0049] (6) Store and visualize the real-time analysis results of illegal behaviors at the oilfield site for supervisors to view and process.
[0050] Embodiment 1
[0051] Figure 1 The flowchart of this embodiment is given. In this embodiment, a test set selects a video data segment that simultaneously contains illegal behaviors and standard behaviors. An oilfield site illegal behavior recognition method based on the TimeSformer network for this video stream consists of the following steps:
[0052] (1) Make an oilfield illegal behavior recognition data set; collect oilfield site video data, segment it according to the start time and end time of various behaviors to obtain video data, randomly select 8000 video segments from all video data as the original data set, and then use via3 to calibrate various behaviors in the segmented data. The illegal behaviors include smoking in the production area, crossing the guardrail, not holding the handrail when going up and down the stairs, stepping on the gas cylinder, stepping on the tong frame, and using a mobile phone in the production area, to obtain the video and the corresponding label file. Finally, divide the various behavior data into a training set and a test set according to a ratio of 8:2.
[0053] (2) Build an oilfield site illegal behavior recognition model based on the TimeSformer network under the PyTorch framework;
[0054] (3) Select training samples to train and optimize the oilfield site illegal behavior recognition model. The specific steps are as follows:
[0055] (a) Set the maximum number of network iterations to 10000; initialize the learning rate to 0.01, reduce it to 0.001 in the 8th round, and reduce it to 0.0001 in the 11th round; set the momentum to 0.9 and the weight decay to 0.0001; use the pre-trained model ImageNet-1K.pt;
[0056] (b) Modify the number of detected categories to the number of illegal behaviors at the oilfield site, and set the number of categories to 6.
[0057] (4) Input the video stream to be detected into the trained oilfield site illegal behavior recognition model to obtain the oilfield site illegal behavior recognition data;
[0058] (5) Make a judgment on illegal behaviors according to the obtained detection data. The specific steps are as follows:
[0059] (a) Set the detection threshold T;
[0060] (b) According to the detection confidence S in the detection data, when S > T or S = T, it is determined that the detection of illegal behaviors at the oilfield site is accurate; on the contrary, when S < T, it is determined that the detection is inaccurate.
[0061] (6) Store and visualize the real-time analysis results of illegal behaviors at the oilfield site for supervisors to view and process.
[0062] Embodiment 2
[0063] Figure 2 This is a schematic diagram of the model structure in the method for identifying illegal behaviors at the oilfield site based on the TimeSformer network provided by the present invention, which is introduced in detail as follows:
[0064] (1) The input video data first passes through an encoding network, and the encoding network performs a linear mapping on the input video in both the time and space dimensions, mapping it into a Token sequence.
[0065] (2) The Token sequence then passes through N layers of feature extraction networks. The structure of the feature extraction network is as Figure 3 shown and mainly consists of three structures:
[0066] (a) TimeAttention, which is used to extract temporal interaction information;
[0067] (b) SpaceAttention, which is used to extract spatial interaction information;
[0068] (c) MLP, which is used to mix information between different spatio-temporal domains.
[0069] Through these three MLP structures, we can extract the spatio-temporal information features contained in the video.
[0070] (3) The extracted spatio-temporal information features are used by the classification network to calculate the category of the behavior and obtain the detection confidence at the same time.
[0071] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented 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.
[0072] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0073] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0074] These computer program instructions can also be loaded onto a computer or other programmable data processing device, and a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0075] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for identifying illegal behaviors on the oil field site based on TimeSformer network, characterized in that: Including: (1) Making an oilfield on-site violation behavior recognition dataset: First, segment the video data stream to obtain video data, and then use via3 to calibrate various behaviors in the segmented data to obtain the video and the corresponding label file. Randomly divide the dataset into a training set and a test set according to a fixed ratio. (2) Constructing an oilfield on-site violation behavior recognition model based on the TimeSformer network under the PyTorch framework. (3) Selecting training samples to train and optimize the oilfield violation behavior recognition detection model. (4) Segment the video stream to be detected and input it into the trained oilfield violation behavior recognition detection model to obtain oilfield violation behavior recognition detection data. (5) Storing the detected oilfield violation behavior recognition data. (6) Generating judgment information according to the stored detection data.
2. According to claim 1, a method for identifying oil field on-site violations based on TimeSformer network is characterized in that: The making of the oilfield on-site violation behavior recognition dataset includes: Segment the video stream data of the oilfield operation site according to the start and end times of various behaviors, and then use via3 to calibrate various behaviors in the segmented data, mainly including 6 types of violation behaviors: smoking in the production area, crossing the guardrail, not holding the handrail when going up and down the stairs, stepping on the gas cylinder, stepping on the clamp frame, and using a mobile phone in the production area. Randomly divide various video data into a training set and a test set according to 8:
2.
3. The method for identifying oilfield on-site illegal behaviors based on TimeSformer network according to claim 2 is characterized in that: The oilfield on-site violation behavior recognition model based on the TimeSformer network includes: (a) An encoding network for frame-by-frame processing of video segments, dividing each frame image into N patch blocks of the same size, and then mapping the patch block sequence into a token sequence at a certain time interval. (b) A feature extraction network that uses the spatio-temporal attention mechanism in the TimeSformer network to realize information interaction between tokens, and then extracts the spatio-temporal information of the entire video. (c) A classification network that classifies the video according to the spatio-temporal information obtained by the extraction network.
4. The method for identifying oilfield on-site illegal behaviors based on TimeSformer network according to claim 3 is characterized in that: The selecting training samples to train and optimize the oilfield on-site violation behavior recognition model includes: (a) Setting the training parameters of the network. (b) Using the oilfield on-site violation behavior recognition dataset to train the oilfield on-site violation behavior recognition model based on the TimeSformer network.
5. The method for identifying oilfield on-site illegal behaviors based on TimeSformer network according to claim 2 is characterized in that: In step 401), set the number of detected classification categories to the number of oilfield on-site violation behaviors; set the maximum number of iterations to 10,000; initialize the learning rate to 0.01, reduce it to 0.001 in the 8th round, and reduce it to 0.0001 in the 11th round; set the momentum to 0.9 and the weight decay to 0.0001; use the pre-trained model ImageNet-1K.pt.
6. The method for identifying oilfield on-site illegal behaviors based on TimeSformer network according to claim 4 is characterized in that: The oilfield violation behavior data is the behavior category of each video segment.
7. The method for identifying oilfield on-site illegal behaviors based on TimeSformer network according to claim 6 is characterized in that: The specific implementation steps of the oilfield on-site violation behavior determination are as follows: (a) Setting the detection threshold T. (b) According to the detection confidence S obtained in claim 5, when S>T or S=T, it is determined that the oilfield on-site violation behavior detection is accurate; on the contrary, when S<T, it is determined that the detection is inaccurate. (c) Store and visualize the real-time analysis results of the oilfield on-site violation behavior for the supervision personnel to view and process.
Citation Information
Cited By
Wind speed identification method, device, equipment and medium
CN120259370A
