Machine-Learning-Based Real-Time Photoacoustic Surface Crack Detection †

: Photoacoustic imaging is commonly utilized in biomedical research due to its capability to provide the functional and structural details of imaging targets, featuring optical contrast and ultrasound resolution. This imaging technique has also found applications in industry, particularly in non-destructive testing, such as in surface crack detection. However, the cost of photoacoustic systems and the time required for scanning and image reconstruction limit their use in non-destructive testing. In this study, low-cost photoacoustic equipment was combined with machine learning techniques and applied in surface crack detection. This scanning technique achieved a 97% ofﬂine prediction accuracy. Additionally, it demonstrated a reduction in system complexity compared to traditional photoacoustic imaging techniques. This reduction in complexity results from using a single scanning line as input to the machine learning model, unlike the imaging technique, which requires multiple scanning lines to reconstruct the photoacoustic image.


Introduction
Over recent decades, numerous researchers have explored fracture analysis to enhance material inspection techniques.Cracks in materials come from product defects and environmental influences like corrosion and fatigue [1] and signify structural vulnerability [2].Material cracking is a known contributor to mechanical system failure in transportation research [3].Various approaches have been devised, including strain gauges, visual cameras, thermography, and others [4][5][6][7].These techniques primarily rely on employing and observing the same modality; for example, visual cameras utilize optical perturbations and optical observations.Photoacoustic measurements have emerged as a promising alternative to optical imaging, addressing issues such as the diffuse reflection from irregular surfaces [8].This unique approach employs optical disturbance but captures its effects acoustically, minimizing optical analysis challenges related to scattering effects.Although photoacoustic measurements date back to the 1800s, their complexity has slowed their widespread adoption [9].However, advancements in semiconductor and laser technology in the 1960s have transformed them into a cutting-edge imaging technique [10].Thus, they are widely utilized in the medical field [11][12][13].Researchers have also reported successful applications of photoacoustic measurements in detecting material cracks [14][15][16].However, the cost of photoacoustic systems and the time consumed for scanning and imaging reconstruction limit its use in non-destructive testing.Therefore, in this study, low-cost photoacoustic equipment with machine learning techniques will be investigated for surface crack detection.This investigation reduces the system complexity and the time for detection compared to those when photoacoustic imaging techniques are used.

Method 2.1. Delay and Sum (DAS) Beamforming Technique
The delay and sum (DAS) beamformer is one of the simplest and most popular beamforming techniques in ultrasound and photoacoustic imaging.In this beamforming technique, the photoacoustic image is reconstructed based on combining the delayed photoacoustic signals, as shown in Equation (1) [17,18]: where Y DAS is the beamformer output, N is the number of transducer elements or scanning lines, RF i (t, ∆t) is the delayed photoacoustic signal that is received by element or scanning line number i, and ∆t is the time delay.

Machine Learning Model
The Convolutional Neural Network (CNN) model architecture used is illustrated in Figure 1.The first layer performs a convolution over the input spectrogram image with 32 kernels of size 3 × 3, accompanied by the Rectified Linear Unit (ReLU) [19] activation function.The obtained feature maps are then sub-sampled using a max-pooling layer operating over 2 × 2 squares.The second and third convolutional layers are the same as the first one except they have a higher number of kernels (64 and 128, respectively).The last sub-sampling operation is a max-pooling layer which operates over the entire sequence length.Batch normalization [20] was used as an intermediate layer after each convolutional layer.For regularization, we added a dropout layer equal to 0.5 after the last max-pooling layer.Finally, to classify the spectrogram image to see if it was obtained from a cracked or uncracked place, the output layer consists of a fully connected layer with a sigmoid activation function.

