Quantitative detection of composite defects based on infrared technology and FA-LSTM

Given the difficulties in obtaining the defect data of composite materials and the low accuracy of defect size detection, this paper proposes a quantitative defect detection method for composite materials based on infrared technology and a firefly algorithm (FA)-optimized long short-term memory (LSTM) network. First, composite plates with different defects were periodically heated and photographed using a specific heat source and infrared camera to obtain the maximum surface temperature difference and the best detection time data of the composite plates. Then, the maximum temperature difference and the best detection time of each cycle of the material plate are weighted averages, and a vector model containing the defect feature information is established. Next, the optimal number of hidden neurons and the learning rate are obtained by the FA optimization of the LSTM model parameters. Finally, the eigenvector model is input into the FA-LSTM for fitting and outputting the defect diameter and depth to realize the quantitative detection of material plate defects. The experimental results show that the FA-LSTM can accurately identify the defect diameter and depth of the material plate, with an average relative error of only 2.59%.


Introduction
In recent years, with the rapid development of the aerospace industry, composite materials have been widely used in this field because of their high specific strength, fatigue resistance, corrosion resistance, and other advantages [1].However, when processing and using composite materials, there will always be inevitable damage and defects such as cracks, debonding, and impact.If defects cannot be detected and repaired in time, it will seriously hinder the development of national production and cause incalculable losses to the industry.Therefore, it is particularly important to accurately and rapidly detect defects in composite materials to ensure the steady development of relevant industries [2][3].
To avoid secondary damage to composite materials and ensure the normal use of products and equipment in service, non-destructive testing of composite defects has become a current research hotspot.At present, a variety of technologies, including ultrasonic and eddy current non-destructive testing, have practical applications in this field [4][5].Renaldas et al. [6] used ultrasonic non-destructive testing to detect internal defects in carbon fiber composites.Gao et al. [7] carried out ultrasonic testing for the laminated plate structure of skin and effectively detected delamination and inclusion defects.However, 2 in the application of ultrasonic technology, the ultrasonic probe needs a coupling agent and needs to contact the material surface, which may cause secondary damage and can't achieve true non-destructive testing.Cheng et al. [8] proposed a method based on spatial and frequency domain aliasing to enhance eddy current imaging and improve its accuracy of eddy current imaging.Eddy's current testing does not use a coupling agent and has a strong anti-interference ability; however, it has strict requirements for materials and relatively low detection efficiency.However, these NDT methods have limitations.Therefore, simpler, safer, and more efficient NDT technology is required to compensate for these deficiencies.Infrared thermal wave detection technology has been widely used in the field of nondestructive testing of composite materials because of its intuitive imaging, fast detection speed, simple structure, and easy operation of detection equipment [9][10].
Although infrared technology can quickly and accurately obtain image information of composite material defects, it cannot quantitatively identify defects.With the rise of machine learning, the combination of infrared technology with machine learning algorithms and quantitative detection of composite defects has become a research hotspot in this field.Zhou et al. [11] combined infrared thermal wave technology, finite element analysis, and SVM to expand the number of samples and effectively detect delamination defects.Liu et al. [12] used infrared technology and a BP neural network to fit the relationship between temperature, time input, and defect feature output, which can accurately and quantitatively identify the diameter and depth of material defects.Kong et al. [13], used an artificial neural network to realize quantitative recognition of defect characteristics based on the transient temperature distribution on the material surface.Li et al. [14] used a PSO-BP neural network to fit the functional relationship between the phase difference, amplitude, defect depth, and area of the infrared image to accurately predict the defect type.Liu et al. [15] used a pulsed infrared thermal wave and Fast R-CNN + model to deeply mine the defect characteristics of composite materials and finally realized high-precision identification of its defect types while improving the diagnosis speed.Liu et al. [16] used infrared technology and the LSTM method to accurately predict and identify the defect depth of honeycomb sandwich structural materials, thereby laying a foundation for the application of depth learning in composite material defect detection.
In summary, given the difficulties in obtaining composite material defect data, the low efficiency of non-destructive testing, and the fact that shallow learning models such as machine learning can't fully reveal the complex relationship between the root cause of defects and information, this paper proposes a quantitative detection method for composite material defects based on infrared technology and FA-LSTM, which realizes the feature extraction of composite material defects and quantitative recognition of defect size through the combination of infrared technology and deep learning.This article focuses on the following two parts: first, the temperature sequence of composite plates is obtained by infrared technology, which can quickly obtain material defect data while avoiding secondary damage to the composite materials; second, the relationship between defect characteristics and defect size is fitted by the FA-LSTM model to realize accurate and quantitative identification of composite defects, emphasizing the correlation between defect root and defect characteristics.

