A 3D printing failure detection method

By acquiring real-time images and sliced ​​images to form image pairs, and utilizing learnable four-neighborhood difference operators and channel-level scaling parameters, combined with global coarse offset, local offset, and sub-pixel regression, the offset is refined step by step. This solves the problems of insufficient robustness and generalization ability of existing 3D printing interlayer offset detection methods, and achieves efficient and accurate offset detection and compensation.

CN122077934BActive Publication Date: 2026-07-07CHENGDU FEIZHENG NENGDA TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHENGDU FEIZHENG NENGDA TECH CO LTD
Filing Date
2026-04-22
Publication Date
2026-07-07

Smart Images

  • Figure CN122077934B_ABST
    Figure CN122077934B_ABST
Patent Text Reader

Abstract

The application discloses a 3D printing fault detection method, and relates to the technical field of 3D printing, and comprises the following steps: S1, collecting real-time images of current 3D printing, and forming a to-be-detected image pair with corresponding slice images; S2, performing feature extraction on the to-be-detected image pair to obtain corresponding real-time feature maps and slice feature maps; and S3, determining global coarse offsets and local offsets according to the real-time feature maps and the slice feature maps, and generating final offsets. The application can stably work on images with different resolutions and different texture features, and has good generalization performance across different printer models and materials.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of 3D printing technology, and more specifically to a 3D printing fault detection method. Background Technology

[0002] In the field of additive manufacturing (3D printing), the layer-by-layer stacking process makes the precise positioning of each layer crucial. Due to factors such as printing platform motion errors, material shrinkage, thermal deformation, and mechanical vibration, slight misalignments often occur between the actual printed layers and the design model. If these misalignments are not detected and compensated for in a timely manner, they will accumulate layer by layer, leading to dimensional deviations in the finished product, reduced structural strength, or even printing failure.

[0003] Existing interlayer migration detection methods can be mainly divided into three categories: The first category is direct image comparison methods based on visual sensors, which estimate migration by image similarity. However, this method is sensitive to changes in illumination and differences in material surface texture, and has poor robustness. The second category is feature point matching methods, which perform registration by extracting local features such as SIFT and ORB. However, the surface of printed layers often has sparse texture and many repetitive textures, making feature point extraction difficult and resulting in a low matching success rate. The third category is deep learning-based methods, which learn the mapping relationship between images through convolutional neural networks. However, existing methods are mostly targeted at specific printing materials or specific printer models, have insufficient generalization ability, and require a large amount of computation, making it difficult to meet the needs of real-time detection. Summary of the Invention

[0004] To address the above problems, this invention proposes a 3D printing fault detection method.

[0005] The technical solution of this invention is: a 3D printing fault detection method, characterized by comprising the following steps:

[0006] S1. Acquire real-time images of the current 3D printing process and form a pair of images to be detected with the corresponding slice images;

[0007] S2. Extract features from the image pairs to be detected to obtain the corresponding real-time feature map and slice feature map;

[0008] S3. Based on the real-time feature map and the slice feature map, determine the global coarse offset and the local offset, and generate the final offset.

[0009] Image pairs are created by combining the corresponding layer slice images of the 3D printed design model with real-time images.

[0010] Furthermore, S2 includes the following sub-steps:

[0011] S21. Add the values ​​of the four neighboring pixels of the current pixel in the real-time image and the slice image;

[0012] S22. Use the summed values ​​of the four neighboring pixels to constrain the current pixel, and obtain the constrained pixel value of the current pixel as the feature map.

[0013] The beneficial effects of the above-mentioned further solutions are as follows: In this invention, a learnable four-neighborhood difference operator is designed, and channel-level scaling parameters and biases are introduced, enabling the feature extraction process to be adaptively adjusted and enhancing its adaptability to different printing materials and lighting conditions. Based on the local edges of pixels, this invention can amplify the features of interlayer edge misalignment, making offset detection more sensitive.

[0014] Furthermore, in S22, the expression for the feature map is:

[0015] ;

[0016] in, Represents pixels in the feature map pixel values, Represents pixels The sum of the values ​​of the four neighboring pixels, Represents pixels in a real-time image or slice image. pixel values, Indicates channel-level scaling parameters. Indicates channel-level bias. This indicates element-wise multiplication. This represents the activation function. Represents the x-coordinate of a pixel. Represents the ordinate of a pixel.

[0017] Furthermore, S3 includes the following sub-steps:

