Computer Vision Algorithm for Predicting the Welding Efficiency of Friction Stir Welded Copper Joints from its Microstructures

Friction Stir Welding is a robust joining process, and numerous AI-based algorithms are being developed in this field to enhance mechanical and microstructure properties. Convolutional Neural Networks (CNNs) are Artificial Neural Networks that use image data as input. Identical to Artificial Neural Networks, they are composed of weights that are determined throughout learning, neurons (activated functions), and a goal (loss function). CNN is utilized in a variety of applications, including image recognition, semantic segmentation, image recognition, and localization. Utilizing training on 3000 microstructure pictures and new tests on 300 microstructure photographs, the current work investigates the predictions of Friction Stir Welded joint effectiveness using microstructure images.


Introduction
Artificial Intelligence (AI) is a rapidly growing field that has revolutionized many industries, including the materials and manufacturing industries.AI has brought new and improved technologies to these industries, leading to increased efficiency, productivity, and profitability.There are many ways in which AI is benefitting the materials and manufacturing industries: AI algorithms can analyze vast amounts of data and identify patterns, helping to predict when a machine is likely to break down.This enables manufacturers to proactively fix the problem before it leads to downtime and lost productivity.AI can automate quality control processes, reducing the risk of human error and improving the accuracy of inspection.By using machine learning algorithms, AI systems can detect and classify defects in realtime, ensuring that products meet high quality standards [1][2][3][4][5].AI can help manufacturers optimize their supply chain processes, reducing costs and improving delivery times.By analyzing data from suppliers, manufacturers can identify bottlenecks in the supply chain and make informed decisions about sourcing, production, and distribution.AI can help engineers optimize product designs, reducing material waste and speeding up the development process.
By using machine learning algorithms, AI systems can evaluate the impact of various design changes and make recommendations based on performance metrics such as strength, durability, and cost.AI can help manufacturers optimize their production processes, reducing energy consumption and increasing output.By analyzing data from production lines, AI systems can identify areas for improvement and make recommendations for optimizing production processes.Computer vision is a field of AI that is concerned with enabling computers to understand, interpret, and analyze visual information.It involves the use of algorithms and mathematical models to analyze images and videos, making it possible for computers to recognize objects, interpret scenes, and understand the relationships between objects [6][7][8][9].Computer vision can be used to automate quality control processes in manufacturing, reducing the risk of human error and improving the accuracy of inspection.This can lead to a reduction in scrap rates and increased efficiency.Computer vision can be used to identify the type of material being processed, such as different types of metals or plastics.This can improve the accuracy of material tracking and reduce the risk of waste.Computer vision can be used to monitor production processes, identifying areas for improvement and reducing downtime.This can help manufacturers to increase efficiency and reduce costs.Computer vision can be used to detect and diagnose problems in equipment and machinery.By analyzing images and videos, it can identify signs of wear and tear, helping to prevent breakdowns and reduce maintenance costs.Computer vision is critical to the development of advanced manufacturing robots, enabling them to accurately identify objects and manipulate them with precision.This has the potential to improve the efficiency of many manufacturing processes.Many Machine Learning approaches are frequently used for the Friction Stir Welding process [10][11][12][13].Friction Stir Welding is a robust joining procedure used to unite materials that arehard to connect using typical welding methods [14][15][16][17].Tool Rotational Speed (RPM), Tool Traverse Rate (mm/min), as well as an Axial Force (KN) are the input variables for the Friction Stir Welding process [18][19][20].Convolutional Neural Networks have been used in the Friction Stir Welding Process in only a few research.Hartl et al. [21] used Neural Network Model modeling for process monitoring with in Friction Stir Welding Process.The Fully Convolutional DenseNet-121 was used for automated visual inspection with in Friction Stir Welding process [22].The present investigation focuses on the implementation of a Deep Convolution Network method for making predictions of the welding efficiency that is the resilience of the weldment in reference to the resilience of the base metal of Friction Stir Welded Copper joints, based on metallographic image obtained from huge datasets available on Google and numerous other scientific papers [23][24][25][26][27][28][29][30][31][32].

Material and methods
Computer processing of images involves several stages, including image acquisition, preprocessing, feature extraction, and recognition.The first step in processing an image is acquiring the image data.This can be done using a digital camera, scanner, or other image acquisition device.The image data is then stored as a digital signal in a computer.Once the image data is acquired, it goes through a pre-processing stage where it is cleaned, transformed, and corrected for any defects.This includes steps such as noise reduction, color correction, and image resizing.The goal of pre-processing is to prepare the image data for further processing and improve the quality of the image.After pre-processing, the image data is transformed into a set of features that can be analyzed by computer algorithms.This stage involves identifying important features in the image, such as lines, edges, and shapes.These features are then used to represent the image and make it easier for the computer to understand.The final stage of image processing is recognition, where the computer uses the extracted features to identify objects in the image.This can be done using machine learning algorithms, such as deep learning, that are trained on large datasets to recognize patterns in images.The computer then makes a prediction about the objects in the image, such as what they are and their location in the image.In image classification problem the main thing is to predict the class label of each images as shown in Figure 1.

