DETECTION OF HAZARDOUS MATERIALS IN LASER CUTTING USING DEEP LEARNING AND SPECKLE SENSING

: The technology of laser cutting is widely used in various industries for processing materials. However, it generates a substantial amount of harmful dust, smoke, and aerosols, which pose a threat to the environment and endanger the health of workers. One potential method that has emerged to monitor the cutting process and identify materials in real-time is speckle sensing. This paper presents a novel material classification technique that employs a new deep-learning model architecture designed for speckle pattern images to classify materials according to the speckle patterns of the material's surface. The proposed approach involves training a convolutional neural network (CNN) on a large dataset of laser speckle patterns to recognize various material types for safe and efficient cutting. Material classification using speckle sensing enhances the process, reducing the time required to train the speckle images and the inference time for predicting the material from the speckle images. Experimental results demonstrate that the suggested method achieves high precision in categorizing materials, particularly hazardous ones. The model was evaluated on a test dataset of 3,000 new images, achieving an F1-score of 0.9781. The utilization of speckle sensing enables the proposed method to offer a fast, reliable, and accurate approach to material-aware laser cutting while mitigating the potential risks associated with the process.


INTRODUCTION
Laser cutting is a widely used technology in many industrial sectors due to its high precision and efficiency (Riveiro et al., 2012).However, the process generates harmful pollutants such as dust, smoke, and aerosols, which pose a risk to the environment and workers' health (Barrett and Garber, 2003).To ensure safe and efficient laser cutting, it is crucial to monitor and control the process in real time.Speckle sensing has emerged as a promising method for monitoring laser cutting and classifying materials (Dogan et al., 2021).By analyzing the speckle pattern produced by the laser on the surface structure of the used material, it is possible to extract valuable information about the material and the cutting process.Deep learning techniques have displayed immense capabilities in the past few years for analysing speckle patterns and categorizing different materials (Dogan et al., 2021), (Kalyzhner et al., 2019), and (Saguy et al., 2021).
The utilization of laser cutters in workshops is a prevalent practice, however, it comes with its own set of challenges.Therefore, there are various support tools available to assist operators in laser-cutting tasks, such as PacCAM (Saakes et al., 2016) a tool for packing parts according to the placed sheet inside the laser cutter, Fabricaide (Ticha et al., 2021) also proposed another tool that integrates the creation and preparation of designs for fabrication, despite the increasing availability of diverse materials for laser cutting, there remains a shortage of systems that assist operators in effectively navigating and selecting appropriate cutting parameters for each material type.As a result, laser-cutting operators face difficulties in recognizing unmarked sheets from material inventories or spare parts in a laser-cutting workshop since many materials share a similar visual appearance, like transparent materials (e.g., Acrylic, PETG, and Acetate) (Man-Hin et al., 2022).
Consequently, users may mistakenly choose the wrong material from the stack and apply the incorrect power and speed settings, which can lead to material wastage or pose a risk to the environment and workers' health because numerous materials are not safe for laser cutting due to the released toxic fumes (Park et al., 2018), and (He et al., 2022).Unfortunately, the similarity in appearance between safe and hazardous materials can lead to hazardous materials being mistaken for safe ones.
To address this issue, a lens-less camera can be incorporated into the laser cutter to identify materials through laser speckle sensing.In the SensiCut study conducted by (Dogan et al., 2021), they employed a lens-less camera along with deep learning techniques to categorize laser-cutting materials based on their surface characteristics using speckle patterns.They assembled a dataset encompassing 30 distinct material classes, as depicted in Figure 1.The speckle pattern images were generated using a green laser pointer, whereas the majority of laser cutting machines employ a red laser pointer, as elucidated in a subsequent study by (Salem et al., 2023).This paper proposes a material classification technique that uses deep learning to classify materials for laser cutting based on the speckle patterns of the material's surface structure.The proposed technique involves training a convolutional neural network (CNN) on the SensiCut dataset.It utilizes an approach to minimize the training and inference time of the deep learning model in the classification process by training a CNN model from scratch instead of using a pre-trained model as in previous related work (e.g., Sensicut).As a result, it recognizes distinct material types faster than the model used in Sensicut.The proposed method achieves high accuracy in material classification, providing a robust and accurate solution for material-aware laser cutting using speckle sensing.

