The Impact of Excitation Periods on the Outcome of Lock-In Thermography

Thermal imaging is a non-destructive test method that uses an external energy source, such as a halogen lamp or flash lamp, to excite the material under test and measure the resulting temperature distribution. One of the important parameters of lock-in thermography is the number of excitation periods, which is used to calculate a phase image that shows defects or inhomogeneities in the material. The results for multiple periods can be averaged, which leads to noise suppression, but the use of a larger number of periods may cause an increase in noise due to unsynchronization of the camera and the external excitation source or may lead to heating and subsequent damage to the sample. The phase image is the most common way of representing the results of lock-in thermography, but amplitude images and complex images can also be obtained. In this study, eight measurements were performed on different samples using a thermal pulse source (flash lamp and halogen lamp) with a period of 120 s. For each sample, five phase images were calculated using different number of periods, preferably one to five periods. The phase image calculated from one period was used as a reference. To determine the effect of the number of excitation periods on the phase image, the reference phase image for one period was compared with the phase images calculated using multiple periods using the structural similarity index (SSIM) and multi-scale SSIM (MS-SSIM).


Introduction
Infrared thermography is a powerful and widely used method of non-destructive testing (NDT) and evaluation that utilizes an external energy source to create a temperature difference between areas of a sample that are defective and those that are not, in order to identify any defects. This method is known as active thermography, as opposed to passive thermography, in which defects are identified through naturally occurring thermal contrasts.
One of the key advantages of infrared thermography is that it allows for the detection of defects that may not be visible to the naked eye, such as those found inside a material or component. Additionally, it can be used to detect defects in a wide range of materials and industries, including aerospace, automotive, and electrical engineering. As a nondestructive testing method, Infrared thermography can be used to identify defects without causing any damage to the sample, making it a cost-effective and efficient method of testing.
Lock-in thermography is a popular type of non-destructive testing that uses an external source to induce temperature changes in a material or component, and then uses an infrared camera to measure the resulting thermal response. Lock-in thermography is often used to inspect composite materials such as aerospace structural elements [1][2][3][4][5], wind turbine blade parts [6][7][8], and other advanced composites such as composites containing nanotubes [9,10] as well as sandwich structures [11]. Lock-in thermography is widely used for detecting subsurface defects, such as cracks [12,13], delamination [14][15][16], impact damage [17,18], and corrosion [19,20]. It is considered a highly versatile NDT method because it can be used for a wide range of materials and components such as metal [21], composites [22], wood [23], ceramics [24], plastics [25], and concrete [26]. It can be used in laboratory and in-field settings, and it can be used to inspect both single samples or large areas.

Lock-In Method
The lock-in principle is the technique of choice, if signals have to be extracted from statistical noise. Prerequisite to using this technique is that the primary signal, can be periodically pulsed or amplitude-modulated with a certain frequency called "lock-in frequency" [27].
It uses a reference signal, known as a local oscillator that is synchronized with the signal of interest and is used to "lock-in" or extract the small signal from the background noise. This can be done by multiplying the input signal with the reference signal and then applying a low-pass filter to the product. The result is a signal that is proportional to the original small signal, but with much-reduced noise. This method is commonly used in experimental physics, chemistry, and other scientific fields.
The concept of this method is that the response of the system, when stimulated by a signal with a sinusoidal character and lock-in frequency f L , will also be in the form of a sinusoid with the same frequency and with amplitude A anf phase shift ϕ. This means that the response s(t) can be represented as a function of this sinusoidal character in the time t: Given that the amplitude of the response s(t) is very small, and the signal S(t) being measured also contains a much higher level of noise N(t), the relationship between the two can be described as: If S(t) is expressed by Fourier's series than: If A = A 1 and ϕ = ϕ 1 , then the coefficients a, b in Equation (2) can be estimated by using the relationships of discrete Fourier transformation: when n is number of frames recorded by infrared camera in one period, F k is the k-th frame recorded in time t k with sample rate of IR camera. Then the phase shift of the response s(t) is: The phase image is formed by the phase shift values for each single pixel of IR camera.

Structural Similarity Index Measure (SSIM)
The Structural Similarity Index (SSIM) is a tool for measuring the similarity between two images. It was first proposed by Wang et al. in 2004 [28], to quantify the perceived quality of images and videos. The SSIM metric is based on a comparison of the structural information in the image, as well as the luminance and contrast of the image. It is calculated as a value between −1 and 1, with values closer to 1 indicating greater similarity between the two images. The SSIM metric has been widely used in image and video processing, and it has been found to correlate well with human perception of image quality.
It was designed to improve upon traditional methods for measuring the quality of images, such as the peak signal-to-noise ratio (PSNR) and mean squared error (MSE), which rely solely on the absolute error as a metric. The SSIM was developed to address this limitation by considering three independent factors, luminance, contrast, and structure, in its calculation, providing a more comprehensive measure of image similarity.
Unique maximum: SSIM(x, y) = 1 if and only if x = y.