[0018] S31. Downsample the real-time feature map and the slice feature map, and calculate the offset.

[0019] S32. Based on the offset, obtain the global coarse offset;

[0020] S33. Determine the local offset;

[0021] S34, with Centered on the slice feature map and the real-time feature map, a 3×3 neighborhood window of the same size is constructed, where, This represents the number of horizontal global offset pixels that align the sliced ​​feature map with the real-time feature map. This represents the number of vertical global offset pixels that align the sliced ​​feature map with the real-time feature map. The x-coordinate representing the center of the real-time feature map. The ordinate represents the center of the real-time feature map. This represents the number of horizontal local offset pixels that align the sliced ​​feature map with the real-time feature map. This represents the number of vertical local offset pixels that align the sliced ​​feature map with the real-time feature map.

[0022] S35. Generate the final offset based on the pixels of the neighboring window.

[0023] The beneficial effects of the above-mentioned further scheme are as follows: In this invention, the approach is coarse-to-fine, first locking the approximate offset range on a large scale, then finely locating it on a small scale, and finally further improving the accuracy through sub-pixel-level regression. In the global coarse estimation stage, matching is performed using downsampled low-resolution feature maps. The low-resolution operation is equivalent to low-pass filtering, which can suppress high-frequency noise and enhance the perception of the global structure. In the local fine estimation stage, fine matching is performed using the original resolution window, which can correct the integer-level residuals of the coarse estimation. In the sub-pixel regression stage, small neighborhood windows are extracted, and sub-pixel-level offsets are learned through a convolutional network.

[0024] In S31, to reduce computational load and enhance perception of global structure, bilinear interpolation downsampling is performed on the input feature map to obtain a low-resolution feature map. The downsampling factor is 4, and the number of channels remains unchanged.

[0025] Furthermore, in S31, the offset The expression is:

[0026] ;

[0027] in, Represents the pixels in the real-time feature map after downsampling. pixel values, This indicates that the slice feature map after downsampling is at the offset. The corresponding position after pixel values, This represents the horizontal translation offset. This represents the vertical translation offset. This represents the mean value of all pixels in the real-time feature map after downsampling. This represents the mean value of all pixels in the sliced ​​feature map after downsampling. Represents the x-coordinate of a pixel. Represents the ordinate of a pixel.

[0028] The beneficial effects of the above further scheme are: In this invention, the real-time feature map is the result of feature extraction from the image captured at the current printing layer, serving as the search map. The slice feature map is the feature map of the corresponding layer of the design model, serving as a template. (Fixed) The slice feature map at the location Taking this value is equivalent to shifting the entire slice feature map to the right. Pixels, downward shift Pixels. The translated slice feature map and the real-time feature map are on the same coordinates. Align the components and calculate similarity. Iterate through all possible similarities. The response matrix is ​​obtained, where the maximum value corresponds to... That is the most likely offset.

[0029] and The search scope is respectively and , and These represent the height and width of the image, respectively.

[0030] Furthermore, in S32, the expression for the global coarse offset is:

[0031] ;

[0032] ;

[0033] in, This represents the number of horizontal pixels that align the downsampled slice feature map with the real-time feature map. This represents the vertical offset of pixels that aligns the downsampled slice feature map with the real-time feature map. This represents the horizontal translation offset. This represents the vertical translation offset. This represents the number of horizontal global offset pixels that align the sliced ​​feature map with the real-time feature map. This represents the number of vertical global offset pixels that align the sliced ​​feature map with the real-time feature map. Indicates the downsampling factor. Indicates offset offset, This represents the horizontal translation offset. This indicates the vertical translation offset.

[0034] The beneficial effects of the above-mentioned further solutions are: In this invention, and The optimal translation amount is calculated on the downsampled low-resolution feature map. This optimal translation amount in the low-resolution space is then mapped back to the original resolution using a downsampling factor; that is, it is mapped back to the coordinate system of the feature map at the original resolution. Based on template movement for scene matching, this invention selects slice feature map movement to align the real-time feature map. The slice feature map needs to be translated. So many features are needed to align with the real-time feature map.

[0035] Furthermore, S33 includes the following sub-steps:

[0036] S331. Construct a local window at the center of the real-time feature map;

[0037] S332, with Centered on the slice feature map, construct a local window of the same size, where, This represents the number of horizontal global offset pixels that align the sliced ​​feature map with the real-time feature map. This represents the number of vertical global offset pixels that align the sliced ​​feature map with the real-time feature map. The x-coordinate representing the center of the real-time feature map. The ordinate representing the center of the real-time feature map;

