An unmanned aerial vehicle sea surface oil spill position detection method based on artificial intelligence

CN123016257APending Publication Date: 2026-10-30ZHANJIANG BRANCH OF CHINA NATIONAL OFFSHORE OIL CORP +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611191084.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-07
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0005]为了解决面对复杂海况下溢油目标扩散方向任意、边界模糊且类别极度不平衡,导致现有检测模型难以实现高精度紧凑定位和有效抗干扰的问题,本发明提供了一种基于跨尺度特征聚合的无人机海面溢油旋转检测方法及系统

Benefits of technology

由于本发明提供的一种基于跨尺度特征聚合的无人机海面溢油旋转检测方法通过跨尺度特征聚合与旋转回归策略,有效解决了复杂海况下非定型流体目标边界模糊与扩散方向任意的难题。一方面利用包含语义引导融合模块的跨尺度特征聚合模块,通过多尺度交叉注意力机制以深层全局语义作为空间掩码,自适应地锐化浅层微观油膜的模糊边界并强效压制海浪背景噪声,从而保护了极薄油膜的高频边缘,显著降低了复杂海况下的误报率;另一方面采用旋转边界框替代传统水平框,结合角度回归机制使边界框能够沿油污的实际扩散方向发生自适应倾斜,大幅减少了检测框内的无关海水背景,实现了对具有方向任意性的不规则流体目标的高精度紧凑贴合。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123016257A_ABST
    Figure CN123016257A_ABST
Patent Text Reader

Abstract

The application provides a UAV sea surface oil spill rotation detection method and system based on cross-scale feature aggregation, belonging to the field of UAV remote sensing and image processing, comprising: acquiring a UAV low-altitude sea surface oil spill image and extracting a multi-scale hierarchical feature map; performing cross-scale feature aggregation on the multi-scale hierarchical feature map based on a semantic guidance fusion module, using a multi-scale cross-attention mechanism to generate an aggregated feature map that suppresses sea wave background noise and sharpens edges, with deep global semantics as a spatial mask; inputting the aggregated feature map into a rotation target detection head and combining a multi-dimensional joint loss function to perform bottom layer optimization; and determining a sea surface oil spill target detection result according to the category probability distribution output by the rotation detection head and the rotation bounding box containing angle information. The method effectively solves the problems of blurred oil spill target boundaries and arbitrary diffusion directions in complex sea conditions, greatly reduces irrelevant background in the detection box, and realizes high-precision fitting and efficient positioning of the non-regular fluid contour.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of UAV remote sensing and image processing technology, specifically relating to a method and system for detecting rotating oil spills on the sea surface using UAVs based on cross-scale feature aggregation. Background Technology

[0002] Marine oil spills pose a devastating threat to fragile marine ecosystems and coastal economies, making real-time monitoring and precise location crucial for emergency response projects. Currently, macroscopic monitoring of marine oil spills primarily relies on traditional Synthetic Aperture Radar (SAR), which offers all-weather, wide-area monitoring capabilities. However, traditional SAR technology has inherent limitations, being highly susceptible to environmental noise interference in low-wind-speed sea conditions, leading to false alarms. Furthermore, conventional methods struggle to differentiate between various types of pollutants, such as oil films and emulsions, failing to fully meet the objective market demand for precise location in disaster emergency cleanup.

[0003] To address the aforementioned needs and pain points, the industry has introduced low-altitude optical remote sensing technology based on UAV platforms in recent years. Leveraging its high spatial and temporal resolution, it has gradually become a core tool for refined oil spill monitoring. To achieve automated interpretation of UAV oil spill images, existing deep learning detection methods are mainly divided into two categories: pixel-level semantic segmentation models and combined target detection architectures. Pixel-level semantic segmentation methods improve the model's ability to represent small sample oil spill features by introducing a lightweight adapter mechanism. However, because pixel-level segmentation in this type of method has a fixed receptive field, it is difficult to explicitly model the boundary uncertainty when oil spills spread arbitrarily with wind direction. On the other hand, combined target detection architecture methods mainly utilize networks such as YOLO to perform oil spill boundary delineation under dynamic wave interference. While this improves monitoring efficiency to some extent, such methods typically rely on complex module cascading, resulting in huge computational overhead. This makes it difficult for the model to achieve an effective balance between detection accuracy and computational efficiency in practical application scenarios where UAV computing power is limited.

[0004] However, considering that oil spills on the sea surface exhibit irregular diffusion patterns with arbitrary directions due to the dragging of wind and waves, most existing detection models rely on orthogonal horizontal bounding boxes. This specific architecture inevitably introduces massive amounts of background noise from the water surface when enclosing tilted, amorphous fluids, easily causing feature overlap and boundary distortion between adjacent oil spill instances. Simultaneously, existing methods based on conventional encoders are prone to feature dilution of high-frequency information during hierarchical feature transfer, causing the edge details of shallow, small oil films to be completely submerged by wave noise. Furthermore, in real-world sea surface scenarios, the actual distribution of oil spill categories exhibits an extreme long-tail effect, with wide-area water surfaces and thick oil spills dominating, while early thin oil films and facility samples are extremely scarce. Existing models generally lack effective compensation mechanisms for extreme category imbalances, easily leading to missed detections of key pollution sources at the tail end. In summary, facing oil spill targets with arbitrary diffusion directions, blurred boundaries, and extremely imbalanced categories under complex sea conditions, existing detection models relying on horizontal bounding boxes and conventional feature transfer struggle to achieve high-precision, compact regression of the physical geometric contours of amorphous fluids, and the model's boundary perception capability and robustness against interference remain severely limited. Summary of the Invention

[0005] To address the challenges posed by the arbitrary diffusion direction, ambiguous boundaries, and extreme imbalance of oil spill targets under complex sea conditions, which hinders existing detection models from achieving high-precision, compact positioning and effective anti-interference, this invention provides a UAV-based method and system for detecting rotating oil spills on the sea surface, based on cross-scale feature aggregation.