Novelty and Advancements
A new technique for material classification using speckle sensing is proposed in this study.Unlike traditional methods that require all three RGB colour channels of the speckle pattern images for training a convolutional neural network, the proposed approach only utilizes the layer corresponding to the laser colour.This method reduces the training time of the model and makes it more efficient by reducing the inference time while increasing the classification accuracy.By extracting features from only one colour channel, the number of dimensions of the input layer of the deep learning model is reduced.This allows us to exclusively use the speckle patterns of the channel corresponding to the colour of the laser, without considering other colour channels.Consequently, this approach provides a more practical solution for hazardous material detection in laser-cutting applications.
The proposed deep learning model can classify materials before the laser cutting process, aiding in identifying the cutting parameters and alerting the operators if any hazardous materials are present.This approach can significantly reduce the time required for material classification and detection of hazardous materials, making it a practical solution for real-time material classification applications.The proposed approach can be implemented in laser cutting machines, and operators can be alerted to the presence of hazardous materials before the cutting process, ensuring the safe operation of the machine and preventing potential harm to the environment.

Applications of Speckle Patterns
Laser speckle sensing refers to an optical technique whereby lasers are used on bumpy surfaces where scattered waves from these surfaces generate patterns consisting of bright/dark spots commonly characterized as "speckles" containing relevant measurements about texture properties such as movement or roughness evaluated statistically and promptly giving precise results (Fujii et al., 1974), and (Matthijs et al., 2009).
Laser Speckle Sensing does not physically contact surfaces making it useful for diverse applications which require detailed information about textured surfaces like biomaterials imaging, water content measurement, or material characterization thereby preventing any form of damage (Dogan et al. 2021), and (Madruga et al., 2020).An image capture system traps reflected beams originating from a material's surface structure after a laser beam is directed, which produces a unique speckle image through the interaction of reflected rays reflecting different phases as seen in Figure 2.
An overview of the main components of laser speckle sensing is shown in Figure 2. The technique involves directing a laser beam at the surface structure of the material being analysed and capturing the reflected rays using an image sensor.The generated speckle pattern image by the sensor contains valuable information regarding the material's microstructure and surface properties, such as roughness, texture, and movement.The generation of the speckle patterns is due to the interference between the reflected rays in different phases.Through statistical analysis of the speckle pattern, laser speckle sensing is capable of providing real-time and highly sensitive measurements of the material's surface properties.

Image Acquisition and Pre-processing
The SensiCut dataset, which is available on Kaggle, contains 39,609 images classified into 59 different categories.These categories belong to 30 distinct material types, some of which, such as acrylic, are available in multiple colors.Therefore, the dataset contains more than 30 directories, although the classification is only made for 30 material types.Each image has a resolution of 800 pixels by 800 pixels, and the images in the dataset have green speckle patterns due to the use of a laser with a wavelength of 515nm, as shown in Figure 3.The color of the generated speckle pattern depends on the wavelength of the used laser, with the most critical channel among the three RGB layers corresponding to the color of the laser source.Figure 3 demonstrates three different speckle pattern images captured by a lens-less Raspberry Pi camera using three different laser pointers for each image.The wavelength of the laser used in Figure 3(a) is 515 nm, while the laser used to generate the speckles in Figure 3(b) is 532 nm, resulting in a green image.In contrast, when a laser with a wavelength of 650 nm is used, the speckles appear in red colors in the captured image as in Figure 3(c).In summary, the color of speckle patterns in the generated images changes corresponding to the color or wavelength of the used laser source.

Proposed Approach for Speckle Images
Figure 4 provides a more detailed explanation of the main concept behind this study, which involves utilizing only the layer that corresponds to the laser colour used during the speckle pattern-capturing process.The image in Figure 4 shows a sample of Maple Hardwood from the SensiCut dataset, with the original RGB image as the first layer.The individual red, green, and blue layers are displayed separately behind the first layer for comparison.
The visual comparison presented in Figure 4 clearly shows that the green channel of the sample image of Maple hardwood appears to be the most informative layer for material classification.The green layer provides a similar pattern to the original image and appears to contain the most significant features for distinguishing between different materials.In contrast, the other color layers seem to be either noisy or could be neglected for the classification task.Therefore, the proposed approach that utilizes solely one layer for material classification is expected to provide better accuracy and faster inference time compared to the traditional method that utilizes all three RGB channels.To validate the effectiveness of the proposed approach, experiments were conducted using the SensiCut dataset, which comprises 39,609 speckle pattern images, each corresponding to 30 different material types.To assess the proposed method, it was compared against a baseline model (Dogan et al., 2021) that utilized all three RGB layers for material classification by means of transfer learning from a pre-trained ResNet-50 model (He et al., 2016).The experiments showed that the proposed approach achieved higher accuracy and faster inference time compared to the baseline model.Specifically, the proposed approach achieved an accuracy of 98.3%, while the baseline model achieved an accuracy of 98.01%.Moreover, the proposed approach required only 13.5% of the time required by the baseline model for inference.
The results demonstrate the effectiveness of the proposed approach for material classification using speckle sensing, which provides a viable solution for reducing the required time for model training and inference while maintaining high accuracy levels.Furthermore, it offers a solution to the issue of mistakenly cutting hazardous materials by laser-cutting machines, allowing for more flexibility and ease of use in practical applications.

