Multi-scale intelligent detection method based on oil field electric power operation safety target

By introducing a scale-aware gating module and a geometric-aware focal loss function into the oilfield power operation scenario, and combining feature similarity analysis for network pruning, the problems of large target scale variation, difficulty in detecting small targets, insufficient feature fusion, and network redundancy in oilfield power operations are solved, achieving high-precision and high-real-time target detection.

CN121921728APending Publication Date: 2026-04-24NORTHEAST GASOLINEEUM UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NORTHEAST GASOLINEEUM UNIV
Filing Date
2026-01-19
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing target detection technologies face challenges in oilfield and power operation scenarios, such as large variations in target scale, difficulty in detecting small targets, lack of intelligent weighting in feature fusion strategies, severe sample imbalance, and network redundancy, making it difficult to simultaneously meet the requirements of high accuracy and high real-time performance.

Method used

A multi-scale intelligent detection method based on an encoder-decoder architecture is adopted, which introduces a scale-aware gating module and a geometric-aware focus loss function. Through the heterogeneous receptive field design of the convolutional branch in the feature fusion stage and a learnable gating network, dynamic feature fusion and intelligent weighting are achieved. Network pruning is combined with feature similarity analysis to optimize the network structure.

Benefits of technology

It significantly improves the detection accuracy and real-time response capability of oilfield power operation targets, reduces model complexity, and can be efficiently deployed on resource-constrained edge devices, providing reliable assurance for safety monitoring during operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121921728A_ABST
    Figure CN121921728A_ABST
Patent Text Reader

Abstract

The invention relates to a multi-scale intelligent detection method based on an oil field electric power operation safety target, which comprises the following steps of: processing an image data set through an encoder-decoder architecture, and introducing a scale sensing gating module into a feature fusion node, the fusion weights of different receptive field branches are intelligently weighted and adjusted through two convolution branch heterogeneous receptive field design and a learnable gating network in the feature fusion stage, and dynamic multi-scale feature fusion is achieved; a geometric perception focus detection optimization function is introduced for training and optimization, and accurate weighting is carried out on difficult samples from three dimensions of target size, IoU quality and geometric similarity; an intelligent weighted network pruning strategy is constructed based on feature similarity analysis, a redundant module is identified by calculating cosine similarity of features of adjacent layers, and a unified optimization objective is formed by adopting a layered decreasing optimization scheme and an integrated training strategy. According to the invention, the detection precision and real-time response capability of an oil field electric power operation target can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and deep learning, specifically to a multi-scale target detection method for oilfield power operation scenarios based on a scale-aware gating mechanism. Background Technology

[0002] Oilfield power operations are high-risk, high-precision industrial operations, making safety paramount. With the development of deep learning technology, target detection technology based on video surveillance has been widely applied in industrial safety monitoring and intelligent monitoring. However, target detection tasks in oilfield power operation scenarios face numerous challenges. Traditional target detection methods rely on single-scale feature extraction and fixed-weight fusion strategies, which cannot adequately adapt to the dynamic changes in target scale and the detection needs of small targets in complex scenes. This results in significant deficiencies in multi-scale target detection, small target recognition accuracy, and real-time response speed. Traditional image-based target detection methods mainly face the following problems: 1. Large Target Scale Variation: In oilfield power operations, from a high-altitude monitoring perspective, cameras are typically installed at heights of 5-10 meters, resulting in extreme scale variations in targets. The scale can range from small protective gear like helmets and gloves (each with a few pixels) to large power equipment occupying most of the frame, a difference of tens or even hundreds of times. This extreme scale variation makes it difficult for traditional single-scale or fixed multi-scale detection methods to simultaneously handle targets of different scales. This often leads to contradictory phenomena: accurate detection of large targets but significant missed detections of small targets, or improved recall for small targets but numerous false positives for large targets.

[0003] 2. High Proportion of Small Targets: In high-altitude monitoring scenarios, the protective equipment worn by workers (safety helmets, gloves, goggles, etc.) is often smaller than 32×32 pixels in the image. According to the definition of the COCO dataset, these all fall into the category of small targets. More seriously, in actual oilfield monitoring, due to limitations in camera installation height and shooting angle, some targets are even smaller than 16×16 pixels. Small targets inherently possess characteristics such as sparse features, susceptibility to background interference, and difficulty in localization. Traditional methods suffer from severely insufficient recall rates in small target detection, typically below 45%, making it difficult to meet the stringent requirements of full coverage and zero omissions in safety monitoring.

[0004] 3. Lack of Intelligent Weighting in Feature Fusion Strategies: Existing multi-scale feature fusion methods (such as FPN, PANet, and BiFPN) generally employ predefined fixed weights for feature fusion, such as simple addition in FPN, feature concatenation in PANet, and fixed learnable weights in BiFPN. This static fusion approach is based on the fundamental assumption that the importance of features at different scales is constant across all scenarios and locations. However, this assumption does not hold true in practical applications. In oilfield monitoring, the target scale distribution varies greatly across different time periods and regions: small targets are predominant during daytime close-range operations, while medium to large targets are dominant during nighttime long-range monitoring. Fixed fusion weights cannot adapt to this dynamic change, leading to insufficient feature fusion in some scenarios, or even feature conflicts, thus limiting the improvement of detection performance.

[0005] 4. The problem of imbalanced samples is prominent: The number of small targets in the training data is inherently small, a consequence of the objective characteristics of real-world scenarios. This problem is further exacerbated in dense prediction frameworks. A small target may only match 1-2 positive anchor boxes, while a large target may match several or even a dozen. This extreme imbalance severely dilutes the contribution of small targets to gradient updates. During training, the model naturally tends to learn the features of easily detectable large targets while ignoring the features of difficult small targets. While traditional Focal Loss alleviates class imbalance from the perspective of classification difficulty, it does not consider the impact of the target's geometric characteristics (size, shape, positional quality) on detection difficulty, thus its effectiveness in small target detection is limited.

[0006] 5. The detection optimization function design does not fully consider geometric characteristics: Existing focus loss is mainly designed from the perspective of classification difficulty, mitigating class imbalance by reducing the weight of easily classified samples. However, this design ignores the impact of geometric factors such as target size, shape, and aspect ratio on detection difficulty. Small targets, due to their inherent feature sparsity and difficulty in localization, should receive more attention during training, but are treated the same as large targets in standard detection optimization functions. In addition, two detection boxes with the same IoU may have significant differences in shape matching (one with a similar aspect ratio and slightly off-center position, and the other with a mismatched aspect ratio and accurate position), but existing detection optimization functions cannot distinguish such differences, which is not conducive to improving the localization quality of bounding boxes.

[0007] 6. Extensive Redundancy in Network Structure: To achieve high accuracy on public datasets, existing high-performance detection networks typically contain multiple redundant feature extraction modules, each of which contains multiple residual units. Detailed feature similarity analysis reveals high feature similarity between adjacent layers (cosine similarity often exceeds 0.85), resulting in significant redundant computation. For example, the third C2f module after the P2 feature layer has a feature similarity of 0.87 with the second module, indicating that the third module's actual contribution is very limited. While this redundant design may bring a 0.1-0.2 percentage point improvement in accuracy, the cost is a substantial increase in the number of parameters and computational load, becoming a major bottleneck for deployment on resource-constrained industrial edge devices.

[0008] 7. The trade-off between real-time performance and accuracy is difficult to balance: Two-stage detectors such as Faster R-CNN and Cascade R-CNN, while highly accurate, have slow inference speeds (typically below 15 FPS), making them unsuitable for real-time monitoring. Single-stage lightweight networks such as MobileNet-SSD, while fast, suffer from severe accuracy issues in small targets and complex scenarios, with mAP typically below 55%. Existing methods often have to make trade-offs between speed and accuracy, lacking solutions that can simultaneously satisfy both high accuracy (mAP > 60%) and high real-time performance (FPS > 60), thus failing to truly meet the stringent requirements of both accuracy and immediacy in industrial settings.