[0006] To achieve the above objectives, the present invention provides the following technical solution: A method for detecting rotating oil spills on the sea surface using unmanned aerial vehicles (UAVs) based on cross-scale feature aggregation includes: A low-altitude image of an oil spill on the sea surface from a drone to be detected is acquired. Features are extracted from the oil spill image using a backbone network to obtain a hierarchical feature pyramid, which includes deep semantic features and shallow detail features. The deep semantic features and shallow detail features are aggregated across scales using a cross-scale feature aggregation module that includes a semantic-guided fusion module. Background noise is suppressed by using a multi-scale cross-attention mechanism with deep global semantics as a spatial mask to obtain an aggregated feature map. The aggregated feature map is input to the decoupled rotating detection head, and the class probability distribution of the oil spill target and the rotating bounding box parameters containing angle information are predicted and output in parallel. Based on the category probability distribution and the rotation bounding box parameters containing angle information, the detection results of oil spill targets in the UAV low-altitude sea surface oil spill image are determined.

[0007] This invention also provides a UAV-based oil spill rotation detection system for the sea surface based on cross-scale feature aggregation, comprising: The feature extraction module is used to acquire low-altitude oil spill images of the sea surface from the UAV to be detected; and to extract features from the oil spill images of the sea surface through a backbone network to obtain a hierarchical feature pyramid, which includes deep semantic features and shallow detail features. The feature aggregation module is used to aggregate the deep semantic features and shallow detail features across scales using the cross-scale feature aggregation module that includes the semantic guidance fusion module. It uses a multi-scale cross-attention mechanism to suppress background noise by using deep global semantics as a spatial mask to obtain an aggregated feature map. The result recognition module is used to input the aggregated feature map into the decoupled rotating detection head, predict and output the category probability distribution of the oil spill target and the rotating bounding box parameters containing angle information in parallel; and determine the detection result of the oil spill target in the UAV low-altitude sea surface oil spill image based on the category probability distribution and the rotating bounding box parameters containing angle information.

[0008] The present invention provides a method and system for detecting rotating oil spills on the sea surface using unmanned aerial vehicles (UAVs) based on cross-scale feature aggregation, which has the following advantages: The UAV-based oil spill rotation detection method for the sea surface provided by this invention effectively solves the problems of blurred boundaries and arbitrary diffusion directions of non-amorphous fluid targets under complex sea conditions by employing cross-scale feature aggregation and rotation regression strategies. On one hand, it utilizes a cross-scale feature aggregation module including a semantic-guided fusion module, employing a multi-scale cross-attention mechanism with deep global semantics as a spatial mask to adaptively sharpen the blurred boundaries of shallow microscopic oil films and effectively suppress background noise from ocean waves, thereby protecting the high-frequency edges of extremely thin oil films and significantly reducing the false alarm rate under complex sea conditions. On the other hand, it replaces the traditional horizontal bounding box with a rotated bounding box, and combined with an angle regression mechanism, enables the bounding box to adaptively tilt along the actual diffusion direction of the oil spill, greatly reducing irrelevant seawater background within the detection frame and achieving high-precision, compact fitting of irregular fluid targets with arbitrary directions.

[0009] Furthermore, the UAV-based oil spill rotation detection method for marine surfaces based on cross-scale feature aggregation provided in this invention introduces a weighted strategy based on the inverse of the number of categories for classification gradient compensation during the network optimization stage. This mechanism effectively corrects the model's bias towards fitting the majority class when fitting long-tail data by assigning higher penalty weights to rare categories. This not only forces the network to learn the features of scarce categories and improves the missed detection problem caused by extreme class imbalance, but also significantly improves the detection capability and model recall rate of small and scarce oil spill targets (such as offshore facilities or localized emulsions). Attached Figure Description

[0010] To more clearly illustrate the embodiments and design schemes of the present invention, the accompanying drawings required for this embodiment will be briefly described below. The drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a schematic diagram of the UAV-based method for detecting rotating oil spills on the sea surface based on cross-scale feature aggregation, provided in an embodiment of the present invention. Figure 2 This is an example of the overall model framework provided in the embodiments of the present invention; Figure 3 This is an example of a semantic guidance fusion module provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the oil stain target detection results provided in an embodiment of the present invention; Detailed Implementation

[0012] To enable those skilled in the art to better understand and implement the technical solutions of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and should not be construed as limiting the scope of protection of the present invention.

[0013] Compared to conventional target detection models based on orthogonal horizontal bounding boxes, rotated target detection models, by introducing angle parameters, are configured to fit target distributions that are tilted or arbitrarily oriented. However, for non-morphic fluids such as oil spills on the sea surface, conventional path aggregation feature networks are prone to feature dilution of high-frequency information during layer-by-layer propagation. Furthermore, existing bounding box models, when encompassing irregularly spreading oil spills dragged by ocean currents, incorporate seawater background noise, leading to feature aliasing and boundary distortion. A basic rotated target detection architecture typically consists of a deep convolutional backbone network, a feature aggregation network, and a detection head, such as... Figure 2As shown, the deep convolutional backbone network is configured to extract multi-scale hierarchical feature pyramids from the input image, each corresponding to a feature map with a specific downsampling stride relative to the input image. The feature aggregation network is used to pass and fuse the feature maps layer by layer. Finally, the decoupled rotation detection head outputs the target's class probability distribution and rotation bounding box parameters containing angle information in parallel. Based on this, this invention proposes a cross-scale feature aggregation rotation detection architecture for non-amorphous fluid features. Specifically, for the multi-scale feature fusion stage, a cross-scale feature aggregation module including a semantically guided fusion module is designed. This module adopts an asymmetric cascaded fusion topology, calculates the spatial correlation between aligned deep and shallow features through a multi-scale cross-attention mechanism to generate an attention mask, and uses deep global semantics to guide the shallow network to filter out background interference. Furthermore, for the network optimization part, a weighted strategy based on the inverse of the number of classes is introduced into the classification loss for classification gradient compensation; at the same time, rotation intersection-union loss, distribution focus loss, and angle loss are jointly used in the regression head. The combination of the above architecture and joint constraint strategy improves the network's feature learning efficiency for long-tailed data and enhances the accuracy of the detection box in locating the fluid tilt direction.

