Semantic segmentation method for ship lift safety mechanism monitoring
By constructing a lightweight encoder-decoder network and introducing multi-scale feature enhancement and attention mechanisms, the problem of insufficient segmentation accuracy of the ship lift safety mechanism under complex conditions is solved, and efficient and stable pixel-level segmentation results are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-05
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies are insufficient to effectively segment key structures such as screws, nuts, and secondary clearances during the operation of ship lift safety mechanisms. They are affected by motion vibrations, metal reflections, and complex lighting conditions, resulting in blurred edges and insufficient segmentation accuracy. Furthermore, existing models have high computational complexity and cannot meet real-time requirements.
A lightweight encoder-decoder semantic segmentation network is constructed, and a multi-scale feature enhancement mechanism and a normalization-based attention enhancement mechanism are introduced. Through the ECCA-ASPP module and the NAM module, the segmentation accuracy and robustness are improved.
While ensuring the model's lightweight and real-time performance, it significantly improves the segmentation accuracy and stability for narrow sub-gap and complex structures, and can output high-quality pixel-level semantic segmentation results.
Smart Images

Figure CN121838153A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of computer vision and intelligent monitoring of industrial equipment, and particularly relates to a semantic segmentation method for ship lift safety mechanism monitoring. BACKGROUND
[0002] The ship lift is an important device for realizing the vertical transportation of ships in a water conservancy hub project, and its operation safety has an important influence on the stability of the navigation system. As a core component of the ship lift, the screw rod, the screw nut column and the secondary gap structure of the safety mechanism are prone to wear or gap changes during long-term operation, and thus need to be continuously and reliably monitored.
[0003] The existing safety mechanism monitoring method mainly relies on manual inspection or contact measurement, which is not only low in efficiency and high in labor intensity, but also difficult to implement in the running state of the device, and thus has a great safety risk. Meanwhile, the manual measurement result is easily affected by subjective factors, and thus it is difficult to meet the needs of fine and long-term online monitoring.
[0004] In recent years, the non-contact monitoring method based on computer vision has been gradually applied to industrial scenes. However, in the actual operation process of the ship lift, due to factors such as device vibration, motion jitter, metal surface reflection and changes in light conditions, the collected images often have problems such as edge blur, reduced contrast and degraded details, which leads to insufficient segmentation accuracy of the existing semantic segmentation method in narrow secondary gaps and thread boundaries.
[0005] In addition, the existing high-precision semantic segmentation model usually has a large parameter size and high computational complexity, and thus it is difficult to meet the real-time and stability requirements of industrial online monitoring. Therefore, it is necessary to design a semantic segmentation method for ship lift safety mechanism monitoring to solve the above problems. SUMMARY
[0006] The technical problem to be solved by the present application is to provide a semantic segmentation method for ship lift safety mechanism monitoring, which aims to solve the problem that the existing ship lift safety mechanism is easily affected by motion jitter, metal reflection and complex light conditions during operation, leading to edge blur, long structure and difficult accurate segmentation of key structures such as screw rod, screw nut column and secondary gap in images. By constructing a lightweight encoder-decoder semantic segmentation network, and respectively introducing a multi-scale feature enhancement mechanism and a normalized attention enhancement mechanism in the encoding and decoding stages, the segmentation accuracy and robustness of fine structures such as narrow secondary gaps and thread boundaries are effectively improved under the premise of ensuring the lightweight and real-time of the model.
[0007] To achieve the above technical effects, the technical solution adopted by the present application is: A semantic segmentation method for ship lift safety mechanism monitoring, comprising: S1, construct the ship lift safety mechanism image dataset; S2, construct the enhanced attention mechanism and ASPP module ECCA-ASPP, further introduce channel attention and coordinate attention mechanism based on the hollow convolution feature, and improve the selectivity and spatial sensitivity of feature expression; S3, introduce the normalized attention mechanism NAM, realize global dependence modeling and feature corresponding redistribution by constructing the similarity matrix between each spatial position of the input feature map; S4, construct the lightweight semantic segmentation model EMFFLabNet integrating attention mechanism and multi-scale feature enhancement. MobileNetV2 backbone network combines depth separable convolution and reverse residual structure, which significantly improves network efficiency and deployability from two aspects of operator optimization and module structure design; ECCA-ASPP module fuses multi-scale hollow convolution features and attention maps generated by ECA and CA modules, while preserving multi-scale context information, and significantly enhances key structural regions; S5, input the ship lift safety mechanism image dataset into the EMFFLabNet model for training; S6, use the trained model weight to segment and predict the ship lift safety mechanism image, and output the pixel-level segmentation result.
[0008] Preferably, in step S1, the dataset is constructed, and the constructed dataset is merged and cleaned, specifically: S101, select Hikvision robot MV-CU060-10GC, 600 million pixel network interface area camera to shoot key areas at a fixed angle, and the obtained image resolution is 1536*1024; S102, select 1641 images under different light and different working conditions for dataset construction for semantic segmentation task, and divide them into training set and test set according to the ratio of 8:2; S103, data augmentation is performed on the training set images by means of brightness enhancement, noise increase and saturation adjustment, so that the training set images are expanded to 5252; S104, use LabelMe professional labeling tool to label all images in the dataset, divide the semantic categories into 5 categories according to the target task, which are 4 effective structure surfaces of safety mechanism and background, and perform polygon contour labeling with pixel-level accuracy; S105, use the processed ship lift safety mechanism semantic set as the input dataset of EMFFLabNet segmentation model.
[0009] Preferably, the specific steps of constructing the enhanced attention mechanism and ASPP module ECCA-ASPP in the above S2 are as follows: S201, the input of the ECCA-ASPP module is a feature map F from the output of the encoder, which has a size of HxWxC; Based on the input feature map F, five parallel feature extraction branches are constructed, denoted as branch0, branch1, branch2, branch3 and branch4 respectively. Among them, branch0 is a 1x1 convolution branch, which is used to maintain the local information of the original features. branch1, branch2 and branch3 are 3x3 hollow convolution branches respectively, and their hollow rates are set to 6, 12 and 18 respectively, which are used to extract multi-scale context information under different receptive fields. branch4 is an image-level pooling branch, which is used to model global context features.
[0010] S202, the input feature map F is input into the above five parallel branches for feature processing: The input feature map F is subjected to 1x1 convolution operation of branch0 to obtain feature map f0. The input feature map F is subjected to 3x3 hollow convolution (hollow rate is 6) of branch1 to obtain feature map f1. The input feature map F is subjected to 3x3 hollow convolution (hollow rate is 12) of branch2 to obtain feature map f2. The input feature map F is subjected to 3x3 hollow convolution (hollow rate is 18) of branch3 to obtain feature map f3. The input feature map F is subjected to global average pooling operation of branch4, and is processed by convolution and up-sampling to obtain global context feature map f4.
[0011] S203, in order to unify the channel dimension of each branch feature, channel compression processing is performed on feature maps f0, f1, f2, f3 and f4 respectively, so that their channel numbers remain consistent, and processed feature maps are obtained: S204, the five branch feature maps after channel compression are spliced in the channel dimension to form a fused multi-scale feature map , whose expression is as follows: Among them, S205, on the spliced multi-scale feature map , a channel attention mechanism ECA is introduced to model the importance of the channel dimension and generate a channel weight vector The channel weight vector To depict the importance of different channel features in the multi-scale semantic space.
[0012] S206, on the basis of generating the channel weight, further introducing the coordinate attention mechanism CA to the feature map Modeling the position information in the spatial dimension to generate a spatial weight matrix To enhance the model's ability to perceive the spatial position relationship of the target structure; S207, broadcasting and expanding the channel weight And the spatial weight Make it consistent in size with the multi-scale feature map And through the way of element-by-element multiplication to weight the feature map Get attention-enhanced feature map Its process is represented as: ; ; Among them, Indicates the combination operation of the weight, Indicates the Sigmoid activation function; S208, in order to avoid the attention mechanism to cause information covering to the original multi-scale feature, the attention-enhanced feature map And the original spliced feature map Residual addition is performed to obtain the final output feature map of the ECCA-ASPP module Its expression is: ; S209, the final output feature map As a multi-scale feature enhancement result, it is passed to the subsequent decoder module for further feature fusion and semantic segmentation prediction.
[0013] Preferably, the normalized attention mechanism NAM is introduced in S3, and the specific construction steps are as follows: S301, the input of the NAM module is the feature map F1 from the shallow layer of the decoder, and its size is HxWxC, where H and W represent the spatial size of the feature map respectively, and C represents the number of channels.
[0014] S302, input the input feature map F1 into the channel attention submodule, and perform batch normalization (Batch Normalization, BN) based feature standardization processing, and the batch normalization operation is as follows: ; Among them Indicates the mean, Indicates the variance, , denote trainable affine transformation parameters (scaling and translation, respectively), denotes a small constant to prevent division by zero; S303, the structure output of the channel attention sub-module is denoted as , where the scaling factor weights each channel, and the weight is calculated as: ; S304, pixel normalization in spatial attention is used to independently normalize each spatial position in the feature map, and the operation is as follows: ; where is the spatial position, is the number of channels.
[0015] S305, the output of the spatial attention sub-module is , where the weight of each position is: , where is the scaling factor of the spatial dimension, indicating the importance of different spatial positions.
[0016] Preferably, in step S4, the lightweight semantic segmentation network EMFFLabNet integrating attention mechanism and multi-scale feature enhancement is constructed, and the specific steps are as follows: S401, in the encoder part, the backbone network extracts deep features and uses dilated convolution to expand the receptive field to capture large-scale context information; S402, the features enter the ECCA-ASPP module, which fuses dilated convolutions with different dilation rates (6, 12, 18) and global average pooling to capture multi-scale context information; S403, in the feature fusion stage, the channel attention ECA and coordinate attention CA mechanisms are introduced to further enhance the expression ability of the feature map in the channel and spatial dimensions, and to strengthen the modeling ability of the model for the target geometric shape and positional relationship; S404, in the decoder part, the model extracts shallow features and enhances the perception ability of fine areas such as thread boundaries through the NAM module; S405, after channel compression by convolution, the features are spliced with the upsampled high-level features, and then two convolutions are used to extract detailed features; S406, the fused features are upsampled to the original image size by bilinear interpolation, and the segmentation result is output.
[0017] Preferably, step S6 specifically includes: S601, using the trained model weight to infer the ship lift safety mechanism image in the test set; in the model inference stage, the images of the verification set are detected, and the mean Intersection over Union (mIoU) and mean Pixel Accuracy (mPA) model parameter quantity (Param) and single image inference time (Inference Time) are used as evaluation indexes to measure the detection performance and overall detection effect of the model; S602, output the segmentation result of the model, including the segmentation result graph and related evaluation indexes; the result graph shows the segmentation situation of the model on the multiple categories of images in the test set; through visual analysis of the detection effect, the segmentation performance of the model under different attention conditions, complex background and motion blur can be directly evaluated.
[0018] The beneficial effects of the present application are as follows: 1. By introducing a lightweight backbone network and a multi-scale hollow convolution structure, the model parameter quantity and the calculation complexity are effectively reduced while ensuring the segmentation accuracy, thereby meeting the real-time demand of the ship lift online monitoring.
[0019] 2. By introducing a multi-scale feature enhancement module of fusion channel attention and coordinate attention in the encoding stage, efficient integration of multi-scale context information is realized, and the perception ability of the model to narrow auxiliary gaps and complex structures is improved.
[0020] 3. By introducing a normalized attention module in the decoding stage, the batch normalization parameters and the spatial normalization results are used to directly generate attention weights, thereby enhancing the segmentation ability of the model to fine structures without significantly increasing the calculation overhead.
[0021] 4. The method has better stability and robustness in complex industrial scenes such as complex light, metal reflection, etc., and can output high-quality pixel-level semantic segmentation results. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 is the overall flowchart of the present application; Figure 2 is the ECCA-ASPP module structure schematic diagram; Figure 3 is the NAM attention mechanism module structure schematic diagram; Figure 4 is the overall structure schematic diagram of the semantic segmentation network of the present application. DETAILED DESCRIPTION
[0023] Embodiment one: As Figure 1S1, construct the ship lift safety mechanism image dataset; S2, construct the enhanced attention mechanism and ASPP (ECCA-ASPP) module, further introduce channel attention and coordinate attention mechanisms on the basis of the cavity convolution feature, and improve the selectivity and spatial sensitivity of the feature expression; S3, introduce the normalized attention mechanism (NAM), realize global dependence modeling and feature corresponding redistribution by constructing a similarity matrix between each spatial position of the input feature map; S4, construct the lightweight semantic segmentation model EMFFLabNet integrating attention mechanism and multi-scale feature enhancement. The MobileNetV2 backbone network combines depth separable convolution and reverse residual structure, significantly improves network efficiency and deployability from two aspects of operator optimization and module structure design; the ECCA-ASPP module fuses multi-scale cavity convolution features and attention maps generated by ECA and CA modules, while preserving multi-scale context information, and significantly enhances key structural regions; S5, input the ship lift safety mechanism image dataset into the EMFFLabNet model for training; S6, use the trained model weight to perform segmentation prediction on the ship lift safety mechanism image, and output the pixel-level segmentation result.
[0024] Further, in step S1, the dataset is constructed, and the constructed dataset is merged and cleaned, specifically: S101, select the Hikvision robot MV-CU060-10GC, 600 million pixel network interface area camera to shoot the key area at a fixed angle, and the obtained image resolution is 1536*1024; S102, select 1641 images under different light and different working conditions for dataset construction for semantic segmentation task, and divide them into training set (1313 images) and test set (328 images) according to the ratio of 8:2; S103, perform data enhancement on the training set images by means of brightness enhancement, noise increase and saturation adjustment, etc., so that the training set images are expanded to 5252; S104, use LabelMe professional labeling tool to label all images in the dataset, and divide the semantic categories into 5 categories according to the target task, i.e. 4 effective structure surfaces of the safety mechanism and the background, and perform polygon contour labeling with pixel-level accuracy; S105, use the processed ship lift safety mechanism semantic set as the input dataset of the EMFFLabNet segmentation model.
[0025] Further, as Figure 2As shown in the above S2, the specific steps of constructing the enhanced module ECCA-ASPP with a fusion attention mechanism in S2 are as follows: S201, the input of the ECCA-ASPP module is a feature map F from the output of the encoder, which has a size of HxWxC; Based on the input feature map F, five parallel feature extraction branches are constructed, which are respectively denoted as branch0, branch1, branch2, branch3 and branch4. Among them, branch0 is a 1x1 convolution branch, which is used to maintain the local information of the original feature; branch1, branch2 and branch3 are 3x3 hollow convolution branches respectively, and their hollow rates are set to 6, 12 and 18 respectively, which are used to extract multi-scale context information under different receptive fields; branch4 is an image-level pooling branch, which is used to model global context features.
[0026] S202, the input feature map F is input into the above five parallel branches for feature processing: The input feature map F is subjected to 1x1 convolution operation of branch0 to obtain feature map f0; The input feature map F is subjected to 3x3 hollow convolution (hollow rate is 6) of branch1 to obtain feature map f1; The input feature map F is subjected to 3x3 hollow convolution (hollow rate is 12) of branch2 to obtain feature map f2; The input feature map F is subjected to 3x3 hollow convolution (hollow rate is 18) of branch3 to obtain feature map f3; The input feature map F is subjected to global average pooling operation of branch4, and is processed by convolution and up-sampling to obtain global context feature map f4.
[0027] S203, in order to unify the channel dimension of each branch feature, channel compression processing is performed on feature maps f0, f1, f2, f3 and f4 respectively, so that their channel numbers remain consistent, and processed feature maps are obtained: S204, the five branch feature maps after channel compression are spliced in the channel dimension to form a fused multi-scale feature map , whose expression is as follows: Among them, S205, in the spliced multi-scale feature map , a channel attention mechanism ECA is introduced to model the importance of the channel dimension and generate a channel weight vector ; the channel weight vector is used to depict the importance of different channel features in the multi-scale semantic space.
[0028] S206, on the basis of generating the channel weight, further introducing the coordinate attention mechanism CA, modeling the position information in the spatial dimension of the feature map , generating a spatial weight matrix to enhance the perception ability of the model to the spatial position relationship of the target structure; S207, broadcasting and expanding the channel weight and the spatial weight , so that they are consistent in size with the multi-scale feature map , and the feature map is weighted by element-by-element multiplication to obtain an attention-enhanced feature map , and the process is represented as: ; ; wherein, denotes the combination operation of the weight, denotes the Sigmoid activation function; S208, in order to avoid the information coverage of the attention mechanism to the original multi-scale feature, the attention-enhanced feature map is added in residual to the original spliced feature map to obtain the final output feature map of the ECCA-ASPP module , and the expression is: ; S209, the final output feature map is transmitted to the subsequent decoder module as the multi-scale feature enhancement result, which is used for further feature fusion and semantic segmentation prediction.
[0029] Further, as shown in Figure 3 , the above-mentioned NAM based on normalization introduced in S3, the specific construction steps are as follows: S301, the input of the NAM module is the feature map F1 from the shallow layer of the decoder, and the size is HxWxC, wherein H and W represent the spatial size of the feature map respectively, and C represents the channel number.
[0030] S302, input the input feature map F1 into the channel attention submodule, and perform batch normalization (Batch Normalization, BN) based feature standardization processing, and the batch normalization operation is as follows: ; wherein denotes the mean, denotes the variance, , denote trainable affine transformation parameters, scaling and translation, respectively, denotes a small constant to prevent division by zero; S303, Figure 3 The structure of the channel attention submodule is shown in , wherein the scaling factor weights each channel, and the weight is calculated as: ; S304, pixel normalization in spatial attention is used to independently normalize each spatial position in the feature map, and the operation is as follows: ; wherein is a spatial position, is the number of channels.
[0031] S305, Figure 3 The spatial attention submodule is shown in , wherein the weight of each position is: , wherein is a scaling factor of the spatial dimension, indicating the importance of different spatial positions.
[0032] Further, as shown in Figure 4 , the lightweight semantic segmentation network EMFFLabNet integrating the attention mechanism and multi-scale feature enhancement in S4 is constructed, and the specific steps are as follows: S401, in the encoder part, the backbone network extracts deep features and uses dilated convolution to expand the receptive field to capture large-scale context information; S402, the feature enters the ECCA-ASPP module, which integrates dilated convolution with different expansion rates (6, 12, 18) and global average pooling to capture multi-scale context information; S403, feature fusion stage, introduce channel attention ECA and coordinate attention CA mechanism, further enhance the expression ability of feature map in channel and spatial dimension, strengthen the modeling ability of model to target geometric shape and position relationship; S404, in the decoder part, the model extracts shallow features, and enhances the perception ability of fine areas such as thread boundaries through the NAM module; S405, after channel compression by convolution, the feature is spliced with the up-sampled high-level feature, and then two convolutions are used to extract detailed features; S406, upsample the fused features to the original image size by bilinear interpolation, and output the segmentation result.
[0033] The S6 specifically includes: S601, using the trained model weight to infer the ship lift safety mechanism image in the test set; in the model inference stage, the images in the verification set are detected, and the mean Intersection over Union (mIoU) and mean Pixel Accuracy (mPA) model parameter quantity (Param) and single image inference time (Inference Time) are used as evaluation indexes to measure the detection performance and overall detection effect of the model, S602, output the segmentation result of the model, including the segmentation result image and related evaluation indexes; the result image shows the segmentation of the model on the images in the test set; through visual analysis of the detection effect, the segmentation performance of the model under different attention conditions, complex background and motion blur can be directly evaluated.
[0034] Embodiment two: 1, parameter setting: In this embodiment, in order to verify the implementability and stability of the semantic segmentation method for ship lift safety mechanism monitoring, all model training and inference processes are carried out in a unified hardware and software environment to ensure the consistency of experimental conditions and the repeatability of results.
[0035] In this embodiment, the computing environment used includes: the operating system is Ubuntu 20.04, the central processing unit is Intel Core i7-12700KF, the graphics processing unit is NVIDIA RTX 4080, the system memory is 32GB, the computing platform supports CUDA 12.1, the deep learning framework uses PyTorch 2.4.1, and the programming language environment is Python 3.8.20.
[0036] In the model training stage, the collected ship lift safety mechanism images are preprocessed, and the input images are uniformly scaled to 512x512 pixels as the network input size to balance the model segmentation accuracy and computing efficiency. In the training process, the total training number of the model is set to 100 epochs, the batch size is set to 4, and the initial learning rate is set to 0.01.
[0037] In terms of parameter optimization, the Stochastic Gradient Descent (SGD) optimization algorithm is used to update the model parameters to realize the stable convergence of the network parameters.
[0038] Through the above parameter setting mode, the EMFFLabNet semantic segmentation model is trained and inferred, which can realize effective semantic segmentation of the key structure area of the ship lift safety mechanism while ensuring stable operation of the model.
[0039] 2, experimental results: In this embodiment, the segmentation accuracy and running efficiency of the EMFFLabNet semantic segmentation method are comprehensively verified for the semantic segmentation effect of the key structure area such as the thread pair gap in the ship lift safety mechanism. The specific experimental data is shown in Table 1.
[0040] Table 1: Comparison results of different models;
[0041] In terms of segmentation effect, the average intersection over union and average pixel accuracy are used to evaluate the pixel-level segmentation accuracy of the model. The experimental results show that in the semantic segmentation results obtained by the method of the embodiment, the average intersection over union of the model in the target area reaches 89.53%, and the average pixel accuracy reaches 94.08%, which can accurately realize the pixel-level distinction of the thread pair gap and related structure area, and the overall segmentation result has clear boundary and complete area.
[0042] In terms of running efficiency, the model parameter size and the inference time of a single image are statistically analyzed. The experimental results show that the parameter amount of the EMFFLabNet model used in this embodiment is about 5.89M, which effectively reduces the model complexity while ensuring the segmentation accuracy; under the hardware environment, the average inference time of a single image is about 30.52ms, which can meet the application requirements of real-time and stability in industrial field.
[0043] From the visual effect of the segmentation results, the segmentation results generated by the method of the embodiment perform well in the integrity of the target area, and the thread pair gap area can maintain a continuous and closed regional form, avoiding the phenomenon of area rupture or omission; in terms of edge fineness, the segmentation boundary at the junction of the thread structure can be well aligned with the actual structure contour, and the boundary is clear and smooth; under complex lighting conditions, such as reflection, backlight or uneven brightness, the model can still maintain stable segmentation effect, and has strong robustness.
[0044] The above experimental results show that by introducing the multi-scale feature enhancement module ECCA-ASPP and the attention enhancement module NAM based on the lightweight backbone network, the semantic segmentation accuracy of the key structure area of the ship lift safety mechanism can be effectively improved under the premise of ensuring the lightweight and running efficiency of the model, which is suitable for industrial visual monitoring scenes with high requirements for structure detail recognition.
[0045] To further illustrate the influence of each functional module on the segmentation performance in the present application, different network structure configurations were compared and verified under the same experimental conditions.
[0046] The experimental results are shown in Table 2. When only the basic network structure is used, the model can realize basic semantic segmentation function, but there is a certain deficiency in the segmentation effect of edge details and narrow gap areas. After introducing the multi-scale feature enhancement module ECCA-ASPP, the overall perception ability of the model to the target area is enhanced, and the segmentation precision is further improved. On this basis, the normalized attention mechanism NAM is introduced in the decoding stage, and the key structural information in the low-level features is effectively strengthened, and the edge positioning ability and detail expression ability are further improved.
[0047] Table 2: Experimental results of different network module configurations
[0048] In the table, × means not adding the module, and √ means adding the module. As can be seen from Table 2 above, after comprehensively introducing the optimized backbone network, ECCA-ASPP module and NAM module, the average intersection over union of the model is improved by about 1.57%, the average pixel accuracy is improved by about 1.27%, the model parameter amount is reduced by about 48.82M compared with the basic structure, and the average inference time of a single image is shortened by about 5.42ms. The experimental results fully show that the multi-module collaborative optimization strategy adopted in the present application can improve the segmentation performance while reducing the computational overhead, and has good engineering practicability and application value.
Claims
1. A semantic segmentation method for monitoring the safety mechanisms of ship lifts, characterized in that, Includes the following steps: S1, Construct an image dataset of the ship lift safety mechanism; S2, construct the enhanced module ECCA-ASPP that integrates attention mechanisms, introduce channel attention and coordinate attention mechanisms on the basis of dilated convolution features, and improve the selectivity and spatial sensitivity of feature representation; S3 introduces a normalized attention mechanism, NAM, which constructs a similarity matrix between spatial locations of the input feature map to achieve global dependency modeling and feature response redistribution. S4, construct the lightweight semantic segmentation model EMFFLabNet that integrates attention mechanism and multi-scale feature enhancement; the MobileNetV2 backbone network combines depthwise separable convolution and inverse residual structure, which significantly improves network efficiency and deployability from the aspects of operator optimization and module structure design, respectively. The ECCA-ASPP module fuses multi-scale dilated convolutional features with attention maps generated by the ECA and CA modules, achieving significant enhancement of key structural regions while preserving multi-scale contextual information. S5. Input the image dataset of the ship lift safety mechanism into the EMFFLabNet model for training; S6 uses the trained model weights to segment and predict the image of the ship lift safety mechanism, and outputs pixel-level segmentation results.
2. The semantic segmentation method for monitoring the safety mechanism of a ship lift according to claim 1, characterized in that, In step S1, the dataset is constructed and then merged and cleaned, specifically as follows: S101, acquire safety mechanism images collected during the operation of the ship lift to construct a dataset. The safety mechanism images include images of the screw, nut column and secondary clearance area. S102: Select multiple images under different lighting and working conditions for the semantic segmentation task to construct the dataset, and divide the training set and test set according to a fixed ratio; S103 uses brightness enhancement, noise increase, and saturation adjustment to perform data augmentation on the training set images and expands the number of training set images; S104 uses LabelMe professional annotation tool to annotate all images in the dataset. For the target task, the semantic categories are divided into 5 categories, namely the 4 effective structural surfaces of the security agency and the background, and polygon contours are annotated with pixel-level precision. S105, the processed semantic set of the ship lift safety mechanism is used as the input dataset for the EMFFLabNet segmentation model.
3. The semantic segmentation method for monitoring the safety mechanism of a ship lift according to claim 1, characterized in that, In step S2, constructing the enhanced module ECCA-ASPP that integrates the attention mechanism includes: The input to the ECCA-ASPP module is a feature map F from the encoder output, and the feature map F has a size of H×W×C. Based on the input feature map F, five parallel feature extraction branches are constructed, denoted as branch0, branch1, branch2, branch3, and branch4, respectively. Among them, branch0 is a 1×1 convolution branch used to preserve the local information of the original features; branch1, branch2, and branch3 are 3×3 dilated convolution branches; and branch4 is an image-level pooling branch used to model global context features.
4. The semantic segmentation method for monitoring the safety mechanism of a ship lift according to claim 3, characterized in that, In step S2, constructing the enhanced module ECCA-ASPP that integrates the attention mechanism includes: The input feature map F is fed into the five parallel branches mentioned above for feature processing. The input feature map F is processed by a 1×1 convolution operation at branch0 to obtain the feature map f0; The input feature map F is processed by a 3×3 dilated convolution in branch1 to obtain the feature map f1; The input feature map F is processed by a 3×3 dilated convolution in branch2 to obtain the feature map f2; The input feature map F is processed by a 3×3 dilated convolution in branch3 to obtain the feature map f3; The input feature map F undergoes global average pooling in branch4, and is then processed by convolution and upsampling to obtain the global context feature map f4. Channel compression was performed on feature maps f0, f1, f2, f3, and f4 respectively to maintain a consistent number of channels and unify the channel dimensions of each branch feature, resulting in the processed feature maps: .
5. A semantic segmentation method for monitoring the safety mechanism of a ship lift according to claim 4, characterized in that, In step S2, constructing the enhanced module ECCA-ASPP that integrates the attention mechanism includes: The five branch feature maps, after channel compression, are concatenated along the channel dimension to form a fused multi-scale feature map. : ; in, ; Multiscale feature maps after stitching Above, a channel attention mechanism (ECA) is introduced to model the importance of the channel dimension and generate channel weight vectors. Channel weight vector This indicates the importance of different channel features in the multi-scale semantic space.
6. A semantic segmentation method for monitoring the safety mechanism of a ship lift according to claim 5, characterized in that, In step S2, constructing the enhanced module ECCA-ASPP that integrates the attention mechanism includes: Based on the generation of channel weights, a coordinate attention mechanism (CA) is introduced to improve the feature map. The spatial location information is modeled to generate a spatial weight matrix. To enhance the model's ability to perceive the spatial relationships of the target structure; Channel weights Spatial weights Perform broadcast extension, so that With multi-scale feature maps Maintaining consistent dimensions and performing element-wise multiplication on the feature map. Weighting is performed to obtain attention-enhanced feature maps. : ; ; in, This represents the combination operation of weights. This represents the Sigmoid activation function; Attention-enhanced feature maps Compared with the original spliced feature map By performing residual summation, the final output feature map of the ECCA-ASPP module is obtained. : ; The final output feature map As a result of multi-scale feature enhancement, it is passed to the subsequent decoder module for further feature fusion and semantic segmentation prediction.
7. A semantic segmentation method for monitoring the safety mechanism of a ship lift according to claim 1, characterized in that, Step S3 introduces the normalization-based attention mechanism NAM, which includes: S301, Set the input of the NAM module to feature map F1 from the shallow layer of the decoder, with a size of H×W×C, where H and W represent the spatial size of the feature map, and C represents the number of channels; S302, Input feature map F1 is fed into the channel attention submodule, where it undergoes feature normalization processing based on batch normalization: ; in This represents the mean. Represents variance. , Let represent the trainable affine transformation parameters, namely scaling and translation. Represent a small constant that prevents division by zero; S303, Set the output of the channel attention submodule to... The scaling factor is used to weight each channel, and the weights are calculated as follows: ; S304, Pixel normalization in spatial attention is used to independently normalize each spatial location in the feature map: ; in For spatial location, Number of channels; S305, Set the output of the spatial attention submodule to... The weight of each position is: ; in It is a scaling factor for spatial dimensions, representing the importance of different spatial locations.
8. A semantic segmentation method for monitoring the safety mechanism of a ship lift according to claim 1, characterized in that, In step S4, a lightweight semantic segmentation network EMFFLabNet integrating attention mechanisms and multi-scale feature enhancement is constructed. The specific steps are as follows: S401, in the encoder part, the backbone network extracts deep features and uses dilated convolution to expand the receptive field to capture large-scale contextual information; S402, the features are fed into the ECCA-ASPP module, which fuses dilated convolutions with different dilation rates with global average pooling to capture multi-scale contextual information; S403, Feature Fusion Stage: Channel Attention (ECA) and Coordinate Attention (CA) mechanisms are introduced to further enhance the expressive power of feature maps in channel and spatial dimensions, and strengthen the model's ability to model the geometric shape and positional relationship of the target. S404, in the decoder part, the model extracts shallow features and enhances the perception of fine regions through the NAM module; S405, via After channel compression via convolution, the features are concatenated with the upsampled high-level features, and then processed by two... Convolution extracts detailed features; S406 upsamples the fused features to the original image size using bilinear interpolation and outputs the segmentation result.
9. A semantic segmentation method for monitoring the safety mechanism of a ship lift according to claim 1, characterized in that, Step S6 specifically includes: The trained model weights are used to infer the images of the ship lift safety mechanism in the test set. During the model inference phase, the images in the validation set are detected, and the average intersection-over-union ratio, average pixel precision, model parameter quantity Param, and single image inference time are used as evaluation indicators to measure the detection performance and overall detection effect of the model.
10. A semantic segmentation method for monitoring the safety mechanism of a ship lift according to claim 9, characterized in that, Step S6 specifically includes: The output model's segmentation results include segmentation result images and related evaluation metrics; the result images show the model's segmentation performance across multiple categories in the test set; and the visualization analysis provides an intuitive evaluation of the model's segmentation performance under different illumination conditions, complex backgrounds, and motion blur.