[0009] To overcome these challenges, deep learning-based object detection methods have made significant progress in recent years. Feature Pyramid Networks (FPNs) achieve multi-scale feature fusion by transmitting high-level semantic information through a top-down path and fusing low-level localization information through bottom-up lateral connections, becoming the current standard framework for object detection. Subsequent studies, such as PANet, added a bottom-up path to FPN to enable bidirectional information flow; BiFPN introduced a learnable weighted fusion mechanism and employed efficient bidirectional cross-scale connections; NAS-FPN automatically designs the optimal feature pyramid structure through neural architecture search. These methods have achieved good performance on public datasets such as COCO.

[0010] However, applying these technologies to oilfield power operations still faces many challenges. First, fixed-weight fusion strategies cannot adapt to the dynamically changing target scale distribution in oilfield scenarios. Target scale distribution varies significantly across different operational stages and monitoring areas, but existing methods use the same fusion weights regardless of the scenario, resulting in poor feature fusion performance. Second, existing detection optimization functions do not fully consider the difficulty of detecting small targets. Although Focal Loss optimizes from a classification perspective, the difficulty in detecting small targets stems not only from classification but also from their sparse features and precise localization requirements; simple classification weighting cannot solve this problem. Third, the redundancy issue in network structures is particularly prominent in practical deployments. Industrial sites typically use edge computing devices with very limited computing resources and memory, while existing high-precision models often have tens of megabytes of parameters and tens of gigabytes of computation, severely restricting practical applications.

[0011] In summary, existing target detection technologies still face challenges in high-risk and complex industrial scenarios such as oilfield power operations, including insufficient feature fusion, difficulty in detecting small targets, and severe network redundancy. Targeted technological innovations are urgently needed to address these challenges. Summary of the Invention

[0012] The purpose of this invention is to provide a multi-scale intelligent detection method for safety targets in oilfield power operations. This method addresses the problems of large target scale variations, difficulty in detecting small targets, lack of intelligent weighting in feature fusion strategies, severe sample imbalance, and network redundancy in traditional oilfield power operation target detection methods.

[0013] The technical solution adopted by this invention to solve its technical problem is as follows: This multi-scale intelligent detection method based on oilfield power operation safety targets processes image datasets through an encoder-decoder architecture. A scale-aware gating module is introduced at the feature fusion node. Through the heterogeneous receptive field design of the two convolutional branches in the feature fusion stage and a learnable gating network, the fusion weights of different receptive field branches are intelligently weighted to achieve dynamic multi-scale feature fusion. A geometric-aware focus detection optimization function is introduced for training and optimization, accurately weighting difficult samples from three dimensions: target size, IoU quality, and geometric similarity. An intelligent weighted network pruning strategy is constructed based on feature similarity analysis. Redundant modules are identified by calculating the cosine similarity of features in adjacent layers. A hierarchical decreasing optimization scheme and an integrated training strategy are adopted to form a unified optimization objective for detecting oilfield power operation targets.

[0014] The multi-scale intelligent detection method based on oilfield power operation safety targets includes the following steps: Step 1: Preprocess the original images of oilfield power operations to construct an image dataset; Step 2: Construct a model for multi-scale feature extraction and intelligent weighted fusion; The input layer of the network architecture is an encoder-decoder architecture. The encoder part adopts a progressive downsampling strategy to extract multi-level features. While retaining the three standard detection scales of P3, P4, and P5, a P2 feature layer is introduced. The backbone network is based on the CSPDarkNet architecture and implements feature extraction through the C2f module. The C2f module combines the gradient splitting idea and residual connection of CSPNet. The decoder adopts a bidirectional fusion architecture of an improved feature pyramid network FPN and a path aggregation network PAN. In the feature fusion stage of the network architecture, a scale-aware gated SAG module is deployed to achieve intelligent weighted fusion of multi-scale features, enabling the network to dynamically adjust the contribution of features at different scales according to the input content; the SAG module adopts a heterogeneous receptive field architecture with two convolutional branches in the feature fusion stage. Step 3: Model training introduces a geometric perception focus detection optimization function, and introduces a multi-dimensional weight adjustment mechanism on the basis of the Focal Loss framework; the multi-object detection optimization function is precisely integrated into different layers of the network to form a joint optimization of the multi-object detection optimization function; an intelligent weighted network optimization strategy based on feature similarity analysis is adopted, and a hierarchical decreasing optimization strategy is used according to the similarity analysis results, with different pruning schemes designed for different layers; through an integrated training strategy, the various innovative modules work together to form a unified optimization goal; Step 4: Validate the original image dataset of oilfield power operations from Step 1, and use the validated multi-scale feature extraction and intelligent weighted fusion model to detect targets in oilfield power operations.

[0015] Step one of the above scheme is specifically as follows: The original images are uniformly adjusted to a fixed size and standardized using zero-mean unit variance. Intelligent weighted histogram equalization technology is then used to enhance each frame of the image, improving image contrast and clarity.

[0016] Step two in the above scheme is specifically as follows: 2.1 Encoder-decoder architecture and multi-scale feature extraction: An encoder-decoder architecture is built at the input layer of the network architecture. The encoder part adopts a progressive downsampling strategy to extract multi-level features. While retaining the three standard detection scales of P3, P4, and P5, a P2 feature layer is introduced. The backbone network is based on the CSPDarkNet architecture and feature extraction is achieved through the C2f module. The C2f module combines the gradient splitting idea and residual connection of CSPNet to control the computational complexity. After the input image X is processed by the backbone network, four feature maps of different scales are generated: ; ; ; ; Where F P2 F represents the output feature map of the P2 feature layer; P3 F represents the output feature map of the P3 feature layer; P4 F represents the output feature map of the P4 feature layer; P5 The output feature map represents the P5 feature layer; H represents the image height; W represents the image width; C2 represents the number of channels in the second feature layer; C3 represents the number of channels in the third feature layer; C4 represents the number of channels in the fourth feature layer; C5 represents the number of channels in the fifth feature layer. The decoder adopts an improved bidirectional fusion architecture of Feature Pyramid Network (FPN) and Path Aggregation Network (PAN). FPN transmits high-level semantic information through a top-down path, while PAN enhances low-level localization information through a bottom-up path, thus achieving the advantage of combining features from different levels. 2.2 Scale-Aware Gated Module SAG Intelligent Weighted Feature Fusion: In the feature fusion stage of the network architecture, a scale-aware gated SAG module is deployed as a key link connecting features of different scales. Through a learnable gated network, intelligent weighted fusion of multi-scale features is achieved, and the contribution of features of different scales is dynamically adjusted according to the input content. The SAG module adopts a heterogeneous receptive field architecture with two convolutional branches in the feature fusion stage.