[0014] Example 1 This application provides a method for detecting UAV oil spill rotation at sea based on cross-scale feature aggregation. A constructed Cross-scale Feature Aggregation OBB (CFA-OBB) network processes low-altitude UAV oil spill images to obtain high-precision oil spill classification and rotation localization results. The CFA-OBB network comprises a deep convolutional backbone network, a cross-scale feature aggregation module, and a decoupled rotation detection head, connected sequentially. The deep convolutional backbone network extracts a hierarchical feature pyramid. The cross-scale feature aggregation module contains multiple asymmetric cascaded Semantic Guided Fusion Blocks (SGFBs). The decoupled rotation detection head includes parallel classification and angle regression branches. The specific steps include: Step 11: Obtain low-altitude oil spill images of the UAV to be detected on the sea surface; extract features from the oil spill images on the sea surface through a backbone network to obtain multi-scale hierarchical feature maps.

[0015] Specifically, the cross-scale aggregation and rotational regression network provided by this invention, such as... Figure 2As shown, the system consists of three parts: a deep convolutional backbone network, a cross-scale feature aggregation module, and a rotating detection head. It performs deep reconstruction of the feature aggregation topology on a basic rotating target detection framework to help improve the model's accuracy in oil spill detection under complex sea conditions. In the deep convolutional backbone network, considering that oil spills on the sea surface typically exhibit a gradual diffusion pattern from a thick oil slick at the center to a thinner oil film on the periphery, and that the scale of oil spill targets varies greatly, this embodiment uses a residual network or a deep convolutional backbone network similar to the YOLO series (such as the backbone network structure of YOLOv8s) to achieve sufficient multi-scale extraction of oil spill features.

[0016] First, low-altitude remote sensing images of the oil spill on the sea surface are acquired using an optical sensor mounted on an unmanned aerial vehicle (UAV) platform. To ensure standardization and computational efficiency in model processing, the spatial resolution of the input UAV low-altitude oil spill images is uniformly adjusted and standardized to a preset size (e.g., 640×640 pixels). Subsequently, the standardized images are input into the deep convolutional backbone network. The backbone network extracts a hierarchical feature pyramid from the input images through a series of downsampling convolutional layers, batch normalization layers, and activation functions. This hierarchical feature pyramid specifically extracts feature map sets corresponding to different spatial resolutions, corresponding to downsampling strides of 8×, 16×, and 32× relative to the input image, respectively.

[0017] Shallow feature maps with smaller downsampling factors (such as 8× downsampling feature maps) retain rich spatial details and high-frequency edge information, which is crucial for identifying the microscopic contours of extremely thin silvery-white oil slicks (Sheen) and rainbow oil slicks (Rainbow) on the sea surface. Deep feature maps with larger downsampling factors (such as 32× downsampling feature maps) have a larger receptive field, containing rich global semantic information, and can effectively capture the macroscopic topological structure of thick oil slicks (Truecolor) as well as the overall marine background context. Through hierarchical extraction using a deep convolutional backbone network, the model effectively separates oil spill features from microscopic edges to macroscopic topology, providing multi-dimensional, high-quality feature representations for subsequent cross-scale feature reuse.

[0018] Step 12: Based on the semantic-guided fusion module, perform cross-scale feature aggregation on the multi-scale hierarchical feature map, and use the global semantics of deep features to suppress ocean wave background noise to obtain the aggregated feature map with sharpened edges.

[0019] Specifically, addressing the ambiguous physical characteristics of oil spill targets on the sea surface, and to overcome the high-frequency information dilution defect caused by the layer-by-layer transmission of traditional Path Aggregation Networks (PANets), this invention designs a cross-scale feature aggregation (CFA) module based on a semantically guided fusion module at the network neck. This module adopts an asymmetric cascaded fusion topology and utilizes a multi-scale cross-attention mechanism to calculate the spatial correlation between features at different scales, performing a skip-dense mapping between shallow spatial details and deep global priors.

[0020] The specific operation process of the Semantic Guided Fusion Module (SGFB) includes the following steps: Step 121: Obtain deep semantic features and shallow detail features, and perform scale alignment operation on the deep semantic features to match the spatial scale and channel dimension of the shallow detail features to obtain the aligned deep feature map.

[0021] Step 122: Perform multi-scale adaptive average pooling on the shallow detail features and the aligned deep feature maps respectively, and perform pooling compression operations in the height and width directions to obtain the height direction vector and the width direction vector respectively.

[0022] Step 123: Perform cross matrix multiplication on the height direction vector and the width direction vector, and then process them with an activation function to generate a spatial attention mask.

[0023] Step 124: Multiply the local edge information of the shallow detail features extracted by depthwise separable convolution with the spatial attention mask element-wise, and then linearly map it to the specified number of output channels through the convolutional layer to obtain the fused and enhanced features.

[0024] Specifically, in step 121, the SGFB module receives feature maps from two different sources: one is shallow detail features with high spatial resolution but weak semantics (let its number of channels be...). Another is deep semantic features with lower spatial resolution but stronger semantics (let its number of channels be...). ),generally Much larger The specific design of SGFB is as follows: Figure 3 As shown. Due to the inconsistency in spatial scale and channel dimension between the two, subsequent mathematical fusion operations cannot be directly performed. The module first performs a scale alignment operation. The scale alignment operation uses bilinear interpolation or deconvolution to upsample the deep semantic features, making their spatial dimensions consistent with the shallow detail features; at the same time, it uses 1×1 convolution to adjust the number of channels, obtaining the aligned deep feature map. .

