{'fraction_non_alphanumeric': 0.025, 'fraction_numerical': 0.01315359477124183, 'mean_word_length': 4.939349830179524, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
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
For scientists working with large amounts of data, machine learning has now become an indispensable tool. To process large datasets, it employs a variety of artificial intelligence (AI) techniques. It then uses the information to build digital neural networks to forecast and make decisions in various scenarios [1][2][3][4][5]. Outside of materials science, the forecasts can help scientists and engineers comprehend a variety of systems.
The eye of industrial automation is Computer vision. Computer vision approaches try to analyze images using cameras, sensors, and computer power in order to allow machines (human -robot interaction or other industrial instruments) to fulfill industrial activities such as production and quality assurance. Capture, process, and action are the three steps that make up the machine vision process. Computer vision is indeed a critical component of Industry 4.0. It benefits industry automation systems in a variety of ways, including increasing efficiency through better inventory management, detecting faulty items, and enhancing manufacturing quality [6][7][8][9]. Computer vision (CV) is a branch of computer science concerned with quantifying the visual contents of an image. A digital picture is a numerical expression in which each pixel is associated with a numeric gradient magnitude or a shorter vectors color value (i.e., RGB); the individual pixels convey minimal information about the image's content. The purpose of CV is to combine pixels into a high-dimensional combination of visual data to represent an image.
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 are hard 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].

Experimental Procedure
Computers process an image as numbers where each pixels of that image have some values. So an image can be represented by a set of numbers in a two-dimensional matrix. In image classification problem the main thing is to predict the class label of each images as shown in Figure 1. 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.
where the scaling factors for the x and y directions are s x and s y , 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 h x and h y , respectively.
In 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 algorithm and result obtained by horizontal shift image augmentation is shown in Figure 2 and 3. The algorithm and result obtained by vertical shift image augmentation is shown in Figure 4 and 5. The algorithm and result obtained by horizontal flip image augmentation is shown in Figure 6 and 7. The algorithm and result obtained by random rotation image augmentation is shown in Figure 8 and 9. The algorithm and result obtained by brightening image augmentation is shown in Figure 10 and 11. The algorithm and result obtained by zoom image augmentation is shown in Figure 12 and 13. In Computer Vision, datasets are divided into two types: training datasets and testing datasets. 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.

Results and Discussion
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 14.
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 down 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.

∑ ∑ (4)
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. Let's we have have a 40 x 40 x 3 image as shown in Figure 15. Height and width of the microstructure image can be represented by and number of channels is represented by . The first layer uses 3 X3 filters to detect the features which are represented by 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 layer of a neural network will be 38 X 38 X 10. The new value of and is calculated by Equation 5.
So the new values for height and width will be and new value for a number of channels is represented by . 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 having a stride of with no padding and number of filters is 20. 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 16 shows the CNN architecture used in the present study. The plot of the loss function against the number of epochs is shown in Figure 17. The plot of accuracy against the number of epochs is shown in Figure 18. The accuracy increases for both the training and testing (validation) datasets, as shown in Figure 18.

Conclusion
In this study, a Deep Convolutional Neural Network is effectively used to predict the welding effectiveness of Friction Stir Welded connections, which is a mechanical feature. Convolutional Neural Networks (CNNs) are a strong tool for image identification and sophisticated problem solving. A few transforms should be kept in mind when training Artificial Neural Network models. For binary classification issues, there is a topmost layer with a nonlinear activation function as well as a binary node. The current research project is primarily focused on developing a basic Classification algorithm for classifying the two types of microstructures. The model was created with such an accuracy of 80%, however it may be better. The model may be improved further by:  including more photographs into the dataset  modifying the learning rate  altering the batch size, which will help the system to recognize patterns more accurately. When the batch size is small, the patterns repeat less frequently, making convergence difficult, whereas when the batches size is large, learning is slow.  Increasing or lowering the amount of epochs The effort will continue to employ the Fully Convolutional (CNN) technique to detect flaws in Friction Stir Welded joints in the future.