A three-dimensional defect segmentation method, system and storage medium

By combining a 2.5D segmentation network and a spatial feature displacement module (SSM) with interlayer continuity loss (ISC), the problems of low efficiency and topological discontinuity in industrial CT defect segmentation are solved, achieving high-precision and efficient three-dimensional defect segmentation, which is suitable for online inspection of industrial production lines.

CN122090071BActive Publication Date: 2026-07-03SHENYANG RES INST OF FOUNDRY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENYANG RES INST OF FOUNDRY
Filing Date
2026-04-24
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing technologies for industrial CT defect segmentation suffer from low efficiency, insufficient accuracy, and discontinuous topology, making it particularly difficult to achieve high throughput and high accuracy in 3D defect segmentation under the demands of large-scale industrial data processing and real-time detection.

Method used

A 2.5D segmentation network architecture is adopted, which combines the Spatial Feature Displacement (SSM) module and the Inter-Layer Continuity Loss (ISC). Through slice feature extraction, cross-slice context information fusion and parallel prediction of segmentation masks, high-precision three-dimensional segmentation of industrial CT volume data is achieved.

Benefits of technology

Without increasing computational costs, high-precision and high-efficiency 3D defect segmentation was achieved, ensuring the 3D topological continuity of the segmentation results and adapting to the online inspection needs of industrial production lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122090071B_ABST
    Figure CN122090071B_ABST
Patent Text Reader

Abstract

This invention relates to a three-dimensional defect segmentation method, system, and storage medium, belonging to the interdisciplinary fields of computer vision, deep learning, and nondestructive testing. The three-dimensional defect segmentation result is obtained by inputting the industrial CT volume data of the object to be inspected into a 2.5D segmentation network composed of an encoder, a spatial feature displacement module, and a decoder. This invention achieves efficient three-dimensional context awareness, significantly improving defect segmentation accuracy and three-dimensional morphological integrity. The segmentation result has topological connectivity and smooth boundaries, and its computational complexity and memory usage are far lower than those of a full 3D network. It can meet the real-time requirements of industrial online inspection and has broad application prospects in high-end manufacturing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision, deep learning and nondestructive testing, and in particular to a three-dimensional defect segmentation method, system and storage medium. Background Technology

[0002] Industrial computed tomography (ICT), as an advanced non-destructive testing technology, can visualize the complex three-dimensional structure of components in a non-invasive and non-destructive manner, making it a core tool for quality control in high-end manufacturing and widely used in the inspection of key aerospace components and core components of new energy vehicles. This technology uses X-ray sources to perform multi-angle transmission imaging of objects, combined with reconstruction algorithms to generate three-dimensional volume data containing internal density information of the object. However, accurately extracting defect information from the raw scan data faces numerous technical challenges.

[0003] First, industrial CT scan data is massive, with a single scan containing hundreds or even thousands of consecutive slice images, and the data volume can reach several gigabytes or even terabytes. Traditional manual visual inspection and manual segmentation methods are extremely inefficient. Affected by the subjective experience and fatigue of the inspectors, the consistency, repeatability and objectivity of the results are difficult to guarantee, which cannot meet the high throughput requirements of industrial production lines.

[0004] Secondly, existing automated segmentation algorithms have significant limitations in generalization and practicality in industrial scenarios. While the achievements of deep learning technology in medical image segmentation have provided a reference for industrial CT defect detection, directly transferring medical image segmentation models to industrial scenarios presents several problems: First, the industrial field lacks large-scale, publicly available 3D defect datasets with voxel-level fine annotations. The diverse materials, shapes, and sizes of parts, along with random defect morphologies, result in insufficient supervision signals for deep learning models, limiting their generalization ability. In contrast, the medical field possesses a long-accumulated publicly labeled dataset, and the structures of human organs are relatively fixed. Second, there is an irreconcilable contradiction between 3D modeling accuracy and computational efficiency. 2D segmentation methods treat 3D volume data as independent 2D slices, processing them image by image. Although this method is computationally efficient and consumes little memory, and can utilize pre-trained weights from natural image datasets to accelerate convergence, it ignores the spatial continuity between slices, easily leading to abrupt changes in defect segmentation results. The 3D segmentation method suffers from several drawbacks. First, it suffers from fractures and cannot accurately reconstruct the 3D topology of defects. Second, it suffers from fractures and fractures. Third, it suffers from fractures and fractures. Fourth, it suffers from fractures and fractures. Fifth, it suffers from fractures and fractures. Sixth, it suffers from fractures and fractures. Seventh, it suffers from fractures and fractures. Eighth ...

[0005] Therefore, the industry urgently needs an industrial CT defect segmentation technology that combines the high efficiency of 2D methods with the three-dimensional context awareness of 3D methods, and can guarantee the three-dimensional continuity of the segmentation results, in order to achieve high-precision, high-efficiency, and robust industrial CT defect segmentation. Summary of the Invention

[0006] To address the aforementioned technical problems, embodiments of the present invention provide a three-dimensional defect segmentation method, system, and storage medium. Without significantly increasing computational costs, it achieves high-precision three-dimensional segmentation of defects in industrial CT volumetric data, balancing segmentation accuracy and processing efficiency, and ensuring the three-dimensional topological continuity of the segmentation results. The technical solution adopted by the present invention is as follows:

[0007] A three-dimensional defect segmentation method, the method comprising:

[0008] The raw volume of industrial CT scans is obtained, standardized preprocessing is performed, and a slice sequence with three-dimensional context information is constructed.

[0009] The slice sequence is fed into a pre-trained 2.5D segmentation network based on deep learning. The network sequentially performs slice feature extraction, cross-slice context information fusion, cross-slice feature aggregation, and parallel prediction of the segmentation mask, and outputs the segmentation mask at the center position of the input sequence.

[0010] All segmentation masks output by the 2.5D segmentation network inference are uniformly integrated, aligned in coordinates, and reconstructed in 3D. The discrete slice-level segmentation results are transformed into complete 3D defect segmentation results that are consistent with the physical structure of the object to be detected, thereby realizing voxel-level 3D characterization of defects in industrial CT volume data.

[0011] Optionally, a sliding window sampling operation is performed on the preprocessed industrial CT volume data. Based on the axial index of the slice, a tensor containing N consecutive two-dimensional slices is extracted from the volume data and used as the input sequence for the 2.5D segmentation network.

[0012] Optionally, the 2.5D segmentation network consists of an encoder, a spatial feature displacement module (SSM), and a decoder. During the training phase, the 2.5D segmentation network introduces an inter-layer continuity loss (ISC) through a total loss function to perform cross-slice topology consistency constraints on the features extracted from the pre-trained 2D backbone network and fused by the spatial feature displacement module (SSM).

[0013] Optionally, the encoder performs overall feature extraction on each industrial CT 2D slice in the input sequence.

[0014] Optionally, the Spatial Feature Displacement (SSM) module is embedded between / within each stage of the encoder and in each layer of the decoder, alternating with feature extraction and upsampling operations. Through channel grouping, spatial axial displacement, boundary filling, and convolutional fusion operations of the feature tensor, it achieves efficient interaction and deep fusion of contextual information between adjacent slices, enabling the feature processing throughout the entire network process to capture cross-slice contextual information and continuously expand the effective receptive field in the depth direction.

[0015] Optionally, the decoder takes the fused feature map processed by the Spatial Feature Shifting (SSM) module as input, and restores the feature spatial resolution and strengthens the defect feature representation through progressive upsampling, skip connection fusion, and cross-slice feature aggregation operations. Finally, it uses a multi-input multi-output asymmetric strategy to predict the segmentation mask of the center position of the input sequence in parallel, thereby realizing the parallel prediction of feature aggregation and segmentation mask.

[0016] Optionally, the Spatial Feature Displacement Module (SSM) receives the feature tensor extracted by the encoder and divides the input feature tensor into three independent logical channel groups along the channel dimension: the hold group, the forward displacement group, and the backward displacement group. The number of channels in each group is flexibly controlled by a custom offset ratio.

[0017] Optionally, the Spatial Feature Displacement (SSM) module performs differentiated pure geometric spatial displacement operations on three independent logical channel groups based on the depth dimension of industrial CT slices. It achieves cross-slice feature information transfer only through position offset, allowing the current slice position to be integrated with the context information of adjacent slices before and after.

[0018] A three-dimensional defect segmentation system is provided for implementing the above-mentioned three-dimensional defect segmentation method. The three-dimensional defect segmentation system includes a scanning subsystem, a motion subsystem, a reconstruction subsystem, and a memory.

[0019] A scanning subsystem is used to generate multi-angle projection data;

[0020] The motion subsystem is used to carry the workpiece under test and complete a 360-degree rotational scan.