[0038] S333. Calculate the cosine similarity of each pair of pixels in the local window of the real-time feature map and the slice feature map;

[0039] S334. Based on the position of the pixel corresponding to the maximum cosine similarity in the slice feature map, obtain the local offset.

[0040] The beneficial effects of the above-mentioned further scheme are as follows: In this invention, a point of interest (e.g., the image center or the current position of the print head) is selected on the real-time feature map, and then the corresponding position is found on the slice feature map. A small window is cut around both for fine matching. The role of the local window is to perform fine matching near the coarse offset, and it needs to cover a sufficient range to capture the coarsely estimated residual. The size of the local window (typically 5×5) covers the common range of the coarsely estimated residual (±2 pixels) while maintaining a small computational cost. The offset is obtained by mapping the maximum similarity position. The similarity between all pixel pairs within the window is calculated as a similarity matrix. The index pair corresponding to the maximum value is taken, and the local offset is directly obtained through the coordinate difference.

[0041] Furthermore, in S334, the expression for the local offset is:

[0042] ;

[0043] in, This indicates that column coordinates are being extracted. This indicates that the row coordinates are extracted. This represents the pixel position of the pixel pair corresponding to the maximum cosine similarity in the real-time feature map. This represents the pixel position of the pixel pair corresponding to the maximum cosine similarity in the slice feature map. This represents the number of horizontal local offset pixels that align the sliced ​​feature map with the real-time feature map. This represents the number of vertical local offset pixels that align the sliced ​​feature map with the real-time feature map.

[0044] The beneficial effect of the above-mentioned further solution is that, in this invention, the pair of pixels with the highest similarity is found. Then, we calculate the spatial offset of this pixel in the slice window relative to the pixel in the real-time window. If the rough estimate is completely correct, the center point of the real-time window should be most similar to the center point of the slice window, with an offset of 0. If residuals exist, the most similar pair of pixels will be off-center; this offset is what we need to compensate for. .

[0045] Furthermore, S35 includes the following sub-steps:

[0046] S351. Based on the pixels contained in the neighborhood windows of the slice feature map and the real-time feature map, construct the corresponding tensors respectively.

[0047] S352. Concatenate the tensor corresponding to the slice feature map and the tensor corresponding to the real-time feature map to obtain the composite feature.

[0048] S353. After convolving the composite features, input them into the activation function to obtain the sub-pixel offset.

[0049] S354. Add the global coarse offset, the local offset, and the sub-pixel offset to obtain the final offset.

[0050] The beneficial effect of the above-mentioned further scheme is that, in this invention, the coarse estimation and fine estimation have already approximately aligned the two images. Therefore, on the real-time image and the slice image, it is desirable to extract small neighborhoods at the same spatial location so that the network can learn small residual shifts.

[0051] The composite features are input into a small network consisting of two 3×3 convolutional layers (keeping the number of channels to 2) and one 1×1 convolutional layer (outputting 2 channels), and the subpixel offset is output after passing through the Tanh activation function.

[0052] The beneficial effects of this invention are as follows: This invention adopts a three-level progressive method of global coarse estimation, local fine estimation, and sub-pixel regression to refine the offset step by step; wherein, global coarse estimation locks the approximate offset range on the downsampled feature map and eliminates the overall translation deviation; local fine estimation corrects the integer residual through cosine similarity matching within the window; sub-pixel regression learns the nonlinear mapping within a small neighborhood window through a convolutional network to predict the offset of less than 1 pixel, so that it can work stably on images with different resolutions and different texture features, and has good generalization performance across printer models and materials. Attached Figure Description

[0053] Figure 1 This is a flowchart of a 3D printing fault detection method. Detailed Implementation

[0054] The embodiments of the present invention will be further described below with reference to the accompanying drawings.

[0055] like Figure 1 As shown, the present invention provides a 3D printing fault detection method, comprising the following steps:

[0056] S1. Acquire real-time images of the current 3D printing process and form a pair of images to be detected with the corresponding slice images;

[0057] S2. Extract features from the image pairs to be detected to obtain the corresponding real-time feature map and slice feature map;

[0058] S3. Based on the real-time feature map and the slice feature map, determine the global coarse offset and the local offset, and generate the final offset.

[0059] Image pairs are created by combining the corresponding layer slice images of the 3D printed design model with real-time images.