Multi-Scale SSIM Index (MS-SSIM)
Multi-scale method is a convenient way to incorporate image details at different resolutions. Experiments show that with an appropriate parameter setting, the multi-scale method outperforms the best single-scale SSIM model as well as state-of-the-art image quality metrics [28].
Multi-scale SSIM is calculated by first converting the two images to grayscale, if they are not already. Next, the images are down-sampled to multiple scales using a Gaussian pyramid. For each scale, the SSIM index is calculated between the two images. The final MS-SSIM value is obtained by averaging the SSIM values across all scales. Finally, the MS-SSIM value is a single value between −1 and 1, where 1 indicates a perfect match and −1 indicates no similarity.

Test Samples
Eight samples, each measuring 120 mm × 120 mm × 5 mm and containing defects, were printed using a 3D printer (Prusa i3 MK3S+, Prusa Research a.s., Partyzánská 188/7A The defects, in the form of blind holes, had known dimensions, geometry, and location. For this study, eight samples were made: S1, S2, S3, and S4 for the samples with circular cross-section defects, and S5, S6, S7, and S8 for the samples with square cross-section defects. Defects were placed 1 mm and 0.5 mm under the measured surface and the midpoints of the defects closest to the edges of the samples had a distance of 30 mm. The samples are shown in Figure 1, where the defects with square cross-sections have an edge length of 20 mm and the defects with circular cross-sections have a diameter of 20 mm. On the measured surface of the test samples a black color with the high emissivity (0.96) was applied to reduce the reflection of the surface.
The additively manufactured specimens were built with full density.

Experimental Setup
Test samples were measured using lock-in thermography. In lock-in thermography, various types of excitations are used, such as laser, halogen lamp, ultrasound sonotrode, flash lamp, etc. In this experiment, two sources of excitation were used: a halogen lamp

Experimental Setup
Test samples were measured using lock-in thermography. In lock-in thermography, various types of excitations are used, such as laser, halogen lamp, ultrasound sonotrode, flash lamp, etc. In this experiment, two sources of excitation were used: a halogen lamp (Kaiser Videolight 4, Kaiser Fototechnik GmbH & Co. KG, Buchen, German) and a flash lamp (Godox QS 1200 II, GODOX Photo Equipment Co.,Ltd., Shenzhen, China). Using the National Instruments module NI 9481, the halogen and flash lamps were connected to the PC and a control script was written in MATLAB. In the case of the halogen lamp, the device was turned on and off every 1 min, and in the case of the flash lamp, it was fired every 2 min. The halogen lamp controlled by the NI 9481 module was used to generate a one-minute thermal wave, and the flash lamp generated a flash with duration 1/800 s. Every period of excitation was 2 min because the lock-infrequency was set to 1/120 Hz. Five periods were performed for each measurement to investigate the effect of the excitation periods number on the results. Table 2 provides a summary of the setup parameters used for the experiment. For collecting the data (sequences of thermograms), we used an infrared camera (FLIR SC7500, FLIR Systems Advanced Thermal Solutions SA, Croissy-Beaubourg, France) with thermal sensitivity less than 20 mK, a spectral range 1.5-5.1 µm and 50 mm lens (objective). The cooled detector is a focal plane array (FPA) with resolution of 320 × 256, made of InSb. Emissivity ε = 0.96 was adopted for the tests because the black color with the same emissivity value were placed on the samples. Figure 2 shows a schematic representation of the experimental setup.  The defects are not located inside the specimens but on one side of the specimen that they are located 1 mm and 0.5 mm below the surface, respectively. For the measur ments, the samples were turned towards the camera so that the camera could see the si of the sample without defects, so that from the camera's point of view the defects we below the surface.
Control signals for switching on and off the halogen lamp and also for switching o the flash lamp were generated in Matlab through the NI 9481 control unit.

Data Processing and Phase Image Calculation
Each measurement consisted of 3000 thermograms recorded over a 10-min perio The defects are not located inside the specimens but on one side of the specimen so that they are located 1 mm and 0.5 mm below the surface, respectively. For the measurements, the samples were turned towards the camera so that the camera could see the side of the sample without defects, so that from the camera's point of view the defects were below the surface. Control signals for switching on and off the halogen lamp and also for switching on the flash lamp were generated in Matlab through the NI 9481 control unit.

Data Processing and Phase Image Calculation
Each measurement consisted of 3000 thermograms recorded over a 10-min period. The camera was positioned 0.5 m away from the sample's surface being measured. The data was collected using the ResearchIR software and exported to a Matlab file. The exported data included sequences of thermograms and files containing information about the date and time each thermogram was taken. We created a script in Matlab to load this data and calculate the phase image (using Formula (7)) for one period (600 thermograms) up to five periods (3000 thermograms). The results were then compared using the SSIM and MS-SSIM indices. SSIM method was chosen because it provides a reliable and accurate measure of the structural similarity between two images, and SSIM is well-established and trusted in many image and video processing applications. The MS-SSIM was used as a second comparative method and because it outperforms the single-scale SSIM method.

Results
In this paper, two excitation methods were used: flash lamp and halogen lamp. For each method, eight measurements were performed. The samples were designed so that the defects occupied different areas on the measured surface, ranging from approximately 8% for three defects to 25% for nine defects. Figures 3 and 4 present a sample thermogram from the recorded sequences of thermograms on the left side. The mean temperature value for the highlighted area is plotted on the graph labeled "Output" located on the right side. The graph labeled "Input" shows the input signal The signal was generated in Matlab and used to control the flash lamp and halogen lamp through the NI 9481 control unit.

Lock-In Thermography Using Flash Lamp Defects Placed 1 mm under the Measured Surface
Figures 5 and 6 display phase images calculated for all eight samples for one to five periods. The reference phase images were calculated using data from a 2-min record, whereas the phase image for five periods was calculated using data from a 10-min record.        The phase images calculated for different periods of time, ranging from one to five, are very similar in appearance. To measure the similarity between these images, the SSIM index and MS-SSIM index were used. The reference phase images, calculated from one period of time, were used as the benchmark to compare against the other phase images calculated for different periods of time. The results, as shown in Table 3, demonstrate that the difference between the reference phase images and the other phase images calculated for different periods of time is quite small. In fact, the difference, as measured by the SSIM index, is less than 10% and, when measured by the MS-SSIM index, is less than 5%. This indicates a high level of similarity between the phase images calculated for different periods of time, providing confidence in the accuracy and reliability of the calculations performed. The Figure 7 shows graphically the SSIM and MS-SSIM index values for the flash lamp. A decrease in the index values with increasing number of periods was observed. We assume that the extreme values of the decrease are due to the increasing noise in the processed data.

Lock-In Thermography Using Halogen Lamp Defects Placed 1 mm under the Measured Surface
The data processing and phase image calculation procedures are similar to those used in the case of lock-in thermography using a flash lamp, as described in Section 4.1.
The Figure 8 shows graphically the SSIM and MS-SSIM index values for a halogen lamp. A decrease in the index values with increasing number of periods was observed. We assume that the extreme values of the decrease are due to the increasing noise in the processed data. Figures 9 and 10 present phase images calculated for all eight samples for periods ranging from one to five. It can be observed from the figures that the phase images are similar, but not as clear as in the previous case. With an increase in the number of periods, the phase images become more blurred, as seen in the comparison between the S3 reference and S3 for four periods. Results in Table 4 indicate that, using both the SSIM and MS-SSIM indices, the difference between the reference phase images and phase images calculated for two periods is less than 10%. However, as the number of periods increases, the percentage differences also increase.

Lock-In Thermography Using Halogen Lamp Defects Placed 1 mm under the Measured Surface
The data processing and phase image calculation procedures are similar to those used in the case of lock-in thermography using a flash lamp, as described in Section 4.1.
The Figure 8 shows graphically the SSIM and MS-SSIM index values for a halogen lamp. A decrease in the index values with increasing number of periods was observed. We assume that the extreme values of the decrease are due to the increasing noise in the processed data.   Figures 9 and 10 present phase images calculated for all eight samples for periods ranging from one to five. It can be observed from the figures that the phase images are similar, but not as clear as in the previous case. With an increase in the number of periods, the phase images become more blurred, as seen in the comparison between the S3 reference and S3 for four periods. Results in Table 4 indicate that, using both the SSIM and MS-SSIM indices, the difference between the reference phase images and phase images calculated for two periods is less than 10%. However, as the number of periods increases, the percentage differences also increase.   The next measurement that was performed was on samples that had a defect depth of 0.5 mm below the surface of the measured area. The sample was extruded from PET-G

Lock-In Thermography Using Halogen Lamp and Flash Lamp. Defects Placed 0.5 mm under the Measured Surface
The next measurement that was performed was on samples that had a defect depth of 0.5 mm below the surface of the measured area. The sample was extruded from PET-G material. In this case, a sample with eight square holes, also marked as S8, is chosen. The measurement setup is the same as for the 1 mm thickness samples. The measurement was performed for both the flash lamp and the halogen lamp excitation types. The phase image from the halogen lamp excitation can be observed in Figure 11 and the phase image from the flash lamp excitation can be observed in Figure 12. The representations are made for five periods. The comparison of the SSIM and MS-SSIM indexes is shown in Table 5.

Lock-In Thermography Using Halogen Lamp and Flash Lamp. Defects Placed 0.5 mm under the Measured Surface
The next measurement that was performed was on samples that had a defect depth of 0.5 mm below the surface of the measured area. The sample was extruded from PET-G material. In this case, a sample with eight square holes, also marked as S8, is chosen. The measurement setup is the same as for the 1 mm thickness samples. The measurement was performed for both the flash lamp and the halogen lamp excitation types. The phase image from the halogen lamp excitation can be observed in Figure 11 and the phase image from the flash lamp excitation can be observed in Figure 12. The representations are made for five periods. The comparison of the SSIM and MS-SSIM indexes is shown in Table 5.     The graph indicating the dependence of the MS-SSIM and SSIM indices on the number of periods is on the left side for flash lamp excitation and on the right side for halogen lamp excitation. The graphs are made for the comparison of sample S8 wall thickness of the measured area of 1 mm and 0.5 mm (Figure 13).  The graph indicating the dependence of the MS-SSIM and SSIM indices on the number of periods is on the left side for flash lamp excitation and on the right side for halogen lamp excitation. The graphs are made for the comparison of sample S8 wall thickness of the measured area of 1 mm and 0.5 mm (Figure 13).

Discussion
The case of excitation by flash lamp. Increasing the number of periods used in the lock-in processing does not increase the value of the MS-SSIM index or the SSIM for the 1 mm and 0.5 samples This observation is represented by the triangular points in Figure 13 for the flash lamp.
We consider the slower decline of the MS-SSIM index relative to the SSIM index to be due to the lower sensitivity of the MS-SSIM to period growth.
The case of excitation by halogen lamp. Increasing the number of periods used in the lock-in data processing does not significantly increase the value of the MS-SSIM index or the SSIM index for the 1 mm sample, and the index values shown are lower for higher numbers of periods. However, in the case of a 0.5 mm sample, increasing the number of periods used in the data processing by the lock-in method increases significantly the value of the MS-SSIM index and not the SSIM for the 0.5 mm sample. In this case, we cannot claim that one period is sufficient.
The presented results for the halogen lamp excitation indicate a possible dependence of the MS-SSIM and SSIM index values on the depth below the surface in which the defect is located. We assume that the halogen lamp heated the sample more than the flash lamp, and then the increase of the indices at 0.5 mm sample may be due to this phenomenon. However, the rising temperature when measuring using a halogen lamp may cause sample damage if the sample is excited for a large number of periods.

Conclusions
In this paper, two excitation methods, namely flash lamp and halogen lamp, were used to perform eight measurements on samples. The phase images were calculated for periods ranging from one to five, and the similarity index was calculated between the reference phase image and others. The data processing and phase image calculation procedures were similar to those used in the case of lock-in thermography using a flash lamp.
For the measurements on the 1 mm and 0.5 mm depth of the defect surfaces, the same lamp power was set for both the halogen lamp and the flash lamp, and the flash power was also set to be the same. The same lock-in periods, camera frame rates, and camera integration times were also used, and the same distance of the samples from the excitation sources was maintained.
Using a flash lamp, it was found that increasing the number of periods that were used in the data processing by the lock-in method did not increase the value of the MS-SSIM index or the SSIM for the 1 mm sample. For the 0.5 mm sample, the increase in value is not demonstrable.
If we subjectively or visually evaluate (0.5 mm sample) the images for one to five periods (see Figure 13), then the image for five periods appear blurrier than for one period, although the values of both indices increase with increasing number of periods.
Based on the above, in future research we will want to observe the influence of other parameters on the value of the above indices as well as the influence of other parameters, such as the power of the halogen reflector or the temperature of the sample during the test, and to make these measurements for other defect depths below the surface as well.
In the case of excitation of an object using a flash lamp, we recommend to use only one period, and we cannot make a recommendation in the case of using a halogen lamp.

Data Availability Statement:
The data that support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest:
The authors declare no conflict of interest.