Image recognition-based underwater lining plate crack detection method and device
By combining multimodal preprocessing, multi-scale feature extraction, and bidirectional cross-Seg-LSTM modules, the problem of insufficient recognition capability in underwater lining plate crack detection is solved, and high-precision crack detection and parameter quantification are achieved.
Patent Information
- Application Number
- CN202610474407.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-11
- Publication Date
- 2026-07-10
Smart Images

Figure CN122367943A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of underwater lining plate crack technology, and in particular to an underwater lining plate crack detection method and apparatus based on image recognition. Background Technology
[0002] With the increasing demand for underwater engineering inspection, the automated identification and quantitative analysis of surface cracks in underwater lining plates has become an important technical direction in underwater structural safety assessment. Underwater lining plates are subjected to complex imaging environments characterized by high humidity, high pressure, low illumination, and significant interference from suspended particulate matter. The acquired images typically suffer from uneven brightness, low contrast, strong scattering noise, blurred textures, and local occlusion, resulting in cracks that appear thin, discontinuous, with weak edges and low resolution. When the crack width is small, the direction is complex, or it overlaps with the background texture, the grayscale and edge differences between the crack and non-crack areas are further weakened, posing significant challenges to subsequent crack identification, segmentation, and parameter measurement.
[0003] For underwater lining plate crack detection, traditional image processing methods such as manual inspection, threshold and edge operator-based methods, or deep learning methods such as convolutional neural networks and encoder-decoder segmentation networks are commonly used to extract crack regions. Traditional image processing methods are sensitive to changes in illumination, noise interference, and background texture changes, and are prone to missed cracks, false cracks, and crack boundary breaks in complex underwater environments. While existing deep learning segmentation methods can improve crack recognition accuracy to some extent, most methods mainly rely on local convolutional receptive fields for feature extraction, making it difficult to fully model the continuous structural relationship of slender cracks over a large spatial range. They also lack the ability to express the overall coherence of cracks that extend across regions, are partially occluded, or have weak contrast.
[0004] Existing segmentation networks often perform multiple downsampling or simple serialization of two-dimensional spatial information during feature encoding, which can weaken the spatial topological relationships in the original image, making it difficult to simultaneously preserve the structural correlation information of cracks in both the height and width directions. In the feature recovery stage, conventional interpolation upsampling or ordinary deconvolution methods have limited ability to recover crack edge details, easily causing problems such as blurred crack boundaries, breakage of minute cracks, and smoothing out of narrow crack structures. In subsequent processing of crack segmentation results, only coarse pixel-level segmentation results are provided, lacking sufficient ability to stably extract structural markings, edge refinement, and spatial distribution, length, and width parameters of cracks in connected crack regions. This makes it difficult to meet the actual needs of underwater lining plate crack detection for crack localization, quantitative analysis, and structured report output. Summary of the Invention
[0005] One objective of this invention is to propose a method and apparatus for detecting cracks in underwater lining plates based on image recognition. This invention can more completely express the long-distance continuous structural features of cracks in underwater lining plates, improve the identification ability of weak cracks, discontinuous cracks and low-contrast cracks, and reduce the probability of crack breakage, missed detection and local missegmentation.
[0006] An underwater lining plate crack detection method and apparatus based on image recognition according to an embodiment of the present invention includes:
[0007] The raw underwater lining plate image data was acquired and multimodal preprocessing was performed to obtain standardized underwater lining plate image data;
[0008] Standardized underwater lining plate image data is input into the encoder module. Multi-scale feature extraction is performed on the standardized underwater lining plate image data using the convolutional feature extraction unit and the depth-separable convolutional unit, and the initial spatial feature map is output.
[0009] The initial spatial feature map is converted into a first sequence feature representation according to the horizontal serialization scanning strategy, and then converted into a second sequence feature representation according to the vertical serialization scanning strategy. The first and second sequence feature representations are input into the bidirectional cross Seg-LSTM module. The bidirectional cross Seg-LSTM module shares a matrix memory structure and cross-gatedly merges the first and second sequence feature representations to obtain an enhanced sequence feature representation.
[0010] The enhanced sequence feature representation is deserialized and reconstructed to restore the enhanced two-dimensional feature map. The enhanced two-dimensional feature map and the initial spatial feature map are superimposed through residual memory backflow connection to generate a global context enhanced feature map.
[0011] The global context-enhanced feature map is input into the decoder module, which has a built-in edge confidence prediction head, channel expansion projection operator, and hierarchical variable step size PixelShuffle module, and the first resolution restoration stage, the second resolution restoration stage, and the third resolution restoration stage are executed sequentially:
[0012] In the first resolution recovery stage, after the edge confidence prediction head generates the first edge confidence weight map, the global context enhancement feature map is weighted and periodically rearranged using the hierarchical variable step size PixelShuffle module with a step size of four to generate the first-level high-resolution feature map.
[0013] In the second resolution recovery stage, after the edge confidence prediction head generates the second edge confidence weight map, the first-level high-resolution feature map is weighted and periodically rearranged using the hierarchical variable step size PixelShuffle module with a step size of two to generate the second-level high-resolution feature map.
[0014] In the third resolution recovery stage, after the edge confidence prediction head generates the third edge confidence weight map, the second-level high-resolution feature map is weighted and periodically rearranged using the hierarchical variable step size PixelShuffle module with a step size of one to generate the third-level high-resolution feature map after adaptive rearrangement.
[0015] The adaptively rearranged third-level high-resolution feature map is input into the crack segmentation prediction head to generate a crack segmentation prediction map.
[0016] A threshold mapping operation is performed on the crack segmentation prediction map to obtain a crack binarized segmentation mask. Connected regions are then labeled on the crack binarized segmentation mask, and the connected region labeling results are output.
[0017] The edge pixels of the connected region marking results are thinned using a morphological thinning operator to generate a processed crack mask. Based on the processed crack mask, the spatial distribution of cracks, crack length parameters, and crack width parameters are calculated, and the underwater lining plate crack detection report data is output.
[0018] Optionally, the acquisition of raw underwater lining plate image data undergoes multimodal preprocessing, including:
[0019] Raw underwater lining plate image data is collected by an underwater robot, and imaging time information and camera temperature metadata are recorded to generate raw underwater lining plate image data with time information and temperature metadata. Multimodal preprocessing is performed on the raw underwater lining plate image data with time information and temperature metadata to obtain standardized underwater lining plate image data.
[0020] Optionally, inputting the standardized underwater lining plate image data into the encoder module includes:
[0021] The standardized underwater lining plate image data is represented as a three-dimensional input tensor and input to the encoder module;
[0022] Within the encoder module, a multi-scale convolutional branch of the convolutional feature extraction unit is constructed. Each convolutional branch is used to perform a two-dimensional convolution operation on the three-dimensional input tensor to obtain a convolutional feature map.
[0023] Each convolutional feature map is input into the corresponding depthwise separable convolutional unit, and a channel-wise convolution operation is performed to obtain a channel-wise feature map.
[0024] Perform pointwise convolution operations on each channel feature map to obtain depthwise separable convolutional feature maps that correspond one-to-one with each convolutional branch.
[0025] Separable convolutional feature maps at different depths are sequentially stacked along the channel direction to form a fused multi-scale feature tensor, which is then output as the initial spatial feature map.
[0026] Optionally, inputting the first sequence feature representation and the second sequence feature representation into the bidirectional cross-Seg-LSTM module includes:
[0027] The initial spatial feature map is converted into a first sequence feature representation according to the horizontal serialization scanning strategy;
[0028] The initial spatial feature map is converted into a second sequence feature representation according to the vertical serialization scanning strategy;
[0029] The first sequence feature representation and the second sequence feature representation are input into the bidirectional cross-Seg-LSTM module. The bidirectional cross-Seg-LSTM module shares a matrix memory structure and cross-gatedly fuses the first sequence feature representation and the second sequence feature representation to obtain the bidirectional cross-fused state.
[0030] The bidirectional cross-fusion states are arranged according to the sequence position order of the first sequence feature representation to obtain the enhanced sequence feature representation.
[0031] Optionally, the deserialization reconstruction of the enhanced sequence feature representation includes:
[0032] The enhanced sequence feature representation is deserialized and reconstructed to restore the enhanced two-dimensional feature map;
[0033] The enhanced 2D feature map and the initial spatial feature map are superimposed using a residual memory backflow connection method to form a feature superposition result.
[0034] The feature overlay results at all spatial coordinate positions and channel positions are organized according to their corresponding spatial coordinate positions and channel positions to obtain a global context-enhanced feature map.
[0035] Optionally, the decoder module, which inputs the global context-enhanced feature map into the built-in edge confidence prediction head, channel expansion projection operator, and hierarchical variable step size PixelShuffle module, sequentially executes a first resolution recovery stage, a second resolution recovery stage, and a third resolution recovery stage, including:
[0036] The global context-enhanced feature map is input into the decoder module, which has a built-in edge confidence prediction head, channel expansion projection operator, and hierarchical variable step size PixelShuffle module, to perform the first resolution recovery stage and obtain the first-level high-resolution feature map.
[0037] A second resolution recovery stage is performed on the first-level high-resolution feature map to obtain the second-level high-resolution feature map;
[0038] A third resolution recovery stage is performed on the second-level high-resolution feature map to obtain the third-level high-resolution feature map after adaptive rearrangement.
[0039] Optionally, inputting the adaptively rearranged third-level high-resolution feature map into the crack segmentation prediction head includes:
[0040] The adaptively rearranged third-level high-resolution feature map is input into the crack segmentation prediction head to obtain the crack segmentation response map;
[0041] Pixel-level probability mapping is performed on the crack segmentation response map to obtain the crack segmentation prediction probability value;
[0042] The crack segmentation prediction probability values at all spatial coordinate locations are organized according to their corresponding spatial coordinate locations to generate a crack segmentation prediction map.
[0043] Optionally, performing a threshold mapping operation on the crack segmentation prediction map includes:
[0044] A threshold mapping operation is performed on the crack segmentation prediction map to obtain a crack binarization segmentation mask;
[0045] The crack binarized segmentation mask is used to mark the connected regions, and the connected region marking values are obtained.
[0046] Organize the connected component label values at all spatial coordinate positions according to their corresponding spatial coordinate positions, and output the connected component labeling results.
[0047] Optionally, the step of using morphological thinning operators to thin the edge pixels of the connected region labeling results includes:
[0048] The edge pixels of the connected region labeling results are thinned using morphological thinning operators to generate a processed crack mask that retains only a single-pixel width topological skeleton.
[0049] Based on the spatial distribution range of the set of spatial coordinates corresponding to each independent connected volume of cracks in the processed crack mask, the spatial distribution result of cracks is calculated.
[0050] Based on the set of spatial coordinates corresponding to each independent connected body of crack in the processed crack mask, geometric dimension statistics are performed to obtain crack length parameter information and crack width parameter information.
[0051] The spatial distribution results of cracks, crack length parameters, and crack width parameters are organized according to the index order of independent connected cracks to generate underwater lining plate crack detection report data.
[0052] An underwater lining plate crack detection device based on image recognition, characterized in that the detection device includes a processor, a memory, and a communication interface;
[0053] The communication interface is used for communication between the detection device and other equipment;
[0054] The memory is used to store one or more programs, which include computer-executable instructions. When the detection device is running, the processor executes the computer-executable instructions stored in the memory to enable the detection device to perform an image recognition-based underwater lining plate crack detection method.
[0055] The beneficial effects of this invention are:
[0056] (1) This invention converts the initial spatial feature map into a first sequence feature representation according to a horizontal sequential scanning strategy, and converts the initial spatial feature map into a second sequence feature representation according to a vertical sequential scanning strategy. The first and second sequence feature representations are then input into a bidirectional cross-Seg-LSTM module. Within the bidirectional cross-Seg-LSTM module, a shared matrix memory structure is used, and the first and second sequence feature representations are cross-gated and fused to obtain an enhanced sequence feature representation. This can simultaneously preserve the continuous structural relationship of underwater lining plate cracks in both the height and width directions. By continuously accumulating the cross-correlation information between the first and second sequence feature representations through the shared matrix memory structure, and by jointly modeling the horizontal and vertical contexts at the same spatial coordinate position through the cross-gated fusion mechanism, the enhanced sequence feature representation can more completely express the long-distance continuous structural features of underwater lining plate cracks, improve the identification ability of weak cracks, discontinuous cracks, and low-contrast cracks, and reduce the probability of crack breakage, missed detection, and local missegmentation.
[0057] (2) This invention deserializes and reconstructs the enhanced sequence feature representation to restore the enhanced two-dimensional feature map. Then, the enhanced two-dimensional feature map and the initial spatial feature map are superimposed through residual memory backflow connection to generate a global context enhanced feature map. The first resolution recovery stage, the second resolution recovery stage and the third resolution recovery stage are executed sequentially in the decoder module. In each resolution recovery stage, the edge confidence prediction head generates the corresponding edge confidence weight map. Then, the hierarchical variable step size PixelShuffle module is combined to perform periodic channel rearrangement based on edge prior, which can significantly enhance the crack edge detail recovery capability and high resolution reconstruction capability. By using an edge confidence prediction head, spatial and channel joint edge confidence prediction is performed on the global context-enhanced feature map, the first-level high-resolution feature map, and the second-level high-resolution feature map. This ensures that each resolution recovery stage completes edge salient region enhancement before entering the hierarchical variable step size PixelShuffle module. Then, the first-channel extended projection operator, the second-channel extended projection operator, and the third-channel adaptive projection operator are used to generate transition feature maps that meet the corresponding rearrangement channel requirements. Finally, progressive high-resolution recovery and adaptive rearrangement are completed at different recovery scales, thereby improving the crack boundary localization accuracy, crack detail fidelity, and segmentation stability in complex underwater backgrounds.
[0058] (3) This invention inputs the adaptively rearranged third-level high-resolution feature map into the crack segmentation prediction head to obtain the crack segmentation response map, then performs pixel-level probability mapping on the crack segmentation response map to obtain the crack segmentation prediction probability value, and further performs threshold mapping operation on the crack segmentation prediction map to obtain the crack binarization segmentation mask, then marks the connected regions of the crack binarization segmentation mask to obtain the connected region marking value, and then uses the morphological thinning operator to perform edge pixel thinning processing on the connected region marking result to generate the processed crack mask. Finally, based on the processed crack mask, the crack spatial distribution result, crack length parameter information and crack width parameter information are calculated, and the underwater lining plate crack detection report data is output. This can improve the crack detection result from a simple pixel-level segmentation result to a detection result data with structural expression ability and parameter quantification ability. By using preset thresholds, connected region marking, eight-connected neighborhood topology rules, and morphological refinement operators, the independent connected cracks in the processed crack mask are made clearer, the edges are more regular, and the geometric shape is more stable. Based on this, the crack spatial distribution results, crack length parameter information, and crack width parameter information obtained have higher consistency and readability, thereby improving the engineering application value of underwater lining plate crack detection report data. Attached Figure Description
[0059] 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:
[0060] Figure 1 This is a flowchart of an underwater lining plate crack detection method and device based on image recognition proposed in this invention;
[0061] Figure 2 This is a model framework diagram of the bidirectional cross-Seg-LSTM module in the underwater lining plate crack detection method and device based on image recognition proposed in this invention. Detailed Implementation
[0062] Example 1: Reference Figures 1-2 A method and apparatus for detecting cracks in underwater lining slabs based on image recognition, comprising:
[0063] The raw underwater lining plate image data was acquired and multimodal preprocessing was performed to obtain standardized underwater lining plate image data;
[0064] In this embodiment, the acquired raw underwater lining plate image data is subjected to multimodal preprocessing, including:
[0065] Raw underwater lining plate image data is collected by an underwater robot, and imaging time information and camera temperature metadata are recorded to generate raw underwater lining plate image data with time information and temperature metadata. Multimodal preprocessing is performed on the raw underwater lining plate image data with time information and temperature metadata to obtain standardized underwater lining plate image data.
[0066] Multimodal preprocessing operations include equalization correction of illumination distribution, uniform mapping of color space, suppression of scattering noise, and contrast enhancement.
[0067] Standardized underwater lining plate image data is input into the encoder module. Multi-scale feature extraction is performed on the standardized underwater lining plate image data using the convolutional feature extraction unit and the depth-separable convolutional unit, and the initial spatial feature map is output.
[0068] In this embodiment, the standardized underwater lining plate image data is input to the encoder module, including:
[0069] The standardized underwater lining plate image data is represented as a three-dimensional input tensor and input to the encoder module;
[0070] Within the encoder module, a multi-scale convolutional branch of the convolutional feature extraction unit is constructed. Each convolutional branch is used to perform a two-dimensional convolution operation on the three-dimensional input tensor to obtain a convolutional feature map.
[0071] In Example 1, the convolutional feature extraction unit includes multiple convolutional branches. Each convolutional branch corresponds to the convolutional kernel size in a set of convolutional kernels. The convolutional kernel size adopts a square structure with different side lengths to form a multi-scale set of convolutional kernels. The convolutional stride of all convolutional branches is set to 1, and the convolutional padding value of all convolutional branches is set to the result obtained by subtracting 1 from the side length of the corresponding convolutional kernel and then dividing by 2.
[0072] By performing element-wise convolution of the kernel weight parameters of the corresponding convolutional branch with the three-dimensional input tensor and superimposing the corresponding bias parameters, a convolutional feature map corresponding to each convolutional branch is obtained. Each convolutional feature map represents the spatial response result of the standardized underwater lining plate image data at the corresponding convolutional kernel scale.
[0073] Each convolutional feature map is input into the corresponding depthwise separable convolutional unit, and a channel-wise convolution operation is performed to obtain a channel-wise feature map.
[0074] In Example 1, each input channel in each convolutional feature map is processed independently. A channel-wise convolutional kernel corresponding to each input channel is set. Within the spatial neighborhood covered by the channel-wise convolutional kernel, all pixel values at the corresponding position of the input channel are multiplied element-wise with the weight parameters in the channel-wise convolutional kernel. The multiplication results are accumulated and summed to generate corresponding channel-wise feature values at each spatial position of the input channel. The channel-wise feature values generated at each spatial position of all input channels are arranged in the original channel order to form a channel-wise feature map with the same number of channels as the convolutional feature map.
[0075] Perform pointwise convolution operations on each channel feature map to obtain depthwise separable convolutional feature maps that correspond one-to-one with each convolutional branch.
[0076] Separable convolutional feature maps at different depths are sequentially stacked along the channel direction to form a fused multi-scale feature tensor, which is then output as the initial spatial feature map.
[0077] The initial spatial feature map is converted into a first sequence feature representation according to the horizontal serialization scanning strategy, and then converted into a second sequence feature representation according to the vertical serialization scanning strategy. The first and second sequence feature representations are input into the bidirectional cross Seg-LSTM module. The bidirectional cross Seg-LSTM module shares a matrix memory structure and cross-gatedly merges the first and second sequence feature representations to obtain an enhanced sequence feature representation.
[0078] In this embodiment, the first sequence feature representation and the second sequence feature representation are input into the bidirectional cross-Seg-LSTM module, including:
[0079] The initial spatial feature map is converted into a first sequence feature representation according to the horizontal serialization scanning strategy;
[0080] In Example 1, the initial spatial feature map is scanned line by line. The position indexes of the initial spatial feature map in the height direction and the position indexes in the width direction are traversed in the order of height first and then width. During the traversal, the channel feature vectors of the initial spatial feature map at the corresponding spatial coordinate positions are arranged in the scanning order to obtain the first sequence feature representation.
[0081] The first sequence feature representation is a one-dimensional sequence structure formed by sequentially expanding the channel feature vectors of all spatial coordinate positions in the initial spatial feature map according to the horizontal serialization scanning strategy. Each sequence position corresponds to a unique spatial coordinate position in the initial spatial feature map.
[0082] The initial spatial feature map is converted into a second sequence feature representation according to the vertical serialization scanning strategy;
[0083] In Example 1, the initial spatial feature map is scanned column by column. The position indexes of the initial spatial feature map in the width direction and the position indexes in the height direction are traversed in the order of width direction first and height direction second. During the traversal, the channel feature vectors of the initial spatial feature map at the corresponding spatial coordinate positions are arranged in the scanning order to obtain the second sequence feature representation.
[0084] The first sequence feature representation and the second sequence feature representation are input into the bidirectional cross-Seg-LSTM module. The bidirectional cross-Seg-LSTM module shares a matrix memory structure and cross-gatedly fuses the first sequence feature representation and the second sequence feature representation to obtain the bidirectional cross-fused state.
[0085] In Example 1, for any sequence position in the first sequence feature representation, the corresponding sequence position in the second sequence feature representation is determined based on the spatial coordinate position corresponding to the sequence position. The channel feature vector that is exactly the same as the spatial coordinate position is extracted from the second sequence feature representation to obtain the first sequence current input feature and the second sequence current input feature after spatial coordinate position alignment.
[0086] After completing the spatial coordinate alignment, the current input features of the first sequence and the current input features of the second sequence after spatial coordinate alignment are simultaneously input into the bidirectional cross Seg-LSTM module. A shared matrix memory structure is established inside the bidirectional cross Seg-LSTM module, and cross-gated fusion is performed in the forward sequence processing direction and the reverse sequence processing direction, respectively.
[0087] The forward sequence processing direction represents the direction of processing sequentially from the start position to the end position according to the sequence position, and the reverse sequence processing direction represents the direction of processing sequentially from the end position to the start position according to the sequence position. The shared matrix memory structure is used to store the matrix structure of the cross-correlation relationship between the first sequence feature representation and the second sequence feature representation.
[0088] In any sequence processing direction, corresponding sequence branches are constructed for the current input features of the first sequence and the current input features of the second sequence. For each sequence branch, at the current sequence position, a cross-association vector corresponding to the current sequence branch at the current sequence position is generated based on the cross-fusion state of the current sequence branch at the adjacent sequence position and the historical information of the other sequence branch at the adjacent sequence position stored in the shared matrix memory structure.
[0089] ;
[0090] in, Indicates the branch with the current sequence. A different branch index of another sequence; Indicates the direction of sequence processing Next adjacent sequence position The shared matrix memory structure at the location; Indicates another sequence branch In adjacent sequence positions The state of cross-fusion at the location, This represents the cross-association vector. The cross-association vector corresponding to the current sequence branch at its current sequence position, the input features of the current sequence branch at its current sequence position, and the cross-fusion state of the current sequence branch at adjacent sequence positions are jointly calculated to obtain the cross-gating vector and candidate fusion state corresponding to the current sequence branch at its current sequence position.
[0091] ;
[0092] ;
[0093] in, Indicates sequence branching In sequence processing direction Next sequence position The corresponding cross-gating vector at that location; Indicates sequence branching In sequence processing direction Next sequence position At the corresponding candidate fusion state, This represents the Sigmoid function acting on the cross-gated vector. This represents the hyperbolic tangent function acting on the candidate fusion state. Indicates the sequence branching In sequence processing direction Next sequence position The input features at a given location are mapped to weight parameters in the cross-gated vector space. Indicates the sequence branching In sequence processing direction The cross-fusion state at the next adjacent sequence position is mapped to the weight parameters in the cross-gating vector space. Indicates the sequence branching In sequence processing direction Next sequence position The weight parameters that map the cross-correlation vectors at a given location to the cross-gated vector space. Indicates sequence branching In sequence processing direction The bias parameters corresponding to the lower cross gate vector Indicates the sequence branching In sequence processing direction Next sequence position The input features at a given location are mapped to weight parameters in the candidate fusion state space. Indicates the sequence branching In sequence processing direction The weight parameters that map the cross-fusion state at the next adjacent sequence position to the candidate fusion state space. Indicates the sequence branching In sequence processing direction Next sequence position The cross-correlation vector at a given point is mapped to the weight parameters of the candidate fusion state space. Indicates sequence branching In sequence processing direction The bias parameters corresponding to the next candidate fusion state Indicates sequence branching In sequence position The corresponding input features at that location, Indicates sequence branching In sequence processing direction Next adjacent sequence position The state of cross-fusion at the location, Indicates sequence branching In sequence processing direction Next sequence position The corresponding cross-association vector at that location, This represents the sequence branch index, used to distinguish between the first sequence branch and the second sequence branch. Indicates the sequence processing direction index, where Indicates the forward sequence processing direction. Indicates the direction of reverse sequence processing. Indicates the sequence position index. Indicates the direction of sequence processing Next sequence position The corresponding adjacent sequence position index function.
[0094] The candidate fusion state corresponding to the current sequence branch at the current sequence position and the cross-association vector corresponding to the current sequence branch at the current sequence position are weighted and fused using the cross-gating vector corresponding to the current sequence branch at the current sequence position to obtain the cross-fusion state of the current sequence branch at the current sequence position.
[0095] ;
[0096] in, Indicates a cross-integration status. This represents the cross-association vector.
[0097] The shared matrix memory structure is updated using the outer product of the cross-fusion state corresponding to the first sequence feature representation and the cross-fusion state corresponding to the second sequence feature representation. Spatial information between the first sequence feature representation and the second sequence feature representation is continuously accumulated in the shared matrix memory structure. By performing the cross-gated fusion process in the forward sequence processing direction and the reverse sequence processing direction respectively, the bidirectional cross-fusion state is obtained.
[0098] ;
[0099] in, Indicates the direction of sequence processing Next sequence position The corresponding shared matrix memory structure, Indicates the direction of sequence processing Next adjacent sequence position The corresponding shared matrix memory structure, Indicates the direction of sequence processing Next sequence position The retention coefficients of the corresponding shared matrix memory structure at that location Indicates the direction of sequence processing Next sequence position The write coefficients of the corresponding shared matrix memory structure at that location. Indicates the first sequence branch in the sequence processing direction. Next sequence position The corresponding cross-fusion state, This indicates the second sequence branch in the sequence processing direction. Next sequence position The corresponding cross-fusion state.
[0100] The bidirectional cross-fusion states are arranged according to the sequence position order of the first sequence feature representation to obtain the enhanced sequence feature representation.
[0101] In Example 1, for any sequence position in the first sequence feature representation, the cross-fusion states corresponding to the first sequence feature representation obtained in the forward sequence processing direction and the cross-fusion states corresponding to the second sequence feature representation obtained in the reverse sequence processing direction are concatenated according to the feature dimension to obtain an enhanced sequence feature vector. The enhanced sequence feature vectors corresponding to all sequence positions are arranged sequentially according to the sequence position order of the first sequence feature representation to form an enhanced sequence feature representation, which is used to represent the sequence feature representation that integrates spatial related information and bidirectional sequence processing direction information under the horizontal and vertical serialization scanning strategies.
[0102] Compared to conventional Seg-LSTM modules (which typically only roughly flatten a two-dimensional image into a one-dimensional sequence for unidirectional processing, or use multi-branch independent processing, with each branch having its own independent memory matrix and gating computation relying only on the context of its own branch), the substantial improvement of the bidirectional cross-connected Seg-LSTM module in this implementation lies in: constructing a shared matrix memory structure and cross-gating fusion connection; extracting adjacent hidden states of another sequence branch during gating computation to generate cross-correlation vectors to participate in nonlinear activation; and using the outer product of the current hidden states of the first and second sequences to calculate the spatiotemporal covariance, overcoming the limitations of traditional methods. Conventional Seg-LSTM is prone to tearing up the two-dimensional topological spatial relationships of images during serialization dimensionality reduction due to its inherent technical bias. This forces the network to calculate and memorize the global cross-response of the horizontal and vertical contexts at every physical coordinate point of the underwater lining plate. This endows the system with strong cross-dimensional spatiotemporal fault tolerance, enabling the model to still achieve high-precision topological stitching and continuity extraction at the underlying semantic features when facing harsh physical environments such as extremely low underwater contrast, severe light scattering, and a large number of suspended objects. This is achieved by sharing covariance memory and using the network to extract the weak and thin cracks that appear to be broken by water noise at the underlying semantic features.
[0103] The enhanced sequence feature representation is deserialized and reconstructed to restore the enhanced two-dimensional feature map. The enhanced two-dimensional feature map and the initial spatial feature map are superimposed through residual memory backflow connection to generate a global context enhanced feature map.
[0104] In this embodiment, the enhanced sequence feature representation is deserialized and reconstructed, including:
[0105] The enhanced sequence feature representation is deserialized and reconstructed to restore the enhanced two-dimensional feature map;
[0106] In Example 1, each sequence position in the enhanced sequence feature representation is mapped back to the corresponding spatial coordinate position in the initial spatial feature map according to the sequence position order of the first sequence feature representation. During the mapping process, the enhanced sequence feature vector of the enhanced sequence feature representation at the corresponding sequence position is filled into the channel dimension at the corresponding spatial coordinate position to obtain the transitional two-dimensional feature map.
[0107] By using pointwise convolution kernels to perform channel dimension projection on the transition 2D feature map, the number of channels is mapped to the same feature dimension as the initial spatial feature map, resulting in an enhanced 2D feature map.
[0108] The enhanced 2D feature map and the initial spatial feature map are superimposed using a residual memory backflow connection method to form a feature superposition result.
[0109] In Example 1, the residual memory backflow connection method means that the enhanced two-dimensional feature map is used as the residual memory backflow branch, and the initial spatial feature map is used as the main branch. When the spatial and channel dimensions of the two are completely aligned, the feature values of the enhanced two-dimensional feature map and the initial spatial feature map at the same spatial coordinate position and channel position are added element by element.
[0110] The feature overlay results at all spatial coordinate positions and channel positions are organized according to their corresponding spatial coordinate positions and channel positions to obtain a global context-enhanced feature map.
[0111] The global context-enhanced feature map is input into the decoder module, which has a built-in edge confidence prediction head, channel expansion projection operator, and hierarchical variable step size PixelShuffle module, and the first resolution restoration stage, the second resolution restoration stage, and the third resolution restoration stage are executed sequentially:
[0112] In the first resolution recovery stage, after the edge confidence prediction head generates the first edge confidence weight map, the global context enhancement feature map is weighted and periodically rearranged using the hierarchical variable step size PixelShuffle module with a step size of four to generate the first-level high-resolution feature map.
[0113] In the second resolution recovery stage, after the edge confidence prediction head generates the second edge confidence weight map, the first-level high-resolution feature map is weighted and periodically rearranged using the hierarchical variable step size PixelShuffle module with a step size of two to generate the second-level high-resolution feature map.
[0114] In the third resolution recovery stage, after the edge confidence prediction head generates the third edge confidence weight map, the second-level high-resolution feature map is weighted and periodically rearranged using the hierarchical variable step size PixelShuffle module with a step size of one to generate the third-level high-resolution feature map after adaptive rearrangement.
[0115] In this embodiment, the global context-enhanced feature map is input to the decoder module, which has a built-in edge confidence prediction head, channel expansion projection operator, and hierarchical variable step size PixelShuffle module, and the first resolution recovery stage, the second resolution recovery stage, and the third resolution recovery stage are executed sequentially, including:
[0116] The global context-enhanced feature map is input into the decoder module, which has a built-in edge confidence prediction head, channel expansion projection operator, and hierarchical variable step size PixelShuffle module, to perform the first resolution recovery stage and obtain the first-level high-resolution feature map.
[0117] In Example 1, the first resolution recovery stage involves setting a first edge confidence prediction head, a first channel extended projection operator, and a hierarchical variable step size PixelShuffle module with a step size of four inside the decoder module. The first edge confidence prediction head performs spatial and channel joint edge confidence prediction on the global context enhancement feature map to obtain a first edge confidence weight map with the same dimension as the global context enhancement feature map.
[0118] The first edge confidence weight map and the global context enhancement feature map are weighted element-wise at the same spatial coordinates and channel positions to obtain the weighted global context enhancement feature map.
[0119] The first channel extension projection operator is used to reshape the weighted global context enhancement feature map to generate a first transition feature map that meets the first rearrangement channel number requirement. The first transition feature map is input into the hierarchical variable step size PixelShuffle module with a step size of four to perform periodic channel rearrangement based on edge prior, and obtain the first-level high-resolution feature map.
[0120] The resolution of the first-level high-resolution feature map is restored to four times that of the corresponding global context-enhanced feature map in both the height and width directions.
[0121] ;
[0122] ;
[0123] ;
[0124] ;
[0125] in, Represents the global context-enhanced feature map. This represents the first edge confidence weighting plot. This represents the weighted global context-enhanced feature map. This represents the first transition feature map. This represents the first-level high-resolution feature map. This indicates the first marginal confidence prediction head. This represents the Sigmoid activation function. This indicates element-wise multiplication. This represents the first channel extended projection operator. This indicates a hierarchical, variable-step PixelShuffle module with a step size of four. Represents the set of real numbers. , Represents the input feature map The initial spatial pixel height and width, This represents the number of channels in the global context-enhanced feature map. Represents the first transition feature map The number of reshaped channels, , This represents the pixel height and pixel width of the first-level high-resolution feature map. This indicates the number of reshaped channels in the channel dimension. This represents the three-dimensional real-valued feature tensor space corresponding to the first-level high-resolution feature map.
[0126] A second resolution recovery stage is performed on the first-level high-resolution feature map to obtain the second-level high-resolution feature map;
[0127] In Example 1, within the decoder module, a second edge confidence prediction head, a second channel extended projection operator, and a hierarchical variable step size PixelShuffle module with a step size of two are set. The second edge confidence prediction head performs spatial and channel joint edge confidence prediction on the first-level high-resolution feature map to obtain a second edge confidence weight map with the same dimension as the first-level high-resolution feature map.
[0128] The second edge confidence weight map and the first-level high-resolution feature map are weighted element-wise at the same spatial coordinates and channel positions to obtain the weighted first-level high-resolution feature map.
[0129] The second channel extension projection operator is used to reshape the channels of the weighted first-level high-resolution feature map to generate a second transition feature map that meets the channel number requirement of the second rearrangement. The second transition feature map is then input into the hierarchical variable step size PixelShuffle module with a step size of two to perform periodic channel rearrangement based on edge priors to obtain the second-level high-resolution feature map.
[0130] The resolution of the second-level high-resolution feature map is restored to twice the resolution of the corresponding first-level high-resolution feature map in both the height and width directions.
[0131] A third resolution recovery stage is performed on the second-level high-resolution feature map to obtain the third-level high-resolution feature map after adaptive rearrangement.
[0132] In Example 1, within the decoder module, a third edge confidence prediction head, a third channel adaptive projection operator, and a hierarchical variable step size PixelShuffle module with a step size of one are set. The third edge confidence prediction head performs spatial and channel joint edge confidence prediction on the second-level high-resolution feature map to obtain a third edge confidence weight map with the same dimension as the second-level high-resolution feature map.
[0133] The third edge confidence weight map and the second-level high-resolution feature map are weighted element-wise at the same spatial coordinates and channel positions to obtain the weighted second-level high-resolution feature map.
[0134] The third-channel adaptive projection operator is used to reshape the channels of the weighted second-level high-resolution feature map to generate a third transition feature map that meets the requirement of adaptive rearrangement channel number. The third transition feature map is then input into a hierarchical variable-step PixelShuffle module with a step size of one. Under the condition that the spatial resolution remains unchanged, the channel space exchange mechanism of sub-pixel convolution is used to perform weighted periodic channel rearrangement based on edge prior on the third transition feature map to obtain the adaptively rearranged third-level high-resolution feature map.
[0135] The resolution of the third-level high-resolution feature map after adaptive rearrangement is consistent with that of the second-level high-resolution feature map in both the height and width directions.
[0136] The adaptively rearranged third-level high-resolution feature map is input into the crack segmentation prediction head to generate a crack segmentation prediction map.
[0137] In this embodiment, the adaptively rearranged third-level high-resolution feature map is input into the crack segmentation prediction head, including:
[0138] The adaptively rearranged third-level high-resolution feature map is input into the crack segmentation prediction head to obtain the crack segmentation response map;
[0139] In Example 1, inside the crack segmentation prediction head, the pixel-level classification mapping unit is used to perform point-by-point convolutional channel mapping on the adaptively rearranged third-level high-resolution feature map, and the multi-channel feature vector at each spatial coordinate position is linearly projected into the crack segmentation response value at the corresponding spatial coordinate position to obtain the crack segmentation response map.
[0140] Pixel-level probability mapping is performed on the crack segmentation response map to obtain the crack segmentation prediction probability value;
[0141] In Example 1, the crack segmentation response value at each spatial coordinate position in the crack segmentation response map is nonlinearly mapped position by position. The normalized exponential activation function is used to convert the crack segmentation response value at each spatial coordinate position into the crack segmentation prediction probability value at the corresponding spatial coordinate position in the (0,1) interval.
[0142] The crack segmentation prediction probability values at all spatial coordinate locations are organized according to their corresponding spatial coordinate locations to generate a crack segmentation prediction map.
[0143] In Example 1, the crack segmentation prediction probability values at all spatial coordinate positions are arranged according to the spatial arrangement of the adaptively rearranged third-level high-resolution feature map to form a crack segmentation prediction map with the same spatial resolution as the adaptively rearranged third-level high-resolution feature map.
[0144] A threshold mapping operation is performed on the crack segmentation prediction map to obtain a crack binarized segmentation mask. Connected regions are then labeled on the crack binarized segmentation mask, and the connected region labeling results are output.
[0145] In this embodiment, a threshold mapping operation is performed on the crack segmentation prediction map, including:
[0146] A threshold mapping operation is performed on the crack segmentation prediction map to obtain a crack binarization segmentation mask;
[0147] In Example 1, the preset threshold is determined by iterating and comparing the crack segmentation prediction probability values corresponding to the pre-labeled sample set. It is obtained by calculating the ratio of the total number of pixels in the intersecting and overlapping areas between the predicted mask and the real labeled mask to the total number of pixels in the joint area of the two, and the candidate threshold that maximizes the ratio is selected as the preset threshold.
[0148] The crack segmentation prediction probability value at each spatial coordinate position in the crack segmentation prediction map is compared with a preset threshold position by position. When the crack segmentation prediction probability value is greater than or equal to the preset threshold, the output value at the corresponding spatial coordinate position is mapped to one. When the crack segmentation prediction probability value is less than the preset threshold, the output value at the corresponding spatial coordinate position is mapped to zero, thus obtaining a two-dimensional matrix form of crack binarization segmentation mask composed of elements with values of zero or one.
[0149] The crack binarized segmentation mask is used to mark the connected regions, and the connected region marking values are obtained.
[0150] In Example 1, connectivity traversal is performed on all spatial coordinate positions with a value of one in the crack binarization segmentation mask. Based on the eight-connected neighborhood topology rule, spatial coordinate positions with connectivity are merged into the same connected region. Based on the transitivity of connectivity, all sets of spatial coordinate positions that satisfy the eight-connected neighborhood topology rule are classified into the same independent connected body. A unique positive integer label value is assigned to each independent connected region. At the same time, the label value of the background region spatial coordinate positions with a value of zero is kept at zero, thus obtaining the connected region label value.
[0151] The octagonal neighborhood topology rule is defined as follows: For any two spatial coordinate positions with a value of one in the binary segmentation mask of the crack, if the maximum value of the absolute value of the difference between their coordinate indices in the height direction and the absolute value of the difference between their coordinate indices in the width direction is less than or equal to one, then these two spatial coordinate positions are determined to be octagonal neighbors of each other and have a connectivity relationship, and are thus assigned the same integer label value.
[0152] Organize the connected component label values at all spatial coordinate positions according to their corresponding spatial coordinate positions, and output the connected component labeling results.
[0153] In Example 1, the connected region marker values at all spatial coordinate positions are arranged according to the spatial arrangement of the crack binarization segmentation mask to form a connected region marker result that is consistent with the spatial resolution of the crack binarization segmentation mask.
[0154] The connected component labeling result is a two-dimensional natural number matrix. The pixel height and width of the two-dimensional natural number matrix are consistent with the crack binarization segmentation mask. The non-zero different natural number elements in the matrix represent different independent connected component numbers of the crack, and the elements with a value of zero in the matrix represent non-crack background regions.
[0155] The edge pixels of the connected region marking results are thinned using a morphological thinning operator to generate a processed crack mask. Based on the processed crack mask, the spatial distribution of cracks, crack length parameters, and crack width parameters are calculated, and the underwater lining plate crack detection report data is output.
[0156] In this embodiment, the edge pixel thinning process of the connected region labeling result is performed using a morphological thinning operator, including:
[0157] The edge pixels of the connected region labeling results are thinned using morphological thinning operators to generate a processed crack mask that retains only a single-pixel width topological skeleton.
[0158] In Example 1, morphological thinning iteration is performed on the spatial coordinate positions corresponding to all non-zero marker values in the connected region marking results. During the thinning process, the connectivity relationship of each independent connected body of the crack remains unchanged, and redundant pixels at the crack edges are gradually removed to generate the processed crack mask.
[0159] Based on the spatial distribution range of the set of spatial coordinates corresponding to each independent connected volume of cracks in the processed crack mask, the spatial distribution result of cracks is calculated.
[0160] In Example 1, the spatial coordinate positions corresponding to all non-zero marker values in the processed crack mask are grouped and statistically analyzed. Spatial coordinate positions with the same marker value are divided into spatial coordinate sets corresponding to independent connected bodies of the same crack. The minimum and maximum position indices in the height direction and the minimum and maximum position indices in the width direction of each spatial coordinate set are extracted to obtain the crack spatial distribution results used to characterize the physical bounding box boundary.
[0161] Based on the set of spatial coordinates corresponding to each independent connected body of crack in the processed crack mask, geometric dimension statistics are performed to obtain crack length parameter information and crack width parameter information.
[0162] In Example 1, the length and width of the spatial coordinate set corresponding to each independent connected crack are statistically analyzed. In the length analysis, the actual physical distance between adjacent spatial coordinate positions is accumulated pixel by pixel along the connected path of the single-pixel width topological skeleton corresponding to the independent connected crack in the processed crack mask. For pixel pairs that are horizontally or vertically adjacent, one unit physical pixel size is accumulated. For pixel pairs that are diagonally adjacent, one unit physical pixel size is accumulated multiplied by the square root of two. The sum of the accumulated distances of all path pixel pairs is used as the crack length parameter information of the corresponding independent connected crack.
[0163] In the width statistics, the total number of spatial coordinate positions contained in the independent connected volume of the same crack in the connected region marking results is counted as the total area of connected pixels. By calculating the ratio of the total area of connected pixels to the corresponding crack length parameter information and multiplying it by the unit physical pixel size, the crack width parameter information of the corresponding independent connected volume of the crack is obtained.
[0164] The spatial distribution results of cracks, crack length parameters, and crack width parameters are organized according to the index order of independent connected cracks to generate underwater lining plate crack detection report data.
[0165] In Example 1, the spatial distribution results, crack length parameter information, and crack width parameter information of each independently connected crack obtained after processing are structurally mapped and associated with the imaging time information and camera temperature metadata of the corresponding original underwater lining plate image data to generate a comprehensive underwater lining plate crack detection report data containing geometric damage features and underwater acquisition environment context.
[0166] An underwater lining plate crack detection device based on image recognition, characterized in that the detection device includes a processor, a memory, and a communication interface;
[0167] The communication interface is used for communication between the detection device and other equipment;
[0168] The memory is used to store one or more programs, which include computer-executable instructions. When the detection device is running, the processor executes the computer-executable instructions stored in the memory to enable the detection device to perform an image recognition-based underwater lining plate crack detection method.
[0169] Example 2: During a continuous underwater inspection cycle, the system received a batch of lining plate image data collected by an underwater camera device, containing 1280 images with a resolution of 1024×1024 pixels. The images showed significant water scattering noise, an average grayscale contrast ratio of 0.21, and crack widths ranging from 1 to 6 pixels. Approximately 37% of the cracks exhibited breakage or obstruction.
[0170] After the data enters the processing flow, the system normalizes the original image, scaling the pixel values to the 0–1 range. At the same time, it uses median filtering to remove high-frequency noise, with the filter window size set to 5×5. The signal-to-noise ratio of the processed image is improved from the original 14.2dB to 18.7dB.
[0171] The image is input to the encoder module for feature extraction. In the convolutional feature extraction unit, the system uses three sets of convolutional kernels with different scales: 3×3, 5×5, and 7×7, to extract multi-scale responses from the image. After convolution calculation, feature maps of three scales are generated, with 32, 64, and 96 channels, respectively. These features are then fed into a depthwise separable convolutional unit, where the channel features are further decoupled and compressed to a uniform channel dimension of 128, ultimately forming an initial spatial feature map with dimensions of 256×256×128.
[0172] During the sequence modeling phase, the system unfolds the initial spatial feature map according to a horizontal serialization scanning strategy. Specifically, it scans row by row, converting each position in the 256×256 space into a sequence position, with a total sequence length of 65536. Each sequence position corresponds to a 128-dimensional feature vector. Simultaneously, it scans column by column according to a vertical serialization scanning strategy to generate a second sequence feature representation, also with a length of 65536.
[0173] In the bidirectional cross-Seg-LSTM module, the system aligns the spatial coordinates of the two sequences. For example, at a certain position in the sequence, corresponding to the spatial coordinates (120, 87), the system extracts the feature vector of the position in the first sequence, and at the same time finds the corresponding spatial coordinate position in the second sequence and extracts the corresponding features to form a paired input.
[0174] During forward sequence processing, the system records the cross-fusion state of adjacent sequence positions. For example, at sequence position 12000, the system extracts the historical state from the previous position 11999 and, together with the cross-branch information in the shared matrix memory, calculates the current cross-association vector. The mean of the cross-association vector is 0.43, and the variance is 0.12, which is significantly higher than the mean of 0.18 in the background region.
[0175] The current input features are fused using a cross-gating mechanism. At the specified location, the average gating value is 0.67, indicating that the current state is more biased towards the new input features. The resulting cross-fused state vector shows a significantly enhanced feature response in the crack region, with an average response value of 0.81, while the background region has a response value of 0.29.
[0176] After completing the entire sequence traversal, the system further supplements the contextual information through reverse processing, thereby increasing the overall information entropy of the final enhanced sequence feature representation from the original 3.12 to 4.87.
[0177] The system performs deserialization and reconstruction on the enhanced sequence feature representation. During the reconstruction process, the sequence positions are mapped back to two-dimensional space one by one. For example, sequence position 35000 is mapped back to spatial coordinates (137, 88), and the corresponding feature is filled into that position. After the mapping is completed, a transitional two-dimensional feature map with a size of 256×256×256 is formed.
[0178] Channel projection is performed using pointwise convolution, compressing the number of channels from 256 to 128 to form an enhanced 2D feature map. This enhanced 2D feature map is then element-wise added to the initial spatial feature map to form a global context-enhanced feature map. After stacking, the feature intensity of the crack region is increased by an average of approximately 27%.
[0179] Upon entering the decoding stage, the system performs the first resolution restoration. The edge confidence prediction head processes the feature map, generating a weighted response with an average value of 0.83 in the crack region and 0.21 in the background region. After weighting, the response is input into the PixelShuffle module for channel rearrangement, increasing the output feature map size to 1024×1024×32.
[0180] In the second resolution restoration stage, the system performs edge prediction again on the first-level feature map. At this time, the average weight of the crack region increases to 0.89, indicating that the edges are clearer. After channel expansion and PixelShuffle processing, the output feature map size is 2048×2048×16.
[0181] In the third-resolution restoration stage, the system no longer performs spatial magnification, but instead refines the features. After channel rearrangement and edge enhancement, the edge gradient of the crack region is improved by approximately 41%.
[0182] The segmentation prediction stage begins. In the crack segmentation prediction head, each pixel location is classified and mapped. For example, at a crack location (512, 768), the original response value is 2.17, which is converted to a probability value of 0.897 after normalization mapping; at the background location (200, 300), the probability value is 0.083.
[0183] The system performs binarization processing based on a preset threshold of 0.5 to obtain a binary segmentation mask for the cracks. Statistical results show that there are 8423 crack pixels in the image, accounting for 0.40% of the total pixels.
[0184] During the connected component labeling phase, the system traverses based on the 8-connectivity rule. For example, in the image, a total of 12 independent connected components were identified, among which the largest gap connected component contained 3261 pixels.
[0185] The system performs morphological thinning, and after six consecutive iterations, the crack width is uniformly thinned to a single-pixel skeleton while maintaining connectivity. After processing, the total number of crack pixels is reduced to 5127.
[0186] During the crack parameter calculation phase, the system analyzes each connected region. For example, in the third connected region, the maximum Euclidean distance is 312 pixels, corresponding to a crack length of 312 pixels. With a total of 1450 pixels, the calculated width is approximately 4.65 pixels.
[0187] The system ultimately generates a detection report containing 12 crack records, each including information on spatial distribution, length, and width.
[0188] In the comparative experiment, the system compared the method of the present invention with the traditional U-Net method, with 4000 training samples and 1000 test samples for both.
[0189] On the same batch of test data, the following results were obtained:
[0190] Crack pixel detection accuracy: 78.4% for traditional methods, 89.7% for this invention.
[0191] Crack connectivity integrity rate: 63.2% for traditional methods, 86.5% for this invention.
[0192] Average crack length error: The error is 6.8 pixels for the traditional method and 2.4 pixels for this invention.
[0193] Average crack width error: The error is 3.1 pixels for traditional methods and 1.3 pixels for this invention.
[0194] Crack fracture rate: 28.7% with the traditional method, 9.6% with the present invention.
[0195] Weak crack recognition rate (width ≤ 2 pixels): 52.3% for traditional methods, 76.8% for this invention.
[0196] As can be seen from Example 2, in actual operation, the present invention has a clear data change process in each processing step, and shows significant advantages in crack continuity restoration, edge accuracy improvement and parameter calculation accuracy, verifying the engineering feasibility of the method in complex underwater environments.
[0197] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for detecting cracks in underwater lining plates based on image recognition, characterized in that, include: The raw underwater lining plate image data was acquired and multimodal preprocessing was performed to obtain standardized underwater lining plate image data; The standardized underwater lining plate image data is input into the encoder module, and multi-scale feature extraction is performed on the standardized underwater lining plate image data to output the initial spatial feature map. The initial spatial feature map is converted into a first sequence feature representation according to the horizontal serialization scanning strategy, and then converted into a second sequence feature representation according to the vertical serialization scanning strategy. The first and second sequence feature representations are then input into the bidirectional cross-Seg-LSTM module to obtain the enhanced sequence feature representation. The enhanced sequence feature representation is deserialized and reconstructed to restore the enhanced two-dimensional feature map. The enhanced two-dimensional feature map and the initial spatial feature map are superimposed through residual memory backflow connection to generate a global context enhanced feature map. The global context-enhanced feature map is input into the decoder module, which has a built-in edge confidence prediction head, channel expansion projection operator and hierarchical variable step size PixelShuffle module. The first resolution recovery stage, the second resolution recovery stage and the third resolution recovery stage are executed in sequence to generate a third-level high-resolution feature map after adaptive rearrangement. The adaptively rearranged third-level high-resolution feature map is input into the crack segmentation prediction head to generate a crack segmentation prediction map. A threshold mapping operation is performed on the crack segmentation prediction map to obtain a crack binarized segmentation mask. Connected regions are then labeled on the crack binarized segmentation mask, and the connected region labeling results are output. The edge pixels of the connected region marking results are thinned using morphological thinning operators to generate a processed crack mask. The underwater lining plate crack detection report data is then output based on the processed crack mask.
2. The underwater lining plate crack detection method based on image recognition according to claim 1, characterized in that, The acquired raw underwater lining plate image data undergoes multimodal preprocessing, including: Raw underwater lining plate image data is collected by an underwater robot, and imaging time information and camera temperature metadata are recorded to generate raw underwater lining plate image data with time information and temperature metadata. Multimodal preprocessing is performed on the raw underwater lining plate image data with time information and temperature metadata to obtain standardized underwater lining plate image data.
3. The underwater lining plate crack detection method based on image recognition according to claim 1, characterized in that, The step of inputting standardized underwater lining plate image data into the encoder module includes: The standardized underwater lining plate image data is represented as a three-dimensional input tensor and input to the encoder module; Within the encoder module, a multi-scale convolutional branch of the convolutional feature extraction unit is constructed. Each convolutional branch is used to perform a two-dimensional convolution operation on the three-dimensional input tensor to obtain a convolutional feature map. Each convolutional feature map is input into the corresponding depthwise separable convolutional unit, and a channel-wise convolution operation is performed to obtain a channel-wise feature map. Perform pointwise convolution operations on each channel feature map to obtain depthwise separable convolutional feature maps that correspond one-to-one with each convolutional branch. Separable convolutional feature maps at different depths are sequentially stacked along the channel direction to form a fused multi-scale feature tensor, which is then output as the initial spatial feature map.
4. The underwater lining plate crack detection method based on image recognition according to claim 1, characterized in that, The step of inputting the first sequence feature representation and the second sequence feature representation into the bidirectional cross-Seg-LSTM module includes: The initial spatial feature map is converted into a first sequence feature representation according to the horizontal serialization scanning strategy; The initial spatial feature map is converted into a second sequence feature representation according to the vertical serialization scanning strategy; The first sequence feature representation and the second sequence feature representation are input into the bidirectional cross-Seg-LSTM module. The bidirectional cross-Seg-LSTM module shares a matrix memory structure and cross-gatedly fuses the first sequence feature representation and the second sequence feature representation to obtain the bidirectional cross-fused state. The bidirectional cross-fusion states are arranged according to the sequence position order of the first sequence feature representation to obtain the enhanced sequence feature representation.
5. The underwater lining plate crack detection method based on image recognition according to claim 1, characterized in that, The deserialization and reconstruction of the enhanced sequence feature representation includes: The enhanced sequence feature representation is deserialized and reconstructed to restore the enhanced two-dimensional feature map; The enhanced 2D feature map and the initial spatial feature map are superimposed using a residual memory backflow connection method to form a feature superposition result. The feature overlay results at all spatial coordinate positions and channel positions are organized according to their corresponding spatial coordinate positions and channel positions to obtain a global context-enhanced feature map.
6. The underwater lining plate crack detection method based on image recognition according to claim 1, characterized in that, The decoder module, which inputs the global context-enhanced feature map into the built-in edge confidence prediction head, channel expansion projection operator, and hierarchical variable step size PixelShuffle module, sequentially executes the first resolution recovery stage, the second resolution recovery stage, and the third resolution recovery stage, including: The global context-enhanced feature map is input into the built-in first edge confidence prediction head, first channel extended projection operator and decoder module with hierarchical variable step size PixelShuffle module with step size of four, and the first resolution recovery stage is performed to obtain the first-level high-resolution feature map. The first-level high-resolution feature map is input into the decoder module, which has a built-in second edge confidence prediction head, a second channel extended projection operator, and a hierarchical variable step size PixelShuffle module with a step size of two. The second resolution recovery stage is performed to obtain the second-level high-resolution feature map. The second-level high-resolution feature map is input into the decoder module, which has a built-in third edge confidence prediction head, a third-channel adaptive projection operator, and a hierarchical variable step size PixelShuffle module with a step size of one. The third resolution recovery stage is performed to obtain the adaptively rearranged third-level high-resolution feature map.
7. The underwater lining plate crack detection method based on image recognition according to claim 1, characterized in that, The step of inputting the adaptively rearranged third-level high-resolution feature map into the crack segmentation prediction head includes: The adaptively rearranged third-level high-resolution feature map is input into the crack segmentation prediction head to obtain the crack segmentation response map; Pixel-level probability mapping is performed on the crack segmentation response map to obtain the crack segmentation prediction probability value; The crack segmentation prediction probability values at all spatial coordinate locations are organized according to their corresponding spatial coordinate locations to generate a crack segmentation prediction map.
8. The underwater lining plate crack detection method based on image recognition according to claim 1, characterized in that, The threshold mapping operation performed on the crack segmentation prediction map includes: A threshold mapping operation is performed on the crack segmentation prediction map to obtain a crack binarization segmentation mask; The crack binarized segmentation mask is used to mark the connected regions, and the connected region marking values are obtained. Organize the connected component label values at all spatial coordinate positions according to their corresponding spatial coordinate positions, and output the connected component labeling results.
9. The underwater lining plate crack detection method based on image recognition according to claim 1, characterized in that, The process of thinning edge pixels in the connected region labeling results using morphological thinning operators includes: The edge pixels of the connected region labeling results are thinned using morphological thinning operators to generate a processed crack mask that retains only a single-pixel width topological skeleton. Based on the spatial distribution range of the set of spatial coordinates corresponding to each independent connected volume of cracks in the processed crack mask, the spatial distribution result of cracks is calculated. Based on the set of spatial coordinates corresponding to each independent connected body of crack in the processed crack mask, geometric dimension statistics are performed to obtain crack length parameter information and crack width parameter information. The spatial distribution results of cracks, crack length parameters, and crack width parameters are organized according to the index order of independent connected cracks to generate underwater lining plate crack detection report data.
10. An underwater lining plate crack detection device based on image recognition, characterized in that, The detection device includes a processor, a memory, and a communication interface; The communication interface is used for communication between the detection device and other equipment; The memory is used to store one or more programs, which include computer-executable instructions. When the detection device is running, the processor executes the computer-executable instructions stored in the memory to cause the detection device to perform the underwater lining plate crack detection method based on image recognition as described in any one of claims 1 to 9.