[0021] The reconstruction subsystem acquires the original volume data of industrial CT scans, performs standardized preprocessing, and constructs a slice sequence with 3D contextual information. The slice sequence is then fed into a pre-trained deep learning-based 2.5D segmentation network. This network sequentially performs slice feature extraction, cross-slice contextual information fusion, cross-slice feature aggregation, and parallel prediction of the segmentation mask, outputting a segmentation mask at the center of the input sequence. All segmentation masks output by the 2.5D segmentation network are then uniformly integrated, aligned, and 3D reconstructed, transforming the discrete slice-level segmentation results into a complete 3D defect segmentation result consistent with the physical structure of the object being detected. This achieves voxel-level 3D representation of defects in industrial CT volume data.

[0022] The memory is used to store industrial CT data, network model weights, and computer-executable instructions.

[0023] A storage medium, which is a computer-readable storage medium, has computer-readable program instructions stored thereon for performing the above-described three-dimensional defect segmentation method.

[0024] This invention provides a three-dimensional defect segmentation method, system, and storage medium. The technical solutions provided by the embodiments of this invention bring at least the following beneficial effects:

[0025] (1) Achieve high-precision and high-continuity three-dimensional defect segmentation: Innovative design of spatial feature displacement scheme, efficient fusion of cross-slice context information by zero-parameter channel grouping and axial displacement, giving the network a receptive field similar to three-dimensional convolution, significantly improving the recognition ability of small and low-contrast defects; At the same time, introduce inter-layer continuity loss, explicitly constrain the prediction consistency of adjacent slices, punish the inter-layer topological break problem, make the defect boundary of the segmentation result smoother and the three-dimensional topology more connected, and completely restore the true shape of the defect.

[0026] (2) Balancing detection efficiency and engineering practicality, adapting to industrial scenarios: Adopting a 2.5D network architecture, it can reuse the 2D backbone network pre-trained on a large-scale natural image dataset, accelerating model convergence and improving generalization ability; its computational complexity and memory usage are far lower than that of a full 3D network, with fast inference speed and the ability to process higher resolution industrial CT data. It can complete data processing without physical slicing, simply through a logical sliding window, perfectly adapting to the online detection and high throughput requirements of industrial production lines. At the same time, combined with the construction strategy of the dedicated ICT-Defect dataset, it further enhances the robustness and adaptability of the model in complex industrial detection scenarios.

[0027] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

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

[0029] Figure 1 This is a flowchart illustrating the three-dimensional defect segmentation method.

[0030] Figure 2a A schematic diagram of a 3D casting in the ICT-Defect dataset;

[0031] Figure 2b A schematic diagram of a 2D casting in the ICT-Defect dataset;

[0032] Figure 3 This is a schematic diagram of the components of a three-dimensional defect segmentation system.

[0033] Reference numerals: 1. X-ray generator; 2. Precision rotating device; 3. Test sample; 4. Flat panel detector. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0035] Before describing the technical solution of the present invention in detail, the technical background and technical terms involved in the technical solution will be explained first:

[0036] Industrial Computed Tomography (ICT) is a high-precision non-destructive testing technology applied in the industrial field. It is also a professional application of computed tomography technology in industrial quality inspection and structural analysis. Its core function is to non-invasively and non-destructively acquire the internal three-dimensional structure and density information of industrial parts through X-ray and computer reconstruction technology. It is one of the core means of quality control in modern high-end manufacturing. In this invention, industrial CT is the core data source. Industrial CT scans acquire the three-dimensional volume data of the workpiece to be inspected, providing the original data foundation for subsequent sliding window sampling, 2.5D segmentation network inference, and three-dimensional defect segmentation. Simultaneously, the high resolution and multi-slice characteristics of industrial CT data determine the technical direction of core designs such as sliding window sampling, spatial feature displacement (SSM) modules, and interlayer continuity loss (ISC) in the technical solution, adapting to the characteristics of industrial CT data to achieve high-precision defect segmentation.

[0037] ICT-Defect Dataset: A dedicated dataset tailored for industrial CT 3D defect segmentation tasks. Its construction standards, annotation accuracy, and partitioning strategies are deeply matched with the 2.5D segmentation network design of this technical solution and the actual industrial application requirements. It is an important data support for achieving high-precision and high-generalization industrial CT defect segmentation.

[0038] Voxel-level information: A core term in 3D spatial data analysis, it is an extension of pixel-level information in 3D space. It refers to the collective attribute and spatial positioning information carried by each voxel after a 3D entity (such as a component scanned by industrial CT) is discretized into its smallest cubic unit (i.e., a voxel) in 3D space. In this industrial CT 3D defect segmentation technology solution, voxel-level information is the foundation for refined, 3D characterization of the internal structure and defects of industrial components. It is also the core data unit for achieving voxel-level defect segmentation and quantitative analysis, directly determining the accuracy and detail richness of defect detection. A pixel is a two-dimensional constituent unit of a voxel. A voxel is formed by stacking pixels. Voxel data = pixel data (H×W) + a stack of pixel data in the depth dimension (Z-axis). The pixel level is the two-dimensional basis of the voxel level, and the voxel level is the complete representation of the pixel level in 3D space.

[0039] Receptive Field: A core term in deep learning computer vision, specifically referring to the region of the original input image corresponding to a single pixel on a feature map of a convolutional neural network layer; that is, the size of the original image region that a pixel on the feature map "can see". The receptive field is the region of the original input corresponding to a pixel in the feature map; the deeper the layer, the larger the range, reflecting the network's core ability to capture contextual information. This invention expands the two-dimensional receptive field of 2D convolution into a three-dimensional field through the Spatial Feature Shifting (SSM) module, covering the depth dimension of industrial CT slices and adapting to the three-dimensional continuous features of defects. The construction of the three-dimensional receptive field is a key design for improving the segmentation accuracy of small defects in industrial CT and ensuring the topological continuity of defects.

[0040] Inter-Slice Continuity Loss (ISC): This is a topology-constrained loss function customized for industrial CT 3D defect segmentation tasks in this technical solution. As a core component of the total loss of the 2.5D segmentation network, it works in conjunction with binary cross-entropy loss and Dice coefficient loss to specifically address the problems of discontinuous inter-slice predictions and defect topological breaks caused by independent slice-by-slice optimization in traditional 2D / 2.5D segmentation methods. Based on the continuous physical extension of industrial defects in physical space, this method explicitly maximizes the consistency of prediction probabilities between adjacent CT slices in the real defect region, penalizing prediction results of inter-slice jumps and breaks, forcing the network to learn the 3D topological continuity of defects, ultimately resulting in smoother defect boundaries and a 3D morphology that better matches real physical defects in the segmentation results.

[0041] Figure 1 This is a flowchart illustrating a three-dimensional defect segmentation method. The method includes the following steps:

[0042] Step S101: Obtain the original volume of industrial CT, perform standardized preprocessing, and construct a slice sequence with three-dimensional context information.

[0043] This step is the foundational data processing stage for 3D defect segmentation. Its goal is to acquire raw volumetric data from industrial CT scans, perform standardized preprocessing, and construct slice sequences with 3D contextual information. This provides compliant and effective input data for subsequent 2.5D segmentation network inference. The specific execution process is as follows:

[0044] (1) Industrial CT volume data acquisition

[0045] The high-energy X-ray scanning subsystem and reconstruction module of the industrial CT inspection system complete the scanning and data reconstruction of the object to be inspected, and obtain the industrial CT volume data of the object to be inspected. The object to be inspected includes, but is not limited to, complex industrial metal parts such as metal castings and additive manufacturing parts in aerospace, automobile manufacturing and other fields. The industrial CT volume data consists of hundreds to thousands of two-dimensional slice images arranged along the axis, stored in 16-bit unsigned integer format, and completely preserves the grayscale dynamic range and internal structural information of the industrial CT scan.

[0046] (2) Preprocessing of industrial CT volumetric data

[0047] Standardized preprocessing operations are performed on the collected raw industrial CT volume data. First, noise reduction is performed to eliminate noise interference generated during the scanning process and ensure the purity of the data. Then, normalization is performed to map the gray values ​​of the 16-bit raw CT data to a specified range or a standard normal distribution, eliminating the differences in gray range caused by different scanning batches and different parts, and improving the consistency of the data.

[0048] If the training phase of a 2.5D segmentation network is underway, online data augmentation is required after preprocessing. Augmentation methods include random rotation from 0 to 360 degrees, horizontal / vertical flipping, and elastic deformation to expand the training sample size and improve the model's generalization ability. The core requirement of data augmentation is to apply the exact same geometric transformation parameters to all slices in the same input sequence obtained from subsequent sampling, strictly maintain the spatial alignment between slices, and avoid destroying the three-dimensional contextual relationship of slices due to inconsistent transformations.