[0017] Step three in the above plan specifically refers to: 3.1 Geometric Aware Focus Detection Optimization Function GAFL Multidimensional Optimization of Image Datasets: During the model training phase, a geometrically aware focus detection optimization function is introduced, and a multi-dimensional weight adjustment mechanism is introduced on the basis of the Focal Loss framework: ; Where: α and Ψ The standard parameter for focus loss is α = 0.25. Ψ =2;P t The predicted probability of the correct class; W size For size weight, W iou For IoU weights, W geo These three factors—geometric weights, geometric weights, and geometric weights—together constitute GAFL's multi-dimensional weighting mechanism. 3.2 Joint Optimization of Multi-Target Detection Function: During the model training phase, the multi-object detection optimization function is integrated into different layers of the network. The total detection optimization function is formed by a weighted combination of classification loss, bounding box regression loss, and GAFL loss. The classification loss adopts the binary cross-entropy loss; the bounding box regression loss adopts the CIoU loss; the GAFL loss comprehensively considers the target size, IoU quality, and geometric similarity, and accurately weights difficult samples. 3.3 Intelligent Weighted Network Optimization Strategy: The degree of feature redundancy is quantified by calculating the cosine similarity of features from adjacent layers, for two feature maps. and C is the number of channels, H is the height, and W is the width; first, flatten them into vectors. Then, the cosine similarity is calculated. The cosine similarity ranges from -1 to 1. The closer the value is to 1, the more similar the two features are. Based on the similarity analysis results, a hierarchical decreasing optimization strategy is adopted, and different pruning schemes are designed for different levels. Structural reparameterization techniques are employed to further improve inference efficiency; 3.4 Integrated training strategy: A unified optimization goal is formed through an integrated training strategy.

[0018] The heterogeneous receptive field architecture of the two convolutional branches in the feature fusion stage described in the above scheme is specifically as follows: The input features are first processed by 1×1 convolution for channel adjustment and feature preprocessing; The preprocessed features are fed into two convolutional branches in the feature fusion stage. These two convolutional branches have different receptive field designs, enabling them to capture feature information at different scales: Branch 1 Local Feature Branch: Employs a single 3×3 convolution to capture local details and fine edge features; Branch 2 Context Feature Branch: Employs two cascaded 3×3 convolutions, with an equivalent receptive field of 5×5, to capture contextual information and global structural features; The gated network is the core component of the SAG module, responsible for learning the importance weights of features from different branches to achieve intelligent weighted fusion. First, the features output from the two branches are initially fused, and then global average pooling is used to obtain global context information. Features after pooling A two-dimensional weight vector is generated using a 1×1 convolution and a sigmoid activation function: The final fusion features are obtained through weighted combination: ; Where ⊙ represents element-wise multiplication; g1 corresponds to the weight of branch 1, g2 corresponds to the weight of branch 2; F1 represents branch 1, F2 represents branch 2; for feature maps and weight The calculation of element-level multiplication is as follows: ; Where c is the channel index, representing the c-th channel of the feature map; i is the height index, representing the i-th row of the feature map in the vertical direction; j is the width index, representing the j-th column of the feature map in the horizontal direction; F 1,c,i,j The original pixel value of feature map F1 at the same position (c,i,j); g 1,c Let g1 be the scalar weight value specific to the c-th channel; The final fused output feature map The value at the specific pixel position in the c-th channel, i-th row, and j-th column; Implement intelligent weighting at the channel level, so that each channel receives a corresponding weight according to its importance.

[0019] The method described in section 3.3 of the above scheme for further improving inference efficiency using structural reparameterization technology is as follows: Training phase: The network structure includes batch normalization (BN) layers, identity mapping, and multi-branch structure; Inference phase: merge batch normalization layers into convolutional layers, eliminate individual BN layers; merge consecutive 1×1 convolutions; remove identity mappings; fold multi-branch structures into single branches; For a structure where a convolutional layer is followed by a batch normalization (BN) layer: ; Reparameterization to a single convolutional layer: ; The fused convolutional weights and biases are as follows: ; ; Where: R is the weight matrix of the original convolutional layer; b' is the bias vector of the original convolutional layer; μ is the mean vector obtained by the BN layer during the training phase; σ 2 γ is the variance vector obtained statistically during the training phase of the BN layer; β is the scaling parameter of the BN layer; ε is the translation parameter of the BN layer; and ε is a small numerical stability constant to prevent the denominator from being zero.

[0020] Specifically, section 3.4 of the above scheme is as follows: (1) Warm-up phase: The first 10 epochs use η init / 10, gradually increasing to the set base learning rate η. base=0.0008; (2) Main training phase: adopt the cosine annealing learning rate scheduling strategy, the learning rate starts from η base It smoothly decays to near 0, eventually converging to a better local optimum; (3) Gradient clipping: To prevent gradient explosion, normalization is performed when the gradient norm exceeds a threshold. (4) Regularization strategy: L2 regularization: weight decay coefficient set to 0.0005; Dropout: dropout is used in the fully connected layer of the detection head; Data augmentation: random horizontal flip, random cropping, color dithering, mosaic enhancement; (5) The optimizer used is the AdamW optimizer; (6) Batch size and number of training epochs: The batch size is 4, the total number of training epochs is 300, and the early stopping strategy with a pause of 250 is adopted. When the performance of the validation set does not improve for 250 consecutive epochs, the training is terminated early.

[0021] Beneficial effects: 1. This invention, by introducing a Scale-Aware Gated (SAG) module, Geometric Aware Focal Loss (GAFL), and an intelligent weighted network optimization strategy based on feature similarity analysis, can effectively improve the detection accuracy and real-time response capability of oilfield power operation targets. While ensuring classification accuracy, it significantly improves the detection performance of small targets, and reduces model complexity through network optimization, ensuring efficient deployment even on resource-constrained edge devices, thus providing reliable technical support for safety monitoring during operations.

[0022] 2. This invention introduces a scale-aware gating module at the feature fusion node. Through the heterogeneous receptive field design of the two convolutional branches in the feature fusion stage (3×3 single convolution and 3×3×2 concatenated convolution) and a learnable gating network, the fusion weights of different receptive field branches are intelligently weighted and adjusted to achieve dynamic multi-scale feature fusion.

[0023] 3. This invention optimizes the focus detection function based on geometric perception, taking into account three dimensions: target size, IoU quality, and geometric similarity. It accurately weights difficult samples, significantly improving the detection performance of small targets.

[0024] 4. This invention proposes an intelligent weighted network pruning strategy based on feature similarity analysis. By calculating the cosine similarity of features in adjacent layers, redundant modules are identified. A hierarchical decreasing optimization scheme is adopted to significantly reduce the number of model parameters and computational load while maintaining detection accuracy.

[0025] 5. This invention achieves collaborative optimization of various innovative modules through an integrated training strategy.

[0026] 6. This invention can effectively solve problems such as large target scale variation, high proportion of small targets, insufficient feature fusion, and sample imbalance in oilfield power operation scenarios. Attached Figure Description

[0027] Figure 1 This is the overall network architecture diagram; Figure 2 This is a detailed structural diagram of the Scale Aware Gated (SAG) module; Figure 3 This is a visualization of the weight components of the Geometric Awareness Focus Loss (GAFL); Figure 4 This is a schematic diagram of the network pruning process; Figure 5 This is the overall system architecture diagram. Detailed Implementation

[0028] The present invention will be further described below with reference to the accompanying drawings: This multi-scale intelligent detection method based on the safety objectives of oilfield power operations includes the following steps: Step 1: Input data preprocessing: First, the oilfield power operation images are systematically preprocessed, uniformly adjusting the original images to a fixed size (640×640 pixels is used as the standard input size in this invention) and performing standardization. The system uses a zero-mean, unit-variance standardization operation for the input images. The standardized formula is:

[0029] Where μ is the mean of the training set images, and σ is the standard deviation. This standardization operation can eliminate the influence of different lighting conditions and weather conditions on image quality, improving the robustness of the model. Meanwhile, to address common problems in oilfield operating environments such as light variations and shadow interference, intelligent weighted histogram equalization technology is used to enhance each frame of the image, improving image contrast and clarity.