Experiment Setup
In this experiment, photoacoustic emissions were generated from a piece of black plastic with four surface cracks that are shown in Figure 2B.The width of each crack was almost 1 mm.Photoacoustic emissions were generated from this phantom using a pulsed laser diode (PLD) (905D5S3J08X).The pulse width of each firing laser pulse was 100 nm.In addition, the output optical energy and wavelength of this PLD were 3 µJ and 905 nm, respectively.In this experiment, photoacoustic emissions were acquired by using an open-source ultrasound board [21] with a one-element ultrasound transducer (C310-SU).The central frequency and bandwidth of this transducer were 5 MHz and 90% of the centre frequency, respectively.The scanning step of the ultrasound transducer in the lateral direction was 0.1 mm.The received photoacoustic emission for each scanning point was averaged 10 times before using it to improve the SNR. Figure 2A,C shows a schematic diagram of the experiment setup and a real photo of the experiment, respectively.In this experiment, 1131 photoacoustic signals were acquired from a cracked place and 4522 photoacoustic signals were acquired from an uncracked place.These received signals were converted into spectrogram images before using them in the machine learning model.In this study, a CNN classification model was used to detect the presence of cracks on the surfaces.The dataset was randomly split into two independent parts, with 80% and 20% for training and testing, respectively.

Results and Discussion
The received photoacoustic signals from the black plastic with four surface cracks were beamformed by using a DAS beamformer, as shown in Figure 3.An FIR bandpass filter (2.5-7.5 MHz) with a Hamming window was used in this beamformer.From Figure 3, the location of the surface cracks can be clearly defined compared to the uncracked location.In this experiment, 5653 photoacoustic signals were acquired.A total of 1131 of these signals were acquired from a cracked place and 4522 of these signals were acquired from an uncracked place.These received signals were converted into spectrogram images before using them in the machine learning model.In this conversion, the segment length was 100 samples, the window type was a Hamming window, and the length of the overlap window was 50 samples.Examples of cracked and uncracked images are shown in Figure 4.The CNN model was implemented using the Keras Python library.To validate the performance of the model, the dataset was randomly divided into two independent sets, with 80% for training and 20% for testing.The binary cross-entropy loss function and the Adaptive Momentum (ADAM) [22] optimization approach with decay rates of β1 = 0.9 and β2 = 0.999 and a learning rate = 0.001 were utilized.The batch size was set to 32, and the number of epochs for the training process was 50, using the early stopping condition in case there were no improvements over 10 epochs.After the process of training and validating the model, the model yielded a loss of 0.121, an accuracy of 97%, and an F1 score of 91.38%.The confusion matrix that was used to calculate the performances of the model is presented in Figure 5. From this figure, it can be noted that the model correctly classified all images in the testing set that were acquired from an uncracked place, while misclassified 15.9% of the images that were acquired from a cracked place (33 images out of 208).This percentage of misclassifications was due to an imbalance between cracks and non-cracks that were used to train the machine learning model.When comparing this machine learning detection technique with the image reconstruction technique, the machine learning technique reduced the complexity of the system.This is because one scanning line is used as input to the machine learning model, unlike the imaging technique, which needs multiple scanning lines to reconstruct the photoacoustic image.For instance, to detect and image a single surface crack in this experiment, almost 20 scanning lines are needed.This results in consuming more time and memory.The number of scanning lines that are needed to image a single crack could be increased depending on the distance between the imaging target and the focus point of the ultrasound transducer, the size of the scanning step, and the minimum size of the target crack.In addition, cracks with different levels can be easily detected using a machine learning technique.This is unlike the imaging reconstruction technique, which is affected by the contrast level of the imaging targets.For example, in Figure 3, it is difficult to identify the four cracks at the same time.This is because of the large contrast difference between cracks.

Conclusions
In this paper, surface cracks were detected using photoacoustic technology with machine learning.The offline prediction accuracy of the surface crack detection model was 97%.The machine learning detection technique reduced the system complexity and computation time when compared with the image reconstruction technique.In future work, the training data for the machine learning model will be balanced to reduce the percentage of misclassifications.A machine learning model will be also developed to detect internal and surface cracks.

Figure 1 .
Figure 1.A flow-diagram of the CNN model architecture.

Figure 2 .
Figure 2. (A) Schematic diagram of experiment setup, (B) a piece of black plastic with four surface cracks, and (C) experiment setup.

Figure 3 .
Figure 3. Photoacoustic image for black plastic with four surface cracks.