An improved YOLOv12 offshore castaway detection method based on multi-scale expansion and feature fusion

By introducing a high-resolution feature perception path and an adaptive feature fusion structure into the YOLOv12 detection network, the problems of insufficient information on small targets and interference from complex backgrounds in the detection of people falling into the water at sea are solved, achieving high-precision, real-time target recognition, which is suitable for intelligent maritime rescue using drones and unmanned vessels.

CN123141995APending Publication Date: 2026-11-20DALIAN MARITIME UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611380697.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing technologies for detecting people falling into the water at sea suffer from insufficient spatial information for small targets, significant interference from complex backgrounds, and limited ability to fuse multi-scale features, making it difficult to meet the comprehensive requirements of detection accuracy and real-time performance under complex sea conditions.

Method used

An improved YOLOv12 detection method based on multi-scale expansion and feature fusion is constructed. A high-resolution feature perception path is introduced, and combined with the neuron importance adaptive adjustment mechanism, the features of the target region are enhanced. An adaptive spatial feature fusion structure is established to realize the dynamic interaction and fusion of features at different scales.

Benefits of technology

It improves the feature extraction capability for targets at long distances, small scales, and in semi-submerged states, reduces false negatives and false positives, enhances the robustness and detection accuracy of the model in complex marine environments, and supports real-time visual perception for intelligent maritime rescue platforms such as drones and unmanned vessels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123141995A_ABST
    Figure CN123141995A_ABST
Patent Text Reader

Abstract

The application provides an improved YOLOv12 offshore fallen personnel detection method based on multi-scale expansion and feature fusion, and belongs to the field of artificial intelligence and computer vision target detection. In view of the problems of small target scale, semi-submersion and complex background of offshore fallen personnel, the method comprises the following steps: constructing a target detection data set for the offshore rescue scene, screening, labeling and preprocessing the sea surface image; based on the YOLOv12 basic detection framework, introducing a high-resolution detection branch to enable the shallow spatial information to participate in target prediction; introducing a SimAM attention mechanism in the high-resolution detection branch to allocate weights to the input features; introducing an ASFF adaptive feature fusion module in the detection head to dynamically weight and fuse different resolution feature information; inputting the fused multi-scale features into the target detection prediction module to complete target category identification and position regression, and performing model training and verification. The method is suitable for real-time perception systems of unmanned aerial vehicle offshore search and rescue and intelligent rescue equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent sensing and target detection technology, and more particularly to an improved YOLOv12 method for detecting people falling into the sea based on multi-scale expansion and feature fusion. Background Technology

[0002] With the continuous development of maritime transport, offshore operations, and near-shore activities, accidents involving people falling overboard at sea occur frequently. Quickly and accurately locating people in the water is crucial for improving maritime search and rescue efficiency and reducing the risk of casualties. Currently, maritime rescue operations mainly rely on manual lookout, shipborne radar, and traditional video surveillance for target searching. However, complex sea conditions present challenges due to the strong reflectivity, dynamic ripples, and dramatic background changes of the sea surface. Furthermore, people in the water are often small and their posture changes significantly. Traditional manual observation methods are easily limited by observation distance, environmental conditions, and personnel experience, making it difficult to meet the demands for rapid, continuous, and precise search and rescue.

[0003] In recent years, with the development of drones, unmanned surface vessels (USVs), and intelligent visual perception devices, computer vision-based target detection technology has been increasingly applied in the field of maritime rescue. By acquiring sea surface images with visual sensors and automatically identifying people in the water using deep learning target detection algorithms, the workload of manual searches can be effectively reduced, and the level of automation in the search and rescue process can be improved. Among these methods, target detection based on convolutional neural networks has been widely used in target recognition tasks in complex environments due to its strong feature extraction capabilities and end-to-end detection advantages. In particular, the YOLO series of single-stage target detection algorithms, with their high detection speed and good real-time performance, are suitable for real-time visual perception tasks on mobile platforms such as drones and USVs.

[0004] However, existing deep learning-based methods for detecting people falling overboard at sea still have certain shortcomings. On the one hand, due to the strong similarity between targets and backgrounds in the marine environment, people falling overboard typically occupy only a small area in the image. After multiple downsampling operations by the network, target edges, contours, and fine-grained spatial information are easily lost, resulting in insufficient detection capabilities for distant, small-scale, and semi-submerged targets. On the other hand, complex background factors such as sea waves, light reflection, and foam textures generate a large amount of interference information with similar target features, making the detection model prone to false positives and false negatives, reducing the model's robustness in real-world marine environments.

[0005] Furthermore, existing target detection networks typically employ fixed-scale feature fusion, which leads to a mismatch between semantic information and spatial resolution across different feature levels, making it difficult to dynamically adjust feature contribution ratios according to changes in target scale. In the task of detecting people falling into the water at sea, large-scale and small-scale targets coexist. Traditional feature fusion methods struggle to balance spatial detail preservation and high-level semantic representation, limiting the model's adaptability to complex marine environments.

[0006] In summary, existing technologies for detecting people falling overboard at sea suffer from insufficient spatial information for small targets, significant interference from complex backgrounds, and limited multi-scale feature fusion capabilities, making it difficult to simultaneously meet the comprehensive requirements of detection accuracy and real-time performance under complex sea conditions. Therefore, there is an urgent need to propose a method for detecting people falling overboard at sea that can enhance the representation of spatial features of small targets, improve adaptability to complex backgrounds, and achieve effective fusion of multi-scale information, in order to improve the visual perception capabilities of intelligent maritime rescue systems. Summary of the Invention

[0007] To address the technical challenges of existing methods for detecting people falling overboard at sea, such as insufficient feature information for small targets, strong interference from complex sea surface backgrounds, limited multi-scale target detection capabilities, and the difficulty in balancing detection accuracy and real-time performance, this invention provides an improved YOLOv12-based method for detecting people falling overboard at sea, based on multi-scale expansion and feature fusion. This invention constructs a multi-scale feature enhancement detection framework based on YOLOv12, introducing a high-resolution feature perception path to enhance the network's ability to represent spatial details of people falling overboard at long distances, small scales, and in a semi-submerged state. Furthermore, it incorporates an adaptive neuron importance adjustment mechanism to enhance features in key target regions, reducing the impact of wave fluctuations, light reflection, and background textures on the detection results. Simultaneously, it constructs an adaptive spatial feature fusion structure to achieve dynamic interaction and effective fusion of feature information at different scales, improving the model's robustness to target detection in complex sea conditions. This invention achieves rapid and accurate identification of people falling into the water at sea through the aforementioned multi-scale expansion and feature fusion methods. It improves the detection model's adaptability to small targets, weakly textured targets, and complex background conditions, effectively reducing missed detections and false detections. It can be applied to the visual perception systems of UAVs, unmanned vessels, and intelligent maritime rescue equipment, providing reliable target detection technology support for maritime search and rescue missions.

[0008] The technical means employed in this invention are as follows: An improved YOLOv12 method for detecting people falling overboard at sea, based on multi-scale expansion and feature fusion, includes: S1. Construct a target detection dataset for maritime rescue scenarios, filter, label and preprocess the collected sea surface images, and establish a basic model for visual detection of people falling into the water based on a single-stage target detection network. S2. In the established visual detection basic model for people falling into the sea, the feature extraction structure is extended at multiple scales, and a high-resolution feature detection path is added on the basis of the original detection structure. Shallow spatial information participates in target prediction through the high-resolution feature detection path. S3. In the high-resolution feature detection path, an attention enhancement module based on adaptive adjustment of feature importance is constructed to assign weights to the output features of the high-resolution detection path and generate enhanced high-resolution detection features. S4. Input the generated enhanced high-resolution detection features and other scale detection features in the network into the adaptive spatial feature fusion structure, dynamically weight and fuse the feature information of different resolutions, and output the fused multi-scale features. S5. Input the fused multi-scale features into the target detection and prediction module to complete the target category identification and location regression of people who have fallen into the water at sea, and perform model training, performance evaluation and detection verification.

[0009] Further, step S1 includes: S11. Construct a data acquisition system for visual perception tasks of people falling into the water at sea, specifically including: Collect sea surface image data under different sea conditions, lighting conditions, and shooting angles, and establish a multi-source scene image sample library that includes distant targets, partially submerged targets, partially occluded targets, and complex background interference conditions; among them, the sea surface image data includes UAV aerial images, maritime rescue video frames, and publicly available maritime scene data; The sea surface image data is processed through data filtering, redundant frame removal, and quality verification to obtain effective image samples that meet the requirements of the target detection task. S12. Label the target regions of the acquired valid image samples, using rectangular bounding boxes to locate target instances in the image, and generate corresponding annotation information according to the target detection task format, specifically including: Targets in maritime rescue scenarios are categorized as follows:

[0010] in, Indicates the target category of the person who fell into the water. Indicates the category of the ship target. Indicates the buoy target category; Statistical analysis is performed on the target scale, target shape and background environment features in the labeled data to form a data feature representation that includes small-scale targets, weakly textured targets and complex background conditions. S13. Perform augmentation on the labeled dataset by expanding the sample distribution range through random scale changes, horizontal flipping, color perturbation, and Mosaic augmentation. The augmented training samples are represented as follows:

[0011] in, This represents the input image after enhancement processing. This indicates the corresponding target annotation information. This indicates the number of samples after augmentation.

[0012] Further, step S2 includes: S21. Using YOLOv12 as the basic detection framework, multi-level feature extraction is performed on the input sea surface image through the backbone network to obtain semantic feature information at different scales, specifically including: Let the input image be , ; After passing through the feature extraction network, features at different scales are obtained. ,as follows:

[0013] in, Indicates the first Each layer outputs a feature map, which corresponds to semantic features at different spatial resolutions. By fusing features at different scales through a feature pyramid structure, the joint expression of target category information and spatial positioning information can be achieved. S22. Introduce a high-resolution detection path by adding a high-resolution feature detection branch to the basic detection network. This branch fuses shallow spatial features with upsampled deep semantic features to obtain a new high-resolution detection feature layer. ,as follows:

[0014] in, Represents shallow, high-resolution spatial features. This represents the mesoscale features in the original detection network. Indicates an upsampling operation. Indicates feature concatenation operation; S23. The newly added high-resolution detection branch is fused with the existing multi-scale detection structure to construct a structure containing... , , and The four-scale detection output structure is as follows:

[0015] in, Used for detecting high-resolution small-scale targets. , , Used to provide target semantic information at different scales.

[0016] Further, step S3 includes: S31. In the high-resolution detection branch, a parameter-free attention enhancement module based on neuron importance evaluation is introduced. By calculating the importance weights of different neurons in the feature space, the target region features are adaptively enhanced. Specifically, this includes: For the high-resolution feature detection branch, the output feature map is: , ,in, , , These represent the number of channels, height, and width of the feature map, respectively, and are for neurons at any position in the feature map. Construct the energy function as follows:

[0017] in, Represents the feature transformation weights. Indicates the bias parameter. Represents the regularization coefficient. Indicates the number of other neurons within the same channel; By calculating the energy responses of neurons at different locations, the importance of the energy responses to the target detection task is evaluated, and the neuron importance evaluation results are obtained. S32. Adaptively adjust feature weights and enhance the target region, specifically including: Based on the obtained neuron importance evaluation results, the corresponding spatial attention weights are generated as follows:

[0018] in, The importance weights of the neurons are represented. This represents a very small constant used to avoid numerical instability; The generated weights are used to adaptively adjust the input features, resulting in enhanced high-resolution detection features as the output. ,as follows:

[0019] in, This represents the enhanced output features. Represents the attention weight matrix. This indicates an element-by-element merging operation.

[0020] Further, step S4 includes: S41. The high-resolution detection features after feature enhancement are fused with detection features of other scales in the network to obtain the output features of different detection layers, as follows:

[0021] in, Indicates the first Scale detection feature map , and These represent the number of channels, height, and width of the corresponding feature map, respectively. S42. Since feature maps at different scales have different spatial dimensions, the spatial scale of each feature is adjusted so that the adjusted spatial scale meets the feature fusion conditions, as follows:

[0022] in, This represents the feature information after scaling transformation. This indicates a space size adjustment operation; S43. After unifying the spatial dimensions of input features at different scales, spatial weights for each scale are generated through convolutional mapping, as follows:

[0023] in, Indicates the first Spatial weight response map corresponding to scale features; S44. By using a normalization function to constrain the weights at different scales, adaptive fusion of features at different scales is achieved, resulting in the following fusion weights:

[0024] in, Indicates spatial location First Scale feature fusion weights, Indicates the first Scale features at location The original spatial weight response value at that location, Indicates the first Scale features at location The original spatial weight response value at that location, Indicates the summation index. Iterate through all feature scales involved in adaptive fusion, i.e. , , and Four detection layer scales; S45. Based on the obtained fusion weights, the multi-scale features after unifying the size are weighted and fused to obtain the fused output features as follows:

[0025] in, This represents the fused output features, which simultaneously contain spatial detail information provided by the high-resolution detection branch and semantic representation information provided by the deep network. S46. Input the fused features into the target detection head to complete classification prediction and bounding box regression, and obtain the final detection results as follows:

[0026] in, This indicates the target category prediction result. This indicates the target's location coordinates.

[0027] Further, step S5 includes: S51. Input the training dataset into the improved detection network, process it through a multi-scale expansion structure, an attention enhancement module and an adaptive feature fusion structure to obtain fused multi-scale features; input the fused multi-scale features into the target detection prediction module to perform classification prediction and bounding box regression, and calculate the loss function value between the prediction result and the labeled true value. S52. Based on the calculated loss function value, calculate the network gradient through the backpropagation algorithm, and use the optimizer to iteratively update the network parameters until the preset convergence condition is met, thereby obtaining the drowning person detection model. S53. Input the validation set images into the drowning person detection model, output the prediction results through network forward propagation, compare the prediction results with the ground truth values ​​labeled in the validation set, calculate the category prediction accuracy and location regression error, and output the model performance evaluation index. S54. Export and convert the verified model for detecting people falling into the water, deploy it to the intelligent visual perception platform, input real-time sea surface images for forward inference, and output the target category and location recognition results of the people falling into the water.

[0028] Compared with the prior art, the present invention has the following advantages: 1. This invention provides an improved YOLOv12 method for detecting people falling overboard at sea based on multi-scale expansion and feature fusion. It addresses the problem of small target size and easy loss of spatial features of people falling overboard in complex sea conditions. By introducing a high-resolution feature perception path into the basic detection network and expanding the multi-scale detection structure, it enables shallow spatial information to participate in the target prediction process, thereby improving the model's feature extraction capability for distant, small-scale, and semi-submerged targets and effectively reducing the problem of missed detections caused by the small size of the target.

[0029] 2. This invention provides an improved YOLOv12 method for detecting people falling into the sea based on multi-scale expansion and feature fusion. By constructing a feature enhancement mechanism based on adaptive adjustment of neuron importance, the key target regions in the detection network are enhanced. Without increasing a large number of network parameters, the target feature response capability is improved. At the same time, irrelevant information such as wave ripples, sea surface reflection and complex background textures are suppressed, thereby enhancing the detection robustness of the model in complex marine environments.

[0030] 3. The present invention provides an improved YOLOv12 method for detecting people falling into the water at sea based on multi-scale expansion and feature fusion. By establishing an adaptive spatial feature fusion structure for multi-scale targets, it realizes dynamic interaction and effective fusion between features of different scales. Compared with the traditional fixed fusion method, it can adaptively adjust the contribution ratio of features of different scales according to the spatial location of the target, thereby improving the model's comprehensive detection capability for people falling into the water at different distances and of different sizes.

[0031] 4. The present invention provides an improved YOLOv12 method for detecting people who have fallen into the sea based on multi-scale expansion and feature fusion. By constructing a complete visual perception, feature enhancement and detection optimization process, the model improves detection accuracy and adaptability to complex environments while ensuring real-time detection capability. It can be deployed on intelligent maritime rescue platforms such as UAVs and unmanned vessels, providing reliable visual perception technology support for rapid search and assisted rescue of people who have fallen into the sea.

[0032] In summary, by applying the technical solution of this invention, the existing technologies address the problems of edge, contour, and fine-grained spatial information being easily lost after multiple downsampling of a person falling into the water; interference information easily generated by complex sea surface background factors; and the inability of fixed-scale feature fusion methods to dynamically adjust the feature contribution ratio according to changes in target scale. This invention achieves effective extraction and dynamic fusion of multi-scale features by introducing a high-resolution feature perception path, constructing a feature enhancement mechanism based on adaptive adjustment of neuron importance, and establishing an adaptive spatial feature fusion structure. Therefore, the technical solution of this invention solves the problems of insufficient detection capability for distant small targets and semi-submerged targets, significant false positives and false negatives in complex sea conditions, and poor adaptability of multi-scale feature fusion in existing technologies.

[0033] Based on the above reasons, this invention can be widely applied in fields such as unmanned aerial vehicle (UAV) maritime search and rescue, unmanned vessel intelligent inspection, and visual perception of intelligent rescue equipment. Attached Figure Description

[0034] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0035] Figure 1 This is a flowchart of the method of the present invention.

[0036] Figure 2 This is a schematic diagram of the overall structure of the improved YOLOv12-based network provided in an embodiment of the present invention.

[0037] Figure 3 The precision-recall curves of the model provided in the embodiments of the present invention.

[0038] Figure 4 The recall-confidence curve provided for embodiments of the present invention.

[0039] Figure 5 A comprehensive index curve of the YOLO training process provided in an embodiment of the present invention.

[0040] Figure 6 This is a schematic diagram illustrating the target detection results of the improved detection model provided in this embodiment of the invention under different sea conditions.

[0041] Figure 7 This is a schematic diagram illustrating the identification of the detection model provided in an embodiment of the present invention on a ground-based deployment platform. Detailed Implementation

[0042] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0043] It should be noted that the terms "comprising" and "having" and any variations thereof in the specification, claims and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product or device.

[0044] like Figure 1As shown, this invention provides an improved YOLOv12 method for detecting people falling into the sea based on multi-scale expansion and feature fusion, including: S1. Construct a target detection dataset for maritime rescue scenarios, filter, label and preprocess the collected sea surface images, and establish a basic model for visual detection of people falling into the water based on a single-stage target detection network. S2. In the established visual detection basic model for people falling into the sea, the feature extraction structure is extended at multiple scales, and a high-resolution feature detection path is added on the basis of the original detection structure. Shallow spatial information participates in target prediction through the high-resolution feature detection path. S3. In the high-resolution feature detection path, an attention enhancement module based on adaptive adjustment of feature importance is constructed to assign weights to the output features of the high-resolution detection path and generate enhanced high-resolution detection features. S4. Input the generated enhanced high-resolution detection features and other scale detection features in the network into the adaptive spatial feature fusion structure, dynamically weight and fuse the feature information of different resolutions, and output the fused multi-scale features. S5. Input the fused multi-scale features into the target detection and prediction module to complete the target category identification and location regression of people who have fallen into the water at sea, and perform model training, performance evaluation and detection verification.

[0045] In a specific implementation, as a preferred embodiment of the present invention, step S1 includes: S11. To address the challenges of small target size, significant attitude changes, and complex environmental interference factors in maritime rescue scenarios, a data acquisition system for visual perception tasks involving people who have fallen into the water is constructed, specifically including: Collect sea surface image data under different sea conditions, lighting conditions, and shooting angles, and establish a multi-source scene image sample library that includes distant targets, partially submerged targets, partially occluded targets, and complex background interference conditions; among them, the sea surface image data includes UAV aerial images, maritime rescue video frames, and publicly available maritime scene data; The sea surface image data is processed through data filtering, redundant frame removal, and quality verification to obtain effective image samples that meet the requirements of the target detection task. S12. To address the issue of high similarity between a person falling into the water and the surrounding background in a maritime environment, target regions are labeled on the acquired valid image samples. Rectangular bounding boxes are used to locate target instances in the image, and corresponding annotation information is generated according to the target detection task format. Specifically, this includes: Targets in maritime rescue scenarios are categorized as follows:

[0046] in, Indicates the target category of the person who fell into the water. Indicates the category of the ship target. The target category of the buoy is indicated. In this embodiment, a multi-category scene annotation method is used to enable the detection model to learn the spatial relationship between the person who fell into the water and the sea surface environment, rescue equipment and surrounding targets. Statistical analysis is performed on the target scale, target shape and background environment features in the labeled data to form a data feature representation that includes small-scale targets, weakly textured targets and complex background conditions. S13. To address issues such as wave disturbance, lighting variations, sea surface reflection, and target scale changes in the marine environment, the labeled dataset is augmented. This is achieved by expanding the sample distribution range through random scale changes, horizontal flipping, color perturbation, and Mosaic enhancement, thereby improving the visual perception model's adaptability to complex sea conditions. The augmented training samples are represented as follows:

[0047] in, This represents the input image after enhancement processing. This indicates the corresponding target annotation information. This indicates the number of samples after augmentation.

[0048] In this embodiment, the above-described data construction method enables the visual perception model to fully learn the spatial and semantic features of the target person who has fallen into the water under different sea conditions, providing a reliable data foundation for the subsequent construction of a multi-scale detection network.

[0049] In a specific implementation, as a preferred embodiment of the present invention, step S2 includes: S21. To address the issues of small target size and the susceptibility of target features to continuous downsampling when people fall into the sea, YOLOv12 is adopted as the basic detection framework. A backbone network is used to perform multi-level feature extraction on the input sea surface image to obtain semantic feature information at different scales, specifically including: Let the input image be , ; After passing through the feature extraction network, features at different scales are obtained. ,as follows:

[0050] in, Indicates the first Each layer outputs a feature map, which corresponds to semantic features at different spatial resolutions. By fusing features at different scales through a feature pyramid structure, the joint expression of target category information and spatial positioning information can be achieved. S22. To address the issue that the spatial scale of the highest resolution detection layer in the original YOLOv12 detection structure is still insufficient to fully represent distant, small-scale targets, a high-resolution detection path is introduced. A high-resolution feature detection branch is added to the basic detection network, fusing shallow spatial features with upsampled deep semantic features to obtain a new high-resolution detection feature layer. ,as follows:

[0051] in, Represents shallow, high-resolution spatial features. This represents the mesoscale features in the original detection network. Indicates an upsampling operation. Indicates feature concatenation operation; In this embodiment, by using the above method, shallow texture information, edge information, and deep semantic information are all involved in target detection, thereby improving the network's spatial perception ability for small targets.

[0052] S23. The newly added high-resolution detection branch is fused with the existing multi-scale detection structure to construct a structure containing... , , and The four-scale detection output structure is as follows:

[0053] in, Used for detecting high-resolution small-scale targets. , , Used to provide target semantic information at different scales.

[0054] In this embodiment, by adding a high-resolution detection path, the model can improve its feature representation ability for distant, low-pixel, and partially submerged people in the water while maintaining deep semantic understanding capabilities.

[0055] In a specific implementation, as a preferred embodiment of the present invention, step S3 includes: S31. In the high-resolution detection branch, a parameter-free attention enhancement module based on neuron importance evaluation is introduced. By calculating the importance weights of different neurons in the feature space, the target region features are adaptively enhanced. Specifically, this includes: For the high-resolution feature detection branch, the output feature map is: , ,in, , , These represent the number of channels, height, and width of the feature map, respectively, and are for neurons at any position in the feature map. Construct the energy function as follows:

[0056] in, Represents the feature transformation weights. Indicates the bias parameter. Represents the regularization coefficient. Indicates the number of other neurons within the same channel; By calculating the energy responses of neurons at different locations, the importance of the energy responses to the target detection task is evaluated, and the neuron importance evaluation results are obtained. S32. Adaptively adjust feature weights and enhance the target region, specifically including: Based on the obtained neuron importance evaluation results, the corresponding spatial attention weights are generated as follows:

[0057] in, The importance weights of the neurons are represented. This represents a very small constant used to avoid numerical instability; The generated weights are used to adaptively adjust the input features, resulting in enhanced high-resolution detection features as the output. ,as follows:

[0058] in, This represents the enhanced output features. Represents the attention weight matrix. This indicates an element-by-element merging operation.

[0059] In this embodiment, the above-mentioned method is used to improve the feature response intensity of the target area of ​​a person who has fallen into the water, suppress invalid information from sea surface ripples, reflections, and complex background areas, and achieve accurate perception of the target area in complex sea conditions.

[0060] In a specific implementation, as a preferred embodiment of the present invention, step S4 includes: S41. To address the issue of large variations in the size of individuals falling into the sea and spatial resolution differences between features at different scales, the high-resolution detection features after feature enhancement are fused with detection features at other scales in the network to obtain output features from different detection layers, as follows:

[0061] in, Indicates the first Scale detection feature map , and These represent the number of channels, height, and width of the corresponding feature map, respectively. S42. Since feature maps at different scales have different spatial dimensions, the spatial scale of each feature is adjusted so that the adjusted spatial scale meets the feature fusion conditions, as follows:

[0062] in, This represents the feature information after scaling transformation. This indicates a spatial size adjustment operation; in this embodiment, through the above processing, features of different scales can interact with each other under a unified spatial scale.

[0063] S43. Construct a spatial location-adaptive weight allocation mechanism. Addressing the problem that traditional feature fusion methods use fixed weights, making it difficult to dynamically adjust feature contributions according to changes in the target scale, this mechanism utilizes normalized weights to achieve adaptive fusion of features at different scales. After unifying the spatial dimensions of input features at different scales, spatial weights for each scale are generated through convolutional mapping, as follows:

[0064] in, Indicates the first Spatial weight response map corresponding to scale features; S44. By using a normalization function to constrain the weights at different scales, adaptive fusion of features at different scales is achieved, resulting in the following fusion weights:

[0065] in, Indicates spatial location First Scale feature fusion weights, Indicates the first Scale features at location The original spatial weight response value at the position is obtained by the convolutional layer after applying a uniform size to the first position. The scale feature is obtained through mapping and prediction, reflecting the importance of that scale feature at that spatial location. Indicates the first Scale features at location The original spatial weight response value at that location, Indicates the summation index. Iterate through all feature scales involved in adaptive fusion, i.e. , , and Four detection layer scales; S45. Based on the obtained fusion weights, the multi-scale features after unifying the size are weighted and fused to obtain the fused output features as follows:

[0066] in, This represents the fused output features, which simultaneously contain spatial detail information provided by the high-resolution detection branch and semantic representation information provided by the deep network. S46. Input the fused features into the target detection head to complete classification prediction and bounding box regression, and obtain the final detection results as follows:

[0067] in, This indicates the target category prediction result. This indicates the target's location coordinates.

[0068] In this embodiment, the adaptive spatial feature fusion method described above enables effective complementarity of target features at different scales, thereby improving the accuracy and robustness of detecting people falling into the water in complex sea conditions.

[0069] In a specific implementation, as a preferred embodiment of the present invention, step S5 includes: S51. Input the training dataset into the improved detection network, process it through a multi-scale expansion structure, an attention enhancement module and an adaptive feature fusion structure to obtain fused multi-scale features; input the fused multi-scale features into the target detection prediction module to perform classification prediction and bounding box regression, and calculate the loss function value between the prediction result and the labeled true value. S52. Based on the calculated loss function value, calculate the network gradient through the backpropagation algorithm, and use the optimizer to iteratively update the network parameters until the preset convergence condition is met, thereby obtaining the drowning person detection model. S53. Input the validation set images into the drowning person detection model, output the prediction results through network forward propagation, compare the prediction results with the ground truth values ​​labeled in the validation set, calculate the category prediction accuracy and location regression error, and output the model performance evaluation index. S54. Export and convert the verified model for detecting people falling into the water, deploy it to the intelligent visual perception platform, input real-time sea surface images for forward inference, and output the target category and location recognition results of the people falling into the water.

[0070] Example To verify the effectiveness of the present invention, this embodiment uses a computer vision experimental platform to validate the proposed method for detecting people falling overboard at sea. The experimental subjects are visual image data collected in maritime rescue scenarios, and model training and performance testing are conducted based on the constructed dataset for detecting people falling overboard at sea. This embodiment first performs data filtering, target labeling, and data augmentation on the collected sea surface images to construct a dataset containing different sea conditions, lighting conditions, and target states. The dataset includes target categories such as people falling overboard, ships, and buoys, covering target samples under conditions of long distance, small scale, semi-submerged status, and complex background interference, providing a data foundation for training the detection model.

[0071] In the model construction process, the YOLOv12 object detection network is used as the basic detection framework, and the network structure is improved using the method proposed in this invention. For example... Figure 2 The diagram shows the overall structure of the improved network based on YOLOv12. First, a high-resolution sensor is added to the original detection structure. The feature detection path enables shallow spatial information to participate in target prediction, improving the model's ability to perceive small-scale and weakly featured targets. Secondly, a feature enhancement mechanism based on neuron importance adaptive adjustment is introduced in the high-resolution detection branch to improve the response capability of key target areas and reduce interference caused by waves, reflections, and background textures. Finally, an adaptive spatial feature fusion structure is constructed in the detection head to achieve dynamic fusion of feature information at different scales.

[0072] During model training, a unified experimental environment and parameter settings were used to train and optimize the improved model. The training input image size was set to 640×640 pixels, and the network parameters were updated using the stochastic gradient descent optimization algorithm. The model training process was dynamically evaluated using a validation set.

[0073] To verify the effectiveness of the method of the present invention, such as Figure 3-6 As shown, comparative experiments were conducted using the basic YOLOv12 model, a model with an added high-resolution detection branch, a model with an added feature enhancement module, and a complete improved model. Experimental results show that the improved model achieves an mAP@0.5 of 0.913, a 1.0 percentage point improvement compared to the basic YOLOv12. Table 1 also presents the performance comparison results between the improved detection model and the basic model. The method of this invention can effectively enhance the detection capability of small targets in complex sea conditions, improving the accuracy and stability of target recognition.

[0074] Table 1. Performance comparison results between the improved detection model and the basic model.

[0075] Furthermore, such as Figure 7As shown, the trained detection model is deployed on an edge computing vision platform, acquiring real-time sea surface images through camera equipment and performing target detection inference. Experimental results demonstrate that the method of this invention can achieve rapid identification of people falling into the water and meets the application requirements of intelligent maritime rescue equipment such as drones and unmanned vessels for real-time visual perception.

[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. An improved YOLOv12 method for detecting people falling into the water at sea based on multi-scale expansion and feature fusion, characterized in that, include: S1. Construct a target detection dataset for maritime rescue scenarios, filter, label and preprocess the collected sea surface images, and establish a basic model for visual detection of people falling into the water based on a single-stage target detection network. S2. In the established visual detection basic model for people falling into the sea, the feature extraction structure is extended at multiple scales, and a high-resolution feature detection path is added on the basis of the original detection structure. Shallow spatial information participates in target prediction through the high-resolution feature detection path. S3. In the high-resolution feature detection path, an attention enhancement module based on adaptive adjustment of feature importance is constructed to assign weights to the output features of the high-resolution detection path and generate enhanced high-resolution detection features. S4. Input the generated enhanced high-resolution detection features and other scale detection features in the network into the adaptive spatial feature fusion structure, dynamically weight and fuse the feature information of different resolutions, and output the fused multi-scale features. S5. Input the fused multi-scale features into the target detection and prediction module to complete the target category identification and location regression of people who have fallen into the water at sea, and perform model training, performance evaluation and detection verification.

2. The improved YOLOv12 method for detecting people falling into the water at sea based on multi-scale expansion and feature fusion as described in claim 1, characterized in that, Step S1 includes: S11. Construct a data acquisition system for visual perception tasks of people falling into the water at sea, specifically including: Collect sea surface image data under different sea conditions, lighting conditions, and shooting angles, and establish a multi-source scene image sample library that includes distant targets, partially submerged targets, partially occluded targets, and complex background interference conditions; among them, the sea surface image data includes UAV aerial images, maritime rescue video frames, and publicly available maritime scene data; The sea surface image data is processed through data filtering, redundant frame removal, and quality verification to obtain effective image samples that meet the requirements of the target detection task. S12. Label the target regions of the acquired valid image samples, using rectangular bounding boxes to locate target instances in the image, and generate corresponding annotation information according to the target detection task format, specifically including: Targets in maritime rescue scenarios are categorized as follows: in, Indicates the target category of the person who fell into the water. Indicates the category of the ship target. Indicates the buoy target category; Statistical analysis is performed on the target scale, target shape and background environment features in the labeled data to form a data feature representation that includes small-scale targets, weakly textured targets and complex background conditions. S13. Perform augmentation on the labeled dataset by expanding the sample distribution range through random scale changes, horizontal flipping, color perturbation, and Mosaic augmentation. The augmented training samples are represented as follows: in, This represents the input image after enhancement processing. This indicates the corresponding target annotation information. This indicates the number of samples after augmentation.

3. The improved YOLOv12 method for detecting people falling into the water at sea based on multi-scale expansion and feature fusion as described in claim 1, characterized in that, Step S2 includes: S21. Using YOLOv12 as the basic detection framework, multi-level feature extraction is performed on the input sea surface image through the backbone network to obtain semantic feature information at different scales, specifically including: Let the input image be , ; After passing through the feature extraction network, features at different scales are obtained. ,as follows: in, Indicates the first Each layer outputs a feature map, which corresponds to semantic features at different spatial resolutions. By fusing features at different scales through a feature pyramid structure, the joint expression of target category information and spatial positioning information can be achieved. S22. Introduce a high-resolution detection path by adding a high-resolution feature detection branch to the basic detection network. This branch fuses shallow spatial features with upsampled deep semantic features to obtain a new high-resolution detection feature layer. ,as follows: in, Represents shallow, high-resolution spatial features. This represents the mesoscale features in the original detection network. Indicates an upsampling operation. Indicates feature concatenation operation; S23. The newly added high-resolution detection branch is fused with the existing multi-scale detection structure to construct a structure containing... , , and The four-scale detection output structure is as follows: in, Used for detecting high-resolution small-scale targets. , , Used to provide target semantic information at different scales.

4. The improved YOLOv12 method for detecting people falling into the water at sea based on multi-scale expansion and feature fusion as described in claim 1, characterized in that, Step S3 includes: S31. In the high-resolution detection branch, a parameter-free attention enhancement module based on neuron importance evaluation is introduced. By calculating the importance weights of different neurons in the feature space, the target region features are adaptively enhanced. Specifically, this includes: For the high-resolution feature detection branch, the output feature map is: , ,in, , , These represent the number of channels, height, and width of the feature map, respectively, and are for neurons at any position in the feature map. Construct the energy function as follows: in, Represents the feature transformation weights. Indicates the bias parameter. Represents the regularization coefficient. Indicates the number of other neurons within the same channel; By calculating the energy responses of neurons at different locations, the importance of the energy responses to the target detection task is evaluated, and the neuron importance evaluation results are obtained. S32. Adaptively adjust feature weights and enhance the target region, specifically including: Based on the obtained neuron importance evaluation results, the corresponding spatial attention weights are generated as follows: in, The importance weights of the neurons are represented. This represents a very small constant used to avoid numerical instability; The generated weights are used to adaptively adjust the input features, resulting in enhanced high-resolution detection features as the output. ,as follows: in, This represents the enhanced output features. Represents the attention weight matrix. This indicates an element-by-element merging operation.

5. The improved YOLOv12 method for detecting people falling into the water at sea based on multi-scale expansion and feature fusion as described in claim 1, characterized in that, Step S4 includes: S41. The high-resolution detection features after feature enhancement are fused with detection features of other scales in the network to obtain the output features of different detection layers, as follows: in, Indicates the first Scale detection feature map , and These represent the number of channels, height, and width of the corresponding feature map, respectively. S42. Since feature maps at different scales have different spatial dimensions, the spatial scale of each feature is adjusted so that the adjusted spatial scale meets the feature fusion conditions, as follows: in, This represents the feature information after scaling transformation. This indicates a space size adjustment operation; S43. After unifying the spatial dimensions of input features at different scales, spatial weights for each scale are generated through convolutional mapping, as follows: in, Indicates the first Spatial weight response diagram corresponding to scale features; S44. By using a normalization function to constrain the weights at different scales, adaptive fusion of features at different scales is achieved, resulting in the following fusion weights: in, Indicates spatial location First Scale feature fusion weights, Indicates the first Scale features at location The original spatial weight response value at that location, Indicates the first Scale features at location The original spatial weight response value at that location, Indicates the summation index. Iterate through all feature scales involved in adaptive fusion, i.e. , , and Four detection layer scales; S45. Based on the obtained fusion weights, the multi-scale features after unifying the size are weighted and fused to obtain the fused output features as follows: in, This represents the fused output features, which simultaneously contain spatial detail information provided by the high-resolution detection branch and semantic representation information provided by the deep network. S46. Input the fused features into the target detection head to complete classification prediction and bounding box regression, and obtain the final detection results as follows: in, This indicates the target category prediction result. This indicates the target's location coordinates.

6. The improved YOLOv12 method for detecting people falling into the water at sea based on multi-scale expansion and feature fusion as described in claim 1, characterized in that, Step S5 includes: S51. Input the training dataset into the improved detection network, process it through a multi-scale expansion structure, an attention enhancement module and an adaptive feature fusion structure to obtain fused multi-scale features; input the fused multi-scale features into the target detection prediction module to perform classification prediction and bounding box regression, and calculate the loss function value between the prediction result and the labeled true value. S52. Based on the calculated loss function value, calculate the network gradient through the backpropagation algorithm, and use the optimizer to iteratively update the network parameters until the preset convergence condition is met, thus obtaining the drowning person detection model. S53. Input the validation set images into the drowning person detection model, output the prediction results through network forward propagation, compare the prediction results with the ground truth values ​​labeled in the validation set, calculate the category prediction accuracy and location regression error, and output the model performance evaluation index. S54. Export and convert the verified drowning person detection model, deploy it to the intelligent visual perception platform, input real-time sea surface images for forward inference, and output the target category and location recognition results of the drowning person.