[0030] Step 2: Multi-scale feature extraction and intelligent weighted fusion model: 2.1 Encoder-Decoder Architecture and Multi-Scale Feature Extraction An encoder-decoder architecture is constructed at the input layer of the network architecture. The encoder part employs a progressive downsampling strategy to extract multi-level features. Unlike traditional methods, this invention retains the three standard detection scales P3, P4, and P5 (corresponding to 8x, 16x, and 32x downsampling, respectively) and introduces a higher-resolution P2 feature layer (4x downsampling) to enhance the perception of small targets. The backbone network is based on the CSPDarkNet architecture, and feature extraction is achieved through the C2f module. The C2f module combines the gradient splitting idea and residual connections of CSPNet, effectively controlling computational complexity while ensuring feature representation capabilities.

[0031] After the input image X is processed by the backbone network, four feature maps of different scales are generated: ; ; ; ; Where H and W represent the height and width of the image, respectively, and C i This represents the number of channels in the i-th layer feature. The introduction of the P2 layer allows the network to retain more spatial detail information, which is crucial for detecting small targets. Experiments show that after introducing the P2 layer, the average precision (AP) for small targets increases from 17.6% to 19.8%, an improvement of 2.2 percentage points. The decoder adopts a bidirectional fusion architecture of an improved Feature Pyramid Network (FPN) and a Path Aggregation Network (PAN). The FPN transmits high-level semantic information through a top-down path, helping low-level features gain richer semantic understanding capabilities; the PAN enhances the low-level localization information through a bottom-up path, enabling high-level features to obtain more accurate positional representations. This bidirectional fusion architecture fully combines the advantages of features at different levels, providing a strong feature foundation for subsequent target detection.

[0032] 2.2 Intelligent Weighted Feature Fusion of Scale-Aware Gated Module (SAG) In the feature fusion stage of the network architecture, a scale-aware gating (SAG) module is deployed as a key link connecting features of different scales. The SAG module is specifically designed to address the feature conflicts and insufficient fusion caused by fixed-weight fusion in traditional methods. Through a learnable gating network, intelligent weighted fusion of multi-scale features is achieved, enabling the network to dynamically adjust the contribution of features at different scales based on the input content.

[0033] The SAG module employs a carefully designed heterogeneous receptive field architecture with two convolutional branches in its feature fusion stage. The module's input features are first processed through a 1×1 convolution for channel adjustment and feature preprocessing. ; Where X is the input feature, Conv 1×1 This is a 1×1 convolution operation. The main purpose of this preprocessing step is to unify the number of channels for features from different sources and to perform preliminary feature mapping, preparing for the two convolutional branches in the subsequent feature fusion stage.

[0034] Preprocessed features F i n The data is fed into two parallel feature extraction branches with different receptive field designs, enabling them to capture feature information at different scales: Branch 1 (Local Feature Branch): Employs a single 3×3 convolution with a small receptive field (3×3), primarily responsible for capturing local details and fine edge features, which is crucial for detecting small targets. ; Here, BN represents batch normalization, and ReLU is the activation function. Batch normalization can accelerate network convergence and improve training stability.

[0035] Branch 2 (Context Feature Branch): Employs two cascaded 3×3 convolutions, resulting in an equivalent receptive field of 5×5. This allows for the capture of a wider range of contextual information and global structural features, which is crucial for understanding the semantics and contextual relationships of the target. ;

[0036] This dual-layer convolution design not only expands the receptive field but also enhances the expressive power of features by adding nonlinear transformations.

[0037] This heterogeneous receptive field design with two convolutional branches in the feature fusion stage has the following significant advantages: (1) High parameter efficiency: By replacing one 5×5 convolution with two 3×3 convolutions, the number of parameters is reduced from 25C while obtaining the same receptive field (5×5). 2 Reduced to 18C 2 (C is the number of channels), the number of parameters is reduced by 28%. Taking C=256 as an example, a 5×5 convolution requires 1,638,400 parameters, while two 3×3 convolutions only require 1,179,648 parameters, saving 458,752 parameters.

[0038] (2) Nonlinear enhancement: The cascaded structure introduces additional batch normalization and ReLU activation functions, which increases the depth and nonlinear expressive power of the network, enabling the network to learn more complex feature representations.

[0039] (3) Multi-scale perception: The two branches provide feature representations at local and global scales respectively, which can take into account both details and contextual information, which is crucial for handling targets with large scale changes.

[0040] The gated network is the core component of the SAG module, responsible for learning the importance weights of features from different branches to achieve intelligent weighted fusion. First, the features output from the two branches are initially fused, and then global average pooling is used to obtain global context information. ; GAP stands for Global Average Pooling. Global Average Pooling compresses the feature map of each channel into a scalar value, which represents the average activation intensity of that channel across the entire feature space, effectively capturing global statistical information. For input features... The formula for calculating global average pooling is: ; Where 'c' represents the channel index.

[0041] Features after pooling A two-dimensional weight vector is generated using a 1×1 convolution and a sigmoid activation function: ; Where g1 and g2 correspond to the weights of the two branches, and σ is the Sigmoid activation function: ; The Sigmoid function maps any real number to the (0,1) interval, ensuring that the weights are non-negative and bounded. A key feature of this design is that the two weights, g1 and g2, can be learned independently, unconstrained by traditional Softmax normalization (i.e., g1 + g2 does not necessarily equal 1). This flexibility allows the network to amplify or reduce the contribution of a branch as needed, and even simultaneously enhance or suppress two branches when necessary, providing greater optimization space.

[0042] The final fusion features are obtained through weighted combination: ; Here, ⊙ represents element-wise multiplication, also known as the Hadamard product. Specifically, for feature maps... and weight The calculation of element-level multiplication is as follows: ; This fusion method enables intelligent weighting at the channel level, allowing each channel to receive a corresponding weight based on its importance.

[0043] The key advantage of the gated fusion mechanism lies in its intelligent weighting. Weights g1 and g2 are not fixed but dynamically adjusted based on the content of the input features. When the input image contains many small targets, the gated network automatically increases the weight of branch 1 (the local feature branch) because the detection of small targets relies more on local details. When the input image mainly contains large targets, the weight of branch 2 (the contextual feature branch) increases accordingly, because the detection of large targets requires more contextual information. This dynamic adjustment mechanism allows the network to adapt to the target scale distribution in different scenes, significantly improving the feature fusion effect.

[0044] Experiments show that, compared with traditional fixed-weight fusion methods (such as simple addition F), out =F1+F2 or weighted by fixed coefficients F out =0.5F1+0.5F2), the SAG module improved mAP@50 from 58.5% to 61.2%, an improvement of 2.7 percentage points. Particularly in small object detection, AP increased from 17.6% to 20.1%, an improvement of 2.5 percentage points, fully demonstrating the effectiveness of the intelligent weighted fusion strategy. The SAG module has very low computational overhead. For features with C=256 input channels, the gated network only requires 512 parameters (256×2), which is negligible compared to the total number of parameters in the entire network (approximately 20M). Simultaneously, the computational cost of global average pooling and 1×1 convolution is also very small, with a negligible impact on the overall inference speed (latency increase of less than 0.5ms). This efficient design allows the SAG module to significantly improve detection performance with almost no increase in computational overhead, making it ideal for industrial applications.

[0045] Step 3: Model Training and Optimization Strategies 3.1 Multi-dimensional Sample Optimization of the Geometric Aware Focus Detection Optimization Function (GAFL) During the model training phase, this invention introduces the Geometric-Aware Focal Loss (GAFL) function. GAFL comprehensively optimizes sample weights from three dimensions: target size, localization quality, and geometric similarity, effectively solving the problems of small target detection and sample imbalance.

