Dual-attention fusion detection method and system for port hoisting and transporting equipment steel cable defect detection
Patent Information
- Application Number
- CN202610852026.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-12
- Publication Date
- 2026-09-11
AI Technical Summary
[0004]本发明提供面向港口起重运输设备钢缆缺陷检测的双注意力融合检测方法及系统,利用钢缆周期性纹理的可预测性,通过预测正常纹理→检测预测失效区域的双注意力协同机制,从根本上解决了周期性纹理与缺陷信号难以区分的技术难题,显著提升了检测精度和抗背景干扰能力
[0013] The beneficial effects of this invention compared to existing technologies are as follows: A periodic texture perception attention module extracts the periodic and directional parameters of the spiral texture of the steel cable, constructing an adaptive linear predictor along the spiral direction. This utilizes the spatial predictability of periodic textures to accurately predict normal textures. Simultaneously, an adaptive prediction error attention module uses the statistical characteristics of the prediction error distribution as attention weights to recalibrate multi-scale features, enabling the model to focus on abnormal regions that violate periodicity. The two modules work collaboratively, transforming the attention response from weighted background suppression to active prediction and detection of predicted failure regions. This fundamentally solves the problem of difficulty in distinguishing periodic texture signals from defect signals in feature space, significantly reducing the false detection rate of periodic texture backgrounds while improving the detection sensitivity for subtle wire breakage defects.
Smart Images