Infrared technology principle and data processing introduction
Infrared thermal wave imaging is a new type of non-destructive testing method.Owing to its advantages, such as fast detection speed, non-contact, no damage to the tested parts, large detection range, and easy operation, it has been widely used in composite material defect detection in recent years.In life, an object's surface is higher than zero and emits thermal radiation.Based on this feature, the infrared thermal imager uses thermal radiation imaging technology to display the thermal radiation emitted by the object in the form of a visible "thermal image," that is, complete data acquisition by monitoring the temperature change of the material surface, and then process the collected data to complete the detection of material defects.

Pulse infrared thermal wave detection system
Pulse infrared thermal wave imaging technology is currently a relatively mature active infrared IOP Publishing doi:10.1088/1742-6596/2770/1/0120123 nondestructive testing method.First, pulse excitation is used to change the temperature field on the surface of the material to be measured so that heat waves can be generated from outside to inside.However, cracks, notches, corrosion, degumming, and other damages on the surface or inside of the tested material affect the heat wave conduction process, which is manifested as the temperature difference between the defect area and the normal area.Then, an infrared thermal imager was used to measure the surface temperature change of the material from thermal excitation to natural cooling at a certain frequency and record the above temperature difference.Finally, the collected infrared image sequence was processed to obtain the infrared temperature matrix sequence, as shown in Figure 1.Each pixel in the infrared image represents the temperature value of its location, from which the maximum temperature difference ∆ and the best detection time are extracted (The maximum surface temperature difference is the maximum temperature difference between the defect area and the normal area during the natural cooling process of the material.The best detection time is the time when the maximum temperature difference occurs), which corresponds to the data preparation for the subsequent material defect detection model.
Infrared temperature matrix sequence.To better verify the effectiveness of the model, the infrared acquisition process from the thermal excitation source to the natural cooling of the material surface was regarded as a cycle, and a total of N cycles of infrared image sequences were collected, each containing N infrared images.The average value of the maximum temperature difference and the best detection time of each cycle were taken as the model characteristic data, and the specific expression as in Equation ( 1).
The structure of the pulsed infrared thermal wave detection system is shown in Figure 2. The system includes an infrared data processing system, infrared thermal imager, thermal excitation source, tested part, and power supply.

Principle of LSTM algorithm
Long short-term memory (LSTM) networks are improved recurrent neural networks (RNN).It not only has the advantages of RNN memory but can also efficiently learn the nonlinear characteristics of time series data.Because the activation mode of hidden nodes in the internal structure of LSTM is very complex, it forgets useless or less effective information and remembers useful information within a large time interval through selective memory, which also solves the problem of gradient disappearance and gradient explosion of long time series data.
The long short-term memory network contains three gates: the input gate, the forgetting gate, and the output gate.When the current data and historical data are simultaneously input into the LSTM gate unit at the same time, these data are processed by three full-connection layers with a sigmoid activation function to calculate the values of the input gate, forgetting gate, and output gate.The structural composition of these gates not only ensures that information can pass selectively, but also maintains the invariance in the process of transmitting information, which is mainly maintained by linear operation.Of course, through selective memory information, we can ensure that most of the useful information in the long sequence data can be used to further diagnose defects through deep learning and the mining of deep features.
Suppose there is a hidden unit ℎ, the batch size is , and the number of inputs is , the input is , and the hidden state of the previous time step is ∈ × .Correspondingly, the gate of time step is defined as follows: the input gate is ∈ × , the forgetting gate is ∈ × , and the output gate is ∈ × .The mathematical expression of a long short-term memory network as in Equation ( 2): In LSTM, the data information goes through the following three steps: first, the information goes through the forgetting gate to determine which information is retained, and which is forgotten; second, the information is updated and the information to be updated is determined through the input gate; and finally, the final information is output through the output gate.

FA optimization model
The firefly algorithm (FA) was proposed by Yang [17].It is a bionic optimization algorithm that originates from fireflies, specifically their flashing behavior.When several fireflies are distributed in space, the brightest firefly attracts the darker firefly to move in the direction of the brightest firefly and completes the location update iteration in the process of moving.The brightest firefly represents the best solution.
Suppose a space is n-dimensional, and the position of the ith firefly as in Equation (3): 12 ( ,) The position of the N firefly in the space is initialized to make it evenly distributed in the space.The position of j fireflies in space is set to be attracted by i fireflies.The formula for updating the position of the j firefly as in Equations ( 4) and ( 5): ( 1) ( ) ( ) ( 0.5) where 0 α is the original attraction, 0 r < is the maximum attraction, I is the relative attraction of fireflies, and (0,1) r ⊆ is the absorption parameter, ( 0.5) rand  , refers to the amount of random interference of fireflies in the process of location update, which can avoid falling into local optimization in the process of optimization, if r is the position distance between the i firefly and the jfirefly, and its formula is expressed by the Cartesian distance as in Equation ( 6) However, when there is no brightest firefly around, the firefly still needs to move; therefore, we define the movement track of the brightest firefly as in Equation ( 7) where a is a parameter of the size of the random movement and rand is a random number in the range of [0,1].