[0046] Traditional Focal Loss is primarily used to address the class imbalance problem between foreground and background samples in object detection. Its basic form is: ; Where P t α represents the model's predicted probability for the correct class. t γ is the category balance factor, and γ is the focusing parameter (usually set to 2). (1-P t ) γ The term is the modulation factor, when P t When the value is close to 1 (easily classifiable samples), (1-P) t ) γ As P approaches 0, the loss weight decreases; when P... t When the number of difficult samples is small, the loss weight remains high. This design effectively alleviates the problem of imbalance between positive and negative samples. However, traditional Focal Loss has obvious limitations: it only considers the classification difficulty and ignores the impact of the geometric characteristics of the target on the detection difficulty. In complex industrial scenarios, there are significant differences in the quality of positive samples. Some positive samples, although containing targets, have problems: inaccurate bounding box localization (low IoU), bounding box shape mismatch with the ground truth box (large aspect ratio difference), and target size too small (sparse features, difficult detection). These "low-quality positive samples" have a significant impact on model performance, but traditional Focal Loss cannot identify and optimize them. To address this, this invention proposes the GAFL detection optimization function, which introduces a multi-dimensional weight adjustment mechanism on the basis of the Focal Loss framework: ; Where α and Ψ The standard parameter for focus loss is α = 0.25 in this invention. Ψ =2), P t W is the predicted probability of the correct class. size , W iou , W geo These are size weights, IoU weights, and geometric weights, which together constitute GAFL's multi-dimensional weighting mechanism.

[0047] 3.2 Joint Optimization of Multi-Target Detection Function During model training, the multi-object detection optimization function is precisely integrated into different layers of the network. The overall detection optimization function consists of three parts: classification loss, bounding box regression loss, and GAFL loss.

[0048] (1) Classification loss The classification loss is applied to the classification branch of the detection head to evaluate the accuracy of the model's prediction of the target class. This invention employs binary cross-entropy loss: ; Where N is the number of samples, C is the number of categories, and y i,c For the true label (0 or 1), p i,c Let be the predicted probability of the model that the i-th sample belongs to the c-th class.

[0049] (2) Bounding box regression loss Bounding box regression loss evaluates the positional deviation between the predicted bounding box and the ground truth bounding box. This invention employs CIoU (Complete IoU) loss, which further considers center point distance and aspect ratio in addition to IoU: ; Where: IoU is the intersection-union ratio between the predicted bounding box and the ground truth bounding box; ρ(b,b) gt ) represents the Euclidean distance between the center points of the predicted bounding box and the center points of the ground truth bounding box; c represents the diagonal length of the smallest bounding rectangle that can simultaneously contain both the predicted and ground truth bounding boxes; v measures the consistency of the aspect ratio. α is the trade-off parameter: .

[0050] CIoU loss optimizes overlap area, center point distance, and aspect ratio simultaneously, which can more comprehensively improve the localization quality of the bounding box.

[0051] (3) GAFL loss GAFL loss takes into account target size, IoU quality, and geometric similarity, and applies precise weighting to difficult samples.

[0052] Total detection optimization function: The total loss is formed by a weighted combination of three losses. ; Where λ cls , λ box , λ GAFL The optimal values ​​for the weighting coefficients of each loss were determined experimentally to be 0.5, 0.05, and 1.0. This multi-objective joint optimization ensures that the model is adequately trained in multiple aspects, including classification, localization, and handling of difficult samples.

[0053] 3.3 Intelligent Weighted Network Optimization Strategy To balance detection accuracy and computational efficiency, this invention proposes an intelligent weighted network optimization strategy based on feature similarity analysis. While deep networks possess powerful feature representation capabilities, they also involve a significant amount of redundant computation.

[0054] First, the degree of feature redundancy is quantified by calculating the cosine similarity of features from adjacent layers. For two feature maps... and First, flatten them into vectors. Then calculate the cosine similarity: ; The cosine similarity score ranges from -1 to 1; the closer the value is to 1, the more similar the two features are. At that time, it was considered that there was significant redundancy, and the feature extraction contribution of the later layer was limited.

[0055] This invention conducted a comprehensive feature similarity analysis on the YOLOv10s baseline model and discovered a large number of redundant modules: The C2f modules after P2 layer: The feature similarity between the third C2f module and the second C2f module is as high as 0.87, indicating that the information gain of the third module is very small and it can be safely removed.

[0056] The C2f modules after P3 layer: The similarity between the 5th and 6th C2f modules and the preceding modules is 0.84 and 0.82 respectively. Although slightly below the threshold, there is still some redundancy.

[0057] Layers P4 and P5: The similarity of deep features is relatively low (0.70-0.75), and the redundancy is small. Careful pruning is required to avoid information loss.

[0058] Based on the similarity analysis results, this invention adopts a hierarchical decreasing optimization strategy, designing different pruning schemes for different levels: (1) P2 layer optimization: The C2f module was reduced from 3 layers to 2 layers. Layer P2 is responsible for detecting small targets, with high feature resolution (H / 4 × W / 4), but also high computational cost. Analysis revealed that the third C2f module has a feature similarity of only 0.87, contributing only a limited amount. After removal: the number of parameters is reduced by approximately 1.2M. Computational cost reduction: approximately 2.1 GFLOPs (a 33% reduction in P2 layer computation); Accuracy impact: mAP@50 decreased by only 0.1 percentage points (from 62.2% to 62.1%).

[0059] (2) P3 layer optimization: C2f module reduced from 6 layers to 4 layers The P3 layer is the primary layer for detecting medium-scale targets, requiring a balance between redundancy elimination and performance preservation. Experiments show that retaining the first four C2f modules maintains performance while significantly reducing computational cost. Parameter count reduction: approximately 2.1M; computational cost reduction: approximately 3.2 GFLOPs; accuracy impact: mAP@50 remains unchanged (62.1%). This represents the optimal balance between performance and efficiency.

[0060] (3) Optimization of P4 and P5 layers: Moderately reduce their size to protect deep information. Deep features contain rich semantic information, which is crucial for large object detection and classification. Although there is some redundancy, pruning needs to be more careful: P4 layer: reduce the C2f module from 4 layers to 3 layers; P5 layer: maintain the original structure to avoid loss of semantic information.

[0061] Quantification of overall optimization effect By employing a hierarchical, decreasing pruning strategy, the overall complexity of the model is significantly reduced. ; ; The number of parameters decreased from 24.8M to 19.5M, a reduction of 21.4%; the computational cost decreased from 28.8 GFLOPs to 23.5 GFLOPs, a reduction of 18.4%. This significant reduction in complexity enables the model to run efficiently on resource-constrained edge devices.

[0062] More importantly, inference speed was significantly improved. Under the same hardware conditions (NVIDIA Quadro P6000 GPU), inference speed increased from 49 FPS to 63 FPS, an improvement of 28.6%. ; The processing speed of 63 FPS fully meets the needs of real-time monitoring (which usually requires >30 FPS), and can even process multiple video streams simultaneously.

[0063] Structural Reparameterization: In addition to structural pruning, this invention employs structural reparameterization to further improve inference efficiency. This is an optimization strategy for decoupling training and inference. Training phase: Maintain the complete network structure, including batch normalization (BN) layers, identity mapping, multi-branch structure, etc. These components can improve training stability and convergence speed.

[0064] Inference phase: merge batch normalization layers into convolutional layers, eliminate individual BN layers; merge consecutive 1×1 convolutions; remove identity mappings; and fold multi-branch structures into single branches.

[0065] Specifically, for a structure where a convolutional layer is followed by a BN layer: ; It can be reparameterized into a single convolutional layer: ; The fused convolutional weights and biases are as follows: ; ; Where: R is the weight matrix of the original convolutional layer; b' is the bias vector of the original convolutional layer; μ is the mean vector obtained by the BN layer during the training phase; σ 2 γ is the variance vector obtained statistically during the training phase of the BN layer; γ is the scaling parameter (learnable weight) of the BN layer; β is the translation parameter (learnable bias) of the BN layer; ε is a numerically stable small constant (usually 1). (Order level), to prevent the denominator from being zero.