[0025] In step 122, the aligned features are fed into a multi-scale cross-attention mechanism for deep fusion, as shown in formula (1). First, multi-scale adaptive average pooling is performed, with independent pooling compression operations in the height and width directions applied to the shallow features and the aligned deep feature maps, respectively. This pooling operation aims to separate and capture the oil spill distribution features in the vertical and horizontal directions, generating the height direction vector corresponding to the deep semantic features. With width direction vector And the height direction vector corresponding to shallow detail features With width direction vector .

[0026] (1) In step 123, to capture cross-scale spatial correlation, the network performs cross-matrix multiplication on the height and width vectors obtained from different layers. Specifically, the height vector of deep features is multiplied by the transpose of the width vector of shallow features, and the height vector of shallow features is multiplied by the transpose of the width vector of deep features. The results of the two cross-multiplications are processed by the Sigmoid activation function, mapping their values ​​to the (0,1) interval to generate two spatial attention masks, as shown in formula (2). This mask integrates the global macroscopic perspective of the deep network and the local microscopic perspective of the shallow network, where the high-response region represents the core area of ​​the oil spill, and the low-response region corresponds to environmental noise such as sea foam that needs to be suppressed.

[0027] (2) In step 124, to protect the high-frequency edge information in the shallow features from being destroyed, a depthwise separable convolution operation is first performed on the shallow features to extract the local oil film edge response features. Then, this local edge information is multiplied element-wise with the two spatial attention mask images generated earlier, and then multiplied with the shallow detail features. Perform residual connections to obtain the fused and enhanced features. As shown in formula (3). This process is equivalent to using deep global semantics as a spatial gating mechanism to adaptively preserve and sharpen the blurred boundaries of shallow microscopic oil films, while effectively suppressing irrelevant seawater background noise. The features enhanced by the mask are finally linearly mapped to the specified number of output channels required by the network through a 1×1 convolutional layer, thus completing the feature enhancement and dimensionality unification of a single SGFB module.

[0028] (3) Furthermore, to achieve progressive feature aggregation for amorphous oil spill fluids, this invention employs an asymmetric cascaded fusion topology between different levels of the feature pyramid within the cross-scale feature aggregation module, specifically in three progressive stages: The first stage involves cross-level feature fusion. The network fuses the deepest features output by the backbone network. (e.g., 32× downsampling features) and the highest resolution shallow features (e.g., 8× downsampled features) are input into the first-level SGFB module for forced skip fusion. This process directly utilizes the strongest global context prior of the deepest features as a spatial mask to guide the shallowest network with the highest resolution to filter out wave clutter interference, outputting first-stage fused features with clearer edges and a cleaner background. As shown in formula (4).

[0029] (4) The second stage is mid-level semantic fusion. This involves fusing the features output from the first stage. Mid-layer features of the backbone network output (e.g., 16× downsampled features) are input into the second-level SGFB module for aggregation. This process spatially combines purified micro-edges with medium-sized oil spill features to generate intermediate-level features suitable for detecting most conventionally sized oil spill targets. As shown in formula (5).

[0030] (5) The third stage is deep feature update. This involves updating the intermediate features output from the second stage. Again with the deepest features of the backbone network Combined, the data is input into the third-level SGFB module, as shown in formula (6). The physical significance of this is that the high-frequency edge detail information (such as the boundary of the thin oil film) extracted and purified through the first two stages is transmitted back to the deep network. This operation breaks the limitation of the traditional pyramid which only transmits data unidirectionally from top to bottom or bottom to top, and greatly enhances the deep feature map's ability to identify and respond to fuzzy boundaries. Finally, the high-level feature set output by these three cascaded stages constitutes an aggregated feature map, which effectively preserves the boundary gradient information of the oil spill, providing a solid feature foundation for the subsequent accurate regression of the tilt angle of the non-amorphous fluid by the rotating detection head.

[0031] (6) Step 13: Input the aggregated feature map into the decoupled rotating target detection head to predict the category probability distribution of the oil spill target and perform parameter regression of the rotating bounding box containing angle information.

[0032] Specifically, after obtaining the aggregated feature map that integrates deep semantics and shallow details, this invention abandons the orthogonal horizontal boundary framework that easily introduces massive water surface background noise when enclosing tilted fluids, and instead uses a rotating target detection head to handle non-shaped fluids. The rotating detection head adopts a decoupled structure, sending the aggregated feature map to the classification branch and regression branch for independent processing, in order to avoid feature space conflicts between category prediction and spatial localization tasks.

[0033] For the classification branch, the network outputs the probability distribution of each category (e.g., offshore facility object, rainbow oil film, thin oil film, thick oil sludge truecolor).

[0034] For the regression branch, the network extends the target parameterized model to a rotated bounding box, outputting bounding box parameters that include angle information, denoted as . .in, Indicates the center physical coordinates of the rotated bounding box. This indicates the width of the rotated bounding box (usually referring to the span along the major axis). This indicates the height of the rotated bounding box (usually referring to the span along the minor axis). This represents the angle between the longer side of the bounding box and the X-axis of the image's physical coordinate system. This is achieved by introducing an angle parameter. The detection box can adaptively tilt along the main direction of the actual spread of oil spill dragged by wind and waves, thereby tightly wrapping the narrow oil spill fluid. This significantly reduces irrelevant seawater pixels inside the detection box from a physical and geometric perspective, and reduces feature overlap between adjacent oil spill instances of different categories.

[0035] More importantly, in the training and underlying optimization stages of the network model, to address the various challenges posed by oil spills at sea, this invention introduces a joint loss optimization strategy. This strategy guides the gradient update of network parameters through a carefully designed multi-dimensional loss function. The specific training and optimization process includes: Step 131: In the classification branch, calculate the weighted classification loss based on the inverse of the number of classes to perform classification gradient compensation.

[0036] Step 132: In the regression branch, jointly calculate the total regression loss, which includes the rotation crossover ratio loss, the distribution focus loss, and the angle loss.

