CN117409331B - Method and device for detecting hidden danger of surrounding environment of oil and gas pipeline and storage medium - Google Patents

Method and device for detecting hidden danger of surrounding environment of oil and gas pipeline and storage medium Download PDF

Info

Publication number
CN117409331B
CN117409331B CN202311726119.2A CN202311726119A CN117409331B CN 117409331 B CN117409331 B CN 117409331B CN 202311726119 A CN202311726119 A CN 202311726119A CN 117409331 B CN117409331 B CN 117409331B
Authority
CN
China
Prior art keywords
module
oil
gas pipeline
layer
feature
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311726119.2A
Other languages
Chinese (zh)
Other versions
CN117409331A (en
Inventor
宗涛
刘云川
贺亮
胡悦
周伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Hongbao Technology Co ltd
Sichuan Hongbaorunye Engineering Technology Co ltd
Original Assignee
Chongqing Hongbao Technology Co ltd
Sichuan Hongbaorunye Engineering Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Hongbao Technology Co ltd, Sichuan Hongbaorunye Engineering Technology Co ltd filed Critical Chongqing Hongbao Technology Co ltd
Priority to CN202311726119.2A priority Critical patent/CN117409331B/en
Publication of CN117409331A publication Critical patent/CN117409331A/en
Application granted granted Critical
Publication of CN117409331B publication Critical patent/CN117409331B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/42Global feature extraction by analysis of the whole pattern, e.g. using frequency domain transformations or autocorrelation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/52Scale-space analysis, e.g. wavelet analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/80Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
    • G06V10/806Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Molecular Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Image Analysis (AREA)

Abstract

The application discloses a method, a device and a storage medium for detecting hidden danger of surrounding environment of an oil and gas pipeline, wherein the method comprises the following steps: s100: collecting an input image of the surrounding environment of an oil and gas pipeline; s200: preprocessing the acquired input image; s300: constructing a hidden danger detection model of the surrounding environment of the oil and gas pipeline and training; s400: and inputting the preprocessed oil and gas pipeline surrounding environment input image into a trained model to detect whether hidden danger exists in the oil and gas pipeline surrounding environment. The method and the device can realize the rapid detection of the hidden danger of the surrounding environment of the oil and gas pipeline, greatly shorten the detection time, simultaneously realize the high-precision detection and identification of the hidden danger of the surrounding environment of the oil and gas pipeline, and reduce the possibility of missed detection and false detection.

Description

Method and device for detecting hidden danger of surrounding environment of oil and gas pipeline and storage medium
Technical Field
The disclosure belongs to the technical field of image processing, and particularly relates to a method and a device for detecting hidden danger of surrounding environment of an oil and gas pipeline and a storage medium.
Background
Along with the rapid increase of the national energy demand, the construction pace of the oil and gas pipeline is accelerated, and the construction scale is increased. The oil gas pipeline has the advantages of large transportation capacity, low cost, continuity and the like, and is a main component of the whole oil gas conveying system. However, with the continuous extension of the mileage of the long-distance pipeline, accidents thereof also occur continuously. In order to ensure the safety and stability of the oil and gas conveying system, hidden trouble investigation is required to be carried out on the surrounding environment of the oil and gas pipeline. The hidden trouble situation is checked manually on site, and the detailed check of the risk focus area and the timing spot check of other areas can be generally only realized. This still consumes a lot of manpower and time, and the field staff is also at risk for safety, with significant limitations.
Disclosure of Invention
Aiming at the defects in the prior art, the purpose of the present disclosure is to provide a method for detecting hidden danger of the surrounding environment of an oil and gas pipeline, which can realize rapid detection of hidden danger of the surrounding environment of the oil and gas pipeline and improve detection precision at the same time.
In order to achieve the above object, the present disclosure provides the following technical solutions:
the method for detecting the hidden danger of the surrounding environment of the oil and gas pipeline is characterized by comprising the following steps of:
s100: collecting an input image of the surrounding environment of an oil and gas pipeline;
s200: preprocessing the acquired input image;
s300: constructing a hidden danger detection model of the surrounding environment of the oil and gas pipeline and training;
s400: and inputting the preprocessed oil and gas pipeline surrounding environment input image into a trained model to detect whether hidden danger exists in the oil and gas pipeline surrounding environment.
Preferably, in step S200, preprocessing the acquired input image includes the steps of: each pixel value of the image is divided by 255 and normalized to within the range of 0, 1.
Preferably, in step S300, the model for detecting hidden danger in surrounding environment of the oil and gas pipeline is trained by the following steps:
s301: acquiring an image dataset of hidden danger of the surrounding environment of an oil and gas pipeline, preprocessing the dataset, and dividing the dataset into a training set and a testing set;
s302: setting training parameters, training the model by using a training set, and passing the model training when the training reaches a preset round;
s303: testing the trained model by using a test set, wherein in the test process, the segmentation accuracy MIOU is used as an evaluation index, and when the MIOU reaches 0.8, the model test is passed; otherwise, training parameters are adjusted or the data set samples are expanded to retrain the model until the model test passes.
The present disclosure also provides a detection device for hidden danger in surrounding environment of oil and gas pipeline, the device includes:
the acquisition module is used for acquiring an input image of the surrounding environment of the oil and gas pipeline;
the preprocessing module is used for preprocessing the acquired input image;
the model construction and training module is used for constructing a hidden danger detection model of the surrounding environment of the oil and gas pipeline and training; the oil and gas pipeline surrounding environment hidden danger detection model comprises a main network, wherein the main network adopts a dual-path design consisting of a global path and a local path; the model also comprises a feature fusion module, wherein the feature fusion module is introduced with a feature up-sampling module, and the feature up-sampling module can adaptively reorganize features according to image content so as to enlarge a feature receptive field;
the detection module is used for inputting the preprocessed oil and gas pipeline surrounding environment input image into the trained model so as to detect whether hidden danger exists in the oil and gas pipeline surrounding environment.
The present disclosure also provides a computer storage medium storing computer-executable instructions for performing a method as described in any one of the preceding claims.
The present disclosure also provides an electronic device, including:
a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein,
the processor, when executing the program, implements a method as described in any of the preceding.
Compared with the prior art, the beneficial effects that this disclosure brought are:
1. the method and the device can realize the rapid detection of the hidden trouble of the surrounding environment of the oil and gas pipeline, greatly shorten the detection time and meet the real-time performance of detection;
2. the method and the device can realize high-precision detection and identification of hidden danger of surrounding environment of the oil and gas pipeline, reduce the possibility of missed detection and false detection, and improve the accuracy and reliability of detection;
3. the method can be used on an automatic inspection unmanned aerial vehicle, reduces labor cost, reduces risk of personnel in dangerous environments, and improves working safety.
Drawings
FIG. 1 is a schematic flow chart of a method for detecting environmental hidden trouble around an oil and gas pipeline according to an embodiment of the present disclosure;
FIG. 2 is a schematic structural diagram of a model for detecting environmental potential hazards around an oil and gas pipeline according to another embodiment of the present disclosure;
FIG. 3 is a schematic view of the structure of the initial module stem in the model shown in FIG. 2;
FIG. 4 is a schematic structural diagram of a feature fusion module UAFM in the model shown in FIG. 2;
FIG. 5 is a schematic structural diagram of a feature upsampling module CARAFE in the model shown in FIG. 2;
fig. 6 is a schematic diagram showing comparison of detection effects according to another embodiment of the present disclosure.
Detailed Description
Specific embodiments of the present disclosure will be described in detail below with reference to fig. 1 to 6. While specific embodiments of the disclosure are shown in the drawings, it should be understood that the disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
It should be noted that certain terms are used throughout the description and claims to refer to particular components. Those of skill in the art will understand that a person may refer to the same component by different names. The specification and claims do not identify differences in terms of components, but rather differences in terms of the functionality of the components. As used throughout the specification and claims, the terms "include" and "comprise" are used in an open-ended fashion, and thus should be interpreted to mean "include, but not limited to. The description hereinafter sets forth the preferred embodiments for carrying out the present disclosure, but is not intended to limit the scope of the disclosure in general, as the description proceeds. The scope of the present disclosure is defined by the appended claims.
For the purposes of promoting an understanding of the embodiments of the disclosure, reference will now be made to the embodiments illustrated in the drawings and specific examples, without the intention of being limiting the embodiments of the disclosure.
In one embodiment, as shown in fig. 1, the disclosure provides a method for detecting hidden danger of surrounding environment of an oil and gas pipeline, which includes:
s100: collecting an input image of the surrounding environment of an oil and gas pipeline;
s200: preprocessing the acquired input image;
s300: constructing a hidden danger detection model of the surrounding environment of the oil and gas pipeline and training;
s400: and inputting the preprocessed surrounding environment of the oil and gas pipeline into a trained model to detect whether landslide, heavy machinery, houses and other hidden troubles exist in the surrounding environment of the oil and gas pipeline.
In another embodiment, in step S200, preprocessing the acquired input image includes the steps of: each pixel value of the image is divided by 255 and normalized to within the range of 0, 1. The preprocessing of the input image is helpful to reduce the scale difference of the data, so that the training process is more stable.
In another embodiment, the detection model of the hidden danger of the surrounding environment of the oil and gas pipeline includes a backbone network, a feature fusion module (UAFM) and an output module (seg Head), and the following three modules are respectively described:
1. backbone network
As shown in fig. 2, the backbone network adopts a dual path design, and includes a global path and a local path, where the global path includes five parts, and the first part includes an initial module (step), and as shown in fig. 3, the module includes two convolution layers with a size of 3×3 and a step size of 2, each convolution layer is connected to a batch of normalization layers BN, and a ReLU activation function is further connected to a next layer of each convolution layer.
The second part, the third part and the fourth part have the same structure and comprise a local feature extraction module and a downsampling module (subsamples), wherein the local feature extraction module comprises a 1 multiplied by 1 convolution layer Conv, a loss function GeLU, a 3 multiplied by 3 depth separable convolution layer DWConv, a loss function GeLU, a 3 multiplied by 3 convolution layer Conv and an addition function ADD which are sequentially connected, the 1 multiplied by 1 convolution layer Conv, the 3 multiplied by 3 depth separable convolution layer DWConv and the 3 multiplied by 3 convolution layer Conv are connected with a batch normalization layer (after a BN layer is applied to the convolution layer, the advantages of 1 accelerating model convergence, 2 improving model generalization capability, 3 reducing model dependence on initial parameters, 4 relieving model gradient disappearance problems; the local feature extraction module is used by adopting common convolution and depth separable convolution, so that not only can the global information and spatial relation of input data be captured and the interactive features among different channels be captured, but also the parameter quantity is reduced, the calculation efficiency is improved, and therefore, better generalization capability is provided and the fitting risk is reduced. The downsampling module uses a common convolution of 3 x 3 with a step size of 2. In addition, the second, third and fourth portions have the same structure, because: modular design to save time and cost of model design and training; secondly, because: 3 parts with the same structure are adopted to extract global information, and the receptive field can be enlarged by downsampling for multiple times, so that the global path can better extract global structure and context information, and the performance and effect of the model are improved. Finally, the four parts sequentially reduce the input feature images to 1/4, 1/8, 1/16 and 1/32 of the original size, and the small feature images can accelerate the processing speed of the follow-up global feature extraction module.
The fifth part comprises a global feature extraction module which adopts a multi-head attention mechanism, and specifically comprises the following steps: the output of the 1×1 convolutional layer Conv (likewise, the convolutional layer is connected with a batch normalization layer BN), the output of the 1×1 convolutional layer Conv is respectively input into a Query vector (Query), a Key vector (Key) and a numerical vector (Value) in the attention mechanism, and the Query vector Q and the Key vector K are calculated by calculating the Query vector Q and the Key vector K T Position coding allows the model to better capture features at different locations in the image and improve the model's understanding of the structure of the image by converting the position information of the image into a set of fixed-size vectors and then adding these vectors to the feature vectors of the input image, and adding local attention head (for introducing a local attention) at both ends of the softmax function to enhance the model's modeling ability for local featuresThe ax operation introduces linear mapping between the attention of multiple heads before and after operation, so as to increase information exchange among multiple attention mechanisms. A walking head typically consisting of a convolutional layer and a transform coding layer) gets attention weights; in order to better capture local features in an image, the present disclosure introduces local attention mechanism Locality, limits the range of attention weights through the local attention mechanism Locality so that a model focuses more on the local relationships between image blocks, thereby improving the modeling capability of the local features of the image), multiplies the obtained attention weights, obtains a final feature representation through a 1×1 convolution layer Conv and a batch normalization layer BN, and obtains a final global feature map through a full connection module composed of a normalization layer LN (LN is an abbreviation of Layer Normalization, different from a BN layer, in which a learnable scaling factor and a shifting factor are introduced for Linear transformation of the normalized features, in which the LN layer performs normalization operation only without introducing additional learnable parameters) and 2 full connection layers Linear and an activation function GeLU. The global feature extraction module is creatively introduced, and the following technical effects can be achieved: 1. better long-range dependency modeling: the traditional convolutional neural network may have limitation when processing long-distance dependency, and the global feature extraction module can better capture the long-distance dependency through a concentration mechanism, so that the performance of the model when processing long-distance dependency tasks is improved. 2. Global information integration: the traditional convolutional neural network may need larger receptive fields or multi-layer network stacks when processing global information integration, and the global feature extraction module can better realize the integration and interaction of the global information through an attention mechanism, so that the grasping capability of the model on the global information is improved. 3. Multi-scale feature fusion: the self-attention mechanism of the global feature extraction module can realize global feature interaction, can help the convolutional neural network to better realize the fusion of multi-scale features, and improves the processing capacity of the model on multi-scale information.
The local path comprises a first branch module, a second branch module and a third branch module which are sequentially connected and have the same structure, and each branch module comprises two 3×3 convolution layers Conv (wherein the step size of the second 3×3 convolution layer is 2, and a batch of normalized BN layers are connected after the step size of the second 3×3 convolution layer) and a ReLU activation function. The local path formed by the three branching modules is provided with a small-step space path, and the space position information can be reserved to generate a high-resolution characteristic diagram. In addition, the three branch modules adopt small convolution with small step length, and the local path is more focused on local features due to the small receptive field, so that the local path is mainly responsible for extracting local information and fine features in an image, such as edges, textures and the like. The feature extraction capability of the local path is beneficial to better understanding of local details in the image by the model, so that the recognition capability of the model on object boundaries and small-scale objects is improved, the recognition capability of object edge features is enhanced, and the accuracy of the model is improved.
In the backbone network, the global path can acquire an objective receptive field through a semantic path with a rapid downsampling rate, so that global semantic information can be captured. The local path can better keep the detail information of the input image. By adopting the double-branch design, the main network can effectively capture the characteristic information of different scales while maintaining high resolution, so that the model can obtain strong and rapid characteristic extraction capability, and the detection accuracy of the model is further improved.
2. Feature fusion module
The feature fusion module (UAFM) receives the outputs of the global path and the local path simultaneously, so as to realize the balance of speed and accuracy, and as shown in fig. 4, the feature fusion module comprises two branches, wherein the first branch comprises a feature upsampling module (CARAFE) and a first attention mechanism module CA, the second branch comprises a second attention mechanism module CA, and the first attention mechanism module CA and the second attention mechanism module CA are commonly connected with a splicing function (Concat), a 3×3 convolution layer CONV, a batch normalization layer BN and a Sigmoid function layer.
In the feature fusionIn the combining module, a feature up-sampling module (CARAFE) in the first branch first outputs features of the backbone networkUpsampling to the output characteristic of the local path +.>The same size (because the backbone network adopts a dual-path design, the final feature graphs of the two paths are different in scale, and the scales of the feature graphs output by the two paths can be unified through a feature up-sampling module, so that feature fusion can be performed), and the feature up-sampling feature is marked as up-sampling feature->The method comprises the steps of carrying out a first treatment on the surface of the Then the feature->And featuresGenerating an attention attempt by means of the first and second attention mechanism modules CA, respectively>Andthe method comprises the steps of carrying out a first treatment on the surface of the Then pay attention to the force>And->Feature fusion is carried out through Concat function splicing, feature graphs alpha and 1-alpha are generated through a 3X 3 convolution layer Conv and sigmoid activation function, and element-wise Mul operation (matrix multiplication operation, namely +.f. shown in figure 4 is carried out on the feature graphs alpha and 1-alpha respectively>) Then, the two features after the element-wise Mul operation are subjected to the element-wise Add operation (momentArray addition operation, i.e. +.shown in FIG. 4>) To output the fusion feature Fout. The above process can be expressed specifically by the following formula:
further, the first attention mechanism module CA and the second attention mechanism module C have the same structure, and comprise residual structures from top to bottom, and the residual structures are connected in parallelXDirectional averaging pooling layerYAn average pooling layer of the direction,Xdirectional averaging pooling layerYThe average pooling layer of the direction is commonly connected with a splicing function (Concat), a 3 multiplied by 3 convolution layer CONV, a batch normalization layer BN and a ReLU function, the ReLU function is connected with a first branch and a second branch, and the first branch and the second branch are identical in structure and comprise a 1 multiplied by 1 convolution layer CONV and a Sigmoid function layer.
Specifically, the working principle of the attention mechanism module CA described above is as follows: the upsampling feature is firstOr the output characteristics of the local path->And respectively carrying out average pooling along the X direction and the Y direction, carrying out 1X 1 convolution, BN and ReLU activation function operation after Concat connection, dividing into the X direction and the Y direction again, and respectively carrying out 1X 1 convolution and Sigmoid activation function operation to obtain the attention weight in the X direction and the attention weight in the Y direction. Finally, through residual connection, two attention weights are obtainedRiding to->Or->On, get attention features->Or->
As shown in FIG. 5, the feature upsampling module (CARAFE) comprises, in order from top to bottom, a 1×1 convolutional layer (CONV1×1),k×kConvolutional layer (CONV)k×k) A Pixelshuffle layer, a Kernel Normalizer (kernel regularization) layer, and a Reassemble layer.
Specifically, the working principle of the feature up-sampling module (CARAFE) is described as follows:
1. CARAFE designates a size asFeature map of->And an upper sample magnification σ (σ is an integer);
2. feature map using a 1 x 1 convolution layerIs compressed to +.>
3. Using oneConvolutional layer to predict upsampling kernel, input channel is +.>The output channel is +.>Obtain->Is a upsampling core of (1), wherein ∈>
4. Using a Pixelshuffle layer pairk×kAmplifying the output of the convolution layer;
5. feature mapping through a Reassemble layerIs centered about it +.>The area and the predicted upsampled kernel corresponding to the point after softmax through Kernel Normalizer layer are subjected to dot product to achieve the aim of characteristic recombination, and the obtained size is +.>Feature map of->
Compared with the existing feature fusion module, the feature fusion module is improved by introducing a feature up-sampling module (CARAFE), on one hand, the up-sampling module can adaptively reconstruct features according to image content (CARAFE utilizes convolution and Pixelshuffle, can learn features because the CARAFE has learnable parameters which can be updated through a back propagation algorithm in a training process, so that the CARAFE can automatically learn to extract useful features from input data, and can adaptively reconstruct the features), and does not simply perform interpolation or convolution operation (the existing up-sampling module usually adopts bilinear interpolation), so that the feature receptive field can be enlarged, the feature receptive field can be excellent in recovering the detail information of an image, and the segmentation accuracy of the model can be improved; on the other hand, the up-sampling module can enhance the feature decoding capability to improve the performance of the decoder.
In addition, another improvement of the feature fusion module described in this model is to introduce a attention mechanism module CA, which, unlike the channel attention that converts feature tensors into single feature vectors through a 2D global pool, decomposes the channel attention into two 1D feature encoding processes, aggregating features in two spatial directions, respectively. In this way, long-range correlations can be captured in one spatial direction while precise location information can be retained in another spatial direction. The resulting feature map is then encoded separately into a pair of direction-aware and position-sensitive attention maps that can be applied complementarily to the input feature map to enhance the representation of the object of interest.
3. Output module
The output module (seg Head) consists of a feature up-sampling module CARAFE and bilinear interpolation. And the feature up-sampling module CARAFE up-samples the feature map to 1/4 of the original map, and up-samples and restores the feature map through bilinear interpolation to obtain a final result map. The module can be used for magnifying the scale of the characteristic map on one hand and magnifying the characteristic map with a larger characteristic receptive field on the other hand. The module is used as a reinforcing feature for decoding, so that the performance of a decoder can be improved, and the segmentation precision can be further improved.
Fig. 6 is a schematic diagram comparing the detection results of the model in the present disclosure and the prior model bisanetv 2 for the same input image. In fig. 6, the first row is an original image input to the detection model, the second column is a detection result input to the existing model BiSeNetV2, and the third column is a detection result input to the model of the present disclosure.
As can be seen from fig. 6, on the sample graph a, it can be seen that the condition of false detection occurs on the existing model, and the area without landslide is identified as landslide (except the condition of landslide in the central area in the figure, the condition of no landslide on both sides); the model disclosed by the disclosure has no false detection (compared with the existing model, the model does not identify the area without landslide in the original image as the landslide). On sample B, it can be seen that the model of the present disclosure has higher accuracy, and the detected results (e.g., excavator directly under the image, house in the middle of the image) have a clearer profile, indicating that the improved model herein has higher detection accuracy than the original model.
In another embodiment, in step S300, the model for detecting hidden danger in surrounding environment of the oil and gas pipeline is trained by the following steps:
s301: acquiring an image dataset of hidden danger of the surrounding environment of an oil and gas pipeline, preprocessing the dataset, and dividing the dataset into a training set and a testing set;
in this step, the data set preprocessing step is as described above, and will not be described here again.
S302: setting training parameters, such as, for example, epochs set to 300, batch size set to 16, learning rate set to 0.01,Weight decay set to 0.0005,Box loss gain set to 0.05,Cls loss gain set to 0.5, ioU training threshold set to 0.20, training times set to 400, and the optimizer training with a random gradient descent, training the model with a training set, and when the training reaches the set times, the model trains through;
s303: testing the trained model by using a test set, wherein in the test process, the segmentation accuracy MIOU is used as an evaluation index, and when the MIOU reaches 0.8, the model test is passed; otherwise, training parameters (e.g., learning rate to 0.001, or Batch size to 32, or training number to 500) or expanding the data set samples are adjusted to retrain the model until the model test passes.
In another embodiment, the present disclosure further provides an apparatus for detecting hidden danger in surrounding environment of an oil and gas pipeline, the apparatus comprising:
the acquisition module is used for acquiring an input image of the surrounding environment of the oil and gas pipeline;
the preprocessing module is used for preprocessing the acquired input image;
the model construction and training module is used for constructing a hidden danger detection model of the surrounding environment of the oil and gas pipeline and training; the oil and gas pipeline surrounding environment hidden danger detection model comprises a main network, wherein the main network adopts a dual-path design consisting of a global path and a local path; the model also comprises a feature fusion module, wherein the feature fusion module is introduced with a feature up-sampling module, and the feature up-sampling module can adaptively reorganize features according to image content so as to enlarge a feature receptive field;
the detection module is used for inputting the preprocessed oil and gas pipeline surrounding environment input image into the trained model so as to detect whether hidden danger exists in the oil and gas pipeline surrounding environment.
In another embodiment, the present disclosure also provides a computer storage medium storing computer-executable instructions for performing a method as set forth in any one of the preceding claims.
In another embodiment, the present disclosure further provides an electronic device, including:
a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein,
the processor, when executing the program, implements a method as described in any of the preceding.
Above, the applicant has described embodiments of the present disclosure in detail with reference to the accompanying drawings of the specification, but it should be understood by those skilled in the art that the above embodiments are merely preferred examples of embodiments of the present disclosure and are not limited to the above specific embodiments. The detailed description is intended to aid the reader in better understanding the spirit of the invention and is not intended to limit the scope of the disclosure, but rather any modifications or variations based on the spirit of the disclosure are intended to be included within the scope of the disclosure.