[0066] This fusion operation does not change the functionality of the network, but eliminates the runtime overhead of the BN layer, further improving inference speed by about 5-8%.

[0067] 3.4 Integrated Training Strategy Through an integrated training strategy, the various innovative modules work collaboratively to achieve a unified optimization goal. The training process employs a multi-stage optimization strategy: (1) Warm-up phase: The first 10 epochs use a smaller learning rate (η). init / 10), gradually increasing to the set base learning rate η. base =0.0008. This stage allows the network parameters to gradually enter a reasonable range from a randomly initialized state, avoiding gradient instability in the initial stage.

[0068] (2) Main training phase: Cosine annealing learning rate scheduling strategy is adopted: ; Learning rate from η base The model gradually decays to near zero, allowing for fine-tuning and eventually convergence to a better local optimum.

[0069] (3) Gradient clipping: To prevent gradient explosion, when the gradient norm exceeds a threshold... Normalization is performed at that time: ; (4) Regularization strategies: L2 regularization: weight decay coefficient is set to 0.0005 to prevent overfitting; Dropout: dropout is used in the fully connected layer of the detector head (rate is 0.1); Data augmentation: random horizontal flipping, random cropping, color dithering, mosaic enhancement, etc.

[0070] (5) Optimizer: The AdamW optimizer was used, with parameters set as follows: β1=0.9, β2=0.999, ε=10 -8 .

[0071] (6) Batch size and number of training epochs: The batch size is 4 (limited by GPU memory), the total number of training epochs is 300, and an early stopping strategy (patience=250) is adopted. Training is terminated early when the performance of the validation set does not improve for 250 consecutive epochs. Through positional coordination among modules and multi-objective joint optimization, the overall performance of the network is optimized, and mutual interference between modules is avoided.

[0072] Step 4: Model Validation and Performance Evaluation Finally, a comprehensive experimental verification was conducted using a self-built oilfield power operation image dataset (OEOD).

[0073] The model training and optimization incorporates a geometric acuity focus detection optimization function to optimize the image dataset from multiple dimensions.

[0074] Figure 1 This is an overall network architecture diagram, showcasing a multi-scale object detection framework based on an encoder-decoder architecture. The diagram clearly presents the core components and their connections, including the input layer, encoder (CSPDarkNet backbone), decoder (FPN+PAN bidirectional fusion), SAG module deployment location, and detection head. The diagram labels the size variations of the four feature layers P2, P3, P4, and P5 (160×160, 80×80, 40×40, 20×20 respectively) and the number of channels (128, 256, 512, 1024), as well as the data flow direction between modules. Specifically, the diagram uses different colored boxes to mark the top-down FPN path (blue), the bottom-up PAN path (orange), and the SAG module fusion nodes (green circles), making the overall architecture readily apparent.

[0075] Figure 2 This is a detailed structural diagram of the Scale-Aware Gated (SAG) module, demonstrating its internal working mechanism. The diagram details the heterogeneous receptive field design of the two convolutional branches in the feature fusion stage: branch 1 on the left uses a single 3×3 convolution to capture local detail features (3×3 receptive field), while branch 2 on the right uses two cascaded 3×3 convolutions to capture contextual information (equivalent to a 5×5 receptive field). The diagram clearly labels the specific parameters of each operation: a 1×1 convolution is used for input preprocessing, and BN and ReLU are used for normalization and activation. The gating network compresses features into a global vector using Global Average Pooling (GAP), which is then processed by a 1×1 convolution and Sigmoid activation to generate two gating weights, g1 and g2. Finally, element-wise multiplication is used to achieve intelligent weighted fusion. The diagram uses arrows of different colors to distinguish between the feature flow (solid line) and the weight flow (dashed line), and marks the dimensionality changes of the feature map (C×H×W → C×1×1 → 2), making the module's working principle clear and easy to understand.

[0076] Figure 3 This is a visualization of the weight components of Geometric Awareness Focus Loss (GAFL), comprehensively demonstrating the multi-dimensional weighting mechanism of GAFL through three sub-plots. Sub-plot (a) shows the exponential decay curve of the size weight w_size as a percentage of the target area. The horizontal axis represents the proportion of the target area to the image area (using a logarithmic scale of 0.0001-1.0), and the vertical axis represents the weight value (1.0-3.0). The curve clearly shows that the weight reaches a peak of 2.8 times when the target area is less than 0.001, and the weight approaches 1.0 when the area is greater than 0.1, fully reflecting the accurate weighting for small targets. Sub-plot (b) shows the linear change characteristics of the IoU weight w_iou. The horizontal axis represents the IoU value (0-1), and the vertical axis represents the weight value (1.0-1.3). The straight line linearly decreases from a weight of 1.15 when IoU=0.5 to a weight of 1.0 when IoU=1.0, indicating that the worse the localization quality, the higher the weight is obtained. Subplot (c) uses a heatmap to show the distribution of the overall weights under different target sizes (Small / Medium / Large) and IoU value combinations, with colors gradually changing from cool (blue, weight 1.0) to warm (red, weight 3.2). The top left corner (small target + low IoU) is the darkest red, and the bottom right corner (large target + high IoU) is a cool blue, visually demonstrating the refined weighting effect of GAFL on difficult samples.

[0077] Figure 4 This is a flowchart illustrating the network pruning process, showcasing the complete optimization process of an intelligent weighted network based on feature similarity analysis. The left side of the diagram shows the network structure before optimization, detailing the number of C2f modules and parameters in each layer: P2 layer has 3 C2f modules (5.2M parameters), P3 layer has 6 C2f modules (8.6M parameters), P4 layer has 4 C2f modules (6.8M parameters), and P5 layer has 2 C2f modules (4.2M parameters), totaling 24.8M parameters and 28.8 GFLOPs. The middle section shows the feature similarity analysis module, which identifies highly redundant regions using a cosine similarity matrix (heatmap format) and marks layer pairs with similarity > 0.85 with red boxes: P2 layer modules 2-3 (similarity 0.87), P3 layer modules 4-5 (0.84), and P3 layer modules 5-6 (0.82). The right side of the diagram shows the optimized lightweight network structure: the P2 layer is reduced to 2 C2fs (-33%), the P3 layer to 4 C2fs (-33%), the P4 layer to 3 C2fs (-25%), and the P5 layer remains unchanged at 2 C2fs, resulting in a total of 19.5M parameters (-21.4%), 23.5 GFLOPs (-18.4%), and an inference speed of 63 FPS (+28.6%). A comparison table at the bottom of the flowchart clearly shows the performance changes before and after optimization, fully validating the effectiveness of the pruning strategy.