[0037] Specifically, regarding step 131, in the actual distribution of marine oil spill image data, seawater background and thick oil slicks (Truecolor) usually dominate, while the number of samples of key early local emulsions or marine spill source facilities (Objects) is extremely small, exhibiting a severe long-tail effect. Without intervention, the model will easily develop a fitting bias towards the majority class samples during backpropagation training, causing the gradients of rare classes to be submerged, thereby reducing the critical recall rate in emergency response. Therefore, this invention introduces a weighted loss strategy (Weighted Loss, WL) based on the inverse of the number of classes, in addition to the traditional classification cross-entropy loss.

[0038] For a specific class C in the training batch, the network dynamically calculates its compensation weight. This weight is defined as the reciprocal of the ratio of the total number of instances of that class to the total number of samples in the entire set. To prevent the reciprocal from amplifying infinitely when encountering extremely scarce classes, thus causing gradient explosion during network training, this module introduces a truncation threshold mechanism to forcibly truncate the maximum compensation weight within a set threshold. The modified weighted classification loss function allows the model to adaptively assign larger error penalty weights to minority class samples (such as leak sources) when calculating the loss, thereby forcing the deep neural network to mine and learn the deep features of scarce classes, thoroughly improving the problem of missed detections caused by extreme class imbalance.

[0039] For step 132, for the rotation regression branch, the present invention uses three loss functions in combination to constrain the localization performance of the network, as shown in formula (7).

[0040] (7) First, a rotational crossover ratio loss is used. To replace the traditional L1 / L2 distance loss, traditional coordinate point distance calculations cannot accurately measure the degree of overlap between two tilted rectangles due to the angle of the rotated bounding box. The rotation intersection-union ratio (ROU) directly calculates the physical overlap area ratio between the predicted rotated bounding box and the actual label rotated bounding box using analytical methods or polygon intersection algorithms, ensuring scale invariance. Secondly, a distributed focus loss is introduced. Because the boundaries of oil spill fluids are often accompanied by a semi-transparent gradient (such as an extremely thin sheen region), it is difficult to determine an absolutely rigid physical boundary line at the pixel level. Distributed focus loss does not require the network to output an absolute boundary coordinate scalar; instead, it models the position prediction of the bounding box edge as a discrete probability distribution problem, allowing the network to output the probability integral of the boundary within its neighborhood. This mechanism allows the model to maintain a certain degree of output flexibility when encountering blurred oil film boundaries, effectively reducing the positioning oscillations and errors caused by hard regression.

[0041] Finally, an explicit angle loss is added. Specifically designed for angle parameters. Calculate the periodic deviation between the predicted value and the actual deflection angle. Explicit angle constraints guide the detection frame to quickly align with the tilting diffusion direction of the oil slick, combined with distributed focal loss. Compared with rotational crossover loss Together, they drive the network to output a non-rigid fluid bounding box with extremely high fit. The total loss function of the network optimization... This is the weighted sum of the aforementioned weighted classification loss, rotation intersection-union ratio loss, distribution focus loss, and angle loss. The model weights of the backbone network, CFA module, and detection head are continuously updated through the backpropagation algorithm and optimizers such as Adam or SGD.

[0042] Step 14: Based on the category probability distribution and the rotation bounding box parameters, determine the refined classification and rotational positioning detection results of the oil spill targets in the oil spill image.

[0043] Specifically, when the model completes training and is deployed in a real-world UAV disaster monitoring system, the decoupled rotating detection head will output thousands of candidate bounding boxes. To obtain the final, clear detection results, these candidate outputs need to be post-processed and analyzed.

[0044] First, the network extracts the category probability distribution information of all candidate predicted boxes, extracts the highest probability score as the confidence score of the detected box, and compares it with a preset confidence threshold (e.g., 0.5). Predicted boxes below this threshold are judged as background noise or wave interference and are directly rejected.

[0045] Secondly, to address the issue of the same oil spill area being repeatedly identified by multiple overlapping detection boxes, this invention employs a Rotated Non-Maximum Suppression (R-NMS) algorithm adapted for tilted rectangles. This algorithm sorts the remaining predicted boxes in descending order based on their confidence scores, prioritizing the retention of the highest-scoring baseline rotated box, and then calculates the rotation intersection-union ratio (ROU) of all other boxes with that baseline box. If the ROU of a box with the baseline box exceeds a set overlap threshold (i.e., they are considered to have selected the same oil spill area), it is suppressed and filtered out.

[0046] Finally, the high-confidence, high-independence rotated bounding boxes remaining after R-NMS filtering are the final detection results. The system uses the retained rotated bounding box parameters... The coordinates of the oil film on the normalized feature map are inversely mapped back to the physical space of the original high-resolution UAV aerial image of size . Combined with the pollution type (thin oil film, thick oil film, etc.) determined by the category probability, a visual detection image with category label, precise tilted bounding contour, and diffusion direction is finally output on the user terminal or emergency command screen.

[0047] The method provided in this invention overcomes detail dilution in feature transfer through the SGFB multi-scale cross-attention mechanism, successfully separating the fuzzy boundaries of amorphous fluids under the interference of ocean foam. Furthermore, by using a decoupled rotating detection head and joint loss optimization incorporating a reciprocal weighting strategy, it breaks through the bottleneck of orthogonal horizontal bounding boxes in locating oil spills in arbitrary diffusion directions, and ensures the detection rate of minority classes even under extreme long-tailed class distributions. Without relying on massive computational overhead, this method achieves a highly efficient balance between monitoring accuracy and inference efficiency with a relatively small number of model parameters, providing a reliable and high-precision intelligent technical solution for UAV-based low-altitude marine disaster emergency response and accurate measurement of contaminated area.

[0048] Example 2 Based on Example 1, the CFA-OBB UAV oil spill rotation detection model based on cross-scale feature aggregation adopted in this invention is rigorously compared with several publicly available mainstream rotating target detection networks in terms of quantitative performance. Furthermore, through module ablation experiments, the effectiveness, robustness, and engineering feasibility of the oil spill rotation detection method and system provided by this invention are further explained.