[0049] (3) Sliding window sampling to construct the input sequence

[0050] A sliding window sampling operation is performed on the preprocessed industrial CT volume data. The window size is set to N (N is an odd number greater than 5, preferably 9). Based on the axial index of the slice, a tensor containing N consecutive two-dimensional slices is extracted from the volume data and used as the input sequence of the 2.5D segmentation network.

[0051] When the window size N is configured to 9, for the target slice at layer z in the volume data, extract the 4 slices before and after it along its axis, forming an input sequence of 9 consecutive slices containing layers z-4, z-3, z-2, z-1, z, z+1, z+2, z+3, and z+4. It provides a three-dimensional context view covering four layers above and below each target slice. During the sampling process, by reasonably setting the sliding step size, it ensures the effective connection of adjacent input sequences and avoids the discontinuity of subsequent segmentation results. Finally, all input sequences are tensor data in a uniform format, which can be directly fed into the 2.5D segmentation network for feature extraction and defect segmentation.

[0052] Step S102: Feed the slice sequence into a pre-trained 2.5D segmentation network based on deep learning. The network sequentially performs slice feature extraction, cross-slice context information fusion, cross-slice feature aggregation, and parallel prediction of the segmentation mask, and outputs the segmentation mask at the center position of the input sequence.

[0053] This step is the core reasoning stage for 3D defect segmentation, where the constructed input sequence containing N consecutive slices is fed into a pre-trained deep learning-based 2.5D segmentation network. Before providing a detailed introduction to the 2.5D segmentation network, its relationship with the pre-trained 2D backbone network will be explained.

[0054] In the industrial CT 3D defect segmentation technology of this invention, the pre-trained 2D backbone network is the core component and basic feature extraction carrier of the 2.5D segmentation network. The 2.5D segmentation network is a dedicated segmentation network formed by customizing and expanding the functions of the 2D backbone network to meet the 3D context processing requirements of industrial CT slice sequences. The two are closely related as part and whole, foundation and extension, and the capabilities of the pre-trained 2D backbone network are fully inherited by the 2.5D segmentation network and endowed with 3D perception characteristics. The pre-trained 2D backbone network is the core component of the 2.5D segmentation network encoder, providing it with high-performance basic feature extraction capabilities. The 2.5D segmentation network adopts an encoder-decoder architecture, where the encoder part is directly built with a 2D backbone network pre-trained on a large-scale natural image dataset (such as ImageNet) as the core. This 2D backbone network can be selected from classic 2D convolutional / transformer networks such as ResNet, SegFormer, EfficientNet, and MiT, and is the core carrier for the encoder to complete single-slice feature extraction.

[0055] The 2.5D segmentation network transforms and expands the functionality of a pre-trained 2D backbone network in three dimensions, overcoming its inherent limitations in two-dimensional processing. The native capability of a pre-trained 2D backbone network is limited to processing single two-dimensional images, unable to perceive the depth dimension (Z-axis) contextual information of industrial CT slice sequences. The 2.5D segmentation network, through multi-module fusion and full-process embedding, specifically transforms it, enabling it to retain 2D computational efficiency while possessing three-dimensional contextual processing capabilities. The transformation includes the following aspects:

[0056] (1) Inserting the Spatial Feature Displacement Module (SSM) to achieve cross-slice fusion: The Spatial Feature Displacement Module (SSM) is embedded between / inside each stage of the encoder with the pre-trained 2D backbone network as the core, and in each layer of the decoder. The module takes the single-slice feature map sequence output by the encoder as input, and fuses the features of different slices through parameterless channel grouping and axial displacement operations, so that the single-slice features extracted by the pre-trained 2D backbone network have cross-slice three-dimensional context association, breaking through its limitation of "independent processing of slices".

[0057] (2) Feature recovery and mask prediction are completed with the decoder: The 2.5D segmentation network is equipped with a customized decoder on the basis of the encoder (including the 2D backbone network). The decoder adopts a progressive upsampling and skip connection strategy to restore the high-dimensional fusion features extracted by the encoder to the original CT slice resolution. At the same time, through the "multiple inputs and multiple outputs" asymmetric parallel prediction strategy, the segmentation mask of the center slice of the input sequence is output to complete the whole process from feature extraction to defect segmentation.

[0058] (3) Combining ISC loss to achieve topological constraints: During the training phase, the 2.5D segmentation network introduces inter-layer continuity loss (ISC) through the total loss function. This constrains the cross-slice topological consistency of the features extracted from the pre-trained 2D backbone network and fused by the spatial feature displacement module SSM, forcing the network to learn the three-dimensional continuity of defects and avoiding the discontinuity of inter-layer prediction caused by the slice-by-slice feature extraction of the pre-trained 2D backbone network.

[0059] The aforementioned 2.5D segmentation network modifies the pre-trained 2D backbone network without changing its core 2D convolution calculation logic. It achieves 3D context awareness only by fusing the pure geometric operations of the Spatial Feature Displacement Module (SSM) with 2D convolution. The compatibility of the two at the computational level ensures the efficiency of the entire network.

[0060] The 2.5D segmentation network consists of an encoder, a Spatial Feature Displacement (SSM) module, and a decoder. It sequentially performs slice feature extraction, cross-slice context information fusion, cross-slice feature aggregation, and parallel prediction of the segmentation mask, outputting a segmentation mask at the center of the input sequence. This provides core data for subsequent reconstruction of 3D defect segmentation results. The technical details and execution flow of each step are as follows:

[0061] (1) Encoder realizes independent feature extraction

[0062] The encoder's independent feature extraction is a prerequisite for 2.5D segmentation network inference. Relying on the strong feature extraction capabilities of the pre-trained 2D backbone network, it extracts features from each industrial CT 2D slice in the input sequence, providing basic and accurate feature data for the subsequent cross-slice context fusion of the spatial feature displacement module. The specific technical details and execution flow are as follows:

[0063] Selection and foundation of pre-trained 2D backbone network. The encoder uses a 2D convolutional neural network or Transformer network pre-trained on a large-scale natural image dataset (such as ImageNet) as the backbone network. The selection range includes any one of ResNet, SegFormer, EfficientNet, and MiT. This type of pre-trained 2D backbone network has powerful general texture, edge, contour and other low-level feature recognition capabilities after feature learning from massive natural images. After being transferred to the industrial CT defect segmentation scenario, it can effectively reduce the convergence difficulty of model training and improve the network's ability to represent and generalize the defect features in industrial CT slices.

[0064] Input data adaptation. The encoder input is an input sequence containing N consecutive industrial CT slices (N=9 in the preferred configuration) after data acquisition and sequence construction steps. Each slice in the input sequence is a standardized preprocessed two-dimensional grayscale image, ensuring the consistency and validity of the input data.

[0065] Overall feature extraction from multiple slices. During inference, the encoder processes each 2D slice in the input sequence individually. Specifically, for the 1st to Nth slices in the sequence, it performs layer-by-layer convolution, pooling, and attention mechanisms (Transformer-like networks) of the pre-trained 2D backbone network to extract and map from low-level visual features (such as pixel grayscale and local edges) to high-level semantic features (such as defect contours and texture features).

[0066] Feature map sequence generation. After feature extraction by the pre-trained 2D backbone network, each 2D slice in the input sequence is transformed into a high-dimensional feature map of the corresponding dimension. The feature maps of all slices are arranged in the slice order of the original input sequence to form a feature map sequence that corresponds one-to-one with the input slice sequence. The dimension of this feature map sequence is related to the design of the pre-trained 2D backbone network and will eventually be integrated into a feature tensor of shape (B,D,C,H,W) (B is the batch size, D is the number of slices, C is the number of channels, and H and W are the feature space resolution), which is directly fed into the subsequent spatial feature shifting module for cross-slice context information fusion.

[0067] Module embedding in the network structure. To enable the feature extraction process to have 3D perception capability from the beginning, a Spatial Feature Displacement Module (SSM) is inserted between / within each stage of the encoder. That is, the encoder's feature extraction is alternated with the cross-slice fusion of the SSM, realizing a progressive processing of "feature extraction-cross-slice fusion". This allows the generated feature map sequence to retain the accurate defect features of a single slice, while also initially fusing the contextual information of adjacent slices, laying a better feature foundation for the subsequent feature aggregation of the decoder.

[0068] Overall, the independent feature extraction stage of the encoder not only fully utilizes the computational efficiency and feature extraction advantages of the pre-trained 2D backbone network to ensure accurate identification of single-slice defect features, but also achieves early integration of feature extraction and cross-slice fusion by embedding a spatial feature displacement module (SSM) inside the encoder, balancing computational efficiency and the three-dimensional correlation of features, and providing core feature support for high-precision inference of the subsequent 2.5D network.