FA-LSTM detection model
As LSTM contains memory units, it has unique advantages in the processing and prediction of objects.However, LSTM network diagnosis is affected by many factors and has a certain instability.In addition, it is difficult to determine the parameters of the LSTM network, especially the number of hidden neurons and the initial optimal learning rate of the LSTM network.To solve the above problems, this study used the FA firefly algorithm to optimize the LSTM network.The optimized network model can effectively avoid the problem of falling into local optimization and will enable the LSTM model to effectively determine the optimal parameter combination and achieve high-performance defect diagnosis.First, a standard LSTM network model was established, and the defect feature vector was transferred to the input layer.The FA initializes the parameters according to the feature vector of the input layer and starts to update and iterate to find the optimal hyperparameters.The optimal parameters determined by the FA algorithm were used to replace the number of hidden neurons and the optimal learning rate of the initial LSTM.Model establishment process: , the number of optimization parameters, the maximum number of iterations, the number of neurons, and the upper and lower limits of the optimal learning rate.The parameter values are presented in the following table 1.The position of the firefly was randomly initialized the luminous intensity of the firefly was initialized, and the position of the firefly was iteratively updated until it reached the optimal position.The firefly position represents the optimal value of the parameters to be optimized.
where m is the number of training samples, f is the true value of the defects, and y is the defect value of the model diagnosis.
The steps to establish the optimization model are as follows: Step 1: Infrared technology was used to collect composite material defect data and extract the characteristic parameters of the material plate.
Step 2: The model parameters are initialized in the experiment, a standard FA-LSTM model is established, and the data are input into the model.
Step 3: Set the size, attraction, and light absorption parameters of the initial population, initialize the position of the firefly to G and ξ in the network model, and seek the optimal hyperparameter for the calculation error.
Step 4: According to the attraction formula and the position adjustment formula in the firefly algorithm, the best parameters of the network model are continuously adjusted until the best position of the firefly is found, that is, the best hyperparameters that are most suitable for the model are found.
Step 5: According to the optimal hyperparameter training network model, consider the root mean square error of the model training results as the fitness value of the firefly algorithm, judge the fitness value, and determine whether the optimal parameters are obtained until the experimental requirements are met.
Step 6: When the error requirements are met or the maximum number of iterations is reached, the parameters of the model are outputted to build the optimal model.
Step 7: Output the optimal model fitting results.The optimization model flow chart is shown in Figure 3. T h e e q u i p m e n t u s e d i n t h i s e x p e r i m e n t w a s a n InfraTecImageIR®5300 series infrared thermal imager with a thermal sensitivity of 0.015K at 30℃ and an infrared thermal imager resolution of 320 × 256.The test object was a composite plate, with dimensions of 120 mm×120 mm×5 mm, the infrared image of the composite plate is shown in Figure 4. To realize the quantitative detection of defects, this study introduced two experimental parameters: the maximum surface temperature difference and the best detection time Max t Among them, T Χ is defined as the difference between the temperature of the defect area and the temperature of the normal area, and Max t is defined as the corresponding time when the surface temperature difference reaches a maximum.These two parameters were input into the model for training and fitting.To avoid the random impact of a single test, this study used the average value of five-cycle data measured by an infrared camera as the final experimental data, and finally obtained 20 groups of maximum surface temperature and optimal detection time defect data at different depths and diameters, as shown in Table 3.

Model parameter setting.
First, FA parameters are initialized, and the best number of hidden layer neurons and the best initial learning rate are obtained by using FA to optimize the LSTM network; By optimizing the parameters of the model adaptively and using the optimal initial learning rate training, the number of training is set to 1000, so that the model can converge faster while maintaining stable operation, The ReLU function is selected as the activation function of the hidden layer neurons, and the expression layer is selected as the output layer.The FA population to 50 and the number of iterations was set to 100.The optimal initial learning rate obtained by the FA optimization of LSTM was 0.0014 and the optimal number of hidden layer neurons was 256.