[0060] In this embodiment of the invention, S2 includes the following sub-steps:

[0061] S21. Add the values ​​of the four neighboring pixels of the current pixel in the real-time image and the slice image;

[0062] S22. Use the summed values ​​of the four neighboring pixels to constrain the current pixel, and obtain the constrained pixel value of the current pixel as the feature map.

[0063] In this invention, a learnable four-neighborhood difference operator is designed, and channel-level scaling parameters and biases are introduced to enable adaptive adjustment of the feature extraction process, enhancing its adaptability to different printing materials and lighting conditions. Based on the local edges of pixels, this invention can amplify the features of interlayer edge misalignment, making offset detection more sensitive.

[0064] In this embodiment of the invention, in S22, the expression of the feature map is:

[0065] ;

[0066] in, Represents pixels in the feature map pixel values, Represents pixels The sum of the values ​​of the four neighboring pixels, Represents pixels in a real-time image or slice image. pixel values, Indicates channel-level scaling parameters. Indicates channel-level bias. This indicates element-wise multiplication. This represents the activation function. Represents the x-coordinate of a pixel. Represents the ordinate of a pixel.

[0067] In this embodiment of the invention, S3 includes the following sub-steps:

[0068] S31. Downsample the real-time feature map and the slice feature map, and calculate the offset.

[0069] S32. Based on the offset, obtain the global coarse offset;

[0070] S33. Determine the local offset;

[0071] S34, with Centered on the slice feature map and the real-time feature map, a 3×3 neighborhood window of the same size is constructed, where, This represents the number of horizontal global offset pixels that align the sliced ​​feature map with the real-time feature map. This represents the number of vertical global offset pixels that align the sliced ​​feature map with the real-time feature map. The x-coordinate representing the center of the real-time feature map. The ordinate represents the center of the real-time feature map. This represents the number of horizontal local offset pixels that align the sliced ​​feature map with the real-time feature map. This represents the number of vertical local offset pixels that align the sliced ​​feature map with the real-time feature map.

[0072] S35. Generate the final offset based on the pixels of the neighboring window.

[0073] In this invention, the approach is coarse-to-fine. First, the approximate offset range is determined on a large scale, then fine-tuned on a small scale, and finally, sub-pixel-level regression is used to further improve accuracy. In the global coarse estimation stage, a downsampled low-resolution feature map is used for matching. This low-resolution operation is equivalent to low-pass filtering, which can suppress high-frequency noise and enhance the perception of the global structure. In the local fine estimation stage, the original resolution window is used for fine matching, which can correct the integer residuals of the coarse estimation. In the sub-pixel regression stage, a small neighborhood window is extracted, and a convolutional network is used to learn the sub-pixel-level offset.

[0074] In S31, to reduce computational load and enhance perception of global structure, bilinear interpolation downsampling is performed on the input feature map to obtain a low-resolution feature map. The downsampling factor is 4, and the number of channels remains unchanged.

[0075] In this embodiment of the invention, in S31, the offset... The expression is:

[0076] ;

[0077] in, Represents the pixels in the real-time feature map after downsampling. pixel values, This indicates that the slice feature map after downsampling is at the offset. The corresponding position after pixel values, This represents the horizontal translation offset. This represents the vertical translation offset. This represents the mean value of all pixels in the real-time feature map after downsampling. This represents the mean value of all pixels in the sliced ​​feature map after downsampling. Represents the x-coordinate of a pixel. Represents the ordinate of a pixel.

[0078] In this invention, the real-time feature map is the result of feature extraction from the image captured at the current printing layer, and serves as the search map. The slice feature map is the feature map of the corresponding layer of the design model, and serves as a template. (Fixed) The slice feature map at the location Taking this value is equivalent to shifting the entire slice feature map to the right. Pixels, downward shift Pixels. The translated slice feature map and the real-time feature map are on the same coordinates. Align the components and calculate similarity. Iterate through all possible similarities. The response matrix is ​​obtained, where the maximum value corresponds to... That is the most likely offset.

[0079] and The search scope is respectively and , and These represent the height and width of the image, respectively.

[0080] In this embodiment of the invention, in S32, the expression for the global coarse offset is:

[0081] ;

[0082] ;