[0069] (2) Spatial Feature Displacement Module (SSM) realizes cross-slice context fusion

[0070] The Spatial Feature Displacement (SSM) module is the core mechanism for 2.5D segmentation networks to achieve 3D contextual information perception. Designed specifically for the isotropic nature of industrial CT data, its core advantages are that it requires no additional parameters and does not increase computational burden. Through channel grouping of feature tensors, spatial axial displacement, boundary filling, and convolutional fusion operations, it enables 2D convolutional networks to possess 3D spatial perception capabilities, achieving efficient interaction and deep fusion of contextual information between adjacent slices. Furthermore, this module is embedded between / within each stage of the encoder and in each layer of the decoder, alternating with feature extraction and upsampling operations. This ensures that the network's feature processing throughout the entire process captures cross-slice contextual information, continuously expanding the effective receptive field in the depth direction. Based on the actual needs of industrial CT data processing, its specific execution flow and technical details are as follows:

[0071] Execution flow 1: Feature tensor reception and format definition.

[0072] The Spatial Feature Displacement Module (SSM) receives the feature tensor X extracted by the encoder. The dimension of this tensor is defined as follows: Where B is the batch size, D is the number of slices, C is the number of feature channels, and H and W are the spatial resolutions of the feature map, this tensor It provides a unified feature data foundation for all subsequent operations of the module and is fully compatible with the dimensional features of industrial CT slice sequences.

[0073] Execution process 2: Channel dimension logical grouping.

[0074] The input feature tensor X is divided into three independent logical channel groups along the channel dimension C: the hold group, the forward shift group, and the backward shift group. The number of channels in each group is flexibly controlled by a custom offset ratio. To ensure balanced interaction of slice feature information and avoid excessive feature proportion in one direction, the number of channels in the forward shift group and the backward shift group is usually set to be equal. The hold group carries the current slice. The inherent feature information is used to fuse the feature information of subsequent slices and previous slices, respectively. The three groups of channels completely cover all channel dimensions of the feature tensor, with no channel omissions or overlaps.

[0075] Execution process 3: Spatial displacement in the slice depth direction.

[0076] Based on the depth dimension (Z-axis) of industrial CT slices, differentiated pure geometric spatial displacement operations are performed on the three channel groups. This process involves no parameter learning; it achieves cross-slice feature information transfer solely through positional offset, allowing the current slice position to integrate contextual information from adjacent slices. The specific operation rules are as follows:

[0077] Preservation groups: The position index in the slice depth dimension remains unchanged, fully preserving the original features of the current slice, serving as the core foundation for cross-slice feature fusion. Includes partial channels (e.g., (each channel), this part of the feature is preserved as is, representing the current slice. Its inherent characteristics.

[0078] Forward displacement group: Moves forward one or more unit steps along the slice depth dimension, enabling the feature channels of this group at the current slice position to acquire feature information from subsequent slices, thus supplementing the features of the current slice with those of the later slices. Includes all channels to the left of the middle channel (e.g., ...). (One channel), move forward.

[0079] Backward displacement group: Moves backward one or more unit steps along the slice depth dimension, enabling the feature channels of this group at the current slice position to acquire feature information from previous slices, thus supplementing the current slice's features with those from previous slices. Includes all channels to the right of the middle channel (e.g., ...). (One channel), move backward. To maintain information balance, it is usually set to .

[0080] Different forward / backward displacement groups with different indices can be configured with different offset step sizes, allowing the module to capture cross-slice context information at different distances, thus improving the richness of feature fusion. For the feature map of the forward displacement group, forward displacement is performed along the slice's Z-axis; the number of forward displacement channels varies for different indices. For the feature map of the backward displacement group, backward displacement is performed along the slice's Z-axis; the number of backward displacement channels varies for different indices. The remaining group does not move, carrying the current slice. Information.

[0081] Execution process 4: Fill the nearest neighbor gap in the displacement boundary.

[0082] Since forward and backward displacement operations will create feature gaps at the beginning and end of the slice depth dimension, in order to ensure the shape integrity of the feature tensor and the effectiveness of subsequent processing, the nearest neighbor filling strategy is used to fill these gaps. That is, effective feature values ​​adjacent to the gap are selected to fill the gap, so as to preserve the spatial correlation of features to the greatest extent and avoid feature information breakage caused by gaps.

[0083] Execution process 5: Channel group re-splicing and integration.

[0084] The preserving groups, forward displacement groups, and backward displacement groups that have completed displacement operations and boundary filling are re-concatenated along the channel dimension C, integrating them into a complete feature tensor. The dimensions of the concatenated feature tensor are still preserved. While the features remain unchanged, the feature channels at each slice location have now been integrated with the three-dimensional context information of the current slice, the previous slice, and the subsequent slice, achieving preliminary fusion of cross-layer features and giving the features of a single slice a spatial correlation in depth dimension.

[0085] Execution process 6: Two-dimensional convolutional nonlinear deep fusion.

[0086] Following all the geometric operations of the Spatial Feature Displacement Module (SSM), a standard two-dimensional convolutional layer is immediately applied. This convolutional layer is a crucial component of the module, and its core function is to perform nonlinear fusion of cross-slice features. When calculating pixel output, the two-dimensional convolutional kernel performs a weighted summation of the values ​​of all its input channels. Since the input channels after the geometric operations of the SSM have already incorporated feature information from different slice depths, this two-dimensional convolutional operation effectively completes the cross-slice feature depth fusion process. Its effect is equivalent to simulating the receptive field of three-dimensional convolution, but without introducing a large number of parameters from three-dimensional convolution, thus maintaining the computational efficiency of 2D convolution.

[0087] Execution process 7: Multi-layer stacking enables long-distance context capture.

[0088] The Spatial Feature Displacement Module (SSM) adopts a multi-layered structure combining "SSM+2D convolution". This structure is repeatedly executed during the feature extraction stage of the encoder and the feature recovery stage of the decoder. This allows the network to continuously fuse cross-slice context information during feature processing, rapidly expanding the effective receptive field in the depth direction. This enables the network to capture the long-distance three-dimensional contextual dependence of defects in industrial CT data and adapt to the physical features of industrial defects that extend continuously in three-dimensional space.

[0089] Overall, the Spatial Feature Displacement Module (SSM) abandons the simple channel stacking method of traditional 2.5D methods. By modifying the spatial domain of features, it achieves true cross-slice feature interaction. It retains the core advantages of low computational complexity and low memory usage of 2D convolution, while giving the network a three-dimensional spatial perception capability similar to 3D convolution. Without increasing the number of parameters or computational burden, it significantly improves the network's ability to identify small, low-contrast defects in industrial CT data. It provides high-quality feature data that integrates multi-slice context information for subsequent feature aggregation and accurate mask prediction in the decoder.

[0090] (3) The decoder implements parallel prediction of feature aggregation and segmentation mask.

[0091] The decoder's parallel prediction of feature aggregation and segmentation masks is the core final step in the 2.5D segmentation network inference. The decoder takes the fused feature map processed by the Spatial Feature Shifting (SSM) module as input and employs an improved encoder-decoder architecture adapted to 2.5D data. Through progressive upsampling, skip connection fusion, and cross-slice feature aggregation, it restores the feature space resolution and enhances defect feature representation. Finally, it uses a multi-input multi-output asymmetric strategy to predict the segmentation mask at the center position of the input sequence in parallel, providing accurate pixel-level defect probability prediction for subsequent 3D defect segmentation result reconstruction. Furthermore, the entire decoding process embeds the SSM module to ensure inter-layer feature continuity. Specific technical details and execution flow are as follows:

[0092] Execution process 1: Input feature reception and architecture foundation.

[0093] The decoder receives a high-dimensional semantic feature map extracted by the encoder and fused across slices by a multi-round spatial feature displacement module (SSM). This feature map incorporates 3D contextual information across slices and retains the association between deep semantic features and shallow detail features of defects in industrial CT slices. The decoder adopts a U-Net-like encoder-decoder architecture, customized for 2.5D industrial CT slice sequence data. The core design features a progressive upsampling strategy and skip connections. Furthermore, a spatial feature displacement module (SSM) is inserted into each layer of the decoder to maintain 3D perception across slices during feature recovery, preventing feature fragmentation between slices.

[0094] Execution process 2: Progressive upsampling and feature resolution recovery.

[0095] The decoder performs a progressive upsampling operation on the input high-dimensional semantic feature map, gradually restoring the spatial resolution (H, W) of the feature map to match the resolution of the original industrial CT 2D slice image through deconvolution, interpolation, and other methods. This achieves the restoration from high-dimensional abstract semantic features to low-dimensional pixel-level detailed features. During the upsampling process, the feature processing of each layer first undergoes cross-slice context fusion by the Spatial Feature Shifting (SSM) module before resolution upsampling. This ensures that while restoring details, the topological consistency between slices is maintained, avoiding blurring and positional shifts in defective features caused by simple upsampling.

[0096] Execution process 3: Cross-layer feature fusion of skip connections.

[0097] To compensate for the loss of detailed features during the upsampling process, the decoder uses skip connections to fuse the shallow detail feature maps extracted from each stage of the encoder and processed by the Spatial Feature Shifting (SSM) module with the feature maps from the corresponding upsampling stages of the decoder. The fusion method is either channel-level concatenation or element-level addition. This operation combines the low-level defect features such as slice edges and textures captured by the encoder with the high-level semantic features recovered by the decoder, ensuring both the positional accuracy of defect segmentation and enhancing the representational ability of defect features, effectively improving the segmentation accuracy of small, low-contrast defects.

[0098] Execution process 4: Deep aggregation optimization of cross-slice features.

[0099] For the feature map fused by upsampling and skip connections, the decoder uses 2D convolution to perform deep aggregation and optimization of cross-slice features: by weighted summation of the local receptive field and channel dimension of the convolution kernel, a nonlinear transformation is performed on the fused features to further enhance the feature response of defect regions and weaken the interference of background noise. At the same time, it integrates the contextual information transmitted from different slice depths, so that the features of each pixel in the feature map contain defect association information of its own slice and adjacent slices, providing a more accurate feature foundation for subsequent mask prediction. This 2D convolution operation continues the low computational complexity advantage of 2D convolution, and since the features have been pre-aligned across slices by the Spatial Feature Shifting (SSM) module, the convolution process actually completes a secondary aggregation of cross-slice features.

[0100] Execution process 5: Parallel prediction of multiple-input multiple-output asymmetric segmentation mask.

[0101] Based on the aggregated and optimized feature map, the decoder employs a multiple-input multiple-output (MIMO) asymmetric prediction strategy to perform parallel prediction of the segmentation mask on the input sequence. The core principle follows the rule M=N-4 (where N is the number of consecutive slices in the input sequence and M is the number of predicted center slices). In the preferred embodiment, N=9 and M=5, meaning that for a sequence with 9 consecutive slices as input, the decoder predicts the segmentation mask of the middle 5 slices in parallel. The specific design and execution key points are as follows:

[0102] Prediction logic: This asymmetric strategy ensures that each predicted center slice has at least two layers of context information of the preceding and following adjacent slices at the input end, completely avoiding the prediction uncertainty caused by the lack of context information for edge slices and improving the overall accuracy of mask prediction.

[0103] Parallel output: The number of output channels in the last layer of the decoder is configured to be M, which corresponds one-to-one with the number of center slices to be predicted. A single forward propagation can output the defect prediction probability map of M slices in parallel, i.e. the segmentation mask, which greatly improves inference efficiency and meets the real-time requirements of industrial online inspection.

[0104] Mask format: The output segmentation mask is a pixel-level defect prediction probability map, rather than a binary mask. Each pixel takes a probability value between 0 and 1, representing the confidence level of the pixel as a defect category. This preserves complete probability information for subsequent binarization and 3D reconstruction. The accuracy of defect segmentation can be adjusted by customizing the threshold.

[0105] Execution process 6: Embedding of the Spatial Feature Displacement Module (SSM) in the entire feature processing process.

[0106] Consistent with the encoder, each feature processing stage of the decoder incorporates a Spatial Feature Displacement Module (SSM). That is, after each upsampling, skip connection fusion, and 2D convolution aggregation operation, the SSM performs channel grouping, axial displacement, and convolution fusion operations. This ensures that the feature recovery and aggregation process during the decoding stage maintains awareness and fusion of cross-slice context information throughout, guaranteeing that the final output M center slice segmentation masks have high topological consistency in defect prediction between layers. This lays the foundation for subsequent 3D reconstruction to generate smooth, well-connected 3D defect morphologies.

[0107] Overall, the decoder achieves accurate restoration of feature resolution and enhancement of defect features through a combination of progressive upsampling, skip connections, and 2D convolutional aggregation. The multi-input multi-output asymmetric parallel prediction strategy balances segmentation accuracy and inference efficiency. Combined with the spatial feature displacement module (SSM) embedded throughout the process, it retains the computational advantages of 2D convolution while ensuring feature continuity across slices. The final output center slice segmentation mask has pixel-level accuracy and inter-layer topological consistency, which is a key step in achieving high-precision segmentation of 3D defects in industrial CT.

[0108] Step S103: Unify, integrate, coordinate, and reconstruct all segmentation masks output by the 2.5D segmentation network inference, transforming the discrete slice-level segmentation results into complete three-dimensional defect segmentation results consistent with the physical structure of the object to be detected, thereby realizing voxel-level three-dimensional characterization of defects in industrial CT volume data.

[0109] This step is the final stage of the 3D defect segmentation method. Its core is to unify, integrate, coordinate-align, and reconstruct all segmentation masks output by the 2.5D network inference, transforming the discrete slice-level segmentation results into a complete 3D defect segmentation result consistent with the physical structure of the object to be inspected. This achieves voxel-level 3D characterization of defects in industrial CT volume data. The specific execution process and technical details are as follows:

[0110] Execution process 1: Unified output and format standardization of segmentation masks.

[0111] The receiver decoder outputs segmentation masks for the center positions of M slices in parallel for each sliding window input sequence (M=5 in the preferred configuration). All output segmentation masks are pixel-level defect prediction probability maps, with pixel values ​​ranging from 0 to 1, representing the confidence level of the corresponding position as the defect category. The spatial resolution of the mask is completely consistent with the original industrial CT 2D slices. The pixel coordinates, size and other parameters of the slices are standardized and aligned with the original industrial CT volume data, laying the coordinate foundation for subsequent reconstruction.

[0112] Execution process 2: Axial index calibration of the sliding window mask.

[0113] Based on the original parameters of the sliding window sampling, a unique original slice axial index is assigned to each output segmentation mask: taking the preferred window size N=9 and prediction center M=5 as an example, for the sliding window input sequence extracted from the z-4 to z+4 layers of the original volume data, the five output segmentation masks correspond to the z-2, z-1, z, z+1, and z+2 layers of the original volume data, respectively. Each mask is assigned an axial Z-axis index that corresponds one-to-one with the original industrial CT volume data slice, ensuring that the spatial position of all masks is traceable and aligned.

[0114] Execution process 3: Axial splicing and merging of overlapping areas of the mask.

[0115] Following the sliding window's step size (matching the number of predicted center slices), all axially indexed segmentation masks are sequentially stitched together along the axis (Z-axis) of the original industrial CT volume data:

[0116] If the sliding step size is set to M (preferably 5), the masks output by adjacent windows have no overlapping areas, and the splicing can be completed by arranging them sequentially according to the axial index.

[0117] To improve segmentation accuracy, a smaller sliding step size is set. When overlapping areas occur between adjacent window masks, the pixel prediction probabilities of the overlapping areas are processed using mean fusion or maximum value fusion strategies to eliminate prediction differences in the overlapping areas, ensure the continuity of pixel values ​​in the stitched mask, and avoid segmentation artifacts caused by window sliding.

[0118] Execution process 4: Binarization of the segmentation mask.

[0119] Adaptive binarization is performed on the complete mask sequence after axial stitching. By setting a global or local threshold (which can be customized according to the accuracy requirements of industrial inspection or determined by an adaptive threshold algorithm), the probability values ​​of 0-1 in the mask are converted into binary values ​​of 0 / 1: where 1 represents that the pixel position is a defect voxel and 0 represents that the pixel position is a background voxel. A three-dimensional binary mask with dimensions completely consistent with the original industrial CT volume data is generated. The dimensions of the mask are Z×H×W, which perfectly matches the number of slices (Z) and single slice resolution (H×W) of the original industrial CT volume data, realizing voxel-level defect annotation.

[0120] Execution process 5: Construction and output of 3D defect segmentation results.

[0121] The generated 3D binary mask is spatially aligned and fused with the original industrial CT volumetric data. Based on the binary mask, the spatial information of all defect voxels is extracted from the original industrial CT volumetric data to construct a complete 3D defect segmentation result of the object to be detected. This result contains the core 3D features of the defect.

[0122] Spatial location: The three-dimensional coordinate range (X, Y, Z axes) of the defect within the object to be inspected;

[0123] Morphological characteristics: the three-dimensional contour, shape, and direction of extension of defects, restoring the true physical morphology of defects such as pores, cracks, and inclusions;

[0124] Quantitative indicators: Based on the three-dimensional defect segmentation results, quantitative parameters such as defect volume, equivalent diameter, and surface area can be calculated to meet the quantitative analysis needs of industrial non-destructive testing.

[0125] Execution process 6: Visualization and storage of 3D defect segmentation results.

[0126] The final 3D defect segmentation results are visualized using 3D rendering, presenting the distribution of defects within the object under inspection in the form of a stereo model. Simultaneously, the 3D defect segmentation results are stored in a standardized volumetric data format (such as NIfTI, DICOM, etc.), retaining all data including voxel-level information, axial index, and quantitative indicators. This supports subsequent industrial inspection and analysis, process optimization, quality assessment, and other follow-up operations, and the storage format is compatible with mainstream industrial CT data analysis software.

[0127] Overall, this step achieves the transformation from slice-level defect segmentation to voxel-level 3D defect representation through indexing, axial stitching, overlapping and fusion, and binarization reconstruction of discrete segmentation masks. This ensures that the final 3D defect segmentation result is highly consistent with the actual internal defects of the object under inspection in terms of spatial topology, positional accuracy, and morphological integrity. At the same time, the output quantitative indicators and standardized storage format are fully adapted to the quality inspection and process optimization needs of the high-end manufacturing industry.

[0128] In the above method, the training and optimization of the 2.5D segmentation network is the core prerequisite for achieving high-precision 3D defect segmentation in industrial CT scans. This process is based on voxel-level labeled industrial CT datasets. Through customized loss function design, reasonable training strategy configuration, and iterative parameter optimization, the network learns the feature representations of defects in industrial CT slices and the cross-slice topological continuity rules, ultimately obtaining a model with strong generalization ability and high segmentation accuracy. The entire training process revolves around the dual objectives of pixel-level classification accuracy and cross-slice topological consistency optimization. Key steps include dataset construction and preprocessing, network initialization, loss function design, training hyperparameter configuration, iterative training and gradient optimization, model validation, and saving. All technical details are adapted to the characteristics of industrial CT data and the features of the 2.5D network architecture. The specific execution flow and technical details are as follows:

[0129] Training and optimization process 1: Training dataset construction and preprocessing.

[0130] The training is based on the ICT-Defect dedicated dataset, which is built for industrial CT defect segmentation scenarios. It covers parts of three typical metal materials in high-end manufacturing fields: aluminum alloy, magnesium alloy, and nickel-based high-temperature alloy. All of these are real inspection objects in scenarios such as aerospace and automobile manufacturing. High-resolution industrial CT scans are performed on all parts to obtain 3D volume data in 16-bit unsigned integer format. Industrial inspection experts complete the voxel-level fine defect annotation, and the annotated defect types include common industrial micro-defects such as porosity, cracks, inclusions, and shrinkage cavities. Defect ground truth masks that correspond one-to-one with the volume data are generated.

[0131] The dataset employs a strict component-based partitioning strategy to split the training and test sets. Several complete components are used as the test set, while the remaining components serve as the training set. This ensures complete physical isolation between the training and test sets, closely mimicking the inference scenarios of unknown objects in real-world industrial inspections. This approach avoids model overfitting and accurately verifies generalization capabilities. Before training, the training data undergoes the same preprocessing (denoising and normalization) as the inference stage, along with online data augmentation. Augmentation methods include random rotation from 0 to 360 degrees, horizontal / vertical flipping, and elastic deformation. Furthermore, identical geometric transformation parameters are applied to N consecutive slices of the same input sequence, strictly maintaining spatial alignment between slices to prevent inconsistent transformations from disrupting cross-slice contextual relationships. Simultaneously, the training sample size is expanded to enhance the model's adaptability to different defect morphologies and locations.

[0132] Training and optimization process 2: Network model initialization.

[0133] The parameters of the encoder, spatial feature displacement module (SSM), and decoder of the 2.5D segmentation network are initialized to ensure training stability and convergence efficiency.

[0134] The encoder uses a 2D backbone network (ResNet, SegFormer, EfficientNet, or MiT) pre-trained on a large-scale natural image dataset (such as ImageNet). The pre-trained weights are directly loaded to initialize the encoder parameters. The general texture, edge, and contour features learned by the pre-trained model are used to reduce the training convergence difficulty of industrial CT defect segmentation scenarios and improve the model's ability to represent defect features.

[0135] The Spatial Feature Displacement Module (SSM) is a parameterless geometric operation module that does not require parameter initialization. It only requires preset hyperparameters such as channel grouping ratio and displacement step size.

[0136] The decoder and layers in the network that have not loaded pre-trained weights (such as skip connection fusion layers and 2D convolutional fusion layers) are initialized with random normal distribution to ensure the rationality of the initial parameter values ​​and avoid gradient vanishing or exploding during training.

[0137] Training and optimization process 3: Design and configuration of total loss function.

[0138] The total loss function is designed with multiple components and weights, taking into account pixel-level defect classification accuracy, class imbalance, and cross-slice topological continuity constraints. The formula for the total loss function is as follows:

[0139] ;

[0140] in , , The preferred configuration is as follows: =1、 =10、 =10, a high-weight configuration that emphasizes optimization of defect shape integrity and inter-layer topological continuity, adapting to the three-dimensional continuous physical characteristics of industrial defects. The functions and calculation details of each loss component are as follows:

[0141] Binary cross-entropy loss : Responsible for supervising pixel-level classification accuracy, calculating the cross-entropy between the defect probability predicted by the model and the ground truth mask pixel by pixel, allowing the network to learn to distinguish defect voxels from background voxels, and is the basic loss of the segmentation task.

[0142] Dice coefficient loss To address the severe class imbalance problem in industrial CT images (where the proportion of defect voxels is typically less than 1%), this method measures segmentation similarity by calculating the intersection-union ratio (IUU) of the predicted mask and the ground truth mask. The Dice coefficient loss is 1 - Dice coefficient, which effectively prevents the network from predicting the entire background due to an excessively high proportion of background voxels, thus improving the segmentation ability for minor defects.

[0143] Interlayer continuity loss This function is responsible for supervising topological consistency across slices and explicitly penalizing predicted discontinuities between adjacent slices. Its computation is based on prior knowledge of the physical continuity of industrial defects, and the core steps are as follows:

[0144] Core Step 1: Based on the actual labels, find the adjacent slices. and The regions containing defects are the overlapping defect areas used to determine the truth masks of adjacent layer d and layer d+1 slices. That is, the set of pixel locations in both layers that are defect categories;

[0145] ;

[0146] The defect overlap region represents a set of voxels that must be continuous in terms of physical truth.

[0147] Core Step 2: Overlapping Regions Each pixel position The product of the predicted probabilities of the two layers is calculated as a continuity metric. This value is highly sensitive to inconsistencies in inter-layer predictions (the product approaches 1 when consistent and drops sharply when inconsistent); the expectation network is in the 1st... Layer and first Layer prediction probability and Both are close to 1. The continuity score at this location is defined as the product of the two predicted probabilities, calculated using the following formula:

[0148] ;

[0149] If two layers predict the same result and are accurate (e.g., both 0.9), the product is 0.81; if one layer predicts accurately while the other misses (e.g., 0.9 and 0.1), the product drops sharply to 0.09. This makes the metric very sensitive to inconsistencies between layers.

[0150] Core Step 3: The goal of the ISC loss is to maximize the continuity score mentioned above. Its mathematical form can be designed as a variant based on the Dice coefficient to normalize the numerical range. The continuity metrics for all overlapping regions are aggregated, combined with a normalization factor (a small constant to prevent division by zero). The loss value is calculated using the following formula:

[0151] ;

[0152] in, The area of ​​the overlapping region. To prevent small constants from being divided by zero, The total number of slices, This is a pixel continuity metric that drives the network to output consistent defect prediction probabilities at corresponding positions in adjacent slices.

[0153] Training and optimization process 4: Training hyperparameters and optimizer configuration.

[0154] To suit the characteristics of 2.5D network architecture and industrial CT data, appropriate training hyperparameters and optimizers are configured to ensure training efficiency and convergence performance.

[0155] Optimizer: The Adam W optimizer is selected. This optimizer adds weight decay to the Adam optimizer, which can effectively prevent model overfitting and is suitable for the characteristics of small sample annotation in industrial CT.

[0156] Initial learning rate: set to 5×10-4 to balance gradient update efficiency and stability during initial training, avoiding training oscillations caused by an excessively high learning rate and slow convergence caused by an excessively low learning rate.

[0157] Learning rate decay strategies: Use cosine annealing or Reduce LR On Plateau strategy. Cosine annealing allows the model to escape local optima by periodically adjusting the learning rate, while Reduce LR On Plateau reduces the learning rate when the performance on the validation set no longer improves. Both strategies can make parameter optimization more refined in the later stages of training and improve the final performance of the model.

[0158] Batch Size: Set reasonably according to the hardware memory resources. The preferred configuration is 4, which can improve the effectiveness of feature statistics within the batch while ensuring training stability.

[0159] Training iterations (Epochs): The default is 100 Epochs. An early stopping mechanism is also set. If the Dice coefficient of the validation set does not improve for 10 consecutive Epochs, the training will be terminated early to avoid ineffective training and overfitting.

[0160] Training and optimization process 5: Iterative training and gradient backpropagation optimization.

[0161] Iterative training is performed using mini-batch stochastic gradient descent, executed entirely on high-performance computing units such as GPUs to ensure training efficiency. The specific iterative training process is as follows:

[0162] Iterative training process 1: Randomly select a batch of preprocessed data from the training set, generate an input sequence divided into N consecutive slices, and feed it into the 2.5D segmentation network for forward propagation. Sequentially complete encoder independent feature extraction, spatial feature displacement module SSM cross-slice context fusion, decoder feature aggregation and parallel prediction of the central M slice segmentation masks, and output the defect prediction probability map for each pixel.

[0163] Iterative training process 2: Based on the predicted probability map output by the network and the corresponding ground truth mask, calculate the binary cross-entropy loss, Dice coefficient loss and inter-layer continuity loss respectively, and sum them according to the weight coefficients to obtain the total loss value.

[0164] Iterative training process 3: Based on the total loss value, the gradient of all trainable parameters of the network is calculated using the backpropagation algorithm. The Adam W optimizer is then used to update the parameters according to the gradient values ​​and the learning rate, so that the total loss value is gradually reduced.

[0165] Repeat the forward propagation, loss calculation, and gradient update steps described above to complete one training epoch (the number of times all training data is learned once). After each epoch, the validation set data is fed into the network for inference, and evaluation metrics such as IoU and Dice coefficient are calculated to monitor the model's generalization ability. During training, all trainable layers of the encoder and decoder participate in gradient updates. The Spatial Feature Shift (SSM) module, having no additional parameters, only participates in forward propagation as a feature processing step and does not participate in gradient updates. Furthermore, all two-dimensional convolutional layers in the network employ batch normalization (BN) and activation functions (such as ReLU and GELU) to improve feature representation capabilities and training convergence speed.

[0166] Training and optimization process 6: Model validation and optimal weight saving.

[0167] During training, validation set performance is the core criterion for model effectiveness verification and optimal weight selection: After each epoch of training, inference without data augmentation is performed on the validation set, and key metrics such as IoU (Intersection over Union), Dice coefficient, and inference time are calculated. IoU and Dice coefficient reflect segmentation accuracy, while inference time reflects the model's computational efficiency. An early stopping mechanism and optimal weight preservation strategy are employed. When the validation set Dice coefficient reaches its maximum value during the current training process, all trainable parameters of the current network are immediately saved as the optimal model weights, overwriting the previous weight file. If validation set performance shows no improvement for 10 consecutive epochs, the early stopping mechanism is triggered to terminate training, preventing the model from overfitting to local features of the training set.

[0168] Training and optimization process 7: Model testing and performance evaluation.

[0169] After training, the saved optimal model is evaluated using an independent test set (complete parts not included in the training, divided by component). The evaluation process fully simulates the inference flow of real industrial inspection: preprocessing of industrial CT volume data of the test set, sliding window sampling, 2.5D network inference, and reconstruction of 3D defect segmentation results are performed to verify the model performance from both quantitative and qualitative dimensions.

[0170] Quantitative metrics: Calculate the IoU, Dice coefficient, single inference time, and number of model parameters on the test set to verify the segmentation accuracy and computational efficiency of the model; the model trained by this scheme can achieve an IoU of 0.508, a Dice coefficient of 0.670, process 9 slices in a single run in only 0.027 seconds, and has approximately 14M parameters, balancing accuracy and efficiency.

[0171] Qualitative indicators: Visualize the segmentation results in 2D slices and 3D models to verify the model's ability to identify low-contrast small defects and continuously segment complex topological defects, ensuring that the defect boundaries of the segmentation results are smooth, there are no breaks between layers, and the three-dimensional morphology is highly consistent with the real defects.

[0172] Overall, the training and optimization of the 2.5D segmentation network were designed around the actual needs of industrial CT defect segmentation. Through the construction of a dedicated dataset, pre-trained weight transfer, customization of multi-component loss functions, and configuration of adaptive training strategies, the model learns both the pixel-level features of defects in industrial CT slices and the three-dimensional topological continuity of defects across slices. The final trained model has high segmentation accuracy, strong generalization ability, and high computational efficiency, and is fully adapted to the requirements of industrial online inspection scenarios.

[0173] Figure 2a , Figure 2bThe images shown are schematic diagrams of 3D and 2D castings from the ICT-Defect dataset, illustrating the industrial CT inspection objects included in the dataset and their data formats, as detailed below:

[0174] Figure 2a The 3D casting examples in the dataset showcase three-dimensional models of typical industrial metal parts, reflecting the diversity of application scenarios and inspection objects. These include complex metal castings from aerospace, automotive manufacturing, and other fields, such as structural components, shells, cylindrical parts, and integrated die-cast parts, covering typical industrial materials such as aluminum alloys, magnesium alloys, and nickel-based high-temperature alloys. The gray semi-transparent planes in the figures represent the slice positions during industrial CT scanning, visually demonstrating the correspondence between the three-dimensional parts and subsequent two-dimensional slice data, reflecting the data generation logic of "three-dimensional entity → two-dimensional slice sequence." These three-dimensional models are all objects to be inspected in real industrial inspection scenarios. Their internal defects (porosity, cracks, inclusions, etc.) form the core three-dimensional volume data of the dataset after industrial CT scanning.

[0175] Figure 2b The 2D casting example in the dataset showcases industrial CT 2D slice images reconstructed from the aforementioned 3D castings. These slices serve as the fundamental data units of the dataset: the slices are grayscale images, with grayscale values ​​reflecting material density differences at corresponding locations. Defect areas (such as porosity and shrinkage) appear as dark areas or grayscale anomalies due to their lower density. The dataset demonstrates the CT slice features of different types of components, including: complex structures such as internal reinforcing ribs and holes in structural parts; wall thickness and internal support structures in cylindrical parts; fine structures such as flow channels and cooling channels in integrated die-cast parts; and the mesh-like internal structure of lightweight designs. These slices are the direct input data for the 2.5D segmentation network. After voxel-level annotation, they form the ground truth mask required for network training, supporting the training and optimization of the defect segmentation model.

[0176] Overall, Figure 2a , Figure 2b The core components of the ICT-Defect dataset are clearly presented: real industrial metal parts are used as the inspection objects, three-dimensional volume data are generated through industrial CT scanning, and then decomposed into two-dimensional slice sequences, providing complete sample support from three-dimensional entities to two-dimensional data for industrial CT three-dimensional defect segmentation tasks.

[0177] Figure 3 This is a schematic diagram of the components of a 3D defect segmentation system. The system includes a scanning subsystem, a motion subsystem, a reconstruction subsystem, and a memory.

[0178] The scanning subsystem is used to generate multi-angle projection data.

[0179] The motion subsystem is used to carry the workpiece under test and complete a 360-degree rotational scan.

[0180] The reconstruction subsystem acquires the original volume data from industrial CT scans, performs standardized preprocessing, and constructs a slice sequence with 3D contextual information. This slice sequence is then fed into a pre-trained deep learning-based 2.5D segmentation network. Through sequential slice feature extraction, cross-slice contextual information fusion, cross-slice feature aggregation, and parallel prediction of the segmentation mask, the network outputs a segmentation mask at the center of the input sequence. All segmentation masks output by the 2.5D segmentation network are then uniformly integrated, aligned, and 3D reconstructed, transforming the discrete slice-level segmentation results into a complete 3D defect segmentation result consistent with the physical structure of the object being detected. This achieves voxel-level 3D representation of defects in industrial CT volume data.

[0181] The memory is used to store industrial CT data, network model weights, and computer-executable instructions.

[0182] In practical applications, the scanning subsystem uses a 9MeV linear accelerator as the X-ray generator 1, with a focal size of 2.0mm to ensure spatial resolution of the imaging. It is paired with a high-sensitivity, large dynamic range area array flat panel detector 4 to collect X-ray attenuation signals after penetrating high-density metal workpieces, generating multi-angle projection data. The motion subsystem is equipped with a precision rotation device 2 (high-precision rotating stage) to carry the test sample 3 (workpiece under test) and complete a 360-degree rotational scan. It is also equipped with a granite base with active vibration isolation to eliminate the influence of environmental vibrations on imaging and ensure geometric alignment accuracy. The intelligent analysis software module in the reconstruction subsystem incorporates the 2.5D defect segmentation algorithm proposed in this invention. It is responsible for reading the reconstructed volume data, automatically performing defect segmentation, statistically analyzing defect indicators, and visually displaying the detection results on the user interface through 3D rendering. The reconstruction subsystem uses a high-performance image processing workstation equipped with an NVIDIA H100 GPU. It receives projection data through a high-speed transmission interface, runs the FDK cone-beam reconstruction algorithm to reconstruct the two-dimensional projection data into isotropic three-dimensional volume data, and stores the reconstructed data in 16-bit unsigned integer format.

[0183] To verify the effectiveness of this technical solution, rigorous comparative experiments were conducted on the ICT-Defect dataset. The experiments compared the solution of this invention with current mainstream segmentation algorithms, including:

[0184] 2D methods: U-Net, U-Net++, DeepLabv3+.

[0185] 3D methods: 3DU-Net, AttU-Net, UNETR (Transformer-based 3D networks).

[0186] Other 2.5D methods: SegFormer, TransUnet.

[0187] Experimental results show that the solution of the present invention has significant advantages in the following key indicators.

[0188] IoU (Intersection over Union): The method of this invention achieves an IoU of 0.508, which is about 22% higher than the basic U-Net (0.415) and also significantly higher than the advanced SegFormer (0.373).

[0189] Dice coefficient: The Dice score of the method of this invention is 0.670, which is significantly higher than that of 2D U-Net (0.581) and 3D U-Net (0.292). It is worth noting that the pure 3D method performs worse than the 2D method with limited data due to its large number of parameters and difficulty in training. The 2.5D strategy disclosed in this invention successfully overcomes this drawback.

[0190] Computational efficiency: In terms of inference time, the method of this invention only takes about 0.027 seconds to process 9 slices at a time, which is much faster than 3D methods (such as UXNet which takes 183 seconds), and the number of parameters (about 14M) is comparable to that of lightweight 2D networks, which is much smaller than large models such as TransUnet (95M).

[0191] The solution of the present invention performs particularly well in the following scenarios:

[0192] Low-contrast micro-defects: The SSM mechanism enhances the ability to capture weak signals by fusing context, and can effectively segment micro-pores that are missed by other methods.

[0193] Complex topology: Thanks to the constraints of ISC loss, the defect boundaries segmented by this method are smoother and more continuous, eliminating interlayer fractures and generating more realistic 3D models that conform to the characteristics of physical entities.

[0194] In summary, the technical solution of this invention achieves efficient 3D context awareness. By introducing a Spatial Feature Displacement (SSM) module, while maintaining the computational efficiency of 2D convolution, it endows the network with a receptive field similar to 3D convolution through the axial displacement of feature channels. This zero-parameter feature interaction method can effectively fuse the contextual information of adjacent slices, significantly improving the network's ability to identify small, low-contrast defects. It also enhances 3D topological continuity by proposing Interlayer Continuity Loss (ISC). Utilizing prior knowledge of the continuous physical distribution of industrial defects, it explicitly penalizes the prediction differences between adjacent slices during the training phase, forcing the network to learn the 3D structural features of defects. This solves the problem of inconsistent interlayer predictions in traditional 2D and 2.5D methods, generating high-quality 3D segmentation results with smooth surfaces and topological connectivity. Furthermore, it considers the segmentation... The 2.5D network architecture cleverly balances accuracy and processing speed, allowing the use of a 2D backbone network pre-trained on large-scale natural image datasets to accelerate model convergence and improve generalization ability. Simultaneously, its computational complexity and memory usage are far lower than full 3D networks, enabling it to handle higher-resolution industrial CT data and meet the real-time and efficiency requirements of industrial online inspection. Furthermore, it enhances the model's robustness and adaptability. Combined with the ICT-Defect dataset, designed for industrial scenarios and encompassing various typical industrial materials, and employing voxel-level expert annotation and component-based training and testing set strategies, this method exhibits stronger robustness and environmental adaptability in complex industrial inspection scenarios, effectively segmenting various internal defects in complex metal parts in aerospace, automotive manufacturing, and other fields.

[0195] The present invention provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the above-described three-dimensional defect segmentation method.

[0196] The present invention may also provide a storage medium, which may be a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the above-described three-dimensional defect segmentation method.

[0197] The computer-readable storage medium provided by this invention may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0198] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A three-dimensional defect segmentation method, characterized in that, The method includes: The raw volume of industrial CT scans is obtained, standardized preprocessing is performed, and a slice sequence with three-dimensional context information is constructed. The slice sequence is fed into a pre-trained 2.5D segmentation network based on deep learning. The network sequentially performs slice feature extraction, cross-slice context information fusion, cross-slice feature aggregation, and parallel prediction of the segmentation mask, and outputs the segmentation mask at the center position of the input sequence. All segmentation masks output by the 2.5D segmentation network inference are uniformly integrated, aligned, and reconstructed in three dimensions. The discrete slice-level segmentation results are transformed into complete three-dimensional defect segmentation results that are consistent with the physical structure of the object to be detected, thereby realizing voxel-level three-dimensional characterization of defects in industrial CT volume data. The 2.5D segmentation network consists of an encoder, a spatial feature displacement module (SSM), and a decoder. During the training phase, the 2.5D segmentation network introduces inter-layer continuity loss (ISC) through the total loss function to perform cross-slice topology consistency constraints on the features extracted from the pre-trained 2D backbone network and fused by the spatial feature displacement module (SSM). The Spatial Feature Displacement (SSM) module is embedded between / within each stage of the encoder and in each layer of the decoder. It alternates with feature extraction and upsampling operations. Through channel grouping, spatial axial displacement, boundary filling and convolution fusion operations of the feature tensor, it realizes efficient interaction and deep fusion of contextual information between adjacent slices. This allows the feature processing of the entire network to capture cross-slice contextual information and continuously expand the effective receptive field in the depth direction.