[0078] This invention also provides an intelligent detection system based on the above-described detection method, such as... Figure 5As shown, the system mainly consists of the following modules: (1) Data acquisition module: responsible for acquiring video image data of the oilfield power operation site. This module acquires real-time video streams through camera equipment, supports simultaneous access of multiple video streams, and transmits the video data to the image preprocessing module. (2) Image preprocessing module: preprocesses the acquired raw images. This module uniformly adjusts the images to a standard size of 640×640 pixels, performs zero-mean unit variance standardization processing, and uses intelligent weighted histogram equalization technology to enhance the images, eliminate the influence of factors such as lighting changes and shadow interference, and transmits the processed images to the feature extraction and fusion module. (3) Feature extraction and fusion module: This module is the core computing unit of the system. An encoder-decoder architecture is adopted. The encoder extracts four feature layers of different scales, P2, P3, P4, and P5, through the CSPDarkNet backbone network, and the decoder performs feature fusion through the FPN and PAN bidirectional fusion architecture. A scale-aware gating (SAG) module is deployed at the feature fusion node to realize intelligent weighted fusion of features of different scales. The fused multi-scale features are transmitted to the target detection module. (4) Target Detection Module: Target detection is performed based on the feature map output by the feature extraction and fusion module. This module completes the classification and localization of targets through the detection head network, outputs the category (such as safety helmet, gloves, goggles, reflective clothing, etc.), location coordinates and confidence score of each detected target, and uses the non-maximum suppression algorithm to filter duplicate detection boxes and pass the detection results to the result output module. (5) Model Training Module: Responsible for the training and optimization of the deep learning model. This module is based on the oilfield power operation image dataset and uses the geometrically aware focus detection optimization function (GAFL) proposed in this invention for model training, and comprehensively optimizes the sample weights of three dimensions: target size, IoU quality and geometric similarity. At the same time, this module implements an intelligent weighted network pruning strategy based on feature similarity analysis, which reduces the model complexity by identifying and removing redundant modules, and improves the inference speed while maintaining detection accuracy. The trained model parameters are loaded into the feature extraction and fusion module and the target detection module. (6) Result Output Module: Responsible for the display, warning and storage of detection results. This module presents the detection results in a visual way, and marks the bounding boxes and category labels of the targets on the original image. When violations are detected (such as not wearing a safety helmet or entering a dangerous area), a safety warning mechanism is triggered, notifying relevant personnel through audible and visual alarms, push notifications, and other means. Simultaneously, the module stores the detection results in a database, supporting historical data queries and statistical analysis.System workflow: The data acquisition module acquires video images and transmits them to the image preprocessing module; the image preprocessing module standardizes and enhances the images before passing them to the feature extraction and fusion module; the feature extraction and fusion module extracts multi-scale features and performs intelligent weighted fusion using the SAG module; the target detection module completes target detection based on the fused features and outputs the detection results; the result output module visualizes the detection results, triggers early warnings, and stores the data; the model training module continuously optimizes and updates the model in the background. This system achieves real-time intelligent target detection in oilfield power operation scenarios, accurately identifying workers' protective equipment wearing status, operational status, and violations. It achieves an mAP@50 accuracy of 62.1% and an inference speed of 63 FPS, meeting real-time monitoring requirements and providing reliable technical support for the safety of oilfield power operations.

[0079] This invention designs a user interface that connects the underlying detection algorithm with user operations, enabling visualization and convenient interaction of system functions. The system interface adopts a left-right split layout with a dark theme color scheme to reduce visual fatigue for operators during prolonged monitoring, conforming to usage habits in industrial monitoring scenarios. The central detection screen display area shows the original image or detection result image in real time. After detection, a detection box, category label, and confidence information are overlaid on the image. The bottom control button group includes options for uploading images, starting detection, saving results, and clearing.

[0080] Interaction relationship between the interface and system modules: Interaction with the data acquisition module: Users select image files via the "Upload Image" button, and the system reads the image data and displays a preview.

[0081] Integration with the image preprocessing module: After clicking "Start Detection", the image will automatically undergo 640×640 scaling, normalization and enhancement processing by the preprocessing module.

[0082] Coordination with the feature extraction and fusion module: The model selection function in the interface controls whether to use the base model or the P2 enhanced model. During detection, the feature extraction module processes image features according to the SAG mechanism.

[0083] Interaction with the target detection module: The detection process is executed through an independent thread to avoid interface lag. After completion, the labeled image and detection results are sent back to the interface for display.

[0084] Connection with the results output module: The interface displays real-time visual annotations of the test results, updates statistical information, outputs a detailed list, and provides a results saving function.

[0085] Technical implementation of the interface: A multi-threaded asynchronous processing mechanism ensures smooth interface operation, while the main thread continues to respond to user actions during the detection process. The interface uses intelligent weighted scaling to display images of different sizes, and the status bar provides real-time feedback on the system's operating status. Button states are intelligently enabled / disabled based on the operation flow to prevent unauthorized operations.

[0086] To verify the effectiveness and superiority of the multi-scale target detection method based on scale-aware gating mechanism proposed in this invention in target detection tasks in oilfield power operation scenarios, a comparative experiment was conducted on a self-built oilfield power operation image dataset (OEOD). The experimental results are shown in Table 1.

[0087]

[0088] As shown in Table 1, this invention achieves optimal performance at mAP@50 and mAP@50-95, reaching 62.1% and 38.1% respectively. Precision reaches 81.9%, Recall reaches 59.6%, and F1 score is 65.8%, representing improvements of 7.7, 8.1, and 8.2 percentage points respectively compared to the baseline YOLOv10s. In terms of computational efficiency, the number of parameters is 19.5M (a reduction of 21.4%), GFLOPs are 23.5 (a reduction of 18.4%), and inference speed reaches 63 FPS (an improvement of 28.6%), achieving an optimized balance between accuracy and efficiency.

[0089]

[0090] The three improved modules demonstrate clear functional positioning and synergistic effects: the P2 module provides an enhanced feature representation foundation, the SAG module constructs an efficient multi-scale fusion architecture, and the GAFL module improves detection quality and reduces computational overhead through detection optimization functions. This modular, progressive improvement strategy not only facilitates the analysis of the independent contributions of each component but, more importantly, achieves synergistic optimization of detection accuracy and computational efficiency, ultimately constructing a high-performance object detection framework suitable for practical deployment. Overall, the complete method improves the mAP@50 and F1 scores by 3.6 and 8.2 percentage points respectively compared to the baseline model, while improving computational efficiency by 18.4%, fully demonstrating the superiority of the proposed method.

Claims

1. A multi-scale intelligent detection method based on safety targets for oilfield power operations, characterized in that: Image datasets are processed using an encoder-decoder architecture. A scale-aware gating module is introduced at the feature fusion node. Through the heterogeneous receptive field design of the two convolutional branches in the feature fusion stage and a learnable gating network, the fusion weights of different receptive field branches are intelligently weighted to achieve dynamic multi-scale feature fusion. A geometric-aware focus detection optimization function is introduced for training and optimization. Difficult samples are precisely weighted from three dimensions: target size, IoU quality, and geometric similarity. A smart weighted network pruning strategy is constructed based on feature similarity analysis. Redundant modules are identified by calculating the cosine similarity of features in adjacent layers. A hierarchical decreasing optimization scheme and an integrated training strategy are adopted to form a unified optimization objective for detecting oilfield power operation targets.

2. The multi-scale intelligent detection method based on oilfield power operation safety targets as described in claim 1, characterized in that... Includes the following steps: Step 1: Preprocess the original images of oilfield power operations to construct an image dataset; Step 2: Construct a model for multi-scale feature extraction and intelligent weighted fusion; The input layer of the network architecture is an encoder-decoder architecture. The encoder part adopts a progressive downsampling strategy to extract multi-level features. While retaining the three standard detection scales of P3, P4, and P5, a P2 feature layer is introduced. The backbone network is based on the CSPDarkNet architecture and implements feature extraction through the C2f module. The C2f module combines the gradient splitting idea and residual connection of CSPNet. The decoder adopts a bidirectional fusion architecture of an improved feature pyramid network FPN and a path aggregation network PAN. In the feature fusion stage of the network architecture, a scale-aware gated SAG module is deployed to achieve intelligent weighted fusion of multi-scale features, enabling the network to dynamically adjust the contribution of features at different scales according to the input content; the SAG module adopts a heterogeneous receptive field architecture with two convolutional branches in the feature fusion stage. Step 3: Model training introduces a geometric perception focus detection optimization function, and introduces a multi-dimensional weight adjustment mechanism on the basis of the Focal Loss framework; the multi-object detection optimization function is precisely integrated into different layers of the network to form a joint optimization of the multi-object detection optimization function; The intelligent weighted network optimization strategy based on feature similarity analysis adopts a hierarchical decreasing optimization strategy according to the similarity analysis results, and designs different pruning schemes for different levels; through an integrated training strategy, the various innovative modules work together to form a unified optimization goal. Step 4: Validate the original image dataset of oilfield power operations from Step 1, and use the validated multi-scale feature extraction and intelligent weighted fusion model to detect targets in oilfield power operations.