[0083] in, This represents the number of horizontal pixels that align the downsampled slice feature map with the real-time feature map. This represents the vertical offset of pixels that aligns the downsampled slice feature map with the real-time feature map. This represents the horizontal translation offset. This represents the vertical translation offset. This represents the number of horizontal global offset pixels that align the sliced ​​feature map with the real-time feature map. This represents the number of vertical global offset pixels that align the sliced ​​feature map with the real-time feature map. Indicates the downsampling factor. Indicates offset offset, This represents the horizontal translation offset. This indicates the vertical translation offset.

[0084] In this invention, and The optimal translation amount is calculated on the downsampled low-resolution feature map. This optimal translation amount in the low-resolution space is then mapped back to the original resolution using a downsampling factor; that is, it is mapped back to the coordinate system of the feature map at the original resolution. Based on template movement for scene matching, this invention selects slice feature map movement to align the real-time feature map. The slice feature map needs to be translated. So many features are needed to align with the real-time feature map.

[0085] In this embodiment of the invention, S33 includes the following sub-steps:

[0086] S331. Construct a local window at the center of the real-time feature map;

[0087] S332, with Centered on the slice feature map, construct a local window of the same size, where, This represents the number of horizontal global offset pixels that align the sliced ​​feature map with the real-time feature map. This represents the number of vertical global offset pixels that align the sliced ​​feature map with the real-time feature map. The x-coordinate representing the center of the real-time feature map. The ordinate representing the center of the real-time feature map;

[0088] S333. Calculate the cosine similarity of each pair of pixels in the local window of the real-time feature map and the slice feature map;

[0089] S334. Based on the position of the pixel corresponding to the maximum cosine similarity in the slice feature map, obtain the local offset.

[0090] In this invention, a point of interest (e.g., the image center or the current position of the print head) is selected on the real-time feature map. Then, the corresponding position is found on the sliced ​​feature map, and a small window is cut around both for fine-tuning. The local window performs fine-tuning near the coarse offset, covering a sufficient range to capture the coarsely estimated residuals. The local window size (typically 5×5) covers the common range of coarsely estimated residuals (±2 pixels) while maintaining a small computational load. The offset is obtained by mapping the maximum similarity position. The similarity between all pixel pairs within the window is calculated as a similarity matrix, and the index pair corresponding to the maximum value is taken. The local offset is then directly obtained through the coordinate difference.

[0091] In this embodiment of the invention, in S334, the expression for the local offset is:

[0092] ;

[0093] in, This indicates that column coordinates are being extracted. This indicates that the row coordinates are extracted. This represents the pixel position of the pixel pair corresponding to the maximum cosine similarity in the real-time feature map. This represents the pixel position of the pixel pair corresponding to the maximum cosine similarity in the slice feature map. This represents the number of horizontal local offset pixels that align the sliced ​​feature map with the real-time feature map. This represents the number of vertical local offset pixels that align the sliced ​​feature map with the real-time feature map.

[0094] In this invention, the pair of pixels with the highest similarity is found. Then, we calculate the spatial offset of this pixel in the slice window relative to the pixel in the real-time window. If the rough estimate is completely correct, the center point of the real-time window should be most similar to the center point of the slice window, with an offset of 0. If residuals exist, the most similar pair of pixels will be off-center; this offset is what we need to compensate for. .

[0095] In this embodiment of the invention, S35 includes the following sub-steps:

[0096] S351. Based on the pixels contained in the neighborhood windows of the slice feature map and the real-time feature map, construct the corresponding tensors respectively.

[0097] S352. Concatenate the tensor corresponding to the slice feature map and the tensor corresponding to the real-time feature map to obtain the composite feature.

[0098] S353. After convolving the composite features, input them into the activation function to obtain the sub-pixel offset.

[0099] S354. Add the global coarse offset, the local offset, and the sub-pixel offset to obtain the final offset.

[0100] In this invention, the coarse and fine estimates have already approximately aligned the two images. Therefore, it is desirable to extract small neighborhoods at the same spatial location on the real-time image and the slice image so that the network can learn small residual shifts.

[0101] The composite features are input into a small network consisting of two 3×3 convolutional layers (keeping the number of channels to 2) and one 1×1 convolutional layer (outputting 2 channels), and the subpixel offset is output after passing through the Tanh activation function.

[0102] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of this invention.

Claims