[0049] Specifically, this embodiment uses the LADOS low-altitude UAV oil spill remote sensing dataset for training, optimization, and performance evaluation of the algorithm model. This dataset is a professional, publicly available target detection dataset constructed by UAVs equipped with optical sensors under real and varied complex sea conditions. Its physical scenes aim to realistically reflect the physical diffusion morphology of oil spills under the drag of ocean currents and the influence of wind and waves. To comprehensively verify the high-precision detection capability of the model provided by this invention for oil slicks of different thicknesses and physical forms, as well as related marine targets, the dataset used in this embodiment was strictly divided into four specific semantic categories during the data annotation stage: "Marine facilities or leak sources (object)," "rainbow oil film," "silver-white thin oil film (sheen)," and "true-color thick oil slick (truecolor)."

[0050] Regarding sample size and distribution, this system employs strict data partitioning logic, randomly sampling and isolating the 2570 high-resolution UAV aerial images acquired. Based on a ratio of approximately 4:1, the dataset is divided into a training set for network parameter optimization and a test set for blind testing of model performance. System statistics show that the training set contains 2052 images, and the test set contains 818 images. More importantly, this dataset exhibits a typical, extremely imbalanced (long-tail) data distribution. Specifically, in the total dataset, there are as many as 2462 instances of "truecolor" oil slicks, representing the main pollution source, 1293 instances of "sheen" oil films, and 566 instances of "rainbow" oil films, while only 67 instances represent key traceability clues such as "marine facilities or leak sources." This extreme imbalance in data distribution places extremely high demands on the robustness of feature extraction and the recall capability of rare categories in the detection system, effectively verifying the practical utility of the weighted classification loss compensation mechanism based on the reciprocal of the number of categories described in Embodiment 1 of this invention.

[0051] All underlying logic for model training, network weight updates, and inference testing is executed on a unified hardware computing platform and software runtime environment. Specifically, the hardware computing platform in this embodiment is configured as a graphics workstation equipped with a single NVIDIA GeForce RTX 4090 GPU with 24GB of video memory. The software runtime environment is configured with a Python 3.10.18 interpreter and relies on the PyTorch 2.6.0 deep learning framework for tensor computation and automatic gradient differentiation. To accelerate the convergence speed of the rotation detection network provided in this invention and to enable the network backbone to obtain more robust underlying visual feature representations, the system's backbone network initialization module calls the weight parameters pre-trained on a general massive dataset using the official YOLOv8s-OBB model for initialization.

[0052] During the model training and optimization phase, the detection model provided by this invention employs the following rigorous hyperparameter control logic: the spatial resolution of the input image is uniformly adjusted and forcibly standardized to a 640×640 pixel tensor matrix; the batch size for network training is set to 16; and the total iteration cycle for model parameter optimization is set to 300 epochs. Furthermore, to effectively prevent overfitting when fitting extremely imbalanced long-tailed data, an early stopping monitoring mechanism is introduced in the training process, with the tolerance threshold configured to 50 epochs. Regarding learning rate scheduling, the system uses a standard initial learning rate and employs a cosine annealing strategy to smoothly control the learning rate decay curve, ensuring that the network escapes local minima with a large step size in the early stages of training and accurately converges to the global optimum in the later stages.

[0053] For target detection evaluation metrics, considering the physical characteristics of oil spill targets on the sea surface from the UAV perspective, such as amorphous shape, arbitrary diffusion direction, and blurred fluid edges, this embodiment uses precision (P), recall (R), and mean average precision (mAP) as core quantitative evaluation indicators. Furthermore, the logic for jointly statistically analyzing the output results of the rotating detection network is based on the Rotated Intersectionover Union (IoU) ratio. θ Based on the determination of the angle parameters, since this invention uses a rotated bounding box containing angle information, the evaluation module is configured to calculate the physical intersection area between the predicted bounding box with angle parameters and the ground truth bounding box using a polygon intersection algorithm, and divide it by the union of the two areas to obtain the IoU. θ .

[0054] The specific joint decision-making statistical logic is as follows: Only when the IoU between the predicted rotated bounding box and the true rotated bounding box is the calculated IoU... θ If the intersection-over-union (IoU) ratio exceeds the set threshold and the class predictions are consistent, the prediction is successfully detected and recorded as a TruePositive (TP). If a real oil spill target is not selected by any predicted bounding box that meets the conditions, a false negative (FN) is detected. A false negative (FN) occurs if the predicted bounding box fails to match any true bounding box (e.g., misidentifying normal sea foam as oil slick), or if the IoU is not matched. θ If the data is below the threshold, a false alarm occurs and is recorded as a false positive (FP). After statistically analyzing the data for each category using the above logic, the corresponding precision and recall are calculated.

[0055] Furthermore, this invention introduces mAP@50 and the extremely stringent mAP@50-95 as comprehensive performance metrics. Here, mAP@50 represents the arithmetic mean of the average accuracy (AP) calculated for all categories when the cross-union ratio (IoU) threshold is 0.5. And mAP@50-95 represents the IoU within the system. θ The matching threshold was strictly increased from 0.50 to 0.95 (with an increment step of 0.05), and the average value of mAP was calculated for each stringent threshold. This stringent metric can significantly amplify the positioning error and accurately reflect whether the rotated bounding box output by the model achieves tight enclosure and high-precision geometric fit for irregular and non-amorphous fluids.