3. The multi-scale intelligent detection method based on oilfield power operation safety targets according to claim 2, characterized in that: Step one specifically involves: The original images are uniformly adjusted to a fixed size and standardized using zero-mean unit variance. Intelligent weighted histogram equalization technology is then used to enhance each frame of the image, improving image contrast and clarity.

4. The multi-scale intelligent detection method based on oilfield power operation safety targets according to claim 3, characterized in that: Step two specifically involves: 2.1 Encoder-decoder architecture and multi-scale feature extraction: exist The input layer of the network architecture constructs an encoder-decoder architecture. The encoder part adopts a progressive downsampling strategy to extract multi-level features. While retaining the three standard detection scales of P3, P4, and P5, a P2 feature layer is introduced. The backbone network is based on the CSPDarkNet architecture and implements feature extraction through the C2f module. The C2f module combines the gradient splitting idea and residual connection of CSPNet to control the computational complexity. After the input image X is processed by the backbone network, four feature maps of different scales are generated: The decoder adopts an improved bidirectional fusion architecture of Feature Pyramid Network (FPN) and Path Aggregation Network (PAN). FPN transmits high-level semantic information through a top-down path, while PAN enhances low-level localization information through a bottom-up path, thus achieving the advantage of combining features from different levels. 2.2 Scale-Aware Gated Module SAG Intelligent Weighted Feature Fusion: In the feature fusion stage of the network architecture, a scale-aware gated SAG module is deployed as a key link connecting features of different scales. Through a learnable gated network, intelligent weighted fusion of multi-scale features is achieved, and the contribution of features of different scales is dynamically adjusted according to the input content. The SAG module adopts a heterogeneous receptive field architecture with two convolutional branches in the feature fusion stage.

5. The multi-scale intelligent detection method based on oilfield power operation safety targets according to claim 4, characterized in that: Step three specifically involves: 3.1 Geometric Aware Focus Detection Optimization Function GAFL Multidimensional Optimization of Image Datasets: During the model training phase, a geometrically aware focus detection optimization function is introduced, and a multi-dimensional weight adjustment mechanism is introduced on the basis of the Focal Loss framework: ; Where: α and Ψ The standard parameter for focus loss is α = 0.

25. Ψ =2;P t The predicted probability of the correct class; W size For size weight, W iou For IoU weights, W geo These three factors—geometric weights, geometric weights, and geometric weights—together constitute GAFL's multi-dimensional weighting mechanism. 3.2 Joint Optimization of Multi-Object Detection Optimization Function: During the model training phase, the multi-object detection optimization function is integrated into different layers of the network. The total detection optimization function is formed by a weighted combination of classification loss, bounding box regression loss, and GAFL loss. The classification loss adopts binary cross-entropy loss; the bounding box regression loss adopts CIoU loss; the GAFL loss comprehensively considers target size, IoU quality, and geometric similarity, and accurately weights difficult samples. 3.3 Intelligent Weighted Network Optimization Strategy: The degree of feature redundancy is quantified by calculating the cosine similarity of features from adjacent layers, for two feature maps. and C is the number of channels, H is the height, and W is the width; first, flatten them into vectors. Then, the cosine similarity is calculated. The cosine similarity ranges from -1 to 1. The closer the value is to 1, the more similar the two features are. Based on the similarity analysis results, a hierarchical decreasing optimization strategy is adopted, and different pruning schemes are designed for different levels. Structural reparameterization techniques are employed to further improve inference efficiency; 3.4 Integrated training strategy: A unified optimization goal is formed through an integrated training strategy.

6. The multi-scale intelligent detection method based on oilfield power operation safety targets according to claim 5, characterized in that: The heterogeneous receptive field architecture of the two convolutional branches in the feature fusion stage is specifically as follows: The input features are first processed by 1×1 convolution for channel adjustment and feature preprocessing; The preprocessed features are fed into two convolutional branches in the feature fusion stage. These two convolutional branches have different receptive field designs, enabling them to capture feature information at different scales: Branch 1 Local Feature Branch: Employs a single 3×3 convolution to capture local details and fine edge features; Branch 2 Context Feature Branch: Employs two cascaded 3×3 convolutions, with an equivalent receptive field of 5×5, to capture contextual information and global structural features; The gated network is the core component of the SAG module, responsible for learning the importance weights of features from different branches to achieve intelligent weighted fusion. First, the features output from the two branches are initially fused, and then global average pooling is used to obtain global context information. Features after pooling A two-dimensional weight vector is generated using a 1×1 convolution and a sigmoid activation function: The final fusion features are obtained through weighted combination: ; Where ⊙ represents element-wise multiplication; g1 corresponds to the weight of branch 1, g2 corresponds to the weight of branch 2; F1 represents branch 1, F2 represents branch 2; for feature maps and weight The calculation of element-level multiplication is as follows: ; Where c is the channel index, representing the c-th channel of the feature map; i is the height index, representing the i-th row of the feature map in the vertical direction; j is the width index, representing the j-th column of the feature map in the horizontal direction; F 1,c,i,j The original pixel value of feature map F1 at the same position (c,i,j); g 1,c Let g1 be the scalar weight value specific to the c-th channel; The final fused output feature map The value at the specific pixel position in the c-th channel, i-th row, and j-th column; Implement intelligent weighting at the channel level, so that each channel receives a corresponding weight according to its importance.

7. The multi-scale intelligent detection method based on oilfield power operation safety targets according to claim 6, characterized in that: The method described in section 3.3 for further improving inference efficiency using structural reparameterization technology is as follows: Training phase: The network structure includes batch normalization (BN) layers, identity mapping, and multi-branch structure; Inference phase: Batch normalization layers are merged into convolutional layers, eliminating individual BN layers; consecutive 1×1 convolutions are merged. Remove the identity mapping; Fold a multi-branch structure into a single branch; For a structure where a convolutional layer is followed by a batch normalization (BN) layer: ; Reparameterization to a single convolutional layer: ; The fused convolutional weights and biases are as follows: ; ; Where: R is the weight matrix of the original convolutional layer; b' is the bias vector of the original convolutional layer; μ is the mean vector obtained by the BN layer during the training phase; σ 2 γ is the variance vector obtained statistically during the training phase of the BN layer; β is the scaling parameter of the BN layer; ε is the translation parameter of the BN layer; and ε is a small numerical stability constant to prevent the denominator from being zero.

8. The multi-scale intelligent detection method based on oilfield power operation safety targets according to claim 7, characterized in that: Specifically, 3.4 refers to: (1) Warm-up phase: The first 10 epochs use η init / 10, gradually increasing to the set base learning rate η. base =0.0008; (2) Main training phase: adopt the cosine annealing learning rate scheduling strategy, the learning rate starts from η base It smoothly decays to near 0, eventually converging to a better local optimum; (3) Gradient clipping: To prevent gradient explosion, normalization is performed when the gradient norm exceeds a threshold. (4) Regularization strategy: L2 regularization: weight decay coefficient set to 0.0005; Dropout: dropout is used in the fully connected layer of the detection head; Data augmentation: random horizontal flip, random cropping, color dithering, mosaic enhancement; (5) The optimizer used is the AdamW optimizer; (6) Batch size and number of training epochs: The batch size is 4, the total number of training epochs is 300, and the early stopping strategy with a pause of 250 is adopted. When the performance of the validation set does not improve for 250 consecutive epochs, the training is terminated early.