Claims (6)

1. The method for detecting the hidden danger of the surrounding environment of the oil and gas pipeline is characterized by comprising the following steps of:
s100: collecting an input image of the surrounding environment of an oil and gas pipeline;
s200: preprocessing the acquired input image;
s300: constructing a hidden danger detection model of the surrounding environment of the oil and gas pipeline and training;
the model comprises a backbone network, wherein the backbone network adopts a dual-path design consisting of a global path and a local path; the model also comprises a feature fusion module, wherein the feature fusion module is introduced with a feature up-sampling module, and the feature up-sampling module can adaptively reorganize features according to image content so as to enlarge a feature receptive field;
specifically, the global path in the backbone network includes five parts, the first part includes an initial module, the module includes two convolution layers with the size of 3×3 and the step length of 2, a batch of normalization layer BN is connected behind each convolution layer, and a ReLU activation function is also connected to the next layer of each convolution layer;
the second part, the third part and the fourth part have the same structure and comprise a local feature extraction module and a downsampling module, wherein the local feature extraction module comprises a 1 multiplied by 1 convolution layer Conv, a loss function GeLU, a 3 multiplied by 3 depth separable convolution layer DWConv, a loss function GeLU, a 3 multiplied by 3 convolution layer Conv and an addition function ADD which are sequentially connected, and the 1 multiplied by 1 convolution layer Conv, the 3 multiplied by 3 depth separable convolution layer DWConv and the 3 multiplied by 3 convolution layer Conv are connected with a batch normalization BN layer; the downsampling module adopts common convolution with the size of 3 multiplied by 3 and the step length of 2;
the fifth part comprises a global feature extraction module which adopts a multi-head attention mechanism, and specifically comprises the following steps: a 1×1 convolution layer Conv, wherein the convolution layer is connected with a batch normalization layer BN, the output of the 1×1 convolution layer Conv is respectively input into a query vector, a key vector and a numerical vector in an attention mechanism, and the query vector Q and the key vector K are calculated T Introducing position coding posE, and adding local attention header walking head at two ends of the softmax function to obtain attention weight; the numerical vector V is multiplied by the obtained attention weight after passing through the local attention mechanism Locality, a final characteristic representation is obtained through a 1 multiplied by 1 convolution layer Conv and a batch normalization layer BN, and a final global characteristic diagram is obtained through a full connection module which is formed by a normalization layer LN, 2 full connection layers Linear and an activation function GeLU together;
the local path comprises a first branch module, a second branch module and a third branch module which are sequentially connected and have the same structure, each branch module comprises two 3X 3 convolution layers Conv, wherein the step length of the second 3X 3 convolution layer is 2, and a batch of normalized BN layers and a ReLU activation function are connected after the step length of the second 3X 3 convolution layer;
the feature fusion module comprises two branches, wherein a first branch comprises a feature up-sampling module and a first attention mechanism module CA, a second branch comprises a second attention mechanism module CA, and the first attention mechanism module CA and the second attention mechanism module CA are commonly connected with a splicing function, a 3X 3 convolution layer CONV, a batch normalization layer BN and a Sigmoid function layer;
the first attention mechanism module CA and the second attention mechanism module CA have the same structure, and comprise residual structures from top to bottom, and the residual structures are connected in parallelXDirectional averaging pooling layerYAn average pooling layer of the direction,Xdirectional averaging pooling layerYThe average pooling layer in the direction is commonly connected with a splicing function, a 3 multiplied by 3 convolution layer CONV, a batch normalization layer BN and a ReLU function, the ReLU function is connected with a first branch and a second branch, the first branch and the second branch have the same structure and comprise a 1 multiplied by 1 convolution layer CONV and a Sigmoid function layer;
the characteristic up-sampling module sequentially comprises a 1 multiplied by 1 convolution layer from top to bottom,k×kA convolutional layer, a pixelshutdown layer, a Kernel Normalizer layer, and a Reassemble layer;
the model also comprises an output module, which consists of a feature up-sampling module CARAFE and bilinear interpolation; the feature up-sampling module CARAFE up-samples 1/4 of the original image obtained by up-sampling the feature image, and then up-samples and restores the feature image through bilinear interpolation to obtain a final result image;
s400: and inputting the preprocessed oil and gas pipeline surrounding environment input image into a trained model to detect whether hidden danger exists in the oil and gas pipeline surrounding environment.
2. The method according to claim 1, characterized in that in step S200, preprocessing the acquired input image comprises the steps of: each pixel value of the image is divided by 255 and normalized to within the range of 0, 1.
3. The method according to claim 1, wherein in step S300, the oil and gas pipeline surrounding environment hidden danger detection model is trained by:
s301: acquiring an image dataset of hidden danger of the surrounding environment of an oil and gas pipeline, preprocessing the dataset, and dividing the dataset into a training set and a testing set;
s302: setting training parameters, training the model by using a training set, and passing the model training when the training reaches a preset round;
s303: testing the trained model by using a test set, wherein in the test process, the segmentation accuracy MIOU is used as an evaluation index, and when the MIOU reaches 0.8, the model test is passed; otherwise, training parameters are adjusted or the data set samples are expanded to retrain the model until the model test passes.
4. A device for detecting environmental potential around an oil and gas pipeline for implementing the method of any one of claims 1 to 3, comprising:
the acquisition module is used for acquiring an input image of the surrounding environment of the oil and gas pipeline;
the preprocessing module is used for preprocessing the acquired input image;
the model construction and training module is used for constructing a hidden danger detection model of the surrounding environment of the oil and gas pipeline and training; the oil and gas pipeline surrounding environment hidden danger detection model comprises a main network, wherein the main network adopts a dual-path design consisting of a global path and a local path; the model also comprises a feature fusion module, wherein the feature fusion module is introduced with a feature up-sampling module, and the feature up-sampling module can adaptively reorganize features according to image content so as to enlarge a feature receptive field;
the detection module is used for inputting the preprocessed oil and gas pipeline surrounding environment input image into the trained model so as to detect whether hidden danger exists in the oil and gas pipeline surrounding environment.
5. A computer storage medium storing computer executable instructions for performing the method of any one of claims 1-3.
6. An electronic device, comprising:
a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein,
the processor, when executing the program, implements the method of any of claims 1-3.
CN202311726119.2A 2023-12-15 2023-12-15 Method and device for detecting hidden danger of surrounding environment of oil and gas pipeline and storage medium Active CN117409331B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311726119.2A CN117409331B (en) 2023-12-15 2023-12-15 Method and device for detecting hidden danger of surrounding environment of oil and gas pipeline and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311726119.2A CN117409331B (en) 2023-12-15 2023-12-15 Method and device for detecting hidden danger of surrounding environment of oil and gas pipeline and storage medium