PROPOSED DEEP LEARNING MODEL
The proposed material classification approach employs a Convolutional Neural Network (CNN) for learning the discriminative features of speckle pattern images.The architecture of the CNN model used in this study is shown in Figure 5, and its summary is provided in the following: -

Deep Learning Model Architecture
The architecture consists of four convolutional layers with Maxpooling followed by two fully connected (dense) layers.

Input layer:
The input image size is (256, 256, 1), where only one layer is used from the input image corresponding to the laser colour used during the speckle pattern-capturing process.

First convolutional layer:
The first convolutional layer has 32 filters with a kernel size of 3x3 and a rectified linear unit (ReLU) activation function.The max-pooling layer reduces the spatial dimension by half.

Second convolutional layer:
The second convolutional layer has 64 filters with a kernel size of 3x3 and a ReLU activation function, followed by another max-pooling layer.

Third convolutional layer:
The third convolutional layer has 128 filters with a kernel size of 3x3 and a ReLU activation function, followed by another max-pooling layer.

Fourth convolutional layer:
The fourth convolutional layer has 128 filters with a kernel size of 3x3 and a ReLU activation function, followed by another max-pooling layer.

Flattening and Dense layers:
The flattened output from the last fourth convolutional layer is connected to two dense layers with 512 and 30 neurons, respectively, and a ReLU activation function.

Output layer:
The final layer has 30 neurons with a SoftMax activation function.The SoftMax function is commonly used in multiclass classification tasks, where the model needs to assign a probability score for each possible class label.The SoftMax function takes as input a vector of arbitrary real values and transforms them into a probability distribution over the classes.

RESULTS AND DISCUSSION
The training and validation loss graph in Figure 6 illustrates the performance of the proposed model over 100 epochs.The graph shows that the model achieved stable accuracy and loss throughout the training process.The loss consistently decreased during training, while the accuracy increased rapidly in the initial epochs, it eventually converged to 99%. Figure 7 shows the training and validation accuracy throughout 100 epochs.
To improve the model's capacity to generalize with diverse speckle images and avoid overfitting on the training set, image augmentation techniques such as zooming in and out within a range of ±20% were implemented.This allowed the model to better generalize with materials of varying thicknesses.A batch size of 256 was used during the training process.The key innovation of the proposed approach is to use only one colour channel from the input image, corresponding to the laser colour that generated the speckle patterns.distinguishing between 30 distinct materials.Figure 8 illustrates the classification performance of the proposed model for these materials.The confusion matrix indicates that the proposed model achieved a high accuracy in identifying the materials, with an overall accuracy of 97.8%.Furthermore, the ability of the model to recognize hazardous materials that can have a negative impact on the environment, such as Acrylonitrile butadiene styrene (ABS), Polyvinyl chloride (PVC), Lexan, and Carbon Fibre, was also tested.These materials can produce hazardous fumes and particles during laser-cutting processes, making it crucial to verify the model's ability to accurately identify them.Doing so has the potential to aid in environmental protection efforts.
The tests included 100 images per material, covering all 30 materials, including the four hazardous ones.The proposed model exhibited high accuracy in identifying hazardous materials, underscoring its potential to assist in environmental protection efforts.The confusion matrix displayed confusion between Polyvinyl chloride or vinyl (PVC), which is one of the hazardous materials, and Delrin, owing to the similarities in their surface structures.The samples utilized in the experiment had the same colour properties as a white transparent sheet, contributing to the confusion that arose.To address this problem in the future, materials with different colours could be added to the training set.This would enable the model to better generalize to the unique speckle patterns of each material.
To further evaluate the proposed model, the model's sensitivity to identify the materials was tested using precision, which involves calculating the fraction or proportion of the number of hazardous materials that are actually predicted as positive.This is the number of truly predicted hazardous samples over the tested ones.Additionally, the recall metric was used to calculate the fraction or proportion of the number of materials that are predicted to be hazardous over the total number of truly hazardous samples in the test set.Finally, the F1 score metric was also used to evaluate the model's ability to identify the materials.The precision, recall, and F1-score metrics are calculated according to Equations 1, 2, and 3 respectively.The results indicate that the proposed model was generally able to distinguish between the majority of wooden materials, such as Maple, Walnut, Birch Plywood, Cork, Veneer MDF, Bamboo, and laminated MDF.However, the randomness in the surface structure of Oak and MDF wood led to some confusion between these materials.Although the confusion between Oak and MDF was limited, it was still present when compared to the results of the base model that utilized full-color images.To address this, additional images of these two types of wood could be acquired from different positions and orientations to improve the model's ability to distinguish between them.Figure 9 presents the evaluation of the proposed model performance in terms of the F1-score, precision, and recall for the wooden materials.
Additionally, the precision, recall, and F1 score evaluation of the proposed model for plastic materials is depicted in Figure 10.The model exhibited higher classification accuracy for plastics, despite the confusion observed between silicon and felt, which was due to the black color of the samples that absorbed most of the laser rays and produced only a few speckle patterns in the images.The confusion may be alleviated by using samples with more distinguishable surface textures, thereby improving the model's performance.
Also, the evaluation of textile materials is summarized in Table 1.The F1 score for each category ranged from 0.90 to 1.00, indicating high precision and recall.The precision ranged from 0.91 to 1.00, and the recall ranged from 0.90 to 1.00.Based on the results presented in Table 3, the proposed model achieved high precision, recall, and F1 score in classifying metallic materials.However, some confusion was observed between Aluminium and Carbon Steel.This confusion was also observed in the base model, which used full-colour images.These results suggest that acquiring more images of these materials from different positions and orientations may improve the model's ability to distinguish between them and therefore enhance its classification performance.Most importantly, precision, recall, and F1-score were calculated for the hazardous materials, achieving remarkable results for all four hazardous materials.Despite the confusion between PVC and Delrin due to their similarity in surface structure and colour, the proposed approach achieved 100% accuracy in classifying ABS, Lexan, and Carbon fibre.as shown in Figure 13.Overall, the proposed approach achieved high accuracy in classifying 30 different laser cutting materials, with most classes having a perfect score of 1.0.Lower scores for some materials, such as Oakwood, MDF, and Leather, may be due to physical property variation.Despite this, the approach is satisfactory, reducing material classification time and adaptable to different materials, providing a flexible solution for a safe and environmentally friendly laser cutting industry.