Figure CN122736997A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and industrial defect detection technology, and in particular to a dual-attention fusion detection method and system for detecting defects in steel cables of port lifting and transportation equipment. Background Technology
[0002] As a critical load-bearing and traction component, steel cables in port lifting and transportation equipment operate under complex conditions such as high loads, humidity, dust, oil contamination, and vibration and impact for extended periods, making them prone to various surface defects including wire breakage, wear, and corrosion. Existing deep learning-based steel cable defect detection methods primarily employ the YOLO series of object detection frameworks, enhancing defect feature representation capabilities by introducing attention mechanisms such as deformable attention, two-layer routing attention, and selective kernel attention. These methods have achieved certain results in steel cable defect detection tasks.
[0003] However, the aforementioned existing technologies all treat the steel cable surface as a general target detection scenario, ignoring the unique periodic spiral texture structure of the steel cable surface. This periodic texture is spatially regular and predictable, while defects such as broken wires and wear disrupt this periodicity. Existing attention mechanisms can only suppress background responses through weighting, failing to fundamentally distinguish between periodic texture signals and defect signals. When periodic texture and defect signals highly overlap in the feature space, existing methods are prone to misdetecting periodic textures as defects or missing weak defects. This invention addresses this fundamental technical deficiency by proposing a dual-attention fusion scheme for defect detection that utilizes the predictability of periodic textures. Therefore, this invention proposes a dual-attention fusion detection method and system for steel cable defect detection in port lifting and transportation equipment. Summary of the Invention
[0004] This invention provides a dual-attention fusion detection method and system for detecting defects in steel cables used in port lifting and transportation equipment. By utilizing the predictability of the periodic texture of the steel cable and employing a dual-attention collaborative mechanism that predicts normal texture and detects the predicted failure area, the technical challenge of distinguishing between periodic texture and defect signals is fundamentally solved, significantly improving detection accuracy and resistance to background interference.
[0005] This invention provides a dual-attention fusion detection method for detecting defects in steel cables used in port lifting and transportation equipment, comprising: Obtain surface images of the steel cables of the port lifting and transport equipment to be inspected; The surface image is input into a defect detection network for detection. The defect location and category information output by the defect detection network are used as the detection results for steel cables of port lifting and transportation equipment. The methods for constructing defect detection networks include: A defect detection network is constructed based on the YOLOv11n target detection framework. The defect detection network includes a backbone network, a neck network, and a detection head. A periodic texture-aware attention module is introduced into the backbone network. The periodic texture-aware attention module divides the feature map into multiple overlapping perception windows along the cable axis. Within each perception window, the local texture direction is extracted by Gabor filter bank, and the local periodic parameter is extracted by autocorrelation analysis. The local periodic parameter is used as the prediction step size, and the prediction direction is determined by the local texture direction. The prediction coefficients are solved by the least squares method using the pixel values of the upstream position within the perception window. An adaptive linear predictor along the spiral direction is constructed. The adaptive linear predictor uses the upstream pixel values to predict the downstream pixel values and outputs a periodic texture prediction feature map. The prediction coefficients are calculated independently within each perception window and do not inherit the values of the previous window when the window slides. An adaptive prediction error attention module is introduced into the neck network. The adaptive prediction error attention module calculates the prediction error distribution between the periodic texture prediction feature map and the actual feature map. The mean and variance of the prediction error distribution are used as the first attention weight component and the second attention weight component. The first attention weight component and the second attention weight component are weighted and fused and then multiplied element-wise with the multi-scale feature map to realize error-guided feature recalibration and output the error-guided enhanced feature map. The periodic texture prediction feature map and the error-guided enhanced feature map are fused together in the detection head to output defect location information and category information.
[0006] Preferably, the size of the perception window in the periodic texture perception attention module is dynamically adjusted according to the rate of change of the local periodic parameters: When the rate of change of the local periodic parameter exceeds 10%, the size of the perception window is reduced, and the width of the reduced perception window is not less than 16 pixels. When the rate of change of the local periodic parameter is less than 10%, the size of the sensing window is increased, and the width of the increased sensing window does not exceed 128 pixels. The adjustment step size of the perception window is equal to one-quarter of the current local periodic parameter value, with a minimum limit of 2 pixels.
[0007] Preferably, the adaptive prediction error attention module constructs the prediction error distribution in the following ways: Calculate the original prediction error between the predicted feature map and the actual feature map at each pixel location for the periodic texture; The normalized prediction error is obtained by dividing the original prediction error by the local standard deviation of the pixel values within the perception window. The local standard deviation is calculated as follows: calculate the average value of all pixel values within the perception window, calculate the square of the difference between each pixel value and the average value, calculate the average of all squared differences, and then calculate the square root of the average value. The mean of the normalized prediction error is used as the first attention weight component, and the variance of the normalized prediction error is used as the second attention weight component. The first attention weight component is multiplied by the fusion coefficient α and the second attention weight component is multiplied by the fusion coefficient β. Then, they are added element by element to obtain the comprehensive attention weight matrix. α and β satisfy α+β=1. The value of α is 0.6 and the value of β is 0.4. 0.6 and 0.4 are the optimal values selected by comparing the experimental results of different coefficient combinations on the validation set. Error-guided feature recalibration is achieved by multiplying the comprehensive attention weight matrix element-wise with the multi-scale feature map.
[0008] Preferably, it also includes a predictor health closed-loop assessment step: Autocorrelation function analysis is performed on the prediction error output by the adaptive prediction error attention module. The autocorrelation function R is calculated as follows: R(k) is equal to the covariance of the prediction error sequence and its sequence lagged by k delays divided by the variance of the prediction error sequence. k is a non-zero delay, and the value of k ranges from 1 to twice the prediction step size. The peak amplitude H of the autocorrelation function at non-zero delay is extracted as the predictor health index. The value of H ranges from 0 to 1. The closer H is to 1, the stronger the periodicity of the prediction error. The closer H is to 0, the more random the distribution of the prediction error. When the predictor health index H is lower than the preset health threshold of 0.3, it is determined that the prediction coefficient of the periodic texture perception attention module needs to be updated, triggering the prediction coefficient recalculation process. 0.3 is obtained by statistically analyzing the prediction error of a large number of normal steel cable images and taking the five percentile of the health index distribution. The recalculation process uses the pixel values within the current detection window to re-extract local periodic parameters and local texture direction parameters, redetermines the prediction step size and prediction direction, and re-uses the least squares method to solve for the prediction coefficients, replacing the original prediction coefficients.
[0009] Preferably, it also includes a multi-scale prediction consistency verification step: In the periodic texture-aware attention module, two independent adaptive linear predictors are constructed using a first prediction step size and a second prediction step size, respectively, with the first prediction step size being smaller than the second prediction step size. Calculate the prediction error distributions of the two predictors respectively to obtain the first error distribution and the second error distribution; The corresponding pixel location is marked as a true anomaly region only when the normalized error value of the corresponding pixel location in both the first error distribution and the second error distribution exceeds 0.5. Regions that are marked as anomalous by only a single predictor are filtered as pseudo-anomalies.
[0010] Preferably, it also includes a prediction coefficient drift tracking step: Record the prediction coefficient vector of the adaptive linear predictor within each sensing window along the direction of the steel cable axis to form a prediction coefficient sequence. The number of coefficients contained in each prediction coefficient vector is equal to twice the prediction step size. The cumulative drift is calculated as follows: the cumulative drift of the current sensing window is equal to the cumulative drift of the previous sensing window plus the average of the absolute values of the differences between each prediction coefficient of the current sensing window and the prediction coefficient of the corresponding position of the initial sensing window. The cumulative drift of the initial sensing window is set to 0. When the cumulative drift exceeds the preset drift threshold of 0.5, it is determined that the steel cable has overall degradation at the corresponding position of the sensing window, and a degradation warning signal containing the degradation location range and degradation degree is output. The calculation of cumulative drift is performed in parallel with defect detection, serving as an independent assessment dimension of the cable's health status.
[0011] Preferably, it also includes a time-series verification step for the detection results: The defect detection results of five consecutive frames of surface images are aligned according to their spatial positions and stored to construct a spatiotemporal defect probability map. For each spatial location, the percentage of frames marked as defects in 5 consecutive frames is counted; When the percentage of frames exceeds 60%, the spatial location is identified as a stable defect and output. When the percentage of frames is less than 60%, the spatial location is marked as transient noise and not output.
[0012] This invention provides a dual-attention fusion detection system for detecting defects in steel cables used in port lifting and transportation equipment, comprising: The image acquisition module is used to acquire surface images of the steel cables of the port lifting and transportation equipment to be inspected; The backbone network module includes a periodic texture-aware attention unit. The periodic texture-aware attention unit extracts the texture period parameters and texture direction parameters of the spiral texture on the surface of the steel cable along the spiral direction. It uses the texture period parameters and texture direction parameters to construct an adaptive linear predictor along the spiral direction. The adaptive linear predictor uses the upstream pixel values to predict the downstream pixel values and outputs a periodic texture prediction feature map. The neck network module includes an adaptive prediction error attention unit. The adaptive prediction error attention unit calculates the prediction error distribution between the periodic texture prediction feature map and the actual feature map, uses the statistical features of the prediction error distribution as attention weights, recalibrates the multi-scale features, and outputs an error-guided enhanced feature map. The detection head module is used to fuse the periodic texture prediction feature map with the error-guided enhanced feature map to output defect location information and category information; The output module is used to output defect location information and category information.
[0013] The beneficial effects of this invention compared to existing technologies are as follows: A periodic texture perception attention module extracts the periodic and directional parameters of the spiral texture of the steel cable, constructing an adaptive linear predictor along the spiral direction. This utilizes the spatial predictability of periodic textures to accurately predict normal textures. Simultaneously, an adaptive prediction error attention module uses the statistical characteristics of the prediction error distribution as attention weights to recalibrate multi-scale features, enabling the model to focus on abnormal regions that violate periodicity. The two modules work collaboratively, transforming the attention response from weighted background suppression to active prediction and detection of predicted failure regions. This fundamentally solves the problem of difficulty in distinguishing periodic texture signals from defect signals in feature space, significantly reducing the false detection rate of periodic texture backgrounds while improving the detection sensitivity for subtle wire breakage defects.
[0014] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in this application.
[0015] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0016] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is the overall network architecture diagram of the dual-attention fusion detection method for detecting defects in steel cables for port lifting and transportation equipment in an embodiment of the present invention. Figure 2 This is a flowchart of the dual attention fusion process in an embodiment of the present invention; Figure 3 This is a diagram illustrating the dual-attention collaborative working mechanism in an embodiment of the present invention. Detailed Implementation
[0017] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0018] like Figure 1 , Figure 2 , Figure 3As shown, this invention provides an embodiment of a dual-attention fusion detection method for detecting defects in steel cables used in port lifting and transportation equipment, comprising: Obtain surface images of the steel cables of the port lifting and transport equipment to be inspected; The surface image is input into a defect detection network for detection. The defect location and category information output by the defect detection network are used as the detection results for steel cables of port lifting and transportation equipment. The methods for constructing defect detection networks include: A defect detection network is constructed based on the YOLOv11n target detection framework. The defect detection network includes a backbone network, a neck network, and a detection head. A periodic texture-aware attention module is introduced into the backbone network. The periodic texture-aware attention module divides the feature map into multiple overlapping perception windows along the cable axis. Within each perception window, the local texture direction is extracted by Gabor filter bank, and the local periodic parameter is extracted by autocorrelation analysis. The local periodic parameter is used as the prediction step size, and the prediction direction is determined by the local texture direction. The prediction coefficients are solved by the least squares method using the pixel values of the upstream position within the perception window. An adaptive linear predictor along the spiral direction is constructed. The adaptive linear predictor uses the upstream pixel values to predict the downstream pixel values and outputs a periodic texture prediction feature map. The prediction coefficients are calculated independently within each perception window and do not inherit the values of the previous window when the window slides. An adaptive prediction error attention module is introduced into the neck network. The adaptive prediction error attention module calculates the prediction error distribution between the periodic texture prediction feature map and the actual feature map. The mean and variance of the prediction error distribution are used as the first attention weight component and the second attention weight component. The first attention weight component and the second attention weight component are weighted and fused and then multiplied element-wise with the multi-scale feature map to realize error-guided feature recalibration and output the error-guided enhanced feature map. The periodic texture prediction feature map and the error-guided enhanced feature map are fused together in the detection head to output defect location information and category information.
[0019] In this embodiment, the object detection framework refers to the YOLOv11n object detection framework. It should be noted that YOLOv11n is an improvement based on the publicly released YOLOv8n model. Compared to YOLOv8n, the YOLOv11n described in this embodiment mainly integrates the periodic texture-aware attention module and adaptive prediction error attention module proposed in this invention into its backbone network and neck network, respectively. The remaining network structure, loss function, and training strategy are consistent with YOLOv8n. This framework divides the input image into a grid and directly predicts the bounding boxes and class probabilities, achieving end-to-end defect detection.
[0020] In this embodiment, the backbone network refers to the structure in the YOLOv11n framework used to extract basic feature maps from the input image. The backbone network uses a convolutional neural network to progressively downsample the input image and output multi-scale feature maps.
[0021] In this embodiment, the neck network refers to the feature processing structure located between the backbone network and the detection head in the YOLOv11n framework. The neck network uses a feature pyramid network and a path aggregation network to fuse and enhance the multi-scale feature map output by the backbone network, and outputs the processed multi-scale feature map.
[0022] In this embodiment, the detection head refers to the structure in the YOLOv11n framework used to output the final detection result. The detection head receives the enhanced feature map output by the neck network, outputs the defect category probability through the classification branch, and outputs the defect bounding box coordinates through the regression branch.
[0023] In this embodiment, the periodic texture perception attention module refers to an independent neural network sub-network. This sub-network receives the feature map output by the backbone network as input. The sub-network contains a Gabor filter bank, an autocorrelation analysis unit, and a least squares solution unit. The output of the sub-network is a periodic texture prediction feature map.
[0024] In this embodiment, the periodic texture-aware attention module is integrated into the backbone network as follows: This module is embedded after the C2f module of the original backbone network. The feature map output by the C2f module serves as the input to this module, and the periodic texture prediction feature map output by this module is passed to subsequent convolutional layers for further processing. The adaptive prediction error attention module is integrated into the neck network as follows: This module enhances the multi-scale feature map fused by the feature pyramid network. The original feature map from the backbone network and the periodic texture prediction feature map are input to this module. The attention weight matrix calculated by this module is multiplied element-wise with the corresponding scale feature map output by the feature pyramid network to achieve error-guided enhancement of the output feature map after feature recalibration.
[0025] In this embodiment, the texture period parameter refers to the pixel distance between two adjacent spiral periods of the spiral texture on the surface of the steel cable along the axis of the steel cable. The texture period parameter is calculated by performing autocorrelation analysis on the image of the steel cable surface.
[0026] In this embodiment, the texture direction parameter refers to the angle between the extension direction of the spiral texture on the surface of the steel cable and the direction of the steel cable axis. The texture direction parameter is obtained by performing Gabor filter bank analysis on the surface image of the steel cable.
[0027] In this embodiment, the spiral direction refers to the actual extension path direction along the spiral texture on the surface of the steel cable. The spiral direction is determined by the texture direction parameter and the direction of the steel cable axis. The adaptive linear predictor slides pixel by pixel along this direction to make predictions.
[0028] In this embodiment, the adaptive linear predictor is a linear filter whose prediction coefficients are solved by the least squares method. The input of the adaptive linear predictor is a sequence of pixel values of several pixels upstream of a pixel position, and the output is the predicted pixel value at that pixel position.
[0029] In this embodiment, the upstream pixel value refers to the grayscale value of the pixel located before the current predicted pixel position in the spiral direction, and the number of upstream pixel values is equal to twice the value of the texture period parameter.
[0030] In this embodiment, the downstream pixel value refers to the grayscale value of the pixel located after the current predicted pixel position in the spiral direction. The downstream pixel value is used to compare with the predicted pixel value output by the adaptive linear predictor to calculate the prediction error.
[0031] In this embodiment, the periodic texture prediction feature map refers to a two-dimensional matrix. Each element of the matrix stores the predicted pixel value output by the adaptive linear predictor at that pixel location. The spatial size of the periodic texture prediction feature map is the same as the spatial size of the feature map output by the backbone network.
[0032] In this embodiment, the adaptive prediction error attention module refers to an independent neural network sub-network. This sub-network receives periodic texture prediction feature maps and actual feature maps as inputs. The sub-network contains an error calculation unit, a statistical feature extraction unit, and a weight generation unit. The output of the sub-network is an error-guided enhanced feature map.
[0033] In this embodiment, the prediction error distribution refers to the two-dimensional matrix formed by the difference between the predicted feature map and the actual feature map at each corresponding pixel position of the periodic texture. Positive values in the prediction error distribution indicate that the predicted value is lower than the actual value, and negative values indicate that the predicted value is higher than the actual value.
[0034] In this embodiment, the actual feature map refers to the original feature map directly output by the backbone network and not processed by the periodic texture-aware attention module. The actual feature map serves as a reference benchmark for the adaptive prediction error attention module.
[0035] In this embodiment, the statistical characteristics refer to the mean and variance of the prediction error distribution. The mean is the arithmetic mean of all error values in the prediction error distribution, and the variance is the average of the squares of the differences between all error values and the mean in the prediction error distribution.
[0036] In this embodiment, attention weight refers to a two-dimensional weight matrix with the same spatial size as the multi-scale feature map. Each element in the attention weight matrix takes a value between 0 and 1. The attention weight matrix is obtained by weighted summation of the mean and variance of the prediction error distribution and then mapped by the Sigmoid function.
[0037] In this embodiment, multi-scale features refer to the set of feature maps extracted by the neck network from feature layers with different downsampling ratios. Multi-scale features include original size feature maps, half-size feature maps, and quarter-size feature maps.
[0038] In this embodiment, recalibration refers to the operation of multiplying the attention weight matrix with the feature map of each channel in the multi-scale feature map element by element. After recalibration, the response value of the defect candidate region in the feature map is amplified, while the response value of the background region is suppressed.
[0039] In this embodiment, the error-guided enhanced feature map refers to the feature map output after recalibration. The spatial size of the error-guided enhanced feature map is the same as that of the actual feature map, and the number of channels remains the same as that of the multi-scale feature map.
[0040] In this embodiment, collaborative fusion refers to concatenating the periodic texture prediction feature map and the error-guided enhancement feature map along the channel dimension, and then integrating and reducing the dimensions through a 1×1 convolutional layer. The periodic texture prediction feature map encodes prior knowledge of the normal texture of the steel cable, providing the network with contextual information about the background; the error-guided enhancement feature map highlights the salience of anomalies by focusing on predicted failure areas. This collaborative fusion allows the detection head to make joint decisions based on both the background model and the anomaly model, effectively overcoming the technical bias of misjudging texture fluctuations as defects when relying solely on anomaly signals, and achieving accurate removal of defect signals.
[0041] In another embodiment of the present invention, the size of the perception window in the periodic texture perception attention module is dynamically adjusted according to the rate of change of the local periodic parameter: When the rate of change of the local periodic parameter exceeds 10%, the size of the perception window is reduced, and the width of the reduced perception window is not less than 16 pixels. When the rate of change of the local periodic parameter is less than 10%, the size of the sensing window is increased, and the width of the increased sensing window does not exceed 128 pixels. The adjustment step size of the perception window is equal to one-quarter of the current local periodic parameter value, with a minimum limit of 2 pixels.
[0042] In this embodiment, the sensing window refers to a rectangular area that slides along the axis of the steel cable. The height of the sensing window is equal to the height of the feature map, the width of the sensing window is equal to four times the value of the local periodic parameter, and the overlap width between adjacent sensing windows is equal to twice the value of the local periodic parameter.
[0043] In this embodiment, the Gabor filter bank refers to a set of Gabor filters with different directions and scales. The set includes eight directions, namely 0 degrees, 45 degrees, 90 degrees, 135 degrees, 180 degrees, 225 degrees, 270 degrees, and 315 degrees, and four scales, namely 1, 2, 3, and 4. The image in each perception window is convolved with each Gabor filter to obtain thirty-two filter response maps.
[0044] In this embodiment, the local texture direction refers to the actual extension direction of the spiral texture on the surface of the steel cable within the sensing window. The local texture direction is determined by selecting the filter response map with the largest response energy from the thirty-two filter response maps output by the Gabor filter bank. The Gabor filter direction corresponding to this filter response map is the local texture direction.
[0045] In this embodiment, autocorrelation analysis refers to calculating the autocorrelation function of the image within the perception window in the vertical direction of the local texture direction. The input of the autocorrelation function is the sequence of pixel values of the image within the perception window along the vertical direction, and the output is the sequence of autocorrelation coefficients of the sequence at different lag distances. The lag distance corresponding to the first peak position of the autocorrelation coefficient sequence is the local periodic parameter.
[0046] In this embodiment, the local periodicity parameter refers to the repetition distance of the spiral texture on the surface of the steel cable within the sensing window in the direction perpendicular to the local texture. The local periodicity parameter is expressed in units of pixels, and its value range is limited to between 16 pixels and 128 pixels.
[0047] In this embodiment, the prediction step size refers to the number of pixels that the adaptive linear predictor jumps forward when making predictions, and the value of the prediction step size is equal to the local periodicity parameter.
[0048] In this embodiment, the prediction direction refers to the direction in which the adaptive linear predictor moves along the pixel arrangement within the perception window. The prediction direction is determined by the local texture direction as the forward direction extending along a spiral.
[0049] In this embodiment, the least squares method refers to a method for solving prediction coefficients by minimizing the sum of squared errors. In the solution process, the pixel values at the upstream position within the perception window are used as the independent variable matrix, and the pixel values at the downstream position are used as the dependent variable vector. The prediction coefficient vector is obtained by solving the normal equation.
[0050] In this embodiment, the prediction coefficients refer to a set of weight values of the adaptive linear predictor. The number of prediction coefficients is equal to twice the prediction step size. Each prediction coefficient corresponds to a pixel value at a specific lag distance upstream. The prediction coefficients are obtained by solving the least squares method.
[0051] In another embodiment of the present invention, the adaptive prediction error attention module constructs the prediction error distribution in the following manner: Calculate the original prediction error between the predicted feature map and the actual feature map at each pixel location for the periodic texture; The normalized prediction error is obtained by dividing the original prediction error by the local standard deviation of the pixel values within the perception window. The local standard deviation is calculated as follows: calculate the average value of all pixel values within the perception window, calculate the square of the difference between each pixel value and the average value, calculate the average of all squared differences, and then calculate the square root of the average value. The mean of the normalized prediction error is used as the first attention weight component, and the variance of the normalized prediction error is used as the second attention weight component. The first attention weight component is multiplied by the fusion coefficient α and the second attention weight component is multiplied by the fusion coefficient β. Then, they are added element by element to obtain the comprehensive attention weight matrix. α and β satisfy α+β=1. The value of α is 0.6 and the value of β is 0.4. 0.6 and 0.4 are the optimal values selected by comparing the experimental results of different coefficient combinations on the validation set. Error-guided feature recalibration is achieved by multiplying the comprehensive attention weight matrix element-wise with the multi-scale feature map.
[0052] In this embodiment, the local standard deviation refers to the standard deviation of pixel values within the perception window. The standard deviation is calculated as follows: calculate the average value of all pixel values within the perception window, calculate the square of the difference between each pixel value and the average value, calculate the average of all squared differences, and then calculate the square root of the average value to obtain the local standard deviation.
[0053] In this embodiment, the first attention weight component refers to the weight matrix obtained by mapping the mean of the normalized prediction error through the Sigmoid function. The spatial size of the first attention weight matrix is the same as that of the actual feature map, and the value of each element in the matrix is between 0 and 1.
[0054] In this embodiment, the second attention weight component refers to the weight matrix obtained by mapping the variance of the normalized prediction error through the Sigmoid function. The spatial size of the second attention weight matrix is the same as that of the actual feature map, and the value of each element in the matrix is between 0 and 1.
[0055] In this embodiment, weighted fusion refers to fusing the first attention weight component and the second attention weight component into a final attention weight matrix through linear weighting. Let the first attention weight component be denoted as W_mean and the second attention weight component as W_variance. The final attention weight matrix W is calculated as follows: W equals alpha multiplied by W_mean plus beta multiplied by W_variance. Here, alpha and beta are preset fusion coefficients used to adjust the contribution of the mean and variance components to the final weights, respectively, and alpha plus beta equals 1. In this embodiment, the alpha value is 0.6 and the beta value is 0.4. The values of 0.6 and 0.4 are determined as follows: on a validation set containing 500 steel cable images covering typical defects such as broken wires, wear, and corrosion, multiple combinations of α and β (including (0.1, 0.9), (0.2, 0.8), (0.3, 0.7), (0.4, 0.6), (0.5, 0.5), (0.6, 0.4), (0.7, 0.3), (0.8, 0.2), and (0.9, 0.1)) were tested with a step size of 0.1. Using the mean average accuracy (mAP) as the evaluation metric, experimental results show that when α=0.6 and β=0.4, the defect detection network reaches its peak mAP on the validation set, significantly outperforming other coefficient combinations. Therefore, in this embodiment, α=0.6 and β=0.4 are preferred. The fused W is then multiplied element-wise with the multi-scale feature map to achieve feature recalibration.
[0056] In another embodiment of the invention, a predictor health closed-loop evaluation step is also included: Autocorrelation function analysis is performed on the prediction error output by the adaptive prediction error attention module. The autocorrelation function R is calculated as follows: R(k) is equal to the covariance of the prediction error sequence and its sequence lagged by k delays divided by the variance of the prediction error sequence. k is a non-zero delay, and the value of k ranges from 1 to twice the prediction step size. The peak amplitude H of the autocorrelation function at non-zero delay is extracted as the predictor health index. The value of H ranges from 0 to 1. The closer H is to 1, the stronger the periodicity of the prediction error. The closer H is to 0, the more random the distribution of the prediction error. When the predictor health index H is lower than the preset health threshold of 0.3, it is determined that the prediction coefficient of the periodic texture perception attention module needs to be updated, triggering the prediction coefficient recalculation process. 0.3 is obtained by statistically analyzing the prediction error of a large number of normal steel cable images and taking the five percentile of the health index distribution. The recalculation process uses the pixel values within the current detection window to re-extract local periodic parameters and local texture direction parameters, redetermines the prediction step size and prediction direction, and re-uses the least squares method to solve for the prediction coefficients, replacing the original prediction coefficients.
[0057] In this embodiment, the prediction error refers to the sub-matrix formed by the error values in the prediction error distribution output by the adaptive prediction error attention module that are determined to be within the candidate abnormal window region. This sub-matrix retains the spatial distribution information of the original prediction error and is used to analyze the prediction performance of the predictor.
[0058] In this embodiment, the autocorrelation function refers to the mathematical function used to perform autocorrelation analysis on the prediction error sequence. The input of the autocorrelation function is the data pairs with different lag distances in the prediction error sequence, and the output is the curve showing the correspondence between the lag distance and the autocorrelation coefficient.
[0059] In this embodiment, non-zero delay refers to the case where the lag distance in the autocorrelation function calculation is not equal to zero. The lag distance is in units of pixels, and the value of non-zero delay ranges from 1 to twice the prediction step size.
[0060] In this embodiment, the peak amplitude refers to the maximum value of the autocorrelation function curve in the non-zero delay interval. The value range of the peak amplitude is between 0 and 1. The closer the peak amplitude is to 1, the stronger the periodicity of the prediction error. The closer the peak amplitude is to 0, the more random the distribution of the prediction error.
[0061] In this embodiment, the predictor health index is a numerical value used to quantitatively evaluate the current prediction performance of the adaptive linear predictor. This index is calculated by performing autocorrelation function analysis on the prediction error sequence and extracting the peak amplitude of the autocorrelation function at non-zero delay as the predictor health index. The index ranges from 0 to 1. A value closer to 1 indicates a strong periodicity in the prediction error, suggesting that the predictor has failed to effectively model periodic textures and has poor prediction performance. A value closer to 0 indicates that the prediction error exhibits random distribution characteristics, suggesting that the predictor has successfully modeled periodic textures and has good prediction performance.
[0062] In this embodiment, the preset health threshold is a pre-set value used to determine whether the predictor needs to be updated. This threshold is obtained through statistical analysis of the prediction errors of a large number of normal steel cable images: a dataset of 1000 normal (defect-free) steel cable images collected under different lighting, humidity, and operating speeds is constructed, with 500 images collected from laboratory environments and 500 images collected from on-site port crane and transportation equipment inspections. The predictor health index H is calculated for each image in this dataset, and the empirical cumulative distribution function of H is obtained. Statistically, 95% of the samples in this dataset have an H value higher than 0.3, meaning the 5th percentile of H is 0.3. Therefore, this value is selected as the preset health threshold. The technical consideration for choosing the 5th percentile is to ensure sufficient sensitivity to the actual decline in predictor performance within an acceptable 5% false trigger rate; that is, when the H value is lower than 0.3, it indicates that the current predictor performance is below 95% of normal operating conditions, requiring a recalculation of the prediction coefficients. When the predictor health index H is lower than the preset health threshold of 0.3, it is determined that the prediction coefficients of the periodic texture perception attention module need to be updated, triggering the prediction coefficient recalculation process; when the predictor health index H is equal to or higher than 0.3, it is determined that the predictor is working normally and the prediction coefficients do not need to be updated.
[0063] In this embodiment, the prediction coefficient recalculation process refers to the complete process of resolving the prediction coefficients of the adaptive linear predictor. The recalculation process includes re-extracting the local periodic parameters and local texture direction parameters within the current detection window, redetermining the prediction step size and prediction direction, and re-solving the prediction coefficients using the least squares method.
[0064] In this embodiment, the current detection window refers to the perception window that the adaptive linear predictor is processing when the recalculation process is triggered. The position of the current detection window is determined by the current position of the sliding window, and the size of the current detection window is the same as the size of the perception window.
[0065] In this embodiment, the triggering condition for the recalculation process is an event where the predictor health index is lower than a preset health threshold. When the recalculation process is triggered, the normal prediction operation of the adaptive linear predictor in the current detection window is paused, and the prediction coefficient recalculation process is executed instead.
[0066] In this embodiment, the updated prediction coefficients are used in such a way that after the recalculation process is completed, the newly solved prediction coefficients are immediately applied to the prediction of the remaining pixels in the current detection window, and the newly solved prediction coefficients are used as the initial prediction coefficients for the next perception window, replacing the original prediction coefficients.
[0067] In another embodiment of the present invention, a multi-scale prediction consistency verification step is also included: In the periodic texture-aware attention module, two independent adaptive linear predictors are constructed using a first prediction step size and a second prediction step size, respectively, with the first prediction step size being smaller than the second prediction step size. Calculate the prediction error distributions of the two predictors respectively to obtain the first error distribution and the second error distribution; The corresponding pixel location is marked as a true anomaly region only when the normalized error value of the corresponding pixel location in both the first error distribution and the second error distribution exceeds 0.5. Regions that are marked as anomalous by only a single predictor are filtered as pseudo-anomalies.
[0068] In this embodiment, the first prediction step size refers to the prediction step size used to construct the first adaptive linear predictor, and the value of the first prediction step size is equal to the local periodic parameter.
[0069] In this embodiment, the second prediction step size refers to the prediction step size used to construct the second adaptive linear predictor, and the value of the second prediction step size is equal to twice the local periodic parameter.
[0070] In this embodiment, the two independent adaptive linear predictors are constructed as follows: the first adaptive linear predictor uses a first prediction step size and solves for the first set of prediction coefficients using the pixel values at the upstream position within the perception window through the least squares method; the second adaptive linear predictor uses a second prediction step size and solves for the second set of prediction coefficients using the pixel values at the upstream position within the perception window through the least squares method. The prediction coefficients of the two predictors are calculated independently within the same perception window and do not affect each other.
[0071] In this embodiment, the first error distribution refers to the two-dimensional matrix formed by the difference between the periodic texture prediction feature map output by the first adaptive linear predictor and the actual feature map. The spatial size of the first error distribution is the same as that of the actual feature map.
[0072] In this embodiment, the second error distribution refers to the two-dimensional matrix formed by the difference between the periodic texture prediction feature map output by the second adaptive linear predictor and the actual feature map. The spatial size of the second error distribution is the same as that of the actual feature map.
[0073] In this embodiment, the determination condition for statistical features exceeding the preset threshold is that the normalized error value obtained by dividing the error value of each pixel position in the first error distribution by the local standard deviation of the window where the pixel position is located exceeds 0.5, and at the same time, the normalized error value of the corresponding pixel position in the second error distribution also exceeds 0.5.
[0074] In this embodiment, a true abnormal region refers to a spatial region in which both the first error distribution and the second error distribution are determined to be abnormal. A true abnormal region includes a connected region composed of consecutive adjacent pixels that meet the determination conditions. The minimum area of a true abnormal region is limited to 3 by 3 pixels.
[0075] In this embodiment, a pseudo-anomaly refers to a spatial region that is judged as abnormal only by the first error distribution but not by the second error distribution, or a spatial region that is judged as abnormal only by the second error distribution but not by the first error distribution. Pseudo-anomaly regions are usually composed of single pixels or isolated small-area spots.
[0076] In this embodiment, the filtering method refers to deleting regions marked as pseudo-anomalies from the candidate anomaly region set. After the deletion operation is completed, all remaining candidate anomaly regions are true anomaly regions, and the true anomaly regions are sent to the subsequent connectivity analysis step for clustering processing.
[0077] In another embodiment of the invention, a prediction coefficient drift tracking step is also included: Record the prediction coefficient vector of the adaptive linear predictor within each sensing window along the direction of the steel cable axis to form a prediction coefficient sequence. The number of coefficients contained in each prediction coefficient vector is equal to twice the prediction step size. The cumulative drift is calculated as follows: the cumulative drift of the current sensing window is equal to the cumulative drift of the previous sensing window plus the average of the absolute values of the differences between each prediction coefficient of the current sensing window and the prediction coefficient of the corresponding position of the initial sensing window. The cumulative drift of the initial sensing window is set to 0. When the cumulative drift exceeds the preset drift threshold of 0.5, it is determined that the steel cable has overall degradation at the corresponding position of the sensing window, and a degradation warning signal containing the degradation location range and degradation degree is output. The calculation of cumulative drift is performed in parallel with defect detection, serving as an independent assessment dimension of the cable's health status.
[0078] In this embodiment, the prediction coefficient sequence refers to the sequence set formed by arranging a set of prediction coefficients of the adaptive linear predictor in each sensing window in the order of the sensing windows along the direction of the steel cable axis. Each sensing window corresponds to a set of prediction coefficients, and the number of coefficients in a set of prediction coefficients is equal to twice the prediction step size.
[0079] In this embodiment, the cumulative drift refers to the cumulative difference between the prediction coefficients of the current sensing window and the prediction coefficients of the initial sensing window. It is calculated as follows: For the nth sensing window, firstly, the difference between each prediction coefficient of the current window and the corresponding prediction coefficient of the initial window is calculated. The absolute value of the difference is taken, and the average of all absolute values is used as the window drift of the current window. Then, the window drift is added to the cumulative drift of the previous window to obtain the cumulative drift of the current window. The cumulative drift of the initial window is set to 0. The physical meaning of this calculation method is: the drift of each sensing window is the average absolute deviation between the prediction coefficients of the current window and the prediction coefficients of the initial window, and the cumulative drift is the sum of the drifts of all windows, reflecting the cumulative change of the prediction coefficients along the cable axis. When the cumulative drift exceeds a preset drift threshold of 0.5, it is determined that the cable exhibits overall degradation at that window position.
[0080] In this embodiment, the preset drift threshold is a pre-set value used to determine whether the steel cable has undergone overall degradation. The preset drift threshold is 0.5, and the cumulative drift amount is expressed as a unitless value. When the cumulative drift amount exceeds 0.5, it is determined that there is a risk of degradation. The method for determining 0.5 is as follows: 10 groups of steel cable samples known to have undergone overall degradation were collected, and the cumulative drift amount of each group of samples was calculated. Statistical analysis showed that the cumulative drift amount of the degraded samples all exceeded 0.5, while the cumulative drift amount of the normal samples was all below 0.3. Therefore, 0.5 was selected as the judgment threshold. This value can ensure sensitivity to actual degradation while avoiding false alarms.
[0081] In this embodiment, overall degradation refers to the continuous performance decline of the steel cable over a relatively long distance. Overall degradation does not manifest as the morphological characteristics of a single broken wire or wear defect, but rather as a continuous trend of monotonically increasing or decreasing prediction coefficients along the cable axis.
[0082] In this embodiment, the degradation warning signal refers to an alarm message that includes a degradation location range and a degradation degree. The degradation location range is determined by the start and end positions of a continuous sensing window where the cumulative drift exceeds a preset drift threshold. The degradation degree is represented by the peak value of the cumulative drift within the range. The degradation warning signal is output to the port crane and transport equipment control system to trigger a steel cable maintenance reminder.
[0083] In this embodiment, parallel execution means that the prediction coefficient drift tracking step and the defect detection step run simultaneously during the forward propagation process of the same defect detection network. The two steps share the prediction coefficients output by the same adaptive linear predictor, but the two steps are independent of each other and do not block each other.
[0084] In this embodiment, the independent evaluation dimension means that the degradation warning signal output by the prediction coefficient drift tracking step does not depend on the defect location information output by the defect detection step. When the defect detection step makes a false detection or misses a detection due to periodic texture interference, the prediction coefficient drift tracking step can still output a degradation warning signal independently. The evaluation results of the two dimensions together constitute the comprehensive judgment basis for the health status of the steel cable.
[0085] In this embodiment, the size of the sensing window refers to the number of pixels wide in the direction of the steel cable axis. The height of the sensing window is equal to the height of the feature map, and the initial width of the sensing window is four times the value of the local periodicity parameter. In typical working scenarios, the width of the sensing window is limited to between 16 and 128 pixels. This range is a typical working range determined based on the common periodic distribution of the spiral texture on the surface of the steel cable (usually between 16 and 128 pixels), rather than an absolute physical limitation. When the value of the local periodicity parameter exceeds this range, the window size can be adjusted accordingly, but in practical applications, the steel cable texture period rarely exceeds this range. The determination of the 16-pixel lower limit and 128-pixel upper limit is based on the following: Experiments show that when the perceptual window width is less than 16 pixels, the texture period covered by the window is too small, and the signal-to-noise ratio of the local periodic parameters extracted by autocorrelation analysis drops sharply. The predictor cannot establish a stable periodic model, resulting in a large number of false alarms. When the perceptual window width exceeds 128 pixels, for steel cables with slight twisting or tension changes, the window may contain multiple different local periods and directions. A single linear predictor cannot effectively fit the texture pattern of the entire window, and the prediction accuracy actually decreases. Therefore, limiting the perceptual window width to between 16 and 128 pixels is a technical balance achieved between ensuring the reliability of periodic information extraction and maintaining the local adaptability of the prediction model.
[0086] In this embodiment, the rate of change of the local periodic parameter refers to the absolute value of the difference between the local periodic parameter of the current sensing window and the local periodic parameter of the previous sensing window, divided by the local periodic parameter of the previous sensing window. The result of the rate of change is expressed as a percentage.
[0087] In this embodiment, the preset change rate threshold refers to a pre-set percentage value, which is used to determine the degree of variation in the local texture of the steel cable. The preset change rate threshold value is 10%.
[0088] In this embodiment, reducing the size of the sensing window means that when the rate of change of the local periodic parameter exceeds 10%, the width of the current sensing window is reduced by one adjustment step, and the width of the reduced sensing window is not less than 16 pixels.
[0089] In this embodiment, increasing the size of the sensing window means that when the rate of change of the local periodic parameter is less than 10%, the width of the current sensing window is increased by one adjustment step, and the width of the increased sensing window does not exceed 128 pixels.
[0090] In this embodiment, local adaptability refers to the ability of the adaptive linear predictor to respond to local texture changes on the surface of the steel cable. The smaller the sensing window size, the narrower the area of interest of the predictor, the more sensitive it is to local texture changes, and the stronger its local adaptability.
[0091] In this embodiment, prediction stability refers to the degree of consistency of the prediction coefficients output by the adaptive linear predictor across different perception windows. The larger the perception window size, the more training samples the predictor uses, the less the prediction coefficients are affected by local noise interference, and the higher the prediction stability.
[0092] In this embodiment, the adjustment step size refers to the number of pixels added or removed each time the size of the perception window is adjusted. The value of the adjustment step size is equal to one-quarter of the current local periodic parameter value, and the minimum limit of the adjustment step size is 2 pixels.
[0093] In this embodiment, "proportional" means that there is a direct proportional relationship between the adjustment step size of the sensing window and the rate of change of the local periodic parameter. The higher the rate of change of the local periodic parameter, the larger the adjustment step size; the lower the rate of change of the local periodic parameter, the smaller the adjustment step size. The proportionality coefficient is set to 0.5.
[0094] In another embodiment of the invention, the error-guided enhanced feature map output by the adaptive prediction error attention module is fused with the original multi-scale feature map via residual connections in the neck network: The error-guided enhanced feature map is added element-wise to the original multi-scale feature map, and then channel recalibration is performed through 1×1 convolution. The scaling factor of the residual connection is adaptively adjusted according to the signal-to-noise ratio of the prediction error distribution. The higher the signal-to-noise ratio, the greater the weight of the error-guided feature map.
[0095] In this embodiment, the error-guided enhanced feature map refers to the feature map output by the adaptive prediction error attention module. Each channel of the feature map corresponds to a feature representation at a specific scale. In the error-guided enhanced feature map, the response value of the defect candidate region is amplified, while the response value of the background region is suppressed.
[0096] In this embodiment, the original multi-scale feature map refers to the multi-scale feature map in the neck network that has not been processed by the adaptive prediction error attention module. The original multi-scale feature map includes three scale levels. The feature map space size of the first scale level is half the size of the input image, the feature map space size of the second scale level is one-quarter the size of the input image, and the feature map space size of the third scale level is one-eighth the size of the input image.
[0097] In this embodiment, residual connection fusion refers to the operation of merging the error-guided enhanced feature map and the original multi-scale feature map according to the corresponding scale level. The error-guided enhanced feature map at each scale level is merged with the original multi-scale feature map at that scale level. Figure 1 Merge them one-to-one.
[0098] In this embodiment, element-wise addition refers to adding the pixel values at the same coordinate position in two feature maps with the same spatial size. The two feature maps have the same number of channels, and the addition operation is performed between the corresponding channels. The result of the addition operation is used as the new pixel value at that coordinate position.
[0099] In this embodiment, 1×1 convolution refers to a convolution operation with a kernel size of 1 pixel by 1 pixel. The number of input channels of 1×1 convolution is equal to the total number of channels in the feature map after element-wise addition. The number of output channels of 1×1 convolution is equal to the number of channels in the original multi-scale feature map. 1×1 convolution does not change the spatial size of the feature map.
[0100] In this embodiment, channel recalibration refers to assigning different weight coefficients to different channels of the feature map after element-wise addition using 1×1 convolution. The channel recalibration operation enables the network to focus on the feature channels that contribute more in subsequent processing and suppress the feature channels that contribute less.
[0101] In this embodiment, the scaling factor refers to the weight value of the error-guided enhanced feature map in the residual connection fusion. The scaling factor ranges from 0 to 1. When the scaling factor is 0, it means that the error-guided enhanced feature map is completely ignored. When the scaling factor is 1, it means that the original multi-scale feature map is completely ignored.
[0102] In this embodiment, the signal-to-noise ratio (SNR) refers to the ratio of useful signal energy to noise energy in the prediction error distribution. The useful signal energy is calculated from the sum of squares of error values exceeding a preset threshold in the prediction error distribution, and the noise energy is calculated from the sum of squares of error values below the preset threshold in the prediction error distribution. The SNR is expressed in decibels.
[0103] In this embodiment, adaptive adjustment refers to the process of dynamically calculating the scaling factor based on the signal-to-noise ratio (SNR) value of the current detection window. The scaling factor is calculated by dividing the SNR by the sum of the SNR and 1. The higher the SNR, the closer the scaling factor is to 1, and the lower the SNR, the closer the scaling factor is to 0.
[0104] In another embodiment of the present invention, the dual-attention fusion detection method for detecting defects in steel cables of port lifting and transportation equipment further includes a time-series verification step for the detection results: The defect detection results of five consecutive frames of surface images are aligned according to their spatial positions and stored to construct a spatiotemporal defect probability map. For each spatial location, the percentage of frames marked as defects in 5 consecutive frames is counted; When the percentage of frames exceeds 60%, the spatial location is identified as a stable defect and output. When the percentage of frames is less than 60%, the spatial location is marked as transient noise and not output.
[0105] In this embodiment, continuous multi-frame surface images refer to multiple surface images continuously captured by an image acquisition device at fixed time intervals during the movement of the steel cable. The number of continuous multi-frames is set to 5 frames, and the time interval between two adjacent frames is determined by the speed of the steel cable movement and the frame rate of the image acquisition device.
[0106] In this embodiment, spatial alignment refers to the operation of mapping pixels corresponding to the same physical location of the steel cable in different frame images to the same spatial coordinate system. The alignment method adopts position matching based on the direction of the steel cable axis, and the pixel correspondence between different frame images is determined by the displacement of the steel cable recorded by the encoder.
[0107] In this embodiment, the spatiotemporal defect probability map refers to a three-dimensional data structure containing two spatial dimensions and one temporal dimension. The spatial dimension corresponds to the planar coordinates of the steel cable surface, and the temporal dimension corresponds to the sequence number of the frame sequence. Each storage unit in the spatiotemporal defect probability map records the probability value of the spatial location being marked as a defect under the frame sequence number. The probability value is either 0 or 1.
[0108] In this embodiment, the frame percentage refers to the ratio obtained by dividing the total number of frames marked as defects in 5 consecutive images for the same spatial location by the total number of frames, which is 5. The frame percentage is expressed as a percentage and ranges from 0 to 100%.
[0109] In this embodiment, the preset percentage threshold refers to a pre-set percentage value used to determine whether the defect marking at a spatial location is stable. The preset percentage threshold is set to 60%, meaning that a spatial location is considered a stable defect only when it is marked as a defect in at least 3 out of 5 consecutive frames. The 60% threshold is determined by testing on video sequences containing stable defects and transient noise, using 50%, 60%, 70%, and 80% as thresholds respectively, and comparing the false negative rate and false positive rate under different thresholds. Experiments show that the 60% threshold achieves the best balance between the false negative rate and the false positive rate, therefore this value is selected as the preset percentage threshold.
[0110] In this embodiment, a stable defect refers to a defect region that is consistently detected in multiple consecutive frames of images. A stable defect corresponds to a persistent defect that actually exists on the surface of the steel cable. The output priority of a stable defect is higher than that of a defect marker output in a single frame.
[0111] In this embodiment, transient noise refers to unstable defect markers that appear only in a single frame or a few frames. Transient noise is usually caused by temporary oil stains on the surface of the steel cable, transient light changes, or image acquisition noise. Transient noise does not have time consistency characteristics.
[0112] In this embodiment, "filtering out" refers to the operation of deleting the spatial location determined to be transient noise from the final output result. After the deletion operation is completed, the spatial location will no longer be output as defect information to the port crane and transportation equipment control system, thus avoiding unnecessary maintenance alarms triggered by transient noise.
[0113] This invention provides an embodiment of a dual-attention fusion detection system for detecting defects in steel cables used in port lifting and transportation equipment, comprising: The image acquisition module is used to acquire surface images of the steel cables of the port lifting and transportation equipment to be inspected; The backbone network module includes a periodic texture-aware attention unit. The periodic texture-aware attention unit extracts the texture period parameters and texture direction parameters of the spiral texture on the surface of the steel cable along the spiral direction. It uses the texture period parameters and texture direction parameters to construct an adaptive linear predictor along the spiral direction. The adaptive linear predictor uses the upstream pixel values to predict the downstream pixel values and outputs a periodic texture prediction feature map. The neck network module includes an adaptive prediction error attention unit. The adaptive prediction error attention unit calculates the prediction error distribution between the periodic texture prediction feature map and the actual feature map, uses the statistical features of the prediction error distribution as attention weights, recalibrates the multi-scale features, and outputs an error-guided enhanced feature map. The detection head module is used to fuse the periodic texture prediction feature map with the error-guided enhanced feature map to output defect location information and category information; The output module is used to output defect location information and category information.
[0114] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of this invention and its equivalents, this invention also intends to include these modifications and variations.
Claims
1. A dual-attention fusion detection method for steel cable defect detection of port hoisting and transporting equipment, characterized in that, include: Obtain surface images of the steel cables of the port lifting and transport equipment to be inspected; The surface image is input into a defect detection network for detection. The defect location and category information output by the defect detection network are used as the detection results for steel cables of port lifting and transportation equipment. The methods for constructing defect detection networks include: A defect detection network is constructed based on the YOLOv11n target detection framework. The defect detection network includes a backbone network, a neck network, and a detection head. A periodic texture-aware attention module is introduced into the backbone network. The periodic texture-aware attention module divides the feature map into multiple overlapping perception windows along the cable axis. Within each perception window, the local texture direction is extracted by Gabor filter bank, and the local periodic parameter is extracted by autocorrelation analysis. The local periodic parameter is used as the prediction step size, and the prediction direction is determined by the local texture direction. The prediction coefficients are solved by the least squares method using the pixel values of the upstream position within the perception window. An adaptive linear predictor along the spiral direction is constructed. The adaptive linear predictor uses the upstream pixel values to predict the downstream pixel values and outputs a periodic texture prediction feature map. The prediction coefficients are calculated independently within each perception window and do not inherit the values of the previous window when the window slides. An adaptive prediction error attention module is introduced into the neck network. The adaptive prediction error attention module calculates the prediction error distribution between the periodic texture prediction feature map and the actual feature map. The mean and variance of the prediction error distribution are used as the first attention weight component and the second attention weight component. The first attention weight component and the second attention weight component are weighted and fused and then multiplied element-wise with the multi-scale feature map to realize error-guided feature recalibration and output the error-guided enhanced feature map. The periodic texture prediction feature map and the error-guided enhanced feature map are fused together in the detection head to output defect location information and category information.
2. The dual attention fusion detection method for port crane cable defect detection according to claim 1, characterized in that, In the periodic texture-aware attention module, the size of the perception window is dynamically adjusted based on the rate of change of the local periodic parameters. When the rate of change of the local periodic parameter exceeds 10%, the size of the perception window is reduced, and the width of the reduced perception window is not less than 16 pixels. When the rate of change of the local periodic parameter is less than 10%, the size of the sensing window is increased, and the width of the increased sensing window does not exceed 128 pixels. The adjustment step size of the perception window is equal to one-quarter of the current local periodic parameter value, with a minimum limit of 2 pixels.
3. The dual attention fusion detection method for port crane cable defect detection according to claim 1, characterized in that, The adaptive prediction error attention module constructs the prediction error distribution in the following ways: Calculate the original prediction error between the predicted feature map and the actual feature map at each pixel location for the periodic texture; The normalized prediction error is obtained by dividing the original prediction error by the local standard deviation of the pixel values within the perception window. The local standard deviation is calculated as follows: calculate the average value of all pixel values within the perception window, calculate the square of the difference between each pixel value and the average value, calculate the average of all squared differences, and then calculate the square root of the average value. The mean of the normalized prediction error is used as the first attention weight component, and the variance of the normalized prediction error is used as the second attention weight component. The first attention weight component is multiplied by the fusion coefficient α and the second attention weight component is multiplied by the fusion coefficient β. Then, they are added element by element to obtain the comprehensive attention weight matrix. α and β satisfy α+β=1. The value of α is 0.6 and the value of β is 0.
4. 0.6 and 0.4 are the optimal values selected by comparing the experimental results of different coefficient combinations on the validation set. Error-guided feature recalibration is achieved by multiplying the comprehensive attention weight matrix element-wise with the multi-scale feature map.
4. The dual attention fusion detection method for port crane cable defect detection according to claim 1, characterized in that, It also includes a closed-loop assessment step for predictor health: Autocorrelation function analysis is performed on the prediction error output by the adaptive prediction error attention module. The autocorrelation function R is calculated as follows: R(k) is equal to the covariance of the prediction error sequence and its sequence lagged by k delays divided by the variance of the prediction error sequence. k is a non-zero delay, and the value of k ranges from 1 to twice the prediction step size. The peak amplitude H of the autocorrelation function at non-zero delay is extracted as the predictor health index. The value of H ranges from 0 to 1. The closer H is to 1, the stronger the periodicity of the prediction error. The closer H is to 0, the more random the distribution of the prediction error. When the predictor health index H is lower than the preset health threshold of 0.3, it is determined that the prediction coefficient of the periodic texture perception attention module needs to be updated, triggering the prediction coefficient recalculation process. 0.3 is obtained by statistically analyzing the prediction error of a large number of normal steel cable images and taking the five percentile of the health index distribution. The recalculation process uses the pixel values within the current detection window to re-extract local periodic parameters and local texture direction parameters, redetermines the prediction step size and prediction direction, and re-uses the least squares method to solve for the prediction coefficients, replacing the original prediction coefficients.
5. The dual attention fusion detection method for port crane cable defect detection according to claim 1, characterized in that, It also includes a multi-scale prediction consistency verification step: In the periodic texture-aware attention module, two independent adaptive linear predictors are constructed using a first prediction step size and a second prediction step size, respectively, with the first prediction step size being smaller than the second prediction step size. Calculate the prediction error distributions of the two predictors respectively to obtain the first error distribution and the second error distribution; The corresponding pixel location is marked as a true anomaly region only when the normalized error value of the corresponding pixel location in both the first error distribution and the second error distribution exceeds 0.
5. Regions that are marked as anomalous by only a single predictor are filtered as pseudo-anomalies.
6. The dual attention fusion detection method for port crane cable defect detection according to claim 1, characterized in that, It also includes a prediction coefficient drift tracking step: Record the prediction coefficient vector of the adaptive linear predictor within each sensing window along the direction of the steel cable axis to form a prediction coefficient sequence. The number of coefficients contained in each prediction coefficient vector is equal to twice the prediction step size. The cumulative drift is calculated as follows: the cumulative drift of the current sensing window is equal to the cumulative drift of the previous sensing window plus the average of the absolute values of the differences between each prediction coefficient of the current sensing window and the prediction coefficient of the corresponding position of the initial sensing window. The cumulative drift of the initial sensing window is set to 0. When the cumulative drift exceeds the preset drift threshold of 0.5, it is determined that the steel cable has overall degradation at the corresponding position of the sensing window, and a degradation warning signal containing the degradation location range and degradation degree is output. The calculation of cumulative drift is performed in parallel with defect detection, serving as an independent assessment dimension of the cable's health status.
7. The dual attention fusion detection method for port crane cable defect detection according to claim 1, characterized in that, The error-guided enhanced feature map output by the adaptive prediction error attention module is fused with the original multi-scale feature map via residual connections in the neck network. The error-guided enhanced feature map is added element-wise to the original multi-scale feature map, and then channel recalibration is performed through 1×1 convolution. The scaling factor of the residual connection is adaptively adjusted according to the signal-to-noise ratio of the prediction error distribution. The higher the signal-to-noise ratio, the greater the weight of the error-guided feature map.
8. The dual-attention fusion detection method for detecting defects in steel cables of port lifting and transportation equipment according to claim 1, characterized in that, It also includes a time-series verification step for the detection results: The defect detection results of five consecutive frames of surface images are aligned according to their spatial positions and stored to construct a spatiotemporal defect probability map. For each spatial location, the percentage of frames marked as defects in 5 consecutive frames is counted; When the percentage of frames exceeds 60%, the spatial location is identified as a stable defect and output. When the percentage of frames is less than 60%, the spatial location is marked as transient noise and not output.
9. A dual-attention fusion detection system for detecting defects in steel cables used in port lifting and transportation equipment, characterized in that, include: The image acquisition module is used to acquire surface images of the steel cables of the port lifting and transportation equipment to be inspected; The backbone network module includes a periodic texture-aware attention unit. The periodic texture-aware attention unit extracts the texture period parameters and texture direction parameters of the spiral texture on the surface of the steel cable along the spiral direction. It uses the texture period parameters and texture direction parameters to construct an adaptive linear predictor along the spiral direction. The adaptive linear predictor uses the upstream pixel values to predict the downstream pixel values and outputs a periodic texture prediction feature map. The neck network module includes an adaptive prediction error attention unit. The adaptive prediction error attention unit calculates the prediction error distribution between the periodic texture prediction feature map and the actual feature map, uses the statistical features of the prediction error distribution as attention weights, recalibrates the multi-scale features, and outputs an error-guided enhanced feature map. The detection head module is used to fuse the periodic texture prediction feature map with the error-guided enhanced feature map to output defect location information and category information; The output module is used to output defect location information and category information.