[0056] To verify the advancement of this invention, the models compared include the current mainstream single-stage rotating target detection algorithm architectures, namely the ultra-lightweight model YOLOv8n-OBB and the medium-sized network model YOLOv8m-OBB in the YOLO-OBB series, as well as the official baseline network model YOLOv8s-OBB, which has a similar number of parameters as this invention. Details are shown in Table 1. The performance of the UAV oil spill rotation detection model based on cross-scale feature aggregation (CFA-OBB) provided by this invention is compared with the above models. The specific quantitative comparison results are analyzed below: Table 1 Performance Comparison of Different Mainstream Rotating Target Detection Algorithms ; Analysis of the overall test data shows that, compared to several existing mainstream rotating target detection algorithms, the CFA-OBB model provided by this invention exhibits extremely superior detection performance in handling complex oil spill scenarios. Specifically, in terms of precision, a core metric reflecting the model's ability to withstand complex background interference, the CFA-OBB model provided by this invention achieves an optimal value of 96.55%. In comparison, the baseline YOLOv8s-OBB has a precision of only 89.25%, the parameter-intensive YOLOv8m-OBB has a precision of 92.68%, and the lightweight YOLOv8n-OBB only reaches 83.73%. The precision of this invention significantly surpasses the baseline model YOLOv8s-OBB by a significant 7.30%.

[0057] In terms of recall, which reflects the model's ability to resist missed detections, the model of this invention maintains a high level of 90.31%, which is also better than the baseline model's 86.57%, and surpasses the medium-sized network YOLOv8m-OBB with double the number of parameters (its recall is 89.84%).

[0058] In a thorough examination of the trade-off between detection accuracy and system computational resources, experimental data further highlights the superior parameter utilization efficiency of the network architecture of this invention. While the extremely lightweight YOLOv8n-OBB model has only 3.10M parameters, its precision and recall are both at the bottom due to its extremely limited receptive field, making it unsuitable for highly complex oil spill monitoring scenarios with noisy backgrounds. Furthermore, the officially provided medium-sized network YOLOv8m-OBB attempts to boost performance by simply stacking traditional convolutional layers to a massive 26.80M of parameters; however, its overall performance metrics still lag behind the model provided by this invention. In contrast, the CFA-OBB model provided by this invention introduces only minor architectural modifications to the baseline network, with the total number of parameters strictly controlled at 13.13M (only about 1.71M more than the baseline model), yet it comprehensively surpasses the extreme models with a large number of parameters in all core evaluation metrics.

[0059] The above comparison results show that, for fluid targets with blurred boundaries and highly irregular shapes from a sea surface perspective, traditional models, by blindly expanding network capacity or stacking conventional convolutional layers, are prone to high-frequency feature dilution during hierarchical feature transfer, severely limiting their performance gains. The CFA-OBB model provided in this invention effectively overcomes the feature extraction challenge of non-morphological fluid targets through a carefully designed cross-layer feature connection and semantic guidance module. The cross-scale feature aggregation mechanism (CFA) plays a core leading role in suppressing complex surface clutter such as sea foam and accurately stripping away the true fluid boundaries, ensuring the model's effective detection of small and scarce oil spill targets.

[0060] Furthermore, to more intuitively observe and verify the actual inference and detection performance of the model provided by this invention deployed under the perspective of a real UAV, this embodiment extracted representative complex sea state images from the test set for system forward inference and output qualitative visualization result images containing bounding boxes, such as... Figure 4 As shown in the system-generated visualization, the rotated rectangles with a specific tilt angle accurately represent the oil spill boundary range predicted by the model, and the accompanying text labels indicate the pollution category and confidence probability determined by the network.

[0061] In summary, the UAV-based method and system for detecting rotating oil spills on the sea surface, based on cross-scale feature aggregation, provided by this invention, aims to completely solve the severe engineering monitoring challenges of blurred boundaries, irregular shapes, arbitrary diffusion, and extreme imbalance of pollution categories in oil spills from the UAV perspective. This invention innovatively designs an asymmetric cross-scale feature aggregation module based on SGFB, cleverly utilizing a multi-level cross-attention mechanism of shallow and deep features to significantly enhance the network model's ability to filter out wave clutter and protect high-frequency edge details of thin oil films. Simultaneously, this invention specifically proposes a rotating boundary framework combined with a joint underlying optimization algorithm incorporating a reciprocal weighting strategy and angular loss constraints, achieving accurate and compact fitting of various amorphous oil spill diffusion contours and comprehensively improving the recall response for rare categories. The massive amount of comparative experimental data, rigorous ablation mechanism analysis, and intuitive visualization results of complex scenario reasoning all comprehensively demonstrate that the method and system provided by this invention exhibit industry-leading high positioning accuracy, excellent robustness against environmental interference, and superior computational resource utilization efficiency in handling non-morphological fluid target detection tasks under dual-view / multimodal / complex sea state backgrounds. It can very well meet the stringent performance indicators and practical engineering deployment requirements of modern marine ecological environment protection and emergency response monitoring systems for sudden oil spill disasters using unmanned aerial vehicles.

[0062] Example 3 This application also provides a UAV-based oil spill rotation detection system for the sea surface based on cross-scale feature aggregation, including: The feature extraction module is used to acquire low-altitude oil spill images of the sea surface from the UAV to be detected; the feature extraction of the oil spill images is performed through the backbone network to obtain a hierarchical feature pyramid, which includes deep semantic features and shallow detail features.

[0063] The feature aggregation module is used to aggregate deep semantic features and shallow detail features across scales using the cross-scale feature aggregation module that includes a semantic-guided fusion module. It uses a multi-scale cross-attention mechanism to suppress background noise by using deep global semantics as a spatial mask to obtain an aggregated feature map.

[0064] The result recognition module is used to input the aggregated feature map into the decoupled rotating detection head, predict and output the category probability distribution of the oil spill target and the rotating bounding box parameters containing angle information in parallel; based on the category probability distribution and the rotating bounding box parameters containing angle information, the detection result of the oil spill target in the UAV low-altitude sea surface oil spill image is determined.