CONCLUSION
This study proposes a new deep-learning model architecture that achieves high accuracy rates in classifying a wide range of laser-cutting materials and detecting hazardous materials for safe and efficient cutting, including wood, plastics, metals, and others, with low computational time.The main contribution of this paper is the use of solely one colour channel from the input image corresponding to the colour of the laser in conjunction with a custom CNN architecture.The proposed model significantly decreases the needed inference time compared to traditional laser speckle sensing based on a pre-trained model, as the use of one colour channel depends on a custom architecture.The approach is adaptable to different materials, not just hazardous materials in laser cutting, making it a versatile solution for laser speckle sensing, material classification tasks, and hazardous materials detection.The proposed deep learning model's simplicity and ability to detect hazardous materials make it a promising solution for various industries, including digital manufacturing, additive manufacturing, and CNC machining.Future research could focus on deploying the proposed model in these industries to enhance the safety and efficiency of the digital manufacturing industry.

Figure 1 Figure 1 .
Figure 1 illustrates two different samples from the SensiCut dataset.Specifically, Figure 1(a) displays a sample picture of the speckle patterns of Oak Hardwood, whereas Figure 1(b) depicts the speckle patterns of MDF.

Figure 4 .
Figure 4.The original RGB image of Maple Hardwood from the SensiCut dataset.And its blue, green, and red channels.
, Loss Function, and Metrics: In the context of the proposed CNN model, the optimizer used during training was Adam with a learning rate of 0.001, which determines how quickly the model learns from the training data, The categorical cross-entropy loss function was used to calculate the difference between the predicted probabilities and the actual class labels during training.The output accuracy of the model was used to monitor its performance during training.

Figure 7 .
Figure 7. Training and validation accuracy.The proposed model's performance was evaluated by conducting experiments on a set of 3000 images, and a confusion matrix was generated to validate its accuracy in

Figure 8 .
Figure 8. Confusion matrix for the 30 different materials, including four hazardous.
of true positive samples FN = Number of false negative samples FP = Number of false positive samples True Positive (TP) refers to the cases where the model correctly identifies a hazardous material as hazardous, while False Negative (FN) refers to the cases where the model incorrectly identifies a hazardous material as non-hazardous, and False Positive (FP) refers to the cases where the model incorrectly identifies a non-hazardous material as hazardous.

Figure 9 .
Figure 9. Classification report for different 9 wooden materials.

Figure 10 .
Figure 10.Classification report for different plastic materials.

Table 1 .
Classification report for different textile materials.