A temperature image sequence defect identification method for an infrared nondestructive testing system
By combining 2D-CNN, LSTM and Attention layers, the problem of low defect recognition accuracy in infrared nondestructive testing is solved, achieving high-precision end-to-end defect detection, reducing noise interference and improving detection results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA NUCLEAR POWER OPERATION TECH CORP
- Filing Date
- 2025-04-25
- Publication Date
- 2026-07-10
AI Technical Summary
Traditional infrared nondestructive testing methods suffer from low defect identification accuracy, inability to identify weak feature defects, insufficient utilization of time correlation, and inadequate fusion of multidimensional information, leading to noise sensitivity.
A 2D-CNN layer is used for convolution operations, combined with an LSTM layer to learn temperature change features, and an Attention layer is used for multi-head attention mechanism. Finally, a fully connected layer is used for softmax processing to achieve end-to-end defect recognition.
It improves the accuracy and precision of defect identification, reduces noise interference, and enables automated detection of internal defects in materials.
Smart Images

Figure CN120525810B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of nondestructive testing technology, and in particular relates to a method for identifying defects in temperature image sequences for infrared nondestructive testing systems. Background Technology
[0002] Non-destructive testing (NDT) is a technique that assesses the condition of an object using methods such as ultrasonication, eddy current testing, penetrant testing, and infrared spectroscopy without affecting the performance of the material being tested. Infrared NDT is widely used in composite material internal flaw detection and weld crack detection due to its advantages of high speed and lack of material limitations. Infrared NDT requires applying thermal excitation to the surface of the material. If defects exist, they disrupt the overall heat transfer balance, causing temperature anomalies in the defect area. Defects are identified through relevant temperature image sequence processing algorithms.
[0003] Currently, commonly used infrared temperature image sequence processing methods include pulse phase method, phase-locked loop method, calorific value signal reconstruction method, and principal component analysis method. These methods all involve optimizing the acquired raw temperature image sequence using algorithms to obtain an image with enhanced defect information, thereby achieving non-destructive testing of internal defects in materials. Although these methods have advantages such as wide applicability and low hardware requirements, they also have disadvantages such as low defect detection accuracy and inability to identify weak feature defects.
[0004] In the infrared thermal nondestructive testing process, analysis of the temperature image sequence acquired by the infrared thermal imager after thermal excitation reveals that each pixel exists in one of two states: a defective state and a non-defective state. The essence of these different states lies in the series of temperature changes experienced by each pixel within the sequence. Non-defective pixels, due to their intact material structure, exhibit consistent temperature changes after thermal excitation, while defective pixels, with their disrupted structural integrity, show inconsistent temperature changes. By employing the training-learning approach from neural networks to learn the temperature change characteristics of each pixel in the infrared temperature image sequence, accurate end-to-end detection can be achieved. Summary of the Invention
[0005] The purpose of this application is to provide a method for defect identification of temperature image sequences in infrared non-destructive testing systems, which solves the problem of low defect identification accuracy caused by insufficient utilization of time correlation, insufficient fusion of multi-dimensional information, and sensitivity to noise in traditional image sequence processing technology.
[0006] To achieve the above objectives, this application provides the following technical solution:
[0007] A method for defect identification using temperature image sequences in an infrared nondestructive testing system includes:
[0008] S1. Thermally stimulate the surface of the material being tested and collect temperature image sequence information of the surface of the material being tested after thermal stimulation;
[0009] S2. The acquired temperature image sequence is fed into a 2D-CNN layer for convolution operation, and the output dimension of the convolution is consistent with the input dimension;
[0010] S3. Unfold the nodes of the 2D-CNN convolution operation to form an N×M 2D matrix and use it as the input of the LSTM layer for operation, where N is the number of frames in the temperature image sequence, M is the value of the 2D-CNN after node unfolding and dimensionality reduction, and M = height H × width W of the infrared image.
[0011] The output of the S4 LSTM layer contains the output O of all time steps and the hidden state H of the final time step. n O and H n The input to the Attention layer is used for computation, and the Attention layer employs a multi-head attention mechanism.
[0012] S5. The output of the Attention layer goes through three cascaded fully connected layers, which reduce the dimension from 64×M to 32×M, 16×M and 2×M respectively. Softmax processing is performed on each column of the 2×M matrix, and the nodes of the 2×M matrix are merged to transform it into a matrix with a dimension of 2×H×W.
[0013] S6. The network model trained in S2 to S5 is used as the actual engineering detection model. During the detection stage, the collected temperature image sequence is sent to the network model for detection to obtain the final detection result.
[0014] In S1, after the thermal excitation ends, temperature image data is acquired by an infrared thermal imager, and the number of acquisition frames is set to be greater than 100 frames N.
[0015] In S2, the 2D-CNN layer has 3 convolutional kernels, all of which are 3×3 in size. The stride and padding are both set to 1. The three 2D convolutional kernels are connected in series, and the output of the 2D-CNN layer is activated by ReLU.
[0016] In S3, LSTM is used to learn the intrinsic features of temperature changes in different regions, thereby distinguishing different regions. After 2D-CNN convolution, the nodes are expanded.
[0017] The temperature data from multiple frames for each pixel is treated as a column. Pixels are stacked column by column in a left-to-right, top-to-bottom order to obtain a merged matrix. Each column of the matrix is X = [x...]. i1 ,xi2 ,x i3 ,···,x iN ] are all inputs to LSTM, where i is the i-th pixel, N is the total number of frames in the sequence, and x is the temperature value.
[0018] In S3, the parameter setting method for the LSTM layer is as follows:
[0019] The network input feature dimension is set to 1, the number of network layers is set to 3, and the hidden layer dimension is set to 64.
[0020] The input arrangement of the LSTM layer is (input, (h_0, c_0));
[0021] Wherein, input is [seq_length, batch_size, input_size], the sequence length seq_length is set to the number of frames N acquired by the infrared thermal imager, the length of a single time step input_size is set to 1, batch_size is the batch size, h_0 is the initial hidden unit, and c_0 is the initial memory unit.
[0022] In S4, the output of the LSTM layer includes the outputs of all time steps O = [O1, O2, O3, ..., O2]. N The three hidden states H at the end of the time step. n In the formula, O i A characteristic of a single temperature value;
[0023] The output O of all time steps is compared with the trainable weights W of the Attention layer. K and W V Multiply them separately to obtain the key vector K and value vector V of the Attention layer. Then, multiply the last hidden state H3 of the three hidden states at the last time step with the trainable weights W. Q Multiplying these together yields the Q value of the Attention layer.
[0024] In S4, the Attention layer adopts a multi-head attention mechanism with 64 attention heads. After the data passes through the Attention layer, the output dimension becomes 64×M, where M is the total number of input pixels.
[0025] In S5, the network uses the binary cross-entropy loss function, calculated as follows:
[0026]
[0027] In the formula, y c The label value of the real sample for each pixel, p cThe probability value is the actual output of each pixel after softmax calculation, where N is the number of pixels in the input infrared image.
[0028] In S6, the acquired temperature image sequence is fed into the network model for detection. The final output dimension of the network is 2×H×W, where 2 represents the probability of each pixel being in one of two states. The sum of the two probabilities is 1. The first probability value is taken. If its value is greater than 0.5, the value of the pixel is mapped to 255; otherwise, it is mapped to 0.
[0029] Furthermore, the training set is trained according to the S2-S5 process, and the test set is evaluated according to the pixel accuracy PA, calculated as follows:
[0030]
[0031] In the formula, p ii p represents the number of true pixels i that are predicted to be of class i. ij TP represents the number of true pixels i predicted as class j, TN represents the number of non-defect pixels predicted as non-defect pixels by the model, FP represents the number of defective pixels predicted as non-defect pixels by the model, and FN represents the number of non-defective pixels predicted as defective pixels by the model.
[0032] Compared with existing technologies, the temperature image sequence defect identification method for infrared nondestructive testing systems provided in this application has the following advantages:
[0033] This application uses 2D-CNN to fuse the temperature change process of the current pixel with that of the surrounding pixels. The fused temperature change data of each pixel is used as an input and then fed into a multi-layer LSTM, a multi-head attention network, and a multi-layer fully connected network in sequence to finally determine the defect state of each pixel.
[0034] This application achieves automated detection of internal defects in the same material under training conditions with a certain amount of data by cascading 2D-CNN, LSTM, Attention, and FCNN network modules. Because this method learns the intrinsic features of the cooling curve, it has the advantages of high detection accuracy and end-to-end detection.
[0035] Furthermore, this application introduces a 2D-CNN structure in front of the LSTM, making each input data processed by the LSTM a region-fused dataset. This allows the classification of a single pixel to depend not only on the temperature change of the current pixel but also on the temperature changes of nearby pixels. Ultimately, this reduces noise interference and improves the classification accuracy between defective and non-defective regions.
[0036] Furthermore, this application introduces an Attention structure behind the LSTM, which allows important time steps to have higher weight in the final result determination, further improving the accuracy of the classification results. The Attention layer uses a multi-head attention mechanism, which, compared to a single-head attention mechanism, can simultaneously focus on multiple important time steps in the continuous temperature change sequence of each pixel when processing sequence data, enriching the feature representation of information and improving the accuracy of the final result. Attached Figure Description
[0037] To more clearly illustrate the technical solution of this application, the accompanying drawings used in the technical description will be briefly introduced below.
[0038] Figure 1 A flowchart of the temperature image sequence defect identification method for an infrared nondestructive testing system provided in this application;
[0039] Figure 2 A simplified flowchart illustrating the processing of a temperature image sequence defect identification method for an infrared nondestructive testing system provided in this application embodiment;
[0040] Figure 3 A schematic diagram illustrating the working process of a multi-head attention network provided in an embodiment of this application;
[0041] Figure 4 A detailed schematic diagram illustrating the processing flow of the temperature image sequence defect identification method for an infrared nondestructive testing system provided in this application embodiment;
[0042] Figure 5 Temperature image sequence data and its segmentation method provided in the embodiments of this application;
[0043] Figure 6 A schematic diagram comparing the temperature image sequence processing method provided in this application embodiment with other temperature image sequence processing methods. Detailed Implementation
[0044] The following detailed description provides further details on specific implementation methods.
[0045] like Figure 1 As shown, this application provides a method for defect identification using temperature image sequences in an infrared nondestructive testing system, comprising the following steps:
[0046] S1. During the data acquisition phase, given the thermal excitation of the surface of the material to be detected, the temperature image sequence information of the surface of the material to be detected after thermal excitation is recorded by an infrared thermal imager, and each pixel is normalized in the frame number direction.
[0047] S2. The acquired temperature image sequence is fed into a 2D-CNN layer for convolution operation, and the output dimension of the convolution is consistent with the input dimension;
[0048] S3. Unfold the nodes of the result after the 2D-CNN convolution operation to form a 2D matrix with dimension N×M, where N is the number of frames in the temperature image sequence and M = the height H × width W of the infrared image. Use this matrix as the input to the LSTM layer for operation.
[0049] S4, the output of LSTM includes the output O of all time steps and the three hidden states H of the last time step. n Using O as the key vector K and value vector V of the Attention layer, and H... n The last hidden state H3 in the process is used as Q of the Attention layer, and the Attention layer adopts a multi-head attention mechanism.
[0050] The results of the S5 Attention layer are finally processed by a fully connected layer to adjust the dimension to 2×M, where M is the total number of input pixels (H×W) and 2 represents the two states of a pixel (defective state and non-defective state). Each column of the 2×M dimensional data is processed by softmax, and then the 2×M matrix is transformed into a 2×H×W matrix through node merging. The loss value between the transformed matrix and the true label is calculated, and backpropagation is performed based on the magnitude of the loss value.
[0051] S6 and S2-S5 constitute the training process, where the network model trained through steps S2-S5 is used as the actual detection model. During the detection phase, actual data is collected using the data acquisition method described in S1, and this data is fed into the network model for detection to obtain the final detection results.
[0052] In S1, after the thermal excitation ends, temperature image data is acquired using an infrared thermal imager, with the number of frames N set to be greater than 100. The training data in S1 can come from multiple sets of actual flaw detection data of the same material, or from multiple sets of experimental data of the same material simulating defects. The relative positions of the thermal excitation source, the infrared thermal imager, and the inspected material remain unchanged during data acquisition.
[0053] In S2, the 2D-CNN layer has three convolutional kernels, all set to 3×3. The stride and padding are both set to 1. These three kernels are connected in series, and the output of the 2D-CNN layer uses ReLU activation. Because the 2D-CNN layer uses three cascaded kernels, it integrates multi-frame temperature change information from the current pixel and other pixels within the surrounding 7×7 receptive field. This allows defect detection to rely not only on the multi-frame temperature change data of the current pixel but also on the auxiliary multi-frame temperature change data of surrounding pixels. This method reduces the interference of noisy data and improves the accuracy of defect detection.
[0054] In S3, because the non-defective regions have the same structure, their temperature changes tend to be consistent after thermal excitation. However, the defective regions, due to varying degrees of structural damage, exhibit different trends in their temperature changes after thermal excitation. LSTM can learn the intrinsic characteristics of temperature changes in different regions, thus distinguishing them. After 2D-CNN convolution, node unpacking is required: the multi-frame temperature data for each pixel is treated as a column, and the pixels are stacked column by column in a left-to-right, top-to-bottom order, resulting in a merged matrix. Each column of this matrix X = [x...]. i1 ,x i2 ,x i3 ,···,x iN ] are all inputs to LSTM, where i represents the i-th pixel, N represents the total number of frames in the sequence, and x represents the temperature value.
[0055] In S3, the parameters of the LSTM layer are set as follows: the network input feature dimension is set to 1 (each time step has only one feature, temperature value), the number of network layers is set to 3, and the hidden layer dimension is set to 64. The input of the LSTM layer is arranged as (input, (h_0, c_0)), where input is [seq_length, batch_size, input_size]. The sequence length seq_length is set to the number of frames N acquired by the infrared thermal imager, the length of a single time step input_size is set to 1 (each time step has only one feature, temperature value), and the batch size batch_size is set according to the specific hardware. h_0 represents the initial hidden unit, and c_0 represents the initial memory unit, both of which are randomly initialized. Following the LSTM layer are LN (layer normalization) and ReLU activation functions.
[0056] In S4, the Attention layer further increases the weight of temperature changes at important moments for each pixel in the final classification result, making important time steps play a more significant role in the final judgment. The Attention layer employs a multi-head attention mechanism, introducing multiple attention heads so that the Attention can simultaneously focus on multiple key time steps when processing data, enriching the feature representation of information and improving the accuracy of the final result.
[0057] In S4, the output of the LSTM includes: the outputs of all time steps O = [O1, O2, O3...O...]. N ], and the three hidden states H at the end of the time step. n In the formula, O i For a single temperature value, the output O of all time steps is fed with the trainable weights W of the Attention layer. K and W V Multiplying them separately yields the key vector K and value vector V of the Attention layer, and H... n The last hidden state H3 and trainable weights W in the middle Q Multiplying these results gives the Q value of the Attention layer. The Attention layer employs a multi-head attention mechanism with 64 attention heads. After passing through the Attention layer, the output dimension becomes 64×M, where M is the total number of input pixels, represented by the height H × width W of the infrared image, and 64 is the output dimension of the Attention layer. Following the Attention layer are LN (layer normalization) and ReLU activation functions.
[0058] In S5, the output of the Attention layer passes through three cascaded fully connected layers, reducing the dimension from 64×M to 32×M, 16×M, and 2×M respectively. The matrix with dimension 2×M is then merged into nodes. The merging method is as follows: each column of data (dimension 2) in the 2×M matrix is used as the channel direction data (dimension 2) of the merged matrix. Then, the M columns (dimension H×W) are sequentially divided into W groups, and each group W forms a row of the merged matrix.
[0059] In S5, the value of the true label is defined as follows: for each pixel, if the pixel is a defect, the value is defined as 0, otherwise it is defined as 1.
[0060] In S5, the network uses the binary cross-entropy loss function, which is calculated as follows:
[0061]
[0062] In the formula, y cIt is the label value of the real sample for each pixel, p c This represents the probability value of each pixel's actual output after softmax calculation, where N is the number of pixels in the input infrared image. A smaller cross-entropy loss function value indicates a more accurate network output.
[0063] In S6, the prediction phase collects actual data using the same data acquisition method as in S1. The target material to be detected in S6 should be consistent with the material used in the training phase of S1. The data is then fed into the network model trained in steps S2 to S5 for detection. The final output dimension of the network is 2×H×W, where 2 represents the probability of each pixel being in one of two states (the sum of the two probabilities is 1). The first probability value is taken; if its value is greater than 0.5, the pixel value is mapped to 255; otherwise, it is mapped to 0. Finally, a binary image containing defects is obtained. White areas with a grayscale value of 255 are non-defect areas, and black areas with a grayscale value of 0 are defect areas.
[0064] Example
[0065] like Figures 2 to 6 As shown, this embodiment provides a method for defect identification of temperature image sequences in an infrared nondestructive testing system, including the following steps:
[0066] S1. Obtain multiple temperature image sequences of materials with the same material and different defects through the existing thermally excited infrared non-destructive testing system. The thermally excited non-destructive testing system includes a thermal excitation source and an infrared thermal imager. After the thermal excitation source finishes thermally exciting the component, the infrared thermal imager acquires the temperature image sequence data.
[0067] During data acquisition, the relative positions of the thermal excitation source, the infrared thermal imager, and the material under test are kept constant. Subsequently, a real label is created for each acquired sequence, where each defective pixel is marked as 0, and each non-defective pixel is marked as 1.
[0068] S2. Each pixel in the acquired temperature image sequence is normalized using the L2 norm along the frame number direction, and then fed into a 2D-CNN layer consisting of three cascaded convolutional kernels (two-dimensional convolutions). Each kernel is 3×3 in size, with a stride of 1 and a padding value of 1. The input and output channel values are both the number of frames N in the temperature image sequence. After the 2D-CNN layer is completed, it is activated using the ReLU function.
[0069] S3. Expand the nodes of the result from S2, transforming the N×H×W matrix into an N×M matrix (M = H×W). Use each column of the expanded matrix as an input to the LSTM layer. Here, N is the number of frames in the temperature image sequence, H is the height of the temperature image, and W is the width of the temperature image.
[0070] The parameters for the LSTM layer are set as follows: the network input feature dimension is set to 1 (only the temperature value is a feature at each time step), the number of network layers is set to 3 (to improve the processing capability for long-term dependencies), and the hidden layer dimension is set to 64 (to extract more dimensional information). The input parameters for the LSTM layer are set as follows: the sequence length (seq_length) is set to the number of frames N in the infrared temperature image sequence, the length of a single time step (input_size) is set to 1, and the batch size (batch_size) is set according to the specific hardware. The initial hidden unit h_0 and the initial memory unit c_0 are both randomly initialized. The output of the LSTM includes: the output O of all time steps, and the three hidden states H of the last time step. n The LSTM layer is followed by LN (layer normalization) and ReLU activation functions.
[0071] S4. Combine the O in the output of S3 with the trainable weights W of the Attention layer. K and W V Multiplying them separately yields the key vector K and value vector V of the Attention layer, and H... n The last hidden state H3 and trainable weights W in the middle Q Multiplying these results gives the Q value of the Attention layer. The Attention layer employs a multi-head attention mechanism with 64 attention heads. After passing through the Attention layer, the output dimension becomes 64×M, where M is the total number of input pixels, represented by the height H × width W of the infrared image; and 64 is the output dimension of the Attention layer. The specific working process of the Attention layer is as follows: Figure 4 As shown. The Attention layer is followed by LN (layer normalization) and ReLU activation functions. The output of the S5 Attention layer passes through three cascaded fully connected layers, reducing the dimension from 64×M to 32×M, 16×M, and 2×M respectively. Each column of the 2×M matrix undergoes softmax processing. The 2×M matrix is then merged into a 2×H×W matrix. This matrix is then compared with the true label values to calculate the loss. The loss function used is the binary cross-entropy loss function.
[0072] S6. After the process of S2-S5, a network model capable of identifying defects in temperature image sequences is trained.
[0073] In actual testing, the S1 method is used to acquire temperature image sequences of the test piece. These sequences are then fed into a trained network model for detection. The model ultimately outputs a 2×H×W matrix, where 2 represents the probability of each pixel being in one of two states (the sum of the two probabilities is 1). The first probability value is taken; if it is greater than 0.5, the pixel is mapped to 255; otherwise, it is mapped to 0. This results in a binary image containing defects. White areas with a grayscale value of 255 represent non-defect areas, while black areas with a grayscale value of 0 represent defect areas.
[0074] The calculation process for steps S2-S6 above is as follows: Figure 4 During the training process, the adaptive learning rate parameter update algorithm (Adam) was selected to update the network weight values. The number of training rounds was set to 500, the initial learning rate was 0.001, the weight decay hyperparameter was 0.0005, and the network weights were initialized using Kaiming initialization.
[0075] For example, a sequence of actual acquired infrared temperature images is used for the calculation demonstration. Figure 5 As shown, blind holes and tapered holes of different diameters and depths were fabricated on the non-inspection surface of the composite material. Temperature image sequence data of the inspection surface after thermal excitation was acquired using a thermally excited infrared non-destructive testing system. Each frame in the sequence is 492×492 pixels, and there are 300 frames. Since there is only one image sequence, a single image was used. Figure 6 As shown, the dataset is divided into training, validation, and test sets. Multiple sub-regions of the same size are randomly selected from each dataset region to expand the dataset size. The size of each sub-region is set to 300×64×64 (C×H×W). After expansion, the training set contains 300 sub-regions, the validation set contains 50 sub-regions, and the test set contains 20 sub-regions.
[0076] The training set is trained according to steps S2-S5, and the test set is evaluated according to pixel accuracy (PA), which is calculated as follows:
[0077]
[0078] In the formula, p ii p represents the number of true pixels i that are predicted to be of class i. ij TP represents the number of true pixels i predicted as class j, TN represents the number of non-defect pixels predicted as non-defect pixels, FP represents the number of defective pixels predicted as non-defect pixels, and FN represents the number of non-defective pixels predicted as defective pixels.
[0079] Table 1 compares the defect recognition performance of different network models on temperature image sequences. The higher the mPA value in the table, the higher the classification accuracy and the more accurate the defect recognition.
[0080] Table 1
[0081]
[0082] In Table 1, mPA refers to the average pixel accuracy. As can be seen from Table 1, compared to LSTM-FCNN and LSTM-Attention-FCNN, the network model proposed in this application has the highest detection accuracy. Furthermore, from... Figure 6 It can be seen that the principal component analysis method, pulse phase reconstruction method, and calorimeter signal reconstruction method all have problems such as unclear defect display, incomplete area display, and unintuitive results for the three defect locations. In comparison, the method proposed in this application has the best visual defect detection effect.
[0083] The above description is only a specific embodiment of this application, but the protection scope of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application.
Claims
1. A method for defect identification using temperature image sequences in an infrared nondestructive testing system, characterized in that, include: S1. Thermally stimulate the surface of the material being tested and collect temperature image sequence information of the surface of the material being tested after thermal stimulation; S2. The acquired temperature image sequence is fed into a 2D-CNN layer for convolution operation. The output dimension of the convolution is consistent with the input dimension. The number of convolution kernels in the 2D-CNN layer is 3, the kernel size is set to 3×3, the stride and padding are set to 1, the 3 two-dimensional convolution kernels are connected in series, and the output of the 2D-CNN layer is activated by ReLU. S3. Unfold the nodes of the 2D-CNN convolution operation to form an N×M 2D matrix and use it as the input of the LSTM layer for operation, where N is the number of frames in the temperature image sequence, M is the value of the 2D-CNN after node unfolding and dimensionality reduction, and M = height H × width W of the infrared image. The output of the S4 LSTM layer contains the output O of all time steps and the hidden state H of the final time step. n O and H n The input to the Attention layer is used for computation, and the Attention layer employs a multi-head attention mechanism. S5. The output of the Attention layer goes through three cascaded fully connected layers, which reduce the dimension from 64×M to 32×M, 16×M and 2×M respectively. Softmax processing is performed on each column of the 2×M matrix, and the nodes of the 2×M matrix are merged to transform it into a matrix with a dimension of 2×H×W. S6. Use the network model trained in S1~S5 as the actual engineering detection model. In the detection stage, the collected temperature image sequence is sent to the network model for detection to obtain the final detection result.
2. The method for temperature image sequence defect identification in an infrared nondestructive testing system according to claim 1, characterized in that, In S1, after the thermal excitation ends, temperature image data is acquired by an infrared thermal imager, and the number of acquisition frames is set to be greater than 100 frames N.
3. The method for temperature image sequence defect identification in an infrared nondestructive testing system according to claim 1, characterized in that, In S3, LSTM is used to learn the intrinsic features of temperature changes in different regions, thereby distinguishing different regions. After 2D-CNN convolution, the nodes are expanded. The temperature data from multiple frames for each pixel is treated as a column. Pixels are stacked column by column in a left-to-right, top-to-bottom order to obtain a merged matrix. Each column of the matrix is X=[x i1 , x i2 , x i3 , ··· , x iN ] are all inputs to LSTM, where i is the i-th pixel, N is the total number of frames in the sequence, and x is the temperature value.
4. The method for temperature image sequence defect identification in an infrared nondestructive testing system according to claim 1, characterized in that, In S3, the parameter setting method for the LSTM layer is as follows: The network input feature dimension is set to 1, the number of network layers is set to 3, and the hidden layer dimension is set to 64. The input arrangement of the LSTM layer is (input, (h_0, c_0)). Wherein, input is [seq_length, batch_size, input_size], the sequence length seq_length is set to the number of frames N acquired by the infrared thermal imager, the length of a single time step input_size is set to 1, batch_size is the batch size, h_0 is the initial hidden unit, and c_0 is the initial memory unit.
5. The method for temperature image sequence defect identification in an infrared nondestructive testing system according to claim 1, characterized in that, In S4, the output of the LSTM layer includes the outputs of all time steps O = [O1, O2, O3, ..., O2]. N The three hidden states H at the end of the time step. n In the formula, O i A characteristic of a single temperature value; The output O of all time steps is compared with the trainable weights W of the Attention layer. K and W V Multiplying them separately yields the key vector K and value vector V of the Attention layer, and the hidden states H of the three layers at the last time step are then calculated. n The last hidden state H3 and trainable weights W in the middle Q Multiplying these together yields the query vector Q for the Attention layer.
6. The method for temperature image sequence defect identification in an infrared nondestructive testing system according to claim 5, characterized in that, The Attention layer employs a multi-head attention mechanism, with 64 attention heads. After the data passes through the Attention layer, the output dimension becomes 64×M, where M is the total number of input pixels.
7. The method for temperature image sequence defect identification in an infrared nondestructive testing system according to claim 1, characterized in that, In S5, the network uses the binary cross-entropy loss function, calculated as follows: In the formula, y c The label value of the real sample for each pixel, p c The probability value is the actual output of each pixel after softmax calculation, where N is the number of pixels in the input infrared image.
8. The method for temperature image sequence defect identification in an infrared nondestructive testing system according to claim 1, characterized in that, In S6, the acquired temperature image sequence is fed into the network model for detection. The final output dimension of the network is 2×H×W, where 2 represents the probability of each pixel being in one of two states. The sum of the two probabilities is 1. The first probability value is taken. If its value is greater than 0.5, the value of the pixel is mapped to 255; otherwise, it is mapped to 0.
9. The method for temperature image sequence defect identification in an infrared nondestructive testing system according to claim 1, characterized in that, The training set is trained according to the S2-S5 process, and the test set is evaluated according to the pixel accuracy PA, calculated as follows: In the formula, p ii p represents the number of true pixels i that are predicted to be of class i. ij TP represents the number of true pixels i predicted as class j, TN represents the number of non-defect pixels predicted as non-defect pixels by the model, FP represents the number of defective pixels predicted as non-defect pixels by the model, and FN represents the number of non-defective pixels predicted as defective pixels by the model.