1. A 3D printing fault detection method, characterized in that, Includes the following steps: S1. Acquire real-time images of the current 3D printing process and form a pair of images to be detected with the corresponding slice images; S2. Extract features from the image pairs to be detected to obtain the corresponding real-time feature map and slice feature map; S3. Based on the real-time feature map and the slice feature map, determine the global coarse offset and the local offset, and generate the final offset; S2 includes the following sub-steps: S21. Add the values ​​of the four neighboring pixels of the current pixel in the real-time image and the slice image; S22. Use the summed four neighboring pixel values ​​to constrain the current pixel, and obtain the constrained pixel value of the current pixel as a feature map. In step S22, the expression for the feature map is: ; in, Represents pixels in the feature map pixel values, Represents pixels The sum of the values ​​of the four neighboring pixels, Represents pixels in a real-time image or slice image. pixel values, Indicates channel-level scaling parameters. Indicates channel-level bias. This indicates element-wise multiplication. This represents the activation function. Represents the x-coordinate of a pixel. Represents the ordinate of a pixel; S3 includes the following sub-steps: S31. Downsample the real-time feature map and the slice feature map, and calculate the offset. S32. Based on the offset, obtain the global coarse offset; S33. Determine the local offset; S34, with Centered on the slice feature map and the real-time feature map, a 3×3 neighborhood window of the same size is constructed, where, This represents the number of horizontal global offset pixels that align the sliced ​​feature map with the real-time feature map. This represents the number of vertical global offset pixels that align the sliced ​​feature map with the real-time feature map. The x-coordinate representing the center of the real-time feature map. The ordinate represents the center of the real-time feature map. This represents the number of horizontal local offset pixels that align the sliced ​​feature map with the real-time feature map. This represents the number of vertical local offset pixels that align the sliced ​​feature map with the real-time feature map. S35. Generate the final offset based on the pixels of the neighboring window; In S32, the expression for the global coarse offset is: ; ; in, This represents the number of horizontal pixels that align the downsampled slice feature map with the real-time feature map. This represents the number of pixels offset in the vertical direction that aligns the downsampled slice feature map with the real-time feature map. This represents the horizontal translation offset. This represents the vertical translation offset. This represents the number of horizontal global offset pixels that align the sliced ​​feature map with the real-time feature map. This represents the number of vertical global offset pixels that align the sliced ​​feature map with the real-time feature map. Indicates the downsampling factor. Indicates offset offset, This represents the horizontal translation offset. This indicates the vertical translation offset. S33 includes the following sub-steps: S331. Construct a local window at the center of the real-time feature map; S332, with Centered on the slice feature map, construct a local window of the same size, where, This represents the number of horizontal global offset pixels that align the sliced ​​feature map with the real-time feature map. This represents the number of vertical global offset pixels that align the sliced ​​feature map with the real-time feature map. The x-coordinate representing the center of the real-time feature map. The ordinate represents the center of the real-time feature map; S333. Calculate the cosine similarity of each pair of pixels in the local window of the real-time feature map and the slice feature map; S334. Based on the position of the pixel corresponding to the maximum cosine similarity in the slice feature map, obtain the local offset. In S334, the expression for the local offset is: ; in, This indicates that column coordinates are being extracted. This indicates that the row coordinates are extracted. This represents the pixel position of the pixel pair corresponding to the maximum cosine similarity in the real-time feature map. This represents the pixel position of the pixel pair corresponding to the maximum cosine similarity in the slice feature map. This represents the number of horizontal local offset pixels that align the sliced ​​feature map with the real-time feature map. This represents the number of vertical local offset pixels that align the sliced ​​feature map with the real-time feature map.

2. The 3D printing fault detection method according to claim 1, characterized in that, In S31, the offset The expression is: ; in, Represents the pixels in the real-time feature map after downsampling. pixel values, This indicates that the slice feature map after downsampling is at the offset. The corresponding position after pixel values, This represents the horizontal translation offset. This represents the vertical translation offset. This represents the mean value of all pixels in the real-time feature map after downsampling. This represents the mean value of all pixels in the sliced ​​feature map after downsampling. Represents the x-coordinate of a pixel. Represents the ordinate of a pixel.

3. The 3D printing fault detection method according to claim 1, characterized in that, S35 includes the following sub-steps: S351. Based on the pixels contained in the neighborhood windows of the slice feature map and the real-time feature map, construct the corresponding tensors respectively. S352. Concatenate the tensor corresponding to the slice feature map and the tensor corresponding to the real-time feature map to obtain the composite feature. S353. After convolving the composite features, input them into the activation function to obtain the sub-pixel offset. S354. Add the global coarse offset, the local offset, and the sub-pixel offset to obtain the final offset.