[0065] It should be noted that the above specific embodiments enable those skilled in the art to more fully understand the present invention, but do not limit the present invention in any way. Therefore, although the present invention has been described in detail in this specification and embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the present invention; and all technical solutions and improvements that do not depart from the spirit and scope of the present invention are covered within the protection scope of the present invention patent. No reference numerals in the claims should be construed as limiting the scope of the claims. Any simple variations or equivalent substitutions of technical solutions that can be readily obtained by those skilled in the art within the scope of the technology disclosed in the present invention are within the protection scope of the present invention.

Claims

1. A method for detecting rotating oil spills on the sea surface using unmanned aerial vehicles (UAVs) based on cross-scale feature aggregation, characterized in that: include: Acquire low-altitude oil spill images of the sea surface from the drone to be detected; extract features from the oil spill images of the sea surface through a backbone network to obtain a hierarchical feature pyramid, which includes deep semantic features and shallow detail features; The deep semantic features and shallow detail features are aggregated across scales using a cross-scale feature aggregation module that includes a semantic-guided fusion module. Background noise is suppressed by using deep global semantics as a spatial mask through a multi-scale cross-attention mechanism to obtain an aggregated feature map. The aggregated feature map is input to the decoupled rotating detection head, and the class probability distribution of the oil spill target and the rotating bounding box parameters containing angle information are predicted and output in parallel. Based on the category probability distribution and the rotation bounding box parameters containing angle information, the detection results of oil spill targets in the UAV low-altitude sea surface oil spill image are determined.

2. The method for detecting rotating oil spills on the sea surface by unmanned aerial vehicles based on cross-scale feature aggregation according to claim 1, characterized in that, The oil spill image on the sea surface is processed by a constructed cross-scale aggregation and rotation regression network, which includes a deep convolutional backbone network, a cross-scale feature aggregation module, and a decoupled rotation detection head connected in sequence; the cross-scale feature aggregation module contains multiple cascaded semantic-guided fusion modules. The cross-scale feature aggregation module performs scale alignment on the deep semantic features to obtain an aligned deep feature map, so that the aligned deep feature map and the shallow detail features are consistent in spatial scale and channel dimension. The semantically guided fusion module performs multi-scale adaptive average pooling on the shallow detail features and the aligned deep feature maps to generate height and width vectors. The height and width vectors are fused using a cross-attention mechanism to generate an attention mask. The shallow detail features, after local edge information is extracted through depthwise separable convolution, are fused with the attention mask to obtain fused enhanced features.

3. The method for detecting rotating oil spills on the sea surface by unmanned aerial vehicles based on cross-scale feature aggregation according to claim 2, characterized in that, The height and width vectors are fused using a cross-attention mechanism to generate an attention mask, including: The height direction vector corresponding to the aligned deep feature map is cross-multiplied with the width direction vector corresponding to the shallow detail feature, and then processed by an activation function to generate a first attention mask. The height direction vector corresponding to the shallow detail features is cross-multiplied with the width direction vector corresponding to the aligned deep feature map, and then processed by an activation function to generate a second attention mask.

4. The UAV-based method for detecting rotating oil spills on the sea surface based on cross-scale feature aggregation according to claim 3, characterized in that, The shallow detail features, after local edge information is extracted through depthwise separable convolution, are fused with the attention mask to obtain the fused enhanced features, including: The shallow detail features after extracting local edge information are multiplied element-wise with the first attention mask and the second attention mask; The features output by element-wise multiplication are linearly mapped to a specified number of output channels through a 1×1 convolutional layer to obtain the fused enhanced features.

5. The UAV-based method for detecting rotating oil spills on the sea surface based on cross-scale feature aggregation according to claim 2, characterized in that, The cross-scale feature aggregation module completes global cross-scale feature reuse in three progressive stages between multi-scale hierarchical feature maps, and the resulting aggregated feature map includes: The deepest features and the highest resolution shallow features are input into the semantic-guided fusion module of the first stage for cross-level feature fusion. The deep global semantic guidance is used to filter out background interference and obtain the first-stage features. The first-stage features and the mid-level features are input into the second-stage semantic guidance fusion module for mid-level semantic fusion to obtain the second-stage features; The second-stage features and the deepest features are input into the semantic-guided fusion module of the third stage for deep feature update, and the final high-level feature set is output as the aggregated feature map.

6. The method for detecting rotating oil spills on the sea surface by unmanned aerial vehicles based on cross-scale feature aggregation according to claim 1, characterized in that, When the decoupled rotating detection head processes the aggregated feature map, the total loss function of the network optimization includes weighted classification loss and total regression loss; For a specific category in the training batch, a compensation weight based on the inverse of the number of categories is introduced to calculate the weighted classification loss. The compensation weight is set with a cutoff threshold to prevent gradient explosion. The total regression loss is calculated using the rotational intersection-union loss, the distribution focus loss, and the angle loss, wherein the angle loss is used to constrain the tilt direction of the detection frame against the oil stain. The rotation bounding box parameters containing angle information are represented as follows: ,in This represents the coordinates of the center point of the rotated bounding box. Indicates width. Indicates high, This represents the angle between the long side of the bounding box and the physical coordinate axis of the image.

7. A UAV-based oil spill rotation detection system for the sea surface based on cross-scale feature aggregation, characterized in that, include: The feature extraction module is used to acquire low-altitude oil spill images of the sea surface from the UAV to be detected; and to extract features from the oil spill images of the sea surface through a backbone network to obtain a hierarchical feature pyramid, which includes deep semantic features and shallow detail features. The feature aggregation module is used to aggregate the deep semantic features and shallow detail features across scales using the cross-scale feature aggregation module that includes the semantic guidance fusion module. It uses a multi-scale cross-attention mechanism to suppress background noise by using deep global semantics as a spatial mask to obtain an aggregated feature map. The result recognition module is used to input the aggregated feature map into the decoupled rotating detection head, predict and output the category probability distribution of the oil spill target and the rotating bounding box parameters containing angle information in parallel; and determine the detection result of the oil spill target in the UAV low-altitude sea surface oil spill image based on the category probability distribution and the rotating bounding box parameters containing angle information.