Fig.1 Classification of Microstructure images
The CNN Algorithm pipeline should be accurate enough to correctly perceive the unique features and further predict the classification of the microstructure images i.e. which microstructure image represents the welding efficiency higher than the 80 % and vice versa.The most critical aspect of the entire machine learning process, mainly in supervised learning, is gathering a high-quality dataset.Preparing a complex dataset, on the other hand, is a lot of hard work.The first stage is to figure out what problem the model needs to answer and what kind of data may be collected.A simple end-to-end example objective may be for a car to recognize traffic signs from images captured by its own frontal camera.To generalize well and perform securely when deployed, the model would require a dataset that accurately depicts the task in as many instances as feasible.This includes various lighting and weather situations, as well as several perspectives from which the photograph could be taken.Any bias that may have been introduced inadvertently into the dataset must also be carefully considered.Otherwise, the model may discover patterns or features unrelated to traffic signs, incorrectly conclude they are significant, and make decisions based on inaccurate data.In order to increase the number of the microstructure images, Image augmentation method is used.Data augmentation, also known as implicit regularization, is a popular strategy for improving the generalization performance of deep neural networks.It's crucial in situations where there's a scarcity of moral high-ground data and gathering additional samples is both costly and time-consuming.Image augmentation can be obtained by operations like Random Flipping, shearing, scaling etc. Random flipping produces a 'reciprocal of the input images along one (or more) axes.Natural images may usually be turned all along horizontal axis, but not the vertical axis, because ascending and descending components of an image aren't always "interchangeable."Similarly, in this case, flipping an object by an orientation all around center pixel can be used.After that, appropriate interpolation is used to meet the original image size.Equation 1 denotes the rotation operation R, which is frequently combined with nil performed to the missing pixels.
When scaled replicas of the actual microstructures images are included in the training set, the deep network can be trained on valuable deep features regardless of their original version.
As demonstrated in equation 2, this process S can be done independently in multiple orientations.
, 01 where the scaling factors for the x and y directions are sx and sy, respectively.
Each point in a microstructure image is displaced in a certain direction by the shear transformation (H).As indicated in equation 3, this offset is dependent on the distance from the line that passes through to the beginning and is transverse to this direction.
Where the shear coefficients in the x and y directions are denoted by hx and hy, respectively.
In Training datasets are used to teach the algorithm to do the desired task, while testing datasets are used to test the approach.The microstructure pictures with welding efficiency just under 80% and microstructure imaging with welding efficiency more than or equal to 80% were used in this investigation.Figure 8 shows the implemented Computer Vision framework in the present work.The main goal of the CNN architecture is to learn the features directly from the data.There are three main parts of the CNN architecture i.e.Convolution, Non-linearity and Pooling as shown in Figure 9.The main function of the convolution is to extract the features from the microstructure image or from the previous layer.Non-linearity is introduced to deal with the non-linear data and further introduce the complexity in the learning pipeline in order to solve more complex tasks.Pooling operation allows to sample the spatial resolution of the microstructure image or multiple scale features of the microstructure image.Computation of the class scores can be outputted by a dense layer which is after the convolution layer.Where w is the weight, x is the input features and b is the bias.Consider the following scenario: if we have microstructure image and we want to perform an image pattern classification operation.The input is a microstructure of a friction stir fused joint, and we want to know whether it belongs to the above 80 percent welding efficiency or below 80 percent welding efficiency classification.Figure 10   [0] = 3 .The first layer uses 3 X3 filters to detect the features which are represented by  [1] = 3 and there is a stride of 1 with no padding.By using ten convolutions it is assumed that there are 10 filters then the activations in the next 12 layer of a neural network will be 38 X 38 X 10.The new value of   [1]    [1] and is calculated by Equation 5.   [1] So the new values for height and width will be   [1] =   [1] = 38 and new value for a number of channels is represented by   [1] = 10.These become the dimensions of the activations at a first layer.Now let's say we have n another convolutional layer and 6 X 6 filters are used represented by  [2] = 6 having a stride of  [2] = 2 with no padding and number of filters is It is observed that the dimension had shrunk much faster to 17 X 17 X 20.So overall it is observed that we have taken 40 X 40 X 3 input image and computed it to 17 X 17 X 20 =5780 features for the microstructure image and what's commonly done is flattening into vectors and unrolling the volume of the final microstructure image into 5780 units which is further fed to a logistic regression unit or a soft-max unit to recognize whether the microstructure images belong to the welding efficiency of greater than 80 % or to a welding efficiency less than 80 % and it further yields the output  ̂. Figure 11 shows the CNN architecture used in the present study.a smooth and steady decline.Instead, the plot may oscillate or even increase at certain points.This can indicate overfitting, where the model is too complex and has learned the noise in the data, or underfitting, where the model is too simple and does not have enough capacity to learn the patterns in the data.The plot of the loss function against the number of epochs is shown in Figure 12.