Publications (2)

Publication Number Publication Date
CN117409331A CN117409331A (en) 2024-01-16
CN117409331B true CN117409331B (en) 2024-03-15

Family

ID=89500394

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311726119.2A Active CN117409331B (en) 2023-12-15 2023-12-15 Method and device for detecting hidden danger of surrounding environment of oil and gas pipeline and storage medium

Country Status (1)

Country Link
CN (1) CN117409331B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113393382A (en) * 2021-08-16 2021-09-14 四川省人工智能研究院(宜宾) Binocular picture super-resolution reconstruction method based on multi-dimensional parallax prior
CN114418937A (en) * 2021-12-06 2022-04-29 北京邮电大学 Pavement crack detection method and related equipment
CN114612479A (en) * 2022-02-09 2022-06-10 苏州大学 Medical image segmentation method based on global and local feature reconstruction network
CN114998525A (en) * 2022-06-21 2022-09-02 南京信息工程大学 Action identification method based on dynamic local-global graph convolutional neural network
CN115131557A (en) * 2022-05-30 2022-09-30 沈阳化工大学 Lightweight segmentation model construction method and system based on activated sludge image
CN115909096A (en) * 2022-10-31 2023-04-04 华南蓝天航空油料有限公司湖南分公司 Unmanned aerial vehicle cruise pipeline hidden danger analysis method, device and system
CN116188274A (en) * 2023-03-21 2023-05-30 广东工业大学 Image super-resolution reconstruction method
WO2023123108A1 (en) * 2021-12-29 2023-07-06 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Methods and systems for enhancing qualities of images
CN116958907A (en) * 2023-09-18 2023-10-27 四川泓宝润业工程技术有限公司 Method and system for inspecting surrounding hidden danger targets of gas pipeline
CN116993737A (en) * 2023-09-27 2023-11-03 西南科技大学 Lightweight fracture segmentation method based on convolutional neural network

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113393382A (en) * 2021-08-16 2021-09-14 四川省人工智能研究院(宜宾) Binocular picture super-resolution reconstruction method based on multi-dimensional parallax prior
CN114418937A (en) * 2021-12-06 2022-04-29 北京邮电大学 Pavement crack detection method and related equipment
WO2023123108A1 (en) * 2021-12-29 2023-07-06 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Methods and systems for enhancing qualities of images
CN114612479A (en) * 2022-02-09 2022-06-10 苏州大学 Medical image segmentation method based on global and local feature reconstruction network
CN115131557A (en) * 2022-05-30 2022-09-30 沈阳化工大学 Lightweight segmentation model construction method and system based on activated sludge image
CN114998525A (en) * 2022-06-21 2022-09-02 南京信息工程大学 Action identification method based on dynamic local-global graph convolutional neural network
CN115909096A (en) * 2022-10-31 2023-04-04 华南蓝天航空油料有限公司湖南分公司 Unmanned aerial vehicle cruise pipeline hidden danger analysis method, device and system
CN116188274A (en) * 2023-03-21 2023-05-30 广东工业大学 Image super-resolution reconstruction method
CN116958907A (en) * 2023-09-18 2023-10-27 四川泓宝润业工程技术有限公司 Method and system for inspecting surrounding hidden danger targets of gas pipeline
CN116993737A (en) * 2023-09-27 2023-11-03 西南科技大学 Lightweight fracture segmentation method based on convolutional neural network

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
CARAFE: Content-Aware ReAssembly of FEatures;Iraqi Wang等;《Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)》;20191231;3007-3016 *
CoT-TransUNet:轻量化的上下文Transformer医学图像分割网络;杨鹤等;《计算机工程与应用》;20230201;第59卷(第03期);摘要,221-222 *
基于隐表示的事件社会网络群组推荐模型研究;邓晓斌;《中国博士学位论文全文数据库 (信息科技辑)》;20230115(第01期);I138-179 *