2. The three-dimensional defect segmentation method according to claim 1, characterized in that, A sliding window sampling operation is performed on the preprocessed industrial CT volume data. Based on the axial index of the slice, a tensor containing N consecutive two-dimensional slices is extracted from the volume data and used as the input sequence for the 2.5D segmentation network.

3. The three-dimensional defect segmentation method according to claim 1, characterized in that, The encoder extracts overall features from each industrial CT 2D slice in the input sequence.

4. The three-dimensional defect segmentation method according to claim 1, characterized in that, The decoder takes the fused feature map processed by the Spatial Feature Shifting (SSM) module as input. Through progressive upsampling, skip connection fusion, and cross-slice feature aggregation operations, it restores the feature spatial resolution and enhances the representation of defect features. Finally, it uses a multi-input multi-output asymmetric strategy to predict the segmentation mask of the center position of the input sequence in parallel, realizing the parallel prediction of feature aggregation and segmentation mask.

5. The three-dimensional defect segmentation method according to claim 1, characterized in that, The Spatial Feature Displacement Module (SSM) receives the feature tensor extracted by the encoder and divides the input feature tensor into three independent logical channel groups along the channel dimension: the hold group, the forward displacement group, and the backward displacement group. The number of channels in each group is flexibly controlled by a custom offset ratio.