Conclusions
In conclusion, the current work has demonstrated the potential of using Convolutional Neural Networks (CNNs) for predicting the effectiveness of Friction Stir Welded (FSW) joints based on microstructure images.With a training dataset of 3000 microstructure images and a test dataset of 300 images, the study showed that the CNN was able to achieve an accuracy of 81 percent in its predictions.This result highlights the potential of using computer vision and machine learning techniques in the materials and manufacturing industries to improve the quality control and assessment of FSW joints.In terms of future work, there are several directions that could be taken to further develop and enhance the application of CNNs for predicting FSW joint effectiveness.One possible avenue is to increase the size and diversity of the training dataset, as larger and more diverse datasets have been shown to improve the performance of CNNs.Another possibility is to explore the use of other computer vision techniques, such as image segmentation and object detection, to extract more relevant information from the microstructure images.Additionally, it would be interesting to evaluate the performance of other machine learning algorithms, such as Random Forest or Support Vector Machines, and compare their performance with that of CNNs.
/doi.org/10.1051/e3sconf/202343001252252 430 the present study, horizontal shift image augmentation, vertical shift image augmentation, horizontal flip image augmentation, random rotation image augmentation, brightening image augmentation, and zoom image augmentation were implemented to increase the number of microstructure dataset.The result obtained by horizontal shift image augmentation is shown in Figure 2. Result obtained by vertical shift image augmentation is shown in Figure 3.The result obtained by horizontal flip image augmentation is shown in Figure 4.The result obtained by random rotation image augmentation is shown in Figure 5.The result obtained by brightening image augmentation is shown in Figure 6.The result obtained by zoom image augmentation is shown in Figure 7.In Computer Vision, datasets are divided into two types: training datasets and testing datasets.

Fig. 2 Fig. 8
Fig. 2 Augmented Microstructure images obtained by Horizontal Shift Fig. 3 Augmented Microstructure images obtained by Vertical Shift

Fig. 9
Fig.9 Representation of the CNN Architecture Each neuron in the hidden layer computes a weighted sum of the inputs from that patch of an input microstructure image as shown in Figure and further bias is applied which is activated by a local non-linearity.The actual computation for a neuron in that hidden layer is defined by equation 4. ∑ ∑    +,+ +  4 =1 4 =1 depicts the image of size 40 x 40 x 3.

Fig. 10
Fig.10 Convolution operation on a given microstructure image Height and width of the microstructure image can be represented by   [0] =   [0] = 40 and number of channels is represented by  [0] = 3 .The first layer uses 3 X3 filters to detect the features which are represented by [1] = 3 and there is a stride of 1 with no padding.By using ten convolutions it is assumed that there are 10 filters then the activations in the next 12 layer of a neural network will be 38 X 38 X 10.The new value of  [1]   [1] and is calculated by Equation5.

Fig. 11 CNN
Fig.11 CNN Architecture used in the present study The plot of a loss function against the number of epochs is a common representation used in deep learning and machine learning to evaluate the performance of a model.An epoch is a complete iteration over the entire training dataset, and the loss function measures the difference between the model's predicted output and the actual target values.In general, the loss function decreases as the number of epochs increases, which indicates that the model is improving its performance over time.The plot of the loss function with the number of epochs provides a visual representation of the training process and helps to identify trends in the model's performance.There are different types of loss functions that can be used in machine learning, including mean squared error, cross-entropy, and hinge loss.The choice of loss function depends on the type of problem being solved and the characteristics of the data being used.In some cases, the plot of the loss function against the number of epochs may not show

Fig. 12
Fig.12 Loss function plotted against the number of epochs

Fig. 13
Fig.13 Accuracy as a function of the number of epochs The plot of accuracy against the number of epochs is a common representation used in deep learning and machine learning to evaluate the performance of a model.An epoch is a complete iteration over the entire training dataset, and accuracy measures the proportion of correct predictions made by the model.In general, the accuracy increases as the number of epochs increases, which indicates that the model is improving its performance over time.The plot of accuracy with the number of epochs provides a visual representation of the training process and helps to identify trends in the model's performance.The plot of accuracy against the number of epochs is shown in Figure 13.The accuracy increases for both the training and testing (validation) datasets, as shown in Figure 13.