Also Published As

Publication number Publication date
CN117409331A (en) 2024-01-16

Similar Documents

Publication Publication Date Title
CN110135366B (en) Shielded pedestrian re-identification method based on multi-scale generation countermeasure network
CN112949565A (en) Single-sample partially-shielded face recognition method and system based on attention mechanism
CN111368769B (en) Ship multi-target detection method based on improved anchor point frame generation model
CN111680176A (en) Remote sensing image retrieval method and system based on attention and bidirectional feature fusion
CN112149591B (en) SSD-AEFF automatic bridge detection method and system for SAR image
Xia et al. PANDA: Parallel asymmetric network with double attention for cloud and its shadow detection
CN114445430B (en) Real-time image semantic segmentation method and system for lightweight multi-scale feature fusion
CN114022729A (en) Heterogeneous image matching positioning method and system based on twin network and supervised training
Delibasoglu et al. Improved U-Nets with inception blocks for building detection
CN111915571A (en) Image change detection method, device, storage medium and equipment fusing residual error network and U-Net network
CN115601661A (en) Building change detection method for urban dynamic monitoring
CN114241274A (en) Small target detection method based on super-resolution multi-scale feature fusion
Ren et al. LightRay: Lightweight network for prohibited items detection in X-ray images during security inspection
Yasir et al. ShipGeoNet: SAR image-based geometric feature extraction of ships using convolutional neural networks
Guo et al. Fully convolutional DenseNet with adversarial training for semantic segmentation of high-resolution remote sensing images
CN117409331B (en) Method and device for detecting hidden danger of surrounding environment of oil and gas pipeline and storage medium
Touati et al. Partly uncoupled siamese model for change detection from heterogeneous remote sensing imagery
CN115880660A (en) Track line detection method and system based on structural characterization and global attention mechanism
Zhao et al. ST-YOLOA: a Swin-transformer-based YOLO model with an attention mechanism for SAR ship detection under complex background
CN114332533A (en) Landslide image identification method and system based on DenseNet
CN114565753A (en) Unmanned aerial vehicle small target identification method based on improved YOLOv4 network
Bousias Alexakis et al. Evaluation of semi-supervised learning for CNN-based change detection
CN114842001B (en) Remote sensing image detection system and method
Xu et al. High Resolution Remote Sensing Semantic Segmentation Using Bayesian of Hyperparameters and Improved U-net
Zhong et al. Hierarchical attention-guided multiscale aggregation network for infrared small target detection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant