Coastal crack flow profile identification method and device for real-time early warning
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STATE OCEAN TECH CENT
- Filing Date
- 2026-06-08
- Publication Date
- 2026-08-07
AI Technical Summary
以解决现有技术中裂流监测依赖人工目视、精度低、无法在边缘计算设备上同时实现高精度与实时轮廓识别的矛盾
1.本申请轮廓识别精度高,抗干扰能力强:本申请专门针对裂流特征设计,通过上下文增强提取和内容自适应融合,能有效区分裂流与波浪、眩光等干扰,实现高精度、高完整性的轮廓提取,显著降低漏报和误报。
Smart Images

Figure CN122336571B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of marine environmental monitoring and disaster prevention and mitigation technology, and in particular to an automated, high-precision, real-time monitoring technology and related devices for high-risk coastal rift events. Specifically, it provides an innovative automated method and device for coastal rift event perception and contour recognition, used to extract the complete morphological contour of rifts from coastal monitoring videos in real time and accurately, providing direct and reliable technical support for coastal public safety early warning, hydrological risk analysis, and emergency response decision-making. Background Technology
[0002] Rift currents are among the most threatening sudden hydrological hazards in coastal zones. They are characterized by high flow rates (often exceeding 1-2 m / s), sudden onset, and counterintuitive escape methods (requiring swimming parallel to the coast), leading to numerous drowning accidents worldwide. Traditional monitoring relies entirely on lifeguards' visual observation, which suffers from inherent limitations such as subjectivity, fatigue, and inability to provide 24 / 7 coverage. With the widespread adoption of coastal video surveillance networks, drones, and smartphone cameras, automated and continuous monitoring using visual methods has become possible. Early automated attempts treated rift currents as "boxes," providing only their approximate location and failing to capture precise contour information such as shape, direction, and area. This contour information is crucial for assessing rift current intensity, predicting its movement trends, and issuing accurate spatial warnings. Therefore, pixel-level "contour recognition" technology capable of delineating rift currents has become an essential choice for effective monitoring. However, performing high-precision contour recognition of fracture currents in natural coastal scenes faces a fundamental contradiction: on the one hand, fracture currents have weak visual features (manifested as subtle differences in water surface texture, color, and foam, with blurred contours that easily blend into the wave background), varied shapes, and different scales, requiring recognition models with strong feature discrimination and context integration capabilities, which usually means high computational complexity; on the other hand, coastal monitoring equipment (such as fixed cameras, drones, and buoys) is usually deployed in the field, limited by solar power, embedded processor computing power, and wireless transmission bandwidth, placing extremely stringent requirements on the real-time performance, low power consumption, and model size of the algorithm. Existing general contour recognition models struggle to balance this contradiction: high-precision models have a heavy computational burden (tens to hundreds of GFLOPs) and cannot run in real time on edge devices; while lightweight models designed for edge devices often suffer from a significant decrease in recognition accuracy (especially in characterizing weak fracture currents and contour boundaries), leading to missed detections or inaccurate contour depiction, greatly reducing their practical value. Furthermore, general models are not designed for the unique hydrological visual features of fracture currents and lack robustness to common coastal disturbances such as wave spray and solar glare.
[0003] Therefore, there is an urgent need in this field for a complete technical solution and supporting device that is specifically tailored for coastal rift disaster monitoring scenarios and can achieve high-precision, high-robust real-time contour recognition in resource-constrained edge computing environments, in order to solve the "last mile" problem between laboratory algorithms and practical field applications. Summary of the Invention
[0004] Therefore, the purpose of this invention is to provide a method and related device for coastal rift contour recognition for real-time early warning. This addresses the contradiction in existing technologies where rift monitoring relies on manual visual inspection, has low accuracy, and cannot simultaneously achieve high accuracy and real-time contour recognition on edge computing devices. Specifically, the invention aims to achieve high-precision, low-latency, all-weather automatic recognition of pixel-level rift contours on resource-constrained edge devices through innovative deep learning model architectures (RepHGNet, CAU, LSCSeg) and collaborative compression frameworks (gradient flow pruning and robust knowledge distillation), and integrates a complete monitoring and early warning device, thereby improving the automation level and emergency response capabilities of coastal disaster prevention and mitigation.
[0005] To achieve the above objectives, the present invention provides a coastal rift contour recognition method for real-time early warning, comprising: In the first stage, the basic crack flow contour recognition model RipSegNet is used for crack flow contour recognition. The basic crack flow contour recognition model RipSegNet includes: a backbone network RepHGNet, a content adaptive upsampling mechanism CAU, and a lightweight and stable contour decoding network LSCSeg. Acquire coastal surveillance images and perform preprocessing; The preprocessed coastal monitoring images are input into the RepHGNet backbone network, which has the ability to enhance the extraction of multi-scale contextual features, to extract features and output multi-scale feature maps. The content adaptive upsampling mechanism (CAU) is used to perform feature fusion and contour reconstruction on the multi-scale feature map to obtain the fused feature map. The fused feature map is decoded using the lightweight and stable contour decoding network LSCSeg to generate a pixel-level contour mask for the split flow. In the second stage, the basic crack flow profile recognition model RipSegNet is lightweighted using a collaborative compression framework. The lightweight crack current contour recognition model RipSegNet-Lite is used to infer the crack current recognition results from real-time acquired coastal monitoring images.
[0006] Furthermore, the step of inputting the preprocessed coastal monitoring images into the RepHGNet backbone network, which has multi-scale contextual feature enhancement extraction capabilities, specifically includes: S201, the backbone network RepHGNet, uses the improved heterogeneous network unit HGBlock as the basic building block. The HGBlock includes a backbone branch and parallel skip connections. The backbone branch is connected in series with depthwise separable convolutional units and squeezing and excitation networks. The depthwise separable convolutional unit includes a depthwise convolutional layer and a pointwise convolutional layer connected in series. The depthwise convolutional layer is used to perform spatial convolution on each channel individually, and the pointwise convolutional layer is used to output cross-channel fusion information. S202, Process the pre-processed coastal monitoring images Input the backbone network RepHGNet, and output feature maps at three scales according to the stage: in, Indicates the first Functions for each stage, =2 / 3 / 4; Preserve high-resolution spatial details; Provides a balanced representation; Encapsulate a high-level semantic context to recognize the rift as a coherent entity; and These are the height and width of the input image, respectively. , , These represent the number of feature map channels output at different stages of the backbone network.
[0007] Furthermore, the Content Adaptive Upsampling (CAU) mechanism performs the following steps: Assuming the upsampling factor is Target output position Then the corresponding input feature map The source location on is ; Indicates to The value is rounded down. Indicates to The value is rounded down. Centered on the source location, the context neighborhood is taken as The first region is input into a lightweight neural network module Ψ to obtain a recombination kernel specific to the predicted location. : in, This indicates the source location on the input feature map X. These are the boundary values of the first region; Represents the source location on the input feature map X. Centered on, with side length as The square neighborhood; Output position The value uses the recombined kernel For a larger neighborhood on the input feature map The second region is weighted and summed to obtain the output position. The calculation formula is as follows: in, The boundary value of the second region. The weight value of the recombinant kernel at position p; X(p) is the original feature value of the input feature map at position p.
[0008] Furthermore, in S4, the lightweight stable contour decoding network LSCSeg includes: input features for each scale. Apply scale-specific 1×1 convolution Projecting onto a unified feature space yields projected features. ; All projection features Processing is performed using the same set of shared convolutional layers, which employ grouped normalization. Output shared features , From the shared features Starting from the beginning, a branch dedicated to the additional task is added, which outputs a mask coefficient vector. The mask coefficient vector is then linearly combined with the pre-learned prototype mask to generate a pixel-level contour mask for the split flow.
[0009] Furthermore, in the second stage, a lightweighting process is performed on the basic fracture flow profile recognition model RipSegNet using a collaborative compression framework, including: For the basic crack flow contour recognition model RipSegNet, the first step is to calculate the weight norm of each output channel in each convolutional layer, and the gradient norm of the loss function on the feature map of that output channel. The weighted sum of the weight norm and the gradient norm is used as the importance evaluation index for this channel; Based on the preset computational budget, the output channels with the lowest ranking in importance assessment indicators are removed; The teacher network with momentum update dynamically generates the probability distribution after temperature softening as soft label, and combined with the course-based temperature adjustment strategy, the pruned student network is distilled and fine-tuned to obtain the lightweight fracture flow profile recognition model RipSegNet-Lite.
[0010] Furthermore, in the second phase, the assessment of the importance of each output channel to the task is calculated using the following formula: in: It is the channel weight. Norm, a measure of the static size of the weights, where c is the index of the output channel in the current convolutional layer. The layer number is the convolutional layer number; Is the total loss function L for the first... Layer c-th channel output features gradient Norm, measures the dynamic contribution of a channel to a task; ∈(0,2], is the weighting coefficient that balances the two contributions, determined by grid search on the validation set.
[0011] Furthermore, based on the pre-set computational budget, the output channels with the lowest ranking in importance assessment indicators are removed, including: Set calculation budget ; The computational cost of the pruned model is estimated to meet the constraints shown in the following formula, and the pruned model is generated as follows: in, For the original model, This is the model after pruning. This indicates the computational cost of the model.
[0012] Furthermore, the combined curriculum-based temperature regulation strategy involves distillation fine-tuning of the pruned student network, including: the teacher network parameters employing a momentum update strategy as shown in the following formula: Distillation loss KL divergence is used, and the temperature parameter T is dynamically adjusted with the iteration number t: in, and These are the initial and final temperatures, respectively. This represents the total number of iterations. and Let be the probability distributions of the student network and the teacher network at position i after temperature softening, respectively. These are the parameters of the teacher network at the t-th iteration. It is the momentum coefficient of the distillation model, with a value range of [0, 1); These are the parameters of the student network at the t-th iteration. Let be the distillation temperature parameter at the t-th iteration.
[0013] The present invention also provides a coastal rift contour recognition device for real-time early warning, comprising: A visual perception unit is used to acquire video images of the coastal monitoring area. The intelligent processing unit has a built-in lightweight crack flow profile recognition model RipSegNet-Lite obtained by the above method, which is used to execute the method and output crack flow recognition results in real time. The early warning and communication unit triggers local early warning and / or sends alarm information to the remote monitoring platform based on the crack flow identification results.
[0014] Furthermore, the early warning and communication unit includes a local early warning module and a remote communication module. The local early warning module includes at least an audible and visual alarm and an outdoor LED display screen for graphically displaying the pixel-level outline of the rift risk area. The remote communication module uses 4G / 5G, NB-IoT, or satellite communication equipment.
[0015] The coastal rift contour recognition method and apparatus for real-time early warning disclosed in this application have at least the following advantages: 1. This application has high contour recognition accuracy and strong anti-interference ability: This application is specifically designed for crack flow features. Through context enhancement extraction and content adaptive fusion, it can effectively distinguish crack flow from interference such as waves and glare, and achieve high-precision and high-completeness contour extraction, significantly reducing false alarms and missed alarms.
[0016] 2. This application has strong real-time processing capabilities and extremely low resource consumption: Through training-deployment optimization, parameter sharing decoding, and course-based lightweighting, the core processing unit has a small computational load (only 4.0 GFLOPs) and few parameters (only 0.87M), which can realize real-time processing of video streams on mainstream edge AI chips and meet the instantaneous response requirements of disaster monitoring.
[0017] 3. Good stability in edge deployment: The decoding module of this application adopts group normalization technology, which ensures the performance consistency from laboratory training to deployment in various edge scenarios, avoids recognition failure caused by environmental changes, and the device has high reliability.
[0018] 4. This application provides an end-to-end solution: This invention not only proposes the core algorithm process, but also clarifies the device composition for implementing the process, and provides a complete and rapidly deployable product solution from image perception and intelligent analysis to multi-mode early warning, which greatly reduces the technical threshold for coastal management departments to build an intelligent monitoring system.
[0019] 5. This application enhances disaster prevention and mitigation effectiveness: This device can achieve unattended, all-weather automatic monitoring, timely and accurately detect and delineate rift currents, and release precise spatial early warning information through multiple channels such as sound, light, and network, effectively expanding the monitoring coverage and shortening the early warning time, providing a solid technical equipment foundation for protecting public safety and improving coastal emergency management capabilities. Attached Figure Description
[0020] Figure 1 This is a flowchart illustrating the coastal rift contour recognition method for real-time early warning provided by the present invention.
[0021] Figure 2 This is a schematic diagram of the coastal rift contour recognition device for real-time early warning according to the present invention.
[0022] Figure 3 This is a thermal distribution map of the identification results after using the present invention.
[0023] Figure 4 This is a comparison diagram of the recognition contours of this application and existing recognition technologies in Embodiment 2 of the present invention. Detailed Implementation
[0024] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0025] like Figure 1 As shown, one embodiment of the present invention provides a coastal rift contour recognition method for real-time early warning, which includes the following steps: In the first stage, the basic crack flow contour recognition model RipSegNet is used to perform crack flow contour recognition. The basic crack flow contour recognition model RipSegNet includes: the backbone network RepHGNet, the content adaptive upsampling mechanism CAU, and the lightweight stable contour decoding network LSCSeg. For the large-scale and context-dependent phenomenon of rip currents, this method designs a backbone network, RepHGNet, with a large effective receptive field. It integrates efficient reparameterization with the HGNet network to consolidate information from a broad area of surface water, thereby distinguishing ordered rip currents from disordered background waves. Furthermore, when upsampling low-resolution feature maps representing the core of the rip current, a fixed kernel function can blur features in a uniform neighborhood, affecting contour boundary determination. This method designs a content-adaptive upsampling (CAU) neck network to optimize rip current contour boundary extraction. To address the issue of redundant parameters in the detection head and the limited sample size for edge computation inference, this method designs a lightweight and stable contour decoding network, LSCSeg, to remove redundant parameters for rip current detection and improve the segmentation capability for small-batch data inference at the edge. This architecture integrates a reparameterized and context-aware backbone network (RepHGNet), a content-adaptive upsampling mechanism (CAU) across the entire feature pyramid, and a highly parameter-efficient decoder (LSCSeg). The combination of these three elements significantly improves the balance between accuracy and efficiency.
[0026] S1, acquire coastal monitoring images and perform preprocessing; S2, input the preprocessed coastal monitoring image into the backbone network RepHGNet with multi-scale context feature enhancement extraction capability, perform feature extraction and output multi-scale feature map; In S2, the preprocessed coastal monitoring image is input into the RepHGNet backbone network, which has multi-scale contextual feature enhancement extraction capabilities; specifically, this includes: S201, the backbone network RepHGNet, uses the improved heterogeneous network unit HGBlock as the basic building block. The HGBlock includes a backbone branch and parallel skip connections. The backbone branch is connected in series with depthwise separable convolutional units and squeezing and excitation networks. The depthwise separable convolutional unit includes a depthwise convolutional layer and a pointwise convolutional layer connected in series. The depthwise convolutional layer is used to perform spatial convolution on each channel individually, and the pointwise convolutional layer is used to output cross-channel fusion information. S202, Process the pre-processed coastal monitoring images Input the backbone network RepHGNet, and output feature maps at three scales according to the stage: in, Indicates the first Functions for each stage, =2 / 3 / 4. Preserving high-resolution spatial details is crucial for boundary accuracy; Provides a balanced representation; Encapsulate a high-level semantic context to recognize the rift as a coherent entity; and These are the height and width of the input image, respectively. , , These represent the number of feature map channels output at different stages of the backbone network.
[0027] The content adaptive upsampling mechanism (CAU) is used to perform feature fusion and contour reconstruction on the multi-scale feature map to obtain the fused feature map. Traditional feature fusion involves upsampling (such as upsampling low-resolution features). With high-resolution features When aligning, using a fixed, content-independent interpolation kernel (such as bilinear interpolation) blurs the texture edges unique to crack flow. This invention introduces a Content Adaptive Feature Reassembly (CAU) mechanism.
[0028] For upsampling factor is Target output position Its corresponding input feature map The source location on is ; Indicates to The value is rounded down. Indicates to The value is rounded down.
[0029] Next, perform the following two steps: Step 1: Dynamic kernel prediction. Based on the source location Take a small contextual neighborhood as the center. (For example ), and feed it into a lightweight neural network module (Including channel compression, content encoding, and spatial softmax), utilizing neural network modules Predict a location-specific recombinant core (For example ): The kernel is dynamically generated based on local content. Represents the source location on the input feature map X. Centered on, with side length as The square neighborhood; Step 2: Context-Adaptive Feature Reorganization. Output Location The value is obtained by using the prediction kernel For a larger neighborhood on the input feature map We get the following by weighted summation: in, This indicates the source location on the input feature map X. These are the boundary values of the first region; The boundary value of the second region. X(p) represents the weight value of the recombination kernel at position p; X(p) is the original feature value of the input feature map at position p.
[0030] Integration Application: Integrate the above CAU operator into all upsampling paths of the Feature Pyramid Network (FPN) or Path Aggregation Network (PAN). When fusion... arrive During the path, the upsampling process is performed by Its own content guidance enables it to learn to sharpen or extend fracture features during reconstruction, thereby achieving more accurate and detailed boundary reconstruction in the final fused feature map.
[0031] S4. The lightweight and stable contour decoding network LSCSeg is used to decode the fused feature map to generate a pixel-level contour mask for the split flow. This step designs an efficient decoder to convert the fused high-level features into the final pixel-level contour of the split flow.
[0032] Parameter sharing design: for parameters from different scales (e.g.) The fusion features of this method no longer require designing independent, repetitive processing flows for each scale. First, the input features for each scale are... Apply a lightweight, scale-specific Convolution projects the feature into a unified feature space: Then, all projected features Processing is performed through the same set of shared convolutional layers, which employ Group Normalization (GN): This design forces the network to learn a more general, scale-invariant feature transformation, which significantly reduces the number of parameters, improves robustness, and reduces overfitting.
[0033] Deployment stability assurance: The shared processing layer employs Group Normalization (GN) technology instead of traditional Batch Normalization (BN). GN divides channels into fixed groups and normalizes them by calculating the mean and variance within each group. Since GN statistics are independent of batch size, they exhibit consistent and stable performance during training (large batches) and edge inference (typically single images or very small batches), fundamentally solving the problem of contour recognition performance fluctuations caused by changes in the deployment environment.
[0034] Task-Specific Decoding: From Shared Features Starting from this point, lightweight, task-specific branches (typically only one or two layers) are added for classification, bounding box regression, and mask coefficient prediction. For mask prediction, this branch outputs a mask coefficient vector, dynamically synthesizing pixel-level segmentation masks.
[0035] Phase Two The lightweighting process of the basic fracture flow profile recognition model RipSegNet using a collaborative compression framework includes: Based on the weight norm of each output channel in each convolutional layer of the basic crack flow contour recognition model RipSegNet and the gradient norm of the loss function of the feature map of that output channel, the importance of each output channel to the task is evaluated, and the output channel with the lowest importance ranking is pruned according to the preset computational budget. Traditional structured pruning primarily relies on the magnitude of weights (such as L1 / L2 norms) to evaluate channel importance. However, this static, weight-based evaluation fails to reflect the actual dynamic contribution of channels to complex task information flow (especially the transmission of edge and texture information in fractured flow). This invention introduces an innovative gradient flow guidance mechanism.
[0036] For a given layer The first in Each output channel, and its importance in the entire network information flow. The importance of a gradient is determined not only by its weight norm but also by the strength and direction of the gradient signal it generates. This method introduces the concept of "importance assessment propagation," calculating the gradient from the final loss function by simulating one forward and backward propagation. Gradient propagating to this channel ,in This is the output feature map of this channel. The norm of the gradient reflects the marginal contribution of this channel to the final task loss function.
[0037] The importance of a channel is defined as follows: in: It is the channel weight. Norm, a measure of the static size of the weights, where c is the index of the output channel in the current convolutional layer. The layer number is the convolutional layer number; Is the total loss function L for the first... Layer c-th channel output features gradient Norm, measures the dynamic contribution of a channel to a task; ∈(0,2], are the weighting coefficients balancing the two contributions, determined through a grid search on the validation set. ∈(0,2], such as ).
[0038] In this embodiment, The introduction of this feature makes the evaluation aware of the needs of downstream tasks. Channels used to capture the edges of cracked currents are retained because of their large gradient contribution; while channels that respond to ordinary sea surface textures or lighting noise, although their L2 norm may not be zero, are identified as redundant because of their small gradient contribution.
[0039] Pruning execution: Based on task-aware gradient importance Perform a global sort on all channels. Set a budget for the total computational cost (GFLOPs) or parameter count after pruning. (If 50% of GFLOPs are retained), remove the channels with the lowest importance ranking until the budget constraint is met: in, For the original model, The model is after pruning. Batch normalization (BN) calibration and short-period fine-tuning are performed on the pruned model to recover the statistical shift caused by parameter removal. This indicates the computational cost of the model.
[0040] The teacher network dynamically generates a probability distribution after temperature softening using momentum updates as a soft label. Combined with a course-based temperature adjustment strategy, the pruned student network is distilled and fine-tuned to obtain the lightweight fracture flow profile recognition model RipSegNet-Lite.
[0041] After GFGP pruning, model performance tends to decline. To restore performance, this invention proposes robust knowledge distillation enhancement. The innovation lies in teacher-assisted pseudo-label generation and curriculum-based distillation. This application abandons the traditional static teacher model (i.e., teacher model weights are fixed). Instead, during the fine-tuning of the student network after pruning, the teacher model (i.e., the base model) dynamically generates soft labels using a momentum update mechanism.
[0042] In each iteration Teacher network parameters The updates depend not only on itself, but also on the students' network parameters. : in, It is a momentum coefficient close to 1 (e.g., 0.999). These are the parameters of the teacher network at the t-th iteration. These are the parameters of the student network at the t-th iteration. This allows the teacher model's soft labels to "evolve" as the student model's capabilities improve, avoiding the problem of outdated teacher model knowledge.
[0043] Curriculum-based distillation: In the initial fine-tuning stage, when students' model capabilities are weak, we relax the threshold of the distillation temperature (reducing antagonism) to allow students to focus on learning the global structure (such as the overall location of the fracture flow). As training progresses, the temperature is gradually increased (increasing antagonism), forcing the teacher's model to output more focused information on fine boundaries, guiding students to gradually master the details.
[0044] The distillation loss function uses KL divergence, but the temperature parameter... Dynamically adjusts with the number of iterations: in, and These are the initial and final temperatures (e.g., 2 and 8). This represents the total number of iterations. Let be the distillation temperature parameter at the t-th iteration.
[0045] For student networks in location Predicted value and the predicted values of the teacher network The probability distribution after softening is as follows: Distillation loss for: This represents the predicted value of the student network at all spatial locations j. This represents the teacher network's predictions at all spatial locations j; Complete training and fine-tuning process: 1) Pre-training: Train the base model (RipSegNet) on a computer until convergence. The loss function is: in: , , , These represent the weights of the classification loss, regression loss, distribution focus loss, and segmentation loss, respectively. Classification loss function ; Where N is the total number of samples. The true label of the i-th sample is either 0 or 1. The model predicts the probability that the i-th sample belongs to a certain group. Regression loss function ; in, The intersection-union ratio (IUU) of the predicted bounding box and the ground truth bounding box is defined, with a value in the range [0,1]. c is the diagonal length of the smallest bounding rectangle containing both the predicted and ground truth bounding boxes. is the positive balance parameter used to weigh aspect ratio consistency; v is the parameter used to measure the aspect ratio consistency between the predicted box and the ground truth box. The square of the Euclidean distance between the center point of the predicted bounding box and the center point of the true bounding box is used to penalize the deviation of the center point position.
[0046] Distributed focus loss function ; Where y is the true continuous value of the target location (e.g., the precise coordinates of the bounding box); , The values of the nearest discrete grid points to the true value y (i.e. ≤y≤ ); , The model predicts that y falls within and The probability of Segmentation loss function ; in, This is the binary crossover loss, a commonly used loss function used to calculate classification accuracy. This is a commonly used overlap loss function, used to directly measure the overlap between the predicted segmented region and the actual segmented region. Weighting coefficients used to balance BCE loss and Dice loss.
[0047] 2) Gradient Flow Calculation: Using a batch of data, perform one forward and backward propagation, and calculate the task-aware gradient importance of all channels according to the GFGP formula. .
[0048] 3) Structured pruning: Based on task-aware gradient importance Perform a global sort of all channels. Set a budget for the total computational cost (GFLOPs) or parameter count after pruning, and remove channels with low importance ranking all at once. Perform Batch Normalization (BN) calibration and short-cycle fine-tuning on the pruned model.
[0049] 4) Momentum distillation fine-tuning: Initialize the student network (The pruned model) and teacher network (A copy of the original base model). The pruned student network is then fully fine-tuned. At each step of the fine-tuning process: Loss of students' online learning tasks The teacher network uses momentum to update its parameters: ; The teacher network generates soft labels for predicted features of the student network. A curriculum-based adjustable temperature algorithm is applied to calculate distillation loss. The total loss is: ,in Balance coefficient Take (0,1).
[0050] Ultimately, a high-precision, lightweight student model, RipSegNet-Lite, was obtained for edge inference. The lightweight crack current contour recognition model RipSegNet-Lite is used to infer the real-time acquired coastal monitoring images and output crack current recognition results.
[0051] The present invention also provides a coastal rift contour recognition device for real-time early warning, comprising: The visual perception unit is used to acquire video images of the coastal monitoring area; it includes high-definition industrial cameras or photoelectric sensing devices deployed on the coastline, lookout towers, buoys or drone platforms, responsible for continuously acquiring video images of the sea surface in the monitoring area.
[0052] The intelligent processing unit, equipped with the lightweight fracture flow contour recognition model RipSegNet-Lite obtained by the aforementioned method, is used to execute the method and output fracture flow recognition results in real time. It is the core of the device and incorporates an embedded processor or AI acceleration computing module (such as NVIDIA Jetson series, Huawei Ascend, etc.). This unit solidifies the lightweight fracture flow contour recognition (RipSegNet-Lite) processing model described in this invention, receives the video stream from the visual perception unit, executes the aforementioned contour recognition method in real time, and outputs structured data containing information such as fracture flow contour mask, position, and confidence level.
[0053] It also includes the ability to integrate positioning modules (GPS / BeiDou) or access meteorological and hydrological data interfaces (such as tides and wind speed) to assign spatiotemporal labels and environmental context to the contour recognition results.
[0054] The early warning and communication unit triggers local early warnings and / or sends alarm information to a remote monitoring platform based on the rift flow identification results. The early warning and communication unit includes a local early warning module and a remote communication module. The local early warning module includes at least an audible and visual alarm and an outdoor LED display screen for graphically displaying the pixel-level outline of the rift flow risk area. The remote communication module uses 4G / 5G, NB-IoT, or satellite communication equipment.
[0055] This application also includes: Energy and structural units: a solar-battery combined power supply system or mains power to ensure long-term field operation. The outer shell adopts a waterproof, corrosion-resistant, and UV-resistant industrial protective design to adapt to the harsh environment of high temperature, high humidity, and high salt spray on the coast.
[0056] System control software: running in the intelligent processing unit, responsible for scheduling image acquisition, driving contour recognition model inference, performing post-processing and logical judgment, controlling early warning equipment, and managing data communication.
[0057] In this application, the visual perception unit employs a 2-megapixel high-definition network intelligent PTZ camera, mounted atop a 6-meter-high anti-corrosion column. It features optical zoom, strong light suppression, and a wide dynamic range to adapt to the intense sunlight variations along the coast. The intelligent processing unit utilizes an NVIDIA Jetson Orin Nano core computing module (approximately 40 TOPS of computing power), integrated into a waterproof and salt spray-proof control box in the middle of the column. The early warning and communication unit integrates a 4G / 5G dual-mode router and a digital I / O control board within the box. The control board connects to a rotating audible and visual alarm at the top of the column and a 55-inch outdoor full-color high-brightness LED display screen mounted in the middle of the column, facing the beach. The energy unit consists of two 150W monocrystalline silicon solar panels mounted at the top of the column, and a 200Ah lithium iron phosphate battery pack and intelligent charge / discharge controller within the control box, ensuring continuous operation for 7 days even under continuous rainy weather. The structural unit, including the column and control box, is constructed of 316L stainless steel with a special anti-corrosion coating.
[0058] In actual implementation, deploy Linux-based system software on the Jetson Orin Nano core computing module of the intelligent processing unit, and perform the following operations according to the steps described above: Step 1. Image Acquisition and Preprocessing: Acquire real-time RTSP video stream (1080p@30fps) from the PTZ camera via the ONVIF protocol. The main program extracts frames at a rate of 5 frames / second (balancing real-time performance and computational load). For each extracted frame... First, automatic white balance and glare suppression are performed, then the image is scaled to a fixed size. And perform pixel value normalization: ,in , The mean and standard deviation are preset. This is the normalized image.
[0059] Step 2. Contour Recognition Inference: The deployed RipSegNet-Lite lightweight contour recognition model is invoked for forward computation. The model executes the process described by the aforementioned mathematical formulas sequentially: Multi-scale contextual feature enhancement extraction (RepHGNet), output .
[0060] Content-adaptive multi-level feature fusion and upsampling (CAU) outputs fused features. .
[0061] Lightweight and stable contour decoding outputs preliminary fracture contour information, including the class confidence score for each detection instance. Bounding box coordinates and a set of mask coefficients .
[0062] Step 3. Post-processing: Analyze the model output. Utilize the masking coefficients. Linearly combine the prototype mask pre-learned within the model to generate a pixel-level mask for each instance. Apply threshold filtering (confidence level) Non-maximum suppression (NMS, IoU threshold 0.5) is used to remove overlapping detections. Finally, a binary mask image of one or more fracture contours is generated. And calculate the bounding rectangle and area of each contour. and center point coordinates .
[0063] It should be noted that the pre-learning process for the prototype mask can be referenced in the following example: Before training the base model RipSegNet, all real fracture flow contour masks (pixel-level binary masks) in the training set are first normalized to the same resolution. Then, the K-means clustering algorithm is used to extract K cluster centers, each of which is a prototype mask. During the clustering process, the distance between two masks is defined as 1-IoU (Intersection over Union). In this embodiment, K=32 is used. Once the prototype mask is determined by clustering, it remains unchanged during model training. During inference, the task-specific branch of the lightweight and stable contour decoding network LSCSeg outputs a K-dimensional mask coefficient vector. The final pixel-level contour mask for the split flow is a linear combination. The calculated value is then mapped to the [0,1] interval using the Sigmoid function and binarized for output.
[0064] Step 4. Early Warning Decision-Making and Execution: If If the signal is not empty (i.e., a identified fracture profile exists), a local warning is immediately triggered: the audible and visual alarm is activated via the IO control board (1Hz sound frequency), and simultaneously displayed on the LED screen in a semi-transparent red overlay. The outline of the device is displayed along with the warning text "Danger: Crack Current, Do Not Enter the Water". Simultaneously, structured alarm information (including timestamp, device ID, GPS coordinates, number of outlines, and details of each outline) is transmitted via 4G / 5G network. (A JPEG compressed screenshot with overlaid outline) is packaged in JSON format and sent to the data receiving interface of the marine disaster monitoring platform.
[0065] Example 2: Method Performance Comparison and Verification Experiment The data used in this example consists of 2466 images with precisely annotated pixel-level polygonal contour masks of the fracture flows. The dataset covers a variety of challenges: fracture flows from tilted viewpoints, at different scales, under low visibility conditions, and at different stages of development. It is divided into training, validation, and test sets in an 8:1:1 ratio.
[0066] Baseline for comparison: YOLOv11n-seg, a general-purpose lightweight instance segmentation model widely used in embedded devices, was selected as the baseline for comparison, representing the advanced level of efficiency and accuracy trade-off in this field.
[0067] Evaluation Metrics: Contour Recognition Average Accuracy: This measures the average accuracy of the segmentation mask when the Intersection over Union (IoU) threshold is 0.5, and is the core accuracy metric.
[0068] Model parameter count (params, unit: megabytes): measures the size of the model. Computational complexity (GFLOPs): measures the number of floating-point operations required for a single forward inference, representing the computational burden.
[0069] Experimental Results and Analysis: The superiority of the method of this invention was quantitatively evaluated through comparative experiments. This application compares the methods with the contour recognition methods shown in Table 1. In this table, the baseline model represents the YOLOv11 model, the first component model represents the RepHGNet model, the second component model represents the RepHGNet+CAU model, the complete method of this invention represents the RipSegNet model, and the lightweight method of this invention represents the RipSegNet-Lite model.
[0070] Table 1: Performance Comparison of Contour Recognition Methods
[0071] Based on the data in the table above, the following analysis is performed: Accuracy and efficiency analysis: The complete method of this invention (RipSegNet) reduces the computational cost (8.1 GFLOPs) by 15.6% compared to the baseline (9.6 GFLOPs), while significantly improving the contour recognition accuracy (0.921 mAP) by 3.0% compared to the baseline (0.894 mAP). This verifies the effectiveness of the co-design of the architecture for crack flow features in this invention.
[0072] Lightweighting effect analysis: After the course-based lightweighting (GFGP + REKD) in step four, the resulting RipSegNet-Lite model significantly reduced its computational cost to 4.0 GFLOPs (a 58.3% reduction compared to the baseline) and its parameter count to 0.87M (a 69.3% reduction compared to the baseline). Its recognition accuracy reached 0.919 mAP, showing minimal loss (only 0.2 percentage points) compared to the complete teacher model (0.921 mAP), and still significantly higher than the baseline model. This demonstrates the near-lossless nature of the compression process in this invention.
[0073] As attached Figure 3 As shown in the heat map of the recognition results, the activation areas of the baseline model and the first component model are relatively dispersed and easily affected by sea glare or breaking waves. In the first and third rows, the excessively high activation values incorrectly highlight sunlight reflection and turbulent white water, indicating that the model is easily affected by visual clutter. After introducing CAU, the alignment effect of the object mask boundary is improved, but in some cases, there are still problems of edge information loss and inaccurate detection of small objects. In contrast, the method of this invention and its lightweight version RipSegNet-Lite show highly concentrated activation signals in the core "neck" and "head" regions of the fractured flow, demonstrating better noise suppression and boundary alignment accuracy.
[0074] As attached Figure 4As shown in the contour comparison diagram of the recognition results, the output mask of the baseline model often exhibits breaks, blurred boundaries, or excessive smoothing, resulting in significant deviations from the actual fracture flow morphology. In contrast, the masks generated by the methods of this invention (RipSegNet and RipSegNet-Lite) are continuous, complete, and have clear boundaries, accurately conforming to the dark, low-energy flow channel morphology of fracture flows, significantly improving the reliability and practical value of the segmentation results. The outputs of the baseline model and the first component model have the following problems: image fragmentation and incoherence (e.g., the mask in the first row is segmented into unconnected fragments), blurred or excessively smoothed boundaries (e.g., the mask in the second row lacks the fine structure of fracture flow edges), and erroneous inclusion of adjacent wave bubbles (e.g., false attachments appear in the third row). The output of the second component model has more accurate contour boundaries, but there are missed detections (e.g., the contour in the third row is missing). In contrast, the masks generated by the methods of this invention and its lightweight version, RipSegNet-Lite, have continuity, completeness, and accurate boundary features. Specifically: In the first row, the mask forms a single, connected whole, accurately tracing the fracture current channel; in the second row, the mask boundary clearly separates the fracture current from the surrounding wave area; in the third and fourth rows, the model successfully segments the amorphous or low-contrast fracture current head while maintaining clear separation from neighboring objects. This innovative method architecture can generate high-fidelity pixel-level contours and reliably capture the dynamic morphological features of fracture currents, which is crucial for subsequent disaster quantification and real-time early warning systems.
[0075] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A method for identifying the contours of coastal rift currents for real-time early warning, characterized in that, include: In the first stage, the basic crack flow profile recognition model RipSegNet is used to perform crack flow profile recognition. The basic fracture flow contour recognition model RipSegNet includes: a backbone network RepHGNet, a content adaptive upsampling mechanism CAU, and a lightweight and stable contour decoding network LSCSeg; including Acquire coastal surveillance images and perform preprocessing; The preprocessed coastal monitoring images are input into the RepHGNet backbone network, which has the ability to enhance the extraction of multi-scale contextual features, to extract features and output multi-scale feature maps. The content adaptive upsampling mechanism (CAU) is used to perform feature fusion and contour reconstruction on the multi-scale feature map to obtain the fused feature map. The fused feature map is decoded using the Lightweight Stable Contour Decoding Network (LSCSeg) to generate a pixel-level contour mask for the split flow; the Lightweight Stable Contour Decoding Network (LSCSeg) includes: Input features for each scale Apply scale-specific 1×1 convolution Projecting onto a unified feature space yields projected features. ; All projection features Processing is performed using the same set of shared convolutional layers, which employ grouped normalization. The data is processed through a shared set of convolutional layers, which employ grouped normalization to output shared features. , From the shared features Starting from the beginning, a branch dedicated to the additional task is added, which outputs a mask coefficient vector. The mask coefficient vector is then linearly combined with the pre-learned prototype mask to generate a pixel-level contour mask for the split flow. In the second stage, a collaborative compression framework is used to lightweight the basic crack current contour recognition model RipSegNet. The lightweighted RipSegNet-Lite model is then used to infer the real-time acquired coastal monitoring images and output crack current recognition results. The lightweighting of the basic RipSegNet model includes: For the basic crack flow contour recognition model RipSegNet, we first calculate the weight norm of each output channel in each convolutional layer, and the gradient norm of the loss function on the feature map of that output channel. The weighted sum of the weight norm and the gradient norm is used as the importance evaluation index for this channel; Based on the preset computational budget, the output channel with the lowest ranking in importance assessment index is pruned; the teacher network with momentum update dynamically generates the probability distribution after temperature softening as soft label, and combined with the course-based temperature adjustment strategy, the pruned student network is distilled and fine-tuned to obtain the lightweight fracture flow profile recognition model RipSegNet-Lite.
2. The coastal rift contour recognition method for real-time early warning as described in claim 1, characterized in that, The process of inputting the preprocessed coastal monitoring images into the RepHGNet backbone network, which has multi-scale contextual feature enhancement extraction capabilities, specifically includes: S201, the backbone network RepHGNet, uses the improved heterogeneous network unit HGBlock as the basic building block. The HGBlock includes a backbone branch and parallel skip connections. The backbone branch is connected in series with depthwise separable convolutional units and squeezing and excitation networks. The depthwise separable convolutional unit includes a depthwise convolutional layer and a pointwise convolutional layer connected in series. The depthwise convolutional layer is used to perform spatial convolution on each channel individually, and the pointwise convolutional layer is used to output cross-channel fusion information. S202, Process the pre-processed coastal monitoring images Input the backbone network RepHGNet, and output feature maps at three scales according to the stage: in, Let i represent the function for the i-th stage, where i = 2 / 3 / 4; Preserve high-resolution spatial details; Provides a balanced representation; Encapsulate a high-level semantic context to recognize the rift as a coherent entity; and These are the height and width of the input image, respectively. , , These represent the number of feature map channels output at different stages of the backbone network.
3. The coastal rift contour recognition method for real-time early warning as described in claim 1, characterized in that, The Content Adaptive Upsampling (CAU) mechanism performs the following steps: Assuming the upsampling factor is Target output position Then the source location on the corresponding input feature map X is ; Indicates to The value is rounded down. Indicates to The value is rounded down. Centered on the source location, the context neighborhood is taken as The first region is input into a lightweight neural network module Ψ to obtain a recombination kernel specific to the predicted location. : in, This indicates the source location on the input feature map X. These are the boundary values of the first region; Represents the source location on the input feature map X. Centered on, with side length as The square neighborhood; Output position The value uses the recombined kernel For a larger neighborhood on the input feature map The second region is weighted and summed to obtain the output position. The calculation formula is as follows: in, The boundary value of the second region. X(p) represents the weight value of the recombination kernel at position p; X(p) is the original feature value of the input feature map at position p.
4. The coastal rift contour recognition method for real-time early warning as described in claim 1, characterized in that, In the second phase, the importance of each output channel to the task is calculated using the following formula: in: It is the channel weight. Norm, a measure of the static size of the weights, where c is the index of the output channel in the current convolutional layer. The layer number is the convolutional layer number; Is the total loss function L for the first... Layer c-th channel output features gradient Norm, measures the dynamic contribution of a channel to a task; ∈(0,2], is the weighting coefficient that balances the two contributions, determined by grid search on the validation set.
5. The coastal rift contour recognition method for real-time early warning as described in claim 4, characterized in that, Based on the preset computational budget, the output channels with the lowest ranking in importance assessment indicators are removed, including: Set calculation budget ; The computational cost of the pruned model is estimated to meet the constraints shown in the following formula, and the pruned model is generated. in, For the original model, This is the model after pruning. This indicates the computational cost of the model.
6. The coastal rift contour recognition method for real-time early warning according to claim 5, characterized in that, The aforementioned curriculum-based temperature regulation strategy involves distillation fine-tuning of the pruned student network, including: the teacher network parameters employing a momentum update strategy as shown in the following formula: Distillation loss KL divergence is used, and the temperature parameter T is dynamically adjusted with the iteration number t: in, and These are the initial and final temperatures, respectively. This represents the total number of iterations. and Let be the probability distributions of the student network and the teacher network at position i after temperature softening, respectively. These are the parameters of the teacher network at the t-th iteration. It is the momentum coefficient of the distillation model, with a value range of [0, 1). These are the parameters of the student network at the t-th iteration. Let be the distillation temperature parameter at the t-th iteration.
7. A coastal rift contour recognition device for real-time early warning, characterized in that, include: A visual perception unit is used to acquire video images of the coastal monitoring area. The intelligent processing unit is equipped with a lightweight crack flow profile recognition model RipSegNet-Lite obtained by the method according to any one of claims 1-6, for executing the method and outputting crack flow recognition results in real time; The early warning and communication unit triggers local early warning and / or sends alarm information to the remote monitoring platform based on the crack flow identification results.
8. The coastal rift contour recognition device for real-time early warning according to claim 7, characterized in that, The early warning and communication unit includes a local early warning module and a remote communication module. The local early warning module includes at least an audible and visual alarm and an outdoor LED display screen for graphically displaying the pixel-level outline of the rift risk area. The remote communication module uses 4G / 5G, NB-IoT or satellite communication equipment.
Citation Information
Patent Citations
Hydropower station dam underwater crack image positioning method
CN120580289A
Intelligent crack identification method and system based on semi-supervised learning and improved YOLOv8
CN122116080A