6. The three-dimensional defect segmentation method according to claim 5, characterized in that, The Spatial Feature Displacement Module (SSM) is based on the depth dimension of industrial CT slices. It performs differentiated pure geometric spatial displacement operations on three independent logical channel groups, and achieves cross-slice feature information transfer only through position offset, allowing the current slice position to be integrated with the context information of adjacent slices before and after.

7. A three-dimensional defect segmentation system for implementing the three-dimensional defect segmentation method according to any one of claims 1 to 6, characterized in that, The three-dimensional defect segmentation system includes a scanning subsystem, a motion subsystem, a reconstruction subsystem, and a memory. A scanning subsystem is used to generate multi-angle projection data; The motion subsystem is used to carry the workpiece under test and complete a 360-degree rotational scan. The reconstruction subsystem obtains the original volume of industrial CT, performs standardized preprocessing, and constructs a slice sequence with three-dimensional context information. The slice sequence is fed into a pre-trained 2.5D segmentation network based on deep learning. The network sequentially performs slice feature extraction, cross-slice context information fusion, cross-slice feature aggregation, and parallel prediction of the segmentation mask, and outputs the segmentation mask at the center position of the input sequence. All segmentation masks output by the 2.5D segmentation network inference are uniformly integrated, aligned, and reconstructed in three dimensions. The discrete slice-level segmentation results are transformed into complete three-dimensional defect segmentation results that are consistent with the physical structure of the object to be detected, thereby realizing voxel-level three-dimensional characterization of defects in industrial CT volume data. The memory is used to store industrial CT data, network model weights, and computer-executable instructions.

8. A storage medium, characterized in that, The storage medium is a computer-readable storage medium having computer-readable program instructions stored thereon, the computer-readable program instructions being used to perform the three-dimensional defect segmentation method as described in any one of claims 1 to 6.