Result analysis
In this study, the maximum surface temperature difference and the best detection time at the defect of the composite plate collected using infrared technology were used as input and input into the FA-LSTM fitting model for training.To intuitively reflect the training process of the FA-LSTM model, the relative error of the iterative training process was used for the visual analysis.The curve of the relative error with the training time is shown in Figure 5.It can be observed from Figure 5 that the FA-LSTM model can achieve a set zero error within the specified 500 iterations during the training process, which proves the convergence of the model.From the perspective of the error curve decline trend, because the first 250 iterations of the firefly algorithm search and update the optimal number of hidden neurons and learning rate, the error decline speed will be slightly slow; however, in the 250th to 300th iterations, because of the end of the optimization work of the firefly algorithm, LSTM obtained the optimal super-parameter.At this time, the convergence speed of the model was significantly accelerated and soon reached the set error value.
After the prediction fitting of the network model, the fitting values of the defect data of the eight groups of test samples were obtained, as listed in Table 4.  4 that the fitting value of the model for the diameter and depth of defects is relatively close to the actual diameter and depth, which shows the effectiveness and accuracy of the algorithm.It also proves that the FA-LSTM algorithm can calculate the diameter and depth of defects simultaneously and obtain high fitting accuracy, thus verifying the feasibility of using infrared technology and the FA-LSTM algorithm to achieve quantitative detection of defects.
To show the specific accuracy of the FA-LSTM model fitting in this experiment, the relative error of the predicted value was used as the quantitative evaluation index.The relative errors in the diameter and depth of the predicted sample are listed in Table 5.It can be seen from Table 5 that the maximum relative error and the minimum relative error of the diameter are 6.8% and 0.15%, respectively , and the maximum relative error and the minimum relative error of depth are 4% and 0.2%, respectively, all of which are at a lower level.This verifies the feasibility and effectiveness of the FA-LSTM model for the quantitative identification of hole defects and realizes high-precision detection of quantitative fitting of hole defects.

Conclusion
This study proposes a quantitative detection method for composite defects based on infrared technology and FA-LSTM, which verifies the feasibility of defect feature extraction and quantitative recognition of defect size through infrared technology and deep learning.First, an infrared camera was used to capture periodic photographs of composite plates with different defects, and the vector model containing the defect feature information was obtained after preprocessing.Subsequently, the optimization process of the LSTM model parameters is optimized by FA, and the optimal defect detection model of the composite plate is established.Finally, the eigenvector model is input into the FA-LSTM for fitting and outputting the defect diameter and depth to realize the quantitative detection of material plate defects.From the experimental results, FA-LSTM can accurately fit the defect diameter and depth of the material plate, and the average relative error was only 2.59%, which verifies the accuracy and effectiveness of the experimental method.From the theoretical level, this method has changed the traditional diagnosis method of determining the defect type by processing the defect image in composite material defect detection.It is a method for fitting the functional relationship between the defect feature and size through

3. 3 . 1 .
Model initialization.Set parameters such as the number of populations

Figure 4 .
Figure 4. Infrared image of the composite plate.To realize the quantitative detection of defects, this study introduced two experimental parameters: the maximum surface temperature difference and the best detection time Max t Among them, T Χ is defined as the difference between the temperature of the defect area and the temperature of the normal area, and

Figure 5 .
Figure 5. Training error convergence curve.It can be observed from Figure5that the FA-LSTM model can achieve a set zero error within the specified 500 iterations during the training process, which proves the convergence of the model.From the perspective of the error curve decline trend, because the first 250 iterations of the firefly algorithm search and update the optimal number of hidden neurons and learning rate, the error decline speed will be slightly slow; however, in the 250th to 300th iterations, because of the end of the optimization work of the firefly algorithm, LSTM obtained the optimal super-parameter.At this time, the convergence speed of the model was significantly accelerated and soon reached the set error value.After the prediction fitting of the network model, the fitting values of the defect data of the eight groups of test samples were obtained, as listed in Table4.
(8)orithm are the optimal choices, this study uses the root mean square error (RMSE) as the error judgment standard.The smaller the RMSE value, the better the fitting effect of the model; the parameters of the FA-optimized LSTM network model are the optimal parameters, RMSE as in Equation(8)

Table 2 .
Void defects are typical of composite materials.In this study, the void defects of composite materials were considered as the research object.Table2lists the physical parameters of the experimental composite and the air.Physical parameters of composite material and air.
Figure 3. Flow chart of the optimization model.4.2.1.Data collection and sample division.

Table 3 .
Maximum surface temperature and optimal detection time at different depths and diameters. of experimental data of defects in Table3: diameter 5 mm, depth 1 mm, diameter 5 mm, depth 5 mm, diameter 10 mm, depth 2 mm, diameter 10 mm, depth 4 mm, diameter 20 mm, depth 1 mm, diameter 20 mm, depth 3 mm, diameter 30 mm, depth 2 mm, diameter 30 mm, depth 5 mm as test samples to test the fitting performance of the model, and the remaining 12 groups of data as training samples to train FA-LSTM model parameters.

Table 4 .
Fitting value of FA-LSTM model to test sample defect prediction.

Table 5 .
Relative error of predicted fitting value.
IOP Publishing doi:10.1088/1742-6596/2770/1/01201210 deep learning, which provides a new idea for the deep analysis of fault information and quantitative detection of material plate defects.