A river pollution outlet detection method, system and device
Patent Information
- Application Number
- CN202611063358.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-17
- Publication Date
- 2026-08-18
AI Technical Summary
第一,边缘信号的频率丢失与特征混淆;传统卷积算子在特征提取时具有天然的低通滤波特性,难以从高频随机波动的水面伪影中剥离具有稳定几何结构的管口轮廓,导致模型对微小排污口的判别感度不足
[0009]According to the specific embodiments provided in this application, the following technical effects are disclosed: This application constructs the WFMD_YOLO11-det model based on the YOLO11-det model. Specifically, the C3k2_WT Conv architecture module constructs a wide-area receptive field without introducing redundant computation, and induces the algorithm to establish a strong shape bias rather than a random texture bias for structures such as circular pipe openings or rectangular culverts. A Focal Modulation architecture is introduced to achieve global feature capture with low computational cost and induces the model to establish dynamic focusing capabilities for sewage discharge areas. The C2PSA_MSDA module is introduced to achieve multi-scale coverage of sewage discharge outlet targets. The C3k2_MSCB module effectively enhances the model's ability to represent the contours of small sewage discharge outlets and their complex contexts, significantly improving the target recognition recall and localization accuracy in complex field environments while maintaining lightweight computation. An ultra-lightweight dynamic upsampling operator, DySample, is introduced to improve the spatial alignment accuracy of the model during feature fusion and enables it to adaptively adjust the upsampling path according to the feature content. Removing the P5 detection layer and adding a P2 detection layer in the neck network represents a strategic shift in the detection perspective from full-scale coverage to a focus on microscopic details. While introducing some computational load, this physical mechanism ensures a high detection rate for extremely small targets and effectively avoids noise interference from complex water surface environments, significantly improving the engineering reliability of intelligent monitoring of sewage outlets. Through the layout of the P2, P3, and P4 detection heads, the focus of feature retrieval shifts entirely to a high-resolution coordinate space. This hierarchical mapping reconstruction allows the detection system to perform bounding box regression on feature anchor points with smaller downsampling rates, significantly improving the algorithm's ability to capture distant, concealed sewage outlets.
Smart Images

Figure CN122598005A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of computer vision and environmental monitoring, and in particular to a method, system and equipment for detecting sewage outlets in rivers. Background Technology
[0002] As a key node in water environment management, river sewage outlets exhibit various forms, including open channels, concealed outlets, and underground jet streams, influenced by the watershed's geographical environment and discharge demands. The geometric topological features and background contrast of sewage outlets are crucial characteristics for outlet detection; accurate identification of outlet geometry is essential for analyzing pollutant diffusion patterns. Effective outlet contour identification not only helps models quickly memorize outlet features but also predicts dynamic changes in discharge behavior, further ensuring watershed ecological security. While existing monitoring technologies have evolved from manual inspections to deep learning detection, the following technical obstacles remain under the high-resolution field of view of drone aerial photography: First, there is frequency loss and feature confusion in edge signals. Traditional convolution operators have natural low-pass filtering characteristics when extracting features, making it difficult to separate the pipe opening contours with stable geometric structures from the high-frequency random fluctuations of the water surface artifacts, resulting in insufficient discrimination sensitivity of the model for small sewage outlets.
[0003] Second, semantic distortion in cross-scale feature fusion; the predefined static upsampling operator cannot detect the sudden changes in the content of the sewage outlet at different inspection heights when performing feature fusion, resulting in spatial deviation in feature alignment. This is especially true when dealing with scenarios where large-scale gates and small pipe openings coexist, which can easily cause positioning drift and edge blurring.
[0004] Third, the effective utilization rate of spatial resolution is low. The general detection architecture compresses features through multiple downsampling in the deep network. Although this extracts abstract semantics, it completely erases the extremely small sewage outlet signals with a pixel ratio of less than 0.01%. At the same time, the network has significant computational redundancy in the deep layer for large-scale backgrounds and fails to construct ultra-high resolution feature anchors. As a result, the model cannot balance precision and recall for hidden targets under limited computing power. Summary of the Invention
[0005] The purpose of this application is to provide a method, system and equipment for detecting sewage outlets in rivers, which significantly improves the robustness of identifying extremely small and concealed sewage outlets while maintaining extremely high inference efficiency, achieving a deep balance between detection performance and deployment cost.
[0006] To achieve the above objectives, this application provides the following solution: Firstly, this application provides a method for detecting sewage outlets in river channels, including: Obtain a training sample set; each training sample in the training sample set includes a river image that has undergone image enhancement processing, and the river image contains a sewage outlet label; The YOLO11-det model is invoked; the YOLO11-det model includes a backbone network, a neck network, and a head network. The C3k2 module in the backbone network is replaced with the C3k2_WT Conv module, and the SPPF module in the backbone network is replaced with the Focal Modulation module to introduce a focus modulation mechanism; the C2PSA module in the backbone network is replaced with the C2PSA_MSDA module; the C3k2 module in the neck network is replaced with the C3k2_MSCB module to introduce a multi-scale channel reconstruction mechanism; the nearest neighbor interpolation operator in the neck network is replaced with the Dy Sample upsampling operator; the P5 detection layer in the neck network is deleted and a P2 detection layer is added; the P3, P4, and P5 detection heads in the head network are replaced with P2, P3, and P4 detection heads, thereby constructing the WFMD_YOLO11-det model; The WFMD_YOLO11-det model was trained using the training sample set to obtain a river discharge outlet detection model. The initial river image to be processed is input into the river discharge outlet detection model to identify and locate the discharge outlet.
[0007] Secondly, this application provides a river discharge outlet detection system, which applies a river discharge outlet detection method. The system includes: The sample acquisition module is used to acquire a training sample set; each training sample in the training sample set includes a river image that has undergone image enhancement processing, and the river image contains a sewage outlet label. The original model calling module is used to call the YOLO11-det model; the YOLO11-det model includes a backbone network, a neck network, and a head network. The model optimization module is used to replace the C3k2 module in the backbone network with the C3k2_WT Conv module, and the SPPF module in the backbone network with the Focal Modulation module to introduce a focus modulation mechanism; replace the C2PSA module in the backbone network with the C2PSA_MSDA module; replace the C3k2 module in the neck network with the C3k2_MSCB module to introduce a multi-scale channel reconstruction mechanism; replace the nearest neighbor interpolation operator in the neck network with the Dy Sample upsampling operator; delete the P5 detection layer and add a P2 detection layer in the neck network; and replace the P3, P4, and P5 detection heads in the head network with P2, P3, and P4 detection heads, thereby constructing the WFMD_YOLO11-det model. The model training module is used to train the WFMD_YOLO11-det model using the training sample set to obtain a river discharge outlet detection model. The sewage outlet detection module is used to input the initial river image to be processed into the river sewage outlet detection model to identify and locate the sewage outlet.
[0008] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a method for detecting sewage outlets in rivers.
[0009] According to the specific embodiments provided in this application, the following technical effects are disclosed: This application constructs the WFMD_YOLO11-det model based on the YOLO11-det model. Specifically, the C3k2_WT Conv architecture module constructs a wide-area receptive field without introducing redundant computation, and induces the algorithm to establish a strong shape bias rather than a random texture bias for structures such as circular pipe openings or rectangular culverts. A Focal Modulation architecture is introduced to achieve global feature capture with low computational cost and induces the model to establish dynamic focusing capabilities for sewage discharge areas. The C2PSA_MSDA module is introduced to achieve multi-scale coverage of sewage discharge outlet targets. The C3k2_MSCB module effectively enhances the model's ability to represent the contours of small sewage discharge outlets and their complex contexts, significantly improving the target recognition recall and localization accuracy in complex field environments while maintaining lightweight computation. An ultra-lightweight dynamic upsampling operator, DySample, is introduced to improve the spatial alignment accuracy of the model during feature fusion and enables it to adaptively adjust the upsampling path according to the feature content. Removing the P5 detection layer and adding a P2 detection layer in the neck network represents a strategic shift in the detection perspective from full-scale coverage to a focus on microscopic details. While introducing some computational load, this physical mechanism ensures a high detection rate for extremely small targets and effectively avoids noise interference from complex water surface environments, significantly improving the engineering reliability of intelligent monitoring of sewage outlets. Through the layout of the P2, P3, and P4 detection heads, the focus of feature retrieval shifts entirely to a high-resolution coordinate space. This hierarchical mapping reconstruction allows the detection system to perform bounding box regression on feature anchor points with smaller downsampling rates, significantly improving the algorithm's ability to capture distant, concealed sewage outlets.
[0010] In summary, this application effectively solves the problems of artifact interference, feature response imbalance and disappearance of signals of extremely small targets caused by conventional detection architectures when facing complex backgrounds of rivers by using spatial resolution compensation mechanism and multi-dimensional frequency feature filtering strategy. It specifically enhances the model's ability to capture the underlying details of hidden sewage outlets, significantly improves the recall rate of extremely small targets, and ensures the detection stability of the model in scenarios where targets of different scales coexist. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1This is a flowchart illustrating a method for detecting sewage outlets in a river channel according to one embodiment of this application.
[0013] Figure 2 This is a structural diagram of the WFMD_YOLO11-det model in one embodiment of this application.
[0014] Figure 3 The diagram shows the structure of the C3k2_MSCB1 module according to an embodiment of this application.
[0015] Figure 4 The diagram shows the structure of the C3k2_MSCB2 module provided in one embodiment of this application.
[0016] Figure 5 This is a flowchart of the Dysample dynamic upsampling operator provided in an embodiment of this application.
[0017] Figure 6 This is a Dysample dynamic upsampling initialization diagram provided in an embodiment of this application.
[0018] Figure 7 The diagram shows the structure of the C3k2_WTConv module provided in one embodiment of this application.
[0019] Figure 8 This is a schematic diagram of a FocalModulation module provided in an embodiment of this application.
[0020] Figure 9 This is a structural diagram of the C2PSA_MSDA module provided in one embodiment of this application.
[0021] Figure 10 The image shows the ablation test results provided in one embodiment of this application.
[0022] Figure 11 The image shows the operating results of a real-time sewage outlet detection and identification system provided in one embodiment of this application. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] This application addresses the technical challenges of low recognition accuracy caused by sparse target signals, scale polarization contradictions, and complex environmental texture interference from UAVs in the field of view of sewage outlets. It proposes an improved scheme for full-scale feature perception. The specific process includes: integrating WTConv wavelet convolution into the backbone network to filter background artifacts using frequency domain decomposition characteristics, enhancing the model's bias sensitivity to the outlet geometry; introducing the MSDA multi-scale dilated attention mechanism to simultaneously focus on local details and long-range context through parallel heterogeneous branches, achieving full-scale feature decoupling; reconstructing the neck architecture, removing deep redundancy, and adding a P2 high-resolution feature anchor layer, combined with a focus modulation mechanism to achieve physical fidelity and dynamic focusing of the underlying spatial signal; furthermore, combining the MSCB module and the DySample operator to optimize scale recovery stability during feature fusion. Experiments show that this application achieves a score of 98.5% at mAP@50, with an accuracy of 99.5%, while the computational cost is only 10.9 GFLOPs. This application significantly improves the robustness of identifying extremely small and concealed sewage outlets while maintaining extremely high inference efficiency, achieving a deep balance between detection performance and deployment cost.
[0025] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0026] The river discharge outlet detection method provided in this application is executed by computer equipment, specifically by a terminal or server alone, or by both. The terminal communicates with the server via a network. A data storage system stores the data that the server needs to process. This data storage system can be set up independently, integrated into the server, or located in the cloud or on another server. The terminal can send a training sample set to the server. Upon receiving the set, the server trains the WFMD_YOLO11-det model to obtain a river discharge outlet detection model. The server can then feed back the obtained model to the terminal. Alternatively, the terminal can send an initial river image to the server. Upon receiving the image, the server inputs it into the river discharge outlet detection model to identify and locate the discharge outlets. The server can then feed back the identified discharge outlets to the terminal.
[0027] In one exemplary embodiment, such as Figure 1 As shown, a method for detecting sewage outlets in rivers is provided, including the following steps 101 to 105.
[0028] Step 101: Obtain a training sample set; each training sample in the training sample set includes a river image that has undergone image enhancement processing, and the river image contains a sewage outlet label.
[0029] In a specific application, the process of constructing the training sample set includes: (11) Collect initial river images in the target water area. Specifically, use a drone to collect river image data containing sewage outlets in the target water area to be tested. In this embodiment, a total of 200 images of two types of sewage outlets are taken to improve the generalization ability of the model.
[0030] (12) The initial river image is optimized according to the preset image size and the preset image irrelevant background ratio to obtain the optimized river image.
[0031] Specifically, based on a predetermined image size of 960×960 pixels, 30% to 50% of non-target redundant background is strategically removed. This step aims to solve the feature downsampling distortion problem caused by direct scaling of large-scale aerial images. By maintaining the physical pixel density of the target, the memory load is reduced while minimizing the interference of complex background noise on the core geometric features of the target, ultimately yielding 1328 high-quality slice samples.
[0032] (13) For the optimized river image, an instance vector box is marked with the sewage outlet as the target; multiple optimized river images with sewage outlet markings constitute a river sewage outlet dataset.
[0033] Specifically, Labelme was used to annotate the sewage outlet images, resulting in 2010 sewage outlet instances.
[0034] (14) Using a probability-based composite image enhancement logic, the river discharge outlet dataset is augmented by random combination of Mosaic stitching, gamma dynamic correction, noise embedding, bidirectional flipping, random rotation within ±30° range and HSV space chromaticity shift, to obtain a comprehensive river discharge outlet dataset.
[0035] This application employs a multi-dimensional data augmentation scheme, using randomized data augmentation to improve detection robustness, and assigning each optimized river channel image a 50% probability of performing single or linked enhancement operations. In addition to introducing dynamic noise, the Mosaic algorithm, and random rotation within a range of ±30 degrees, it also covers horizontal and vertical mirror flipping and gamma value correction.
[0036] To focus on the core characteristics of the target and reduce the negative interference of redundant background on feature extraction, this application abandons the overlap rate setting and instead simplifies the image content by cropping irrelevant areas. Simulation of complex weather conditions is achieved by adjusting the HSV space: in simulated sunny weather conditions with strong light reflection, the parameters are set as follows: hue fluctuation ±5%, and saturation and brightness increment ranges defined between 10%~30% and 15%~35%, respectively; in simulated low-contrast rainy weather conditions, the parameters are set as: hue shift ±5%, and saturation and brightness attenuation ratios set at 25%~40% and 20%~30%, respectively, thus ensuring the model's recognition stability under heterogeneous lighting conditions.
[0037] This application achieves high-resolution reconstruction of light and shadow distribution in HSV space, enabling the algorithm to capture the high-reflection highlights on water surfaces in simulated clear-sky scenes. In contrast, under dimmed settings with reduced saturation and brightness, it enhances the perception of dark tones and blurred boundaries in low-contrast environments, effectively breaking the model's dependence on single exposure conditions. By combining random rotation and flipping, Mosaic tiling, and strategic cropping for irrelevant backgrounds, the morphological and topological essence of sewage outlets can be analyzed from a multi-dimensional perspective, significantly solidifying the system's robustness in recognizing complex anatomical structures. Furthermore, dynamic noise injection and nonlinear correction of the gamma curve simulate imaging degradation interference in real-world operations, suppressing overfitting during training while improving the model's adaptability to low-quality images.
[0038] In summary, this data augmentation system, by constructing a sample field that closely matches real-world working conditions, ensures, from the underlying mechanism, that the sewage outlet identification algorithm possesses high accuracy, anti-interference performance, and field reliability in engineering deployments.
[0039] (15) The comprehensive dataset of the river discharge outlets is divided to obtain a training sample set. Specifically, the ratio of the training sample set, the validation sample set and the test sample set is set to 6:2:2, and the training sample set is obtained based on this ratio.
[0040] Step 102: Call the YOLO11-det model; the YOLO11-det model includes a backbone network, a neck network, and a head network. The WFMD_YOLO11-det sewage outlet detection and identification model is an improvement on YOLO11-det, aiming to solve the technical bottlenecks of target scale polarization and environmental noise interference in river inspection.
[0041] Step 103: Replace the C3k2 module in the backbone network with the C3k2_WT Conv module, and replace the SPPF module in the backbone network with the Focal Modulation module to introduce a focus modulation mechanism; replace the C2PSA module in the backbone network with the C2PSA_MSDA module; replace the C3k2 module in the neck network with the C3k2_MSCB module to introduce a multi-scale channel reconstruction mechanism; replace the nearest neighbor interpolation operator in the neck network with the Dy Sample upsampling operator; delete the P5 detection layer and add a P2 detection layer in the neck network; replace the P3, P4, and P5 detection heads in the head network with P2, P3, and P4 detection heads, thereby constructing the WFMD_YOLO11-det model, as follows. Figure 2 As shown in the diagram. S601 is the C3k2_MSCB module, S602 is the Dy Sample upsampling operator, S603 is the P2 detection layer, S604 is the P4 detection head, S605 is the C3k2_WT Conv module, S606 is the Focal Modulation module, and S607 is the C2PSA_MSDA module.
[0042] (a) C3k2_MSCB module.
[0043] In this application, the C3k2_MSCB module introduces a heterogeneous multi-scale sampling mechanism to specifically enhance the model's ability to decouple and model full-scale features of sewage outlets. It utilizes separable convolutional branches of different sizes (e.g., 1×1, 3×3, 5×5, 7×7) to extract multi-scale spatial features from images in parallel, and combines this with a gated attention mechanism to focus on key regions. The C3k2_MSCB module effectively enhances the model's ability to represent the contours of small sewage outlets and their complex contexts, significantly improving the recall and localization accuracy of targets in complex outdoor environments while maintaining lightweight computation.
[0044] Specifically, the C3k2_MSCB module replaces the 3×3 static convolutional layers in one or more bottleneck layers of the C3k2 module in the neck network with MSCB modules and implements this by cascading and stacking them. Addressing the scale polarization and edge blurring characteristics of sewage outlets in aerial images, this embodiment solves the problem of weak feature response by embedding efficient multi-scale convolutional attention blocks within the C3k2 module and utilizing its parallel multi-branch depth sampling structure. The number of stacked bottleneck layers is set to N=2.
[0045] like Figure 3 and Figure 4As shown, the C3k2_MSCB module includes an initial convolutional layer, a segmentation layer, a feature extraction layer, a concatenation layer, and a final convolutional layer arranged sequentially. The outputs of the initial convolutional layer and the segmentation layer are both connected to the input of the concatenation layer. The C3k2_MSCB module has two modes, representing different topological evolutions, corresponding to the C3k2_MSCB1 module and the C3k2_MSCB2 module, respectively.
[0046] For the C3k2_MSCB1 module: When the parameter C3k is set to False, by inheriting the cross-stage local network architecture of C2f, the original single-layer standard Bottleneck unit in the feature extraction branch is replaced 1:1 with a single MSCB module, thereby changing the convolution mode of the basic bottleneck layer and introducing parallel multi-receptive field depthwise separable convolutional branches and a channel shuffling mechanism. Therefore, the feature extraction layer includes multiple MSCB modules connected in series.
[0047] MSCB is a high-efficiency multi-scale convolutional block that borrows the design concept of inverse residual structures. By integrating multi-scale depthwise convolution and a channel shuffling mechanism, it achieves joint enhancement of feature maps in both spatial and channel dimensions. The data processing procedure of the MSCB module is as follows: Figure 3 As shown, it includes: (1) Through a 1×1 point-to-point convolutional layer The received input feature map is subjected to channel dimensionality expansion, followed by batch normalization (BN) processing to enhance nonlinear representation capabilities, resulting in the first feature map.
[0048] (2) Using multi-scale deep convolution MSDC, the first feature map is extracted with spatial detail features of multiple receptive fields on parallel kernel branches of different sizes, and cross-size feature interaction is performed through channel shuffling operator to obtain the second feature map.
[0049] Specifically, with Figure 3 For example, the multi-scale deep convolutional (MSDC) consists of three branches, each of which includes a convolutional layer, a batch normalization (BN) layer, and a ReLU6 activation function layer arranged sequentially. The outputs of the three branches are added element-wise and then input to the channel shuffling operator.
[0050] (3) Use point-to-point convolutional layers The second feature map is compressed to reduce the number of channels and restored to the original dimension. Then, batch normalization (BN) is performed to obtain the output feature map.
[0051] The data processing procedure of the MSCB module can be expressed mathematically as follows: .
[0052] in, Indicates the input feature map, and These represent point-to-point convolutions that expand and compress the channel dimensions, respectively. and Representing the batch normalization layer and ReLU6 Activation function This represents the channel shuffling operator; within the MSCB module, when extracting spatial features on parallel core branches of different sizes, the following function is used: .
[0053] in, The set of convolution kernel sizes is set to [1, 3, 5] in this embodiment; The kernel size is A depthwise convolutional block, which contains depthwise convolution operators. With residual connection structures designed to enhance regularization effects. The spatial features were extracted. Through this collaborative mechanism, MSCB was able to capture the significant morphological features of sewage outlets at different scales with extremely low computational overhead.
[0054] For the C3k2_MSCB2 module: When the parameter C3k is set to True, the original C3k block, which consisted of two standard Bottleneck stacks, is replaced entirely with a customized C3k_MSCB block. Therefore, the feature extraction layer includes multiple C3k_MSCB blocks connected in series. Each C3k_MSCB block contains nested and stacked MSCB modules. In other words, the C3k_MSCB block logically nests and stacks multiple MSCB modules internally. Compared to MSCB1, this is a nested structural upgrade, achieving a deeper, multi-level, serial, multi-scale feature extraction path.
[0055] like Figure 4 As shown, the C3k_MSCB block includes a start convolutional layer, multiple MSCB modules, a splicing layer, and an end convolutional layer arranged sequentially. Furthermore, an intermediate convolutional layer is set between the start convolutional layer and the splicing layer.
[0056] (ii) Dy Sample upsampling operator.
[0057] Images of river discharge outlets from a drone's perspective often feature extremely complex backgrounds, with targets exhibiting very small-scale features that account for a very low percentage of pixels. These outlets are also susceptible to interference from water surface reflections and riverside vegetation. To improve the spatial alignment accuracy of the model during feature fusion and enable it to adaptively adjust the upsampling path based on feature content, an ultra-lightweight dynamic upsampling operator, DySample, is introduced.
[0058] The DySampling upsampling operator abandons the traditional kernel-based dynamic convolution paradigm, instead taking a point-sampling approach and achieving smooth resolution recovery by learning content-aware offsets in the feature maps. For example... Figure 5 As shown, the DySample upsampling operator includes a sampling point generator and a resampling engine.
[0059] The sampling point generator is used to: dynamically adjust the sampling point positions by generating offsets for the received input feature map to generate Dy Sample sampling points and form a sampling set. By dynamically adjusting the sampling point positions through the generated offsets, the feature map can accurately focus on the geometric details of the target during scale evolution. Internally, it can be divided into "linear + pixel shuffling" LP or "pixel shuffling + linear" PL methods depending on the application scenario. In this model, to achieve sub-pixel-level spatial fidelity in extremely small target detection, a PL ensemble method with extremely low parameter density is adopted for small target layers involving low-level details, aiming to alleviate feature collapse through more refined pixel reconstruction; while for medium and large-scale feature layers, an LP method is used to ensure robustness of full-scale detection while also meeting the efficiency requirements of real-time inference on the UAV side.
[0060] The generation of Dy Sample points first involves constructing an initial sampling grid. To avoid the uneven sampling distribution problem caused by traditional nearest neighbor interpolation, this embodiment uses bilinear initialization to ensure that the sampling points are evenly distributed within the 2×2 region to be recovered in the initial state. Figure 6 As shown, the nearest neighbor initialization is generally used, and its multiple upsampling points share the center coordinates while ignoring the spatial positional relationship. This application uses bilinear initialization to distribute the sampling points evenly to improve smoothness. However, if the offset is not restricted, it can easily lead to overlapping sampling ranges and cause edge prediction disorder and semantic artifacts. Therefore, a static range factor of 0.25 is finally introduced to strictly limit the walking space of the sampling points to their respective neighborhoods through geometric constraints in order to eliminate overlapping interference.
[0061] Secondly, offset It is generated through a lightweight linear mapping layer, which calculates the tendency for each sampling point to move towards the target salient feature region by observing the semantic content of the input feature map, as shown in the following formula: .
[0062] in, The input feature map is 0.25, which is a preset static range factor. The physical meaning of this factor is to limit the walking range of the sampling points within the theoretical critical value, prevent the offsets of different sampling points from overlapping, and thus avoid prediction artifacts and boundary disorder caused by sampling conflicts.
[0063] To further enhance the model's flexibility in capturing the contour features of extremely small sewage outlets, a dynamic modulation mechanism can be introduced. This mechanism generates a dynamic range factor through parallel sub-networks, as shown in the following formula: .
[0064] in, The function limits the dynamic scaling range of the offset to the interval [0, 0.5], while maintaining its center point at 0.25. This allows the model to adaptively "lock" the salient feature region of the sewage outlet while ensuring sampling order. Responsible for generating point-to-point dynamic range factors. It is responsible for generating the basic offset vector.
[0065] Finally, the calculated set of sampling points .
[0066] The resampling engine is used to: resample the received input feature map in conjunction with the sampling set to obtain the corresponding output feature map. The formula for performing the resampling operation is as follows: .
[0067] in, and These represent the input low-resolution feature map and the output high-resolution feature map, respectively. This operation is implemented through PyTorch's built-in grid_sample function, achieving content-aware capabilities far exceeding those of traditional interpolation operators while maintaining an ultra-lightweight computational load.
[0068] (III) Detection layer.
[0069] To address the extremely sparse characteristics of river discharge outlets in long-range inspection images, the convolution stacking during deep downsampling can easily lead to irreversible collapse of key spatial signals. Furthermore, the receptive field scale of the P5 detection layer is too large, resulting in weak representation efficiency for pipe outlet targets with extremely small pixel proportions and introducing a large amount of background-independent computational redundancy. Therefore, by stripping the P5 detection layer and introducing the P2 shallow feature map, its sub-pixel-level spatial fidelity is utilized to fully preserve the edge topology and geometric structure of the discharge outlet target. At this level, model resampling technology performs cross-dimensional stitching of abstract deep semantics and the fine spatial information of the P2 detection layer, aiming to construct a dedicated feature transmission link for concealed and small targets.
[0070] This architectural adjustment achieves a strategic shift in the detection perspective from full-scale coverage to a focus on microscopic details. Although it introduces some computational load, it ensures the detection rate of extremely small targets from a physical mechanism perspective and effectively avoids noise interference from complex water surface environments on target discrimination. It is of substantial significance for improving the engineering reliability of intelligent monitoring of sewage outlets.
[0071] (iv) Detection head.
[0072] In conventional YOLO topologies, the P5 detection layer primarily targets large-scale objects downsampled by 32x. However, sewage outlets viewed from aerial perspectives typically exhibit extremely small-scale features and sparse spatial distribution, making it nearly impossible to generate effective discriminative semantic responses on the feature maps at the P5 level. To correct this perceptual imbalance, this application constructs a novel three-head detection architecture centered on the P2 detection layer, replacing the traditional (P3, P4, P5) detection combination with a more targeted (P2, P3, P4) detection layout. This powerfully drives the model's feature retrieval focus to shift entirely to a high-resolution coordinate space. Through this hierarchical mapping reconstruction, the detection system can perform bounding box regression on feature anchor points with smaller downsampling rates, significantly improving the algorithm's ability to capture distant, concealed sewage outlets.
[0073] The feature map size input to the newly added P2 detection head is Because layer P2 retains the most original spatial topological information, this branch is specifically responsible for capturing extremely small openings with pixel widths of only a few units. At this scale, each grid cell is responsible for predicting a smaller candidate region. By performing regression on such a fine-grained grid, the model can significantly reduce the false negative rate for tiny targets. The formula is expressed as: .
[0074] (v) C3k2_WT Conv module.
[0075] River inspection images are limited by massive amounts of texture noise generated by water flow fluctuations, riverside vegetation, and variable lighting. These background disturbances are easily confused with the edges of sewage outlets in terms of spatial characteristics. Aiming to construct a wide-area receptive field without introducing redundant computation, and to induce the algorithm to establish a strong shape bias rather than a random texture bias for structures such as annular pipe openings or rectangular culverts, this application uses the C3k2_WTConv architecture to replace the standard convolutional units in the backbone network.
[0076] like Figure 7As shown, the C3k2_WT Conv module includes a convolutional layer, a segmentation layer, multiple Bottleneck_WTConv layers, a stitching layer, and another convolutional layer arranged sequentially. The outputs of the convolutional layer, the segmentation layer, and the multiple Bottleneck_WTConv layers are all connected to the stitching layer. The Bottleneck_WTConv layer includes a residual-connected convolutional layer and a wavelet convolutional WT Conv block.
[0077] In the wavelet convolution WT Conv block, the original bottleneck layer is reconstructed into... Figure 7 The wavelet convolution topology shown utilizes cascaded wavelet transforms to perform multi-frequency decomposition on the input signal. This mechanism can decouple complex random water ripples from steady-state sewage outlet geometric features in the frequency domain, thereby capturing the structured information of the target at a more macroscopic scale and significantly enhancing the model's shape perception of the target. In this model, N bottleneck layers of integrated wavelet convolutions are stacked in series (N=2). Through this multi-frequency feature reconstruction path, the model can effectively suppress background artifacts while consolidating the system's accuracy in recognizing the topological essence of the sewage outlet from the underlying logic.
[0078] like Figure 7 As shown, the wavelet convolution WT Conv block includes a first wavelet transform WT layer, a second wavelet transform WT layer, a first frequency convolution layer, a second frequency convolution layer, a third frequency convolution layer, a first inverse wavelet transform IWT layer, and a second inverse wavelet transform IWT layer.
[0079] The input of the first wavelet transform (WT) layer is used to receive the input feature map, and the output of the first wavelet transform (WT) layer is connected to the input of the second wavelet transform (WT) layer. The output of the second wavelet transform (WT) layer is connected to the input of the second frequency convolutional layer, and the output of the second frequency convolutional layer is connected to the input of the second inverse wavelet transform (IWT) layer. The output of the second inverse wavelet transform (IWT) layer and the output of the first wavelet transform (WT) layer are weighted and aggregated before being fed into the first frequency convolutional layer. The output of the first frequency convolutional layer is connected to the input of the first inverse wavelet transform (IWT) layer. The third frequency convolutional layer performs convolution processing on the input feature map, and then performs weighted aggregation processing with the output of the first inverse wavelet transform (IWT) layer to obtain the output feature map.
[0080] Input features Figure X After entering the wavelet convolution module, 2D wavelet transform decomposition is performed using the Haar wavelet basis function. The Haar wavelet basis consists of four depthwise convolution kernels, as shown in the following formula: .
[0081] in, Averaging the pixels in a 2x2 region serves to reduce dimensionality and smooth the surface. , , Pixel differences are extracted along the horizontal, vertical, and diagonal directions, respectively, thus extracting edge and texture details. This operation decomposes the input signal into low-frequency subbands. High-frequency subbands in horizontal, vertical, and diagonal directions : .
[0082] Multi-frequency convolution is performed in the wavelet domain. To achieve exponential expansion of the receptive field, multi-frequency convolution is performed on each of the decomposed frequency components. k x k depthwise convolution Its computational logic can be expressed as: .
[0083] in, This represents the inverse wavelet transform. Through cascaded multi-level wavelet decomposition, at the [missing value]... This process is recursively executed on the low-frequency branches of the layer, so that the receptive field increases with the number of decomposition layers. by The rapid expansion of the scale ensures that the model can acquire a global receptive field sufficient to cover the entire sewage outlet area with minimal parameter cost.
[0084] To integrate the feature contributions of different frequency components, the module utilizes the linear properties of wavelet transform to perform weighted aggregation of the outputs at each level. Layer aggregation output The calculation is as follows: .
[0085] in, This is the aggregation result of deep low-frequency components. This is the output of the high-frequency components of the current layer through convolution. The weights of each frequency component are adjusted using a channel-level scaling mechanism, forcing the model to learn more discriminative shape features.
[0086] (vi) Focal Modulation module.
[0087] Given the extremely complex physical spatial semantics of river backgrounds in UAV aerial photography, conventional self-attention mechanisms or static spatial pooling not only face exponential increases in computational cost when processing high-resolution inputs, but also easily induce feature diffusion phenomena in chaotic water surface textures and vegetation shadows, leading to feature confusion between pixel-level sewage outlet signals and background artifacts. This application aims to achieve global feature capture with low computational cost and induce the model to establish dynamic focusing capabilities for sewage discharge areas. Therefore, a Focal Modulation architecture is introduced, replacing the traditional "query-key" comparison paradigm with a "focus aggregation" mechanism, effectively solving the problems of computational redundancy and feature response dilution in high-resolution images.
[0088] The Focal Modulation module employs a full-attention architecture. Its core logic replaces query-key comparison with "focus aggregation." This module comprises three components: focus context encoding, gated aggregation, and element-wise affine transformation. In this approach, the model first aggregates contextual features from various levels to generate a modulator, then adaptively injects it into the query vector. The overall module flow is as follows: Figure 8 As shown.
[0089] First, hierarchical context encoding is performed. The input feature map is first projected through a linear layer to... Then through a stack Deep convolutional layers extract multi-scale context from local to global perspectives. At each focal layer... Its output for: .
[0090] in, For the first The context function of the layer uses a kernel size of Depth-wise convolution. This operation generates an effective receptive field. It expands rapidly as the number of layers increases, thereby capturing environmental information in different ranges around the sewage outlet.
[0091] Secondly, gating aggregation is performed. The model adaptively controls the contribution weights of features at each level using a gating mechanism, and obtains spatially and hierarchically aware gating weights through linear layers. Then, a weighted sum is performed on all the components at all levels to obtain a single feature map. : .
[0092] in, As a gating slice corresponding to the level, this mechanism enables the model to adaptively capture fine structures at low levels for sewage outlets located in complex textures, while suppressing interference by aggregating large-scale context at high levels for background regions.
[0093] The final focus modulation is achieved through element-wise multiplication, given a query projection function. and through linear layers Generated modulator The final expression As shown below: .
[0094] in, This modulation method, which represents element-wise multiplication, has a stronger nonlinear representation capability compared to the traditional additive bias, and can more accurately inject contextual semantics into pixel-level prediction.
[0095] In this embodiment, by introducing a Focal Modulation module, the model achieves "automatic focusing" on the target area of the sewage outlet without relying on cumbersome attention calculations. Experiments show that the modulation map generated by this module can automatically converge to the salient target area that induces the identification category in an unsupervised state. This not only improves the discriminative response strength at the feature level, but also effectively solves the problem of missed detection caused by varying scales and cluttered backgrounds in aerial photography through multi-scale gating aggregation, structurally ensuring the model's accuracy in capturing extremely small sewage outlet targets and its environmental robustness.
[0096] (vii) C2PSA_MSDA module.
[0097] To address the extreme-scale polarization characteristics of sewage outlet targets in river monitoring scenarios, conventional self-attention architectures, due to their singular sampling paradigm, struggle to simultaneously capture sub-pixel-level micro-pipe outlets and large-scale drainage channels while filtering out random water ripple artifacts. This application aims to overcome the feature response imbalance caused by a fixed receptive field by introducing a multi-scale dilated attention mechanism with heterogeneous sampling frequencies. This mechanism drives the network to adaptively construct parallel multi-dimensional perceptual fields within a single feature level, utilizing multiple sets of differentiated sampling dilated rates to perform non-uniform spatial aggregation of the feature maps. This improvement, without introducing computational redundancy, fundamentally enhances the model's semantic alignment stability and target discrimination gain across full-scale scenarios, significantly optimizing the model's robustness in locating concealed targets.
[0098] The C2PSA_MSDA module replaces the original attention mechanism in one or more PSA blocks within the C2PSA module with the multi-scale dilated attention mechanism MSDA, implemented using a cascaded stacking approach. This module achieves parallel modeling of multi-scale spatial dependencies by dividing the attention heads into different groups and assigning differentiated dilated rates to each group. In this model, N improved PSA structures are connected in series using a cascaded stacking approach, with N=2. The overall module flow is as follows: Figure 9 As shown.
[0099] The C2PSA_MSDA module includes a starting convolutional layer, multiple PSABlock layers, a concatenation layer, and an ending convolutional layer arranged sequentially, with convolutional connections between the starting convolutional layer and the concatenation layer. The PSABlock layer includes an MSDA block and two convolutional layers, with residual connections between the input and output of the MSDA block, and residual connections between the input and output of the two convolutional blocks. The data processing procedure for the MSDA block is as follows.
[0100] First, the input feature map is projected to generate a query, key, and value matrix. To simulate multi-scale visual observation perspectives without significantly increasing computational burden, MSDA divides the total n attention heads into k independent subgroups. In this embodiment, k=3 is set, and a differentiated hole rate is assigned to each subgroup. For the first Each attention head has its output calculated as follows: .
[0101] in, This represents the projected components of each group head. During the calculation, MSDA employs a sliding window hole attention mechanism, using the hole rate... Sparse sampling is performed within a local window. The physical significance of this spatial sampling lies in the low-voidity branch. Dense sampling is used to pinpoint the fine structure at the edge of the smallest orifice, while high-voidity branches... It skips redundant noise and captures the long-range contextual relationship between the sewage outlet, the embankment, and the water flow with a broad view.
[0102] The outputs of each header are concatenated and then subjected to a linear projection transformation. Multi-scale aggregated features are obtained. Since the sewage outlet targets are spatially location-sensitive, MSDA can adaptively allocate attention weights across different sampling radii. Subsequently, these features are fed into a feedforward neural network, where two linear transformations—dimensionality increase and dimensionality decrease—are used to further extract deeper semantic meaning, as shown in the following formula: 。
[0103] in, This is a weighting matrix for increasing the dimension of features. Expand to 2 To enhance nonlinear expression, For the dimension reduction weight matrix, This is the activation function.
[0104] Finally, the C2PSA_MSDA module utilizes residual connections (to sum the enhanced features with the original input pixel by pixel): .
[0105] This structural design ensures that even at deeper network layers, the underlying spatial features of extremely small targets can still be preserved through direct connection paths, preventing weak signals from being sparsified during complex attention calculations. By introducing the C2PSA_MSDA module, the model achieves multi-scale coverage of sewage outlet targets. Through parallel modeling of multiple sets of heterogeneous porosity, the network can spontaneously filter effective information in cluttered river backgrounds, significantly improving the model's accuracy in capturing pixel-level micro-pipe openings and its structural recognition ability for large culvert targets, fundamentally enhancing the model's detection performance and environmental robustness in the high-resolution field of view of UAVs.
[0106] Step 104: Using the training sample set, train the WFMD_YOLO11-det model to obtain the river discharge outlet detection model.
[0107] During the training process, in order to objectively evaluate the gain effect of the WFMD_YOLO11-det scheme in a real environment, this application also conducted a progressive ablation experiment. The scientific validity of the scheme was verified by quantifying the impact of each improved module on the core indicators. The results are shown in Table 1 below. Given that the ecological cost of missed sewage outlets in river monitoring is far higher than that of false alarms, this experiment gives a higher weight to recall rate in the indicator evaluation.
[0108] Table 1
[0109] First, a hierarchical reconstruction based on spatial signal anchoring is performed. Addressing the extremely sparse and cluttered background characteristics of sewage outlets under line-of-sight conditions during UAV inspections, this solution replaces the excessively large receptive field P5 layer with a high-resolution P2 detection layer. Data confirms that by forcibly preserving the fine-grained spatial information at the lower levels, the recall rate for pipe targets increased from 89.7% in the baseline architecture to 92.8%. Although discarding macroscopic semantics resulted in a slight fluctuation of 0.6% in mAP@50 for gate targets and an increase in inference time to 4.9ms, this strategy of trading computational power for accuracy ensures the initial detection of subtle targets at the physical mechanism level.
[0110] Secondly, focus modulation is introduced to enhance feature sensitivity. The SPPF module is replaced on the P2 architecture, utilizing dynamic focusing capabilities achieved through hierarchical context encoding. Experiments show that this combination increases global mAP@50-95 to 65.9%, with gate-type metrics improving to 67.4%. This indicates that the focus mechanism effectively compensates for the semantic deficiencies of shallow features, significantly enhancing the model's accuracy in recognizing low-level details.
[0111] Next, C2PSA_MSDA was integrated to achieve scale decoupling. By introducing a dilated attention mechanism with parallel heterogeneous sampling paths, the model can simultaneously consider local contours and long-range context within a single level, effectively suppressing channel lighting artifacts. Data shows that the recall rate for pipe openings further increased to 92.9%, fully validating the robustness of multi-scale sampling in enhancing the response intensity at the small target level.
[0112] Subsequently, frequency domain feature filtering was performed using C3k2_WT Conv. Utilizing the frequency decomposition properties of wavelet convolution, the model obtained structured receptive field gain without introducing redundant computational power. Experiments show that the mAP@50-95 for gate-type targets continues to improve, confirming the facilitating effect of the frequency domain sensing mechanism on extracting stable geometric topological features and further consolidating the discrimination accuracy.
[0113] The response imbalance problem is addressed using the MSCB module. Multi-scale channel reconstruction is introduced into the neck network to balance the feature response differences caused by extreme polarization at the target scale. Ablation tests show that this module, while maintaining the detection level of gate-type targets, increases the mAP@50-95 for orifice-type targets to 63.8%. Combining these two methods results in a significant jump in orifice-type recall to 93.6%, achieving consistent response across all target scales.
[0114] Finally, the Dy Sample operator is introduced to construct the final WFMD_YOLO11-det model. Content-aware resampling corrects signal distortion during scale recovery, resolving artifact interference from small targets. Experimental results show that the final model exhibits superior performance in river inspection tasks: mAP@50 reaches 98.3% for pipe outlets, precision reaches 99.6%, and recall climbs to 94.5%. Compared to the original YOLO11n, this solution maintains its lightweight characteristics while achieving a comprehensive leap in various core regulatory indicators, strongly demonstrating the engineering effectiveness of the proposed improvement path in addressing monitoring tasks of extremely small-scale sewage outlets.
[0115] The WFMD_YOLO11-det model was systematically validated using a constructed sewage outlet image dataset. Its performance in terms of accuracy, recall, segmentation effect, and inference efficiency was evaluated to ensure that the model has the ability to be deployed and promoted in practice.
[0116] The training process of the WFMD_YOLO11-det model is shown in the figure below. Figure 10 As shown. By Figure 10 As can be seen, the model exhibits a significant convergence trend and high stability in the early stages of training. All loss functions show a smooth downward trend and quickly converge to a stable range, fully validating its efficient learning ability for target localization and feature detection in complex river scenarios. In terms of evaluation metrics, the model achieves an accuracy of 99.5% and a recall rate of 95.9% in the sewage outlet identification task. The detection box mAP@50 reaches 98.5% at an IoU threshold of 0.5, and it also achieves an excellent score of 69.3% under the more stringent cross-scale evaluation metric mAP@50–95. This further confirms its strong feature extraction robustness and scene adaptability when facing small pipe targets with very few pixels and gate-type sewage outlets. Regarding runtime efficiency, after integrating several improved operators, the model only increases GFLOPs by 4.2, achieving high-performance detection output while maintaining a lightweight architecture design, fully meeting the requirements for real-time performance and embedded deployment in UAV high-altitude inspection tasks.
[0117] The final test results are as follows Figure 11 As shown, sewage outlets into rivers can be classified into several types based on their physical form, including direct discharge pipes, underground drainage channels, and gate-type discharge outlets. Figure 11 It not only demonstrates tiny pipe targets with extremely low pixel counts against a complex riverbank background, but also shows that gate-type discharge outlets with complex mechanical structures can still be stably captured and have their geometric contour features accurately extracted by the model despite strong water surface reflection, obstruction by riverside vegetation, and interference from different opening angles. Figure 11 All types and sizes of sewage outlets were accurately identified and located.
[0118] Step 105: Input the initial river image to be processed into the river discharge outlet detection model to identify and locate the discharge outlets. The river discharge outlet detection model is used to perform real-time detection and identification of the discharge outlets, thereby achieving accurate identification of the characteristics of the discharge outlets.
[0119] In summary, this application collects sewage outlet image data in target rivers using drones; optimizes the sewage outlet image data according to predetermined image size and image-independent background ratio; annotates the sewage outlet images with instance rectangular vector boxes to construct a sewage outlet dataset from the drone's perspective; performs image enhancement on the images in the dataset; divides the dataset proportionally into training, validation, and test sets; constructs a WFMD_YOLO11-det river sewage outlet detection model; and uses the trained WFMD_YOLO11-det model to perform real-time detection and identification of sewage outlets, thereby achieving accurate identification of the characteristics of river sewage outlets. The constructed WFMD_YOLO11-det river sewage outlet detection model uses an improved version of YOLO11-det, including a backbone network, a neck network, and a head network.
[0120] The C3k2 module in the neck network is replaced with the C3k2_MSCB module. Feature consistency is enhanced under cross-height inspection through multi-scale channel reconstruction. The MSCB module dynamically couples features from different receptive field levels through a multi-scale channel reconstruction mechanism, thereby improving the consistency of feature target response.
[0121] The nearest neighbor interpolation operator in the neck network is replaced with the Dy Sample upsampling operator, and content-aware resampling is used to correct the scale recovery distortion of small targets. The Dy Sample dynamic upsampling operator performs linear feature mapping through content-aware resampling logic to correct the feature distortion and artifacts of small target sewage outlets in the scale recovery process.
[0122] To eliminate large-scale background redundancy, the P5 detection layer in the neck network was removed, and a high-resolution P2 feature layer with a size of 160x160 was introduced to enhance the preservation of low-level details. The (P3,P4,P5) detector heads in the head network were replaced with (P2,P3,P4) detector heads to achieve physical anchoring of low-level signals.
[0123] The C3k2 module in the backbone network is replaced with the C3k2_WT Conv module. The frequency domain decomposition characteristics are used to filter water surface artifacts and enhance the sensitivity to geometric structures. The C3k2_WTConv module introduces wavelet convolution WTConv into the backbone network and uses the decomposition characteristics of wavelet transform in the frequency domain to obtain an exponentially growing receptive field, thereby enhancing the model's bias sensitivity to the geometric edge features of the gate-type sewage outlet.
[0124] The SPPF module in the backbone network is replaced with the Focal Modulation module, which achieves dynamic focusing of key areas through the focus modulation mechanism. The FocalModulation module captures spatial semantics from near to far through hierarchical context encoding and uses a gating aggregation mechanism to generate feature modulators to enhance the model's ability to perceive key sewage discharge areas in the complex background of the river channel.
[0125] The C2PSA module in the backbone network is replaced with the C2PSA_MSDA module. Heterogeneous void parallel sampling is used to decouple the extreme scale span of the sewage outlet. The C2PSA_MSDA module is implemented by replacing the original attention mechanism in one or more PSA modules in the C2PSA module with the multi-scale void attention mechanism MSDA, and adopting a cascaded stacking method.
[0126] Based on the same inventive concept, this application also provides a system. The solution provided by this system is similar to the solution described in the above method. Therefore, the specific limitations of one or more system embodiments provided below can be found in the limitations of the method above, and will not be repeated here.
[0127] In one exemplary embodiment, a river discharge outlet detection system is provided, which applies the above-described river discharge outlet detection method. The system includes the following multiple modules.
[0128] The sample acquisition module is used to acquire a training sample set; each training sample in the training sample set includes a river image that has undergone image enhancement processing, and the river image contains a sewage outlet label.
[0129] The original model calling module is used to call the YOLO11-det model; the YOLO11-det model includes a backbone network, a neck network, and a head network.
[0130] The model optimization module replaces the C3k2 module in the backbone network with the C3k2_WT Conv module, and the SPPF module in the backbone network with the Focal Modulation module to introduce a focus modulation mechanism; it also replaces the C2PSA module in the backbone network with the C2PSA_MSDA module. The C2PSA_MSDA module replaces the original self-attention mechanism within the PSABlock (PSA) structure of the original C2PSA module with the MSDA mechanism, and combines it with a feedforward neural network to enhance feature representation through nonlinear transformation to obtain the final features. The module also replaces the C3k2 module in the neck network with the C3k2_MSCB module to introduce a multi-scale channel reconstruction mechanism; it replaces the nearest neighbor interpolation operator in the neck network with the DySample upsampling operator; it removes the P5 detection layer and adds a P2 detection layer in the neck network; and it replaces the P3, P4, and P5 detectors in the head network with P2, P3, and P4 detectors, thereby constructing the WFMD_YOLO11-det model.
[0131] The model training module is used to train the WFMD_YOLO11-det model using the training sample set to obtain a river discharge outlet detection model.
[0132] The sewage outlet detection module is used to input the initial river image to be processed into the river sewage outlet detection model to identify and locate the sewage outlet.
[0133] In summary, this application effectively solves the core technical challenges of signal sparsity, scale polarization, and complex background artifact interference from concealed sewage outlets under UAV vision by anchoring low-level feature signals and extracting multi-dimensional frequency information. Furthermore, this application achieves efficient extraction of target geometric attributes and environmental semantics by constructing a neural network architecture that deeply couples the physical characteristics of the sewage outlet.
[0134] In one exemplary embodiment, a computer device is also provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the above-described method embodiments.
[0135] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0136] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0137] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0138] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for detecting sewage outlets in river channels, characterized in that, The method includes: Obtain a training sample set; each training sample in the training sample set includes a river image that has undergone image enhancement processing, and the river image contains a sewage outlet label; The YOLO11-det model is invoked; the YOLO11-det model includes a backbone network, a neck network, and a head network. The C3k2 module in the backbone network is replaced with the C3k2_WT Conv module, and the SPPF module in the backbone network is replaced with the Focal Modulation module to introduce a focus modulation mechanism; the C2PSA module in the backbone network is replaced with the C2PSA_MSDA module; the C3k2 module in the neck network is replaced with the C3k2_MSCB module to introduce a multi-scale channel reconstruction mechanism; the nearest neighbor interpolation operator in the neck network is replaced with the Dy Sample upsampling operator; the P5 detection layer in the neck network is deleted and a P2 detection layer is added; the P3, P4, and P5 detection heads in the head network are replaced with P2, P3, and P4 detection heads, thereby constructing the WFMD_YOLO11-det model; The WFMD_YOLO11-det model was trained using the training sample set to obtain a river discharge outlet detection model. The initial river image to be processed is input into the river discharge outlet detection model to identify and locate the discharge outlet.
2. The method for detecting sewage outlets in rivers according to claim 1, characterized in that, The process of constructing the training sample set includes: Acquire initial river channel images within the target water area; The initial river image is optimized according to the preset image size and the preset image irrelevant background ratio to obtain the optimized river image; For the optimized river images, instance vector boxes are labeled with sewage outlets as targets; multiple optimized river images with sewage outlet labels constitute a river sewage outlet dataset; A composite image enhancement logic based on probability selection is adopted. By randomly combining Mosaic stitching, gamma dynamic correction, noise embedding, bidirectional flipping, random rotation within ±30° range and HSV space chromaticity shift, the data of the river sewage outlet dataset is expanded to obtain a comprehensive river sewage outlet dataset. The comprehensive dataset of river sewage outlets is divided to obtain a training sample set.
3. The method for detecting sewage outlets in rivers according to claim 1, characterized in that, The C3k2_MSCB module includes an initial convolutional layer, a segmentation layer, a feature extraction layer, a concatenation layer, and an ending convolutional layer set sequentially. The C3k2_MSCB module has two modes, corresponding to the C3k2_MSCB1 module and the C3k2_MSCB2 module respectively; For the C3k2_MSCB1 module: when the parameter C3k is set to False, the feature extraction layer includes multiple MSCB modules connected in series. For the C3k2_MSCB2 module: when the parameter C3k is set to True, the feature extraction layer includes multiple C3k_MSCB blocks connected in series; multiple MSCB modules are nested and stacked within each C3k_MSCB block.
4. The method for detecting sewage outlets in rivers according to claim 3, characterized in that, The data processing procedure of the MSCB module includes: Through point-to-point convolutional layers The received input feature map is subjected to channel dimensionality expansion, followed by batch normalization (BN) processing to obtain the first feature map. Using multi-scale deep convolution (MSDC), spatial features are extracted from the first feature map on parallel kernel branches of different sizes, and cross-size feature interaction is performed through channel shuffling operators to obtain the second feature map. Point-to-point convolutional layers The second feature map is compressed in terms of the number of channels, and then batch normalization (BN) is performed to obtain the output feature map.
5. The method for detecting sewage outlets in rivers according to claim 1, characterized in that, The Dy Sample upsampling operator includes a sampling point generator and a resampling engine; The sampling point generator is used to: dynamically adjust the sampling point position by generating offsets for the received input feature map, so as to generate Dy Sample sampling points and form a sampling set; The resampling engine is used to: resample the received input feature map in combination with the sampling set to obtain the corresponding output feature map.
6. The method for detecting sewage outlets in rivers according to claim 1, characterized in that, The C3k2_WT Conv module includes a wavelet convolution WT Conv block; The wavelet convolution WT Conv block includes a first wavelet transform WT layer, a second wavelet transform WT layer, a first frequency convolution layer, a second frequency convolution layer, a third frequency convolution layer, a first inverse wavelet transform IWT layer, and a second inverse wavelet transform IWT layer. The input terminal of the first wavelet transform (WT) layer is used to receive the input feature map, and the output terminal of the first wavelet transform (WT) layer is connected to the input terminal of the second wavelet transform (WT) layer. The output of the second wavelet transform (WT) layer is connected to the input of the second frequency convolutional layer, and the output of the second frequency convolutional layer is connected to the input of the second inverse wavelet transform (IWT) layer. The output of the second inverse wavelet transform (IWT) layer and the output of the first wavelet transform (WT) layer are weighted and aggregated before being fed into the first frequency convolutional layer. The output of the first frequency convolutional layer is connected to the input of the first inverse wavelet transform (IWT) layer. After the third frequency convolutional layer performs convolution processing on the input feature map, it is weighted and aggregated with the output of the first inverse wavelet transform (IWT) layer to obtain the output feature map.
7. The method for detecting sewage outlets in rivers according to claim 1, characterized in that, The C2PSA_MSDA module replaces the original attention mechanism in one or more PSA blocks within the C2PSA module with the multi-scale hole attention mechanism MSDA, and is implemented using a cascaded stacking method.
8. The method for detecting sewage outlets in rivers according to claim 2, characterized in that, HSV space chromaticity shift, including the following processing: In the simulated clear weather conditions with strong light reflection, the parameters are set as follows: hue fluctuation ±5%, and the increment range of saturation and brightness is defined between 10%~30% and 15%~35%, respectively. In a simulated low-contrast, rainy climate environment, the parameters were set as follows: hue shift ±5%, and saturation and brightness attenuation ratios set to 25%~40% and 20%~30%, respectively.
9. A river discharge outlet detection system, characterized in that, The system employs the river discharge outlet detection method according to any one of claims 1-8, the system comprising: The sample acquisition module is used to acquire a training sample set; each training sample in the training sample set includes a river image that has undergone image enhancement processing, and the river image contains a sewage outlet label. The original model calling module is used to call the YOLO11-det model; the YOLO11-det model includes a backbone network, a neck network, and a head network. The model optimization module is used to replace the C3k2 module in the backbone network with the C3k2_WT Conv module, and the SPPF module in the backbone network with the Focal Modulation module to introduce a focus modulation mechanism; replace the C2PSA module in the backbone network with the C2PSA_MSDA module; replace the C3k2 module in the neck network with the C3k2_MSCB module to introduce a multi-scale channel reconstruction mechanism; replace the nearest neighbor interpolation operator in the neck network with the DySample upsampling operator; delete the P5 detection layer and add a P2 detection layer in the neck network; and replace the P3, P4, and P5 detection heads in the head network with P2, P3, and P4 detection heads, thereby constructing the WFMD_YOLO11-det model. The model training module is used to train the WFMD_YOLO11-det model using the training sample set to obtain a river discharge outlet detection model. The sewage outlet detection module is used to input the initial river image to be processed into the river sewage outlet detection model to identify and locate the sewage outlet.
10. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the river discharge outlet detection method according to any one of claims 1-8.