FlankPix: An Image Segmentation Algorithm for Flank Wear Analysis in Monel K500 Turning

ABSTRACT


INTRODUCTION 1.1 Background
Many experts have written volumes and articles on the subject of tool wear.On the other hand, flank wear has received a relatively minor amount of attention, even though both online and offline methods for monitoring the state of machining tools have been offered.In their study, Danesh and Khalili [1] used a non-decimated wavelet transform and statistical data on surface flaws to look at how tool wear compared to the surface texture of the turned piece.As a result, they could detect how tool wear affected the texture of the workpiece's surface.Researchers [2,3] used edge recognition and morphological component analysis to find blunted edges in industrial environments.Researchers [4,5] used tungsten carbide inserts to measure the depth of the crater wear during quasi-orthogonal cutting tests on AISI 1045 steel.They used a synthetic neural network to help them accomplish this, which allowed them to succeed.Matlab served as the primary modelling tool in developing an image-processing method by Xiong and his colleagues to assess the degree of tool wear.The image capture system comprises high-frequency linear fluorescent light, a high-resolution CCD camera, and a datagathering module [6,7].

Literature review
Researchers [8][9][10] developed an automated tool wear monitoring system using the active contour approach and neural networks to analyse tool flank wear.Urbicain and Trejo [11] created a system to measure milling and insert cuttingedge flaws in real-time without interfering with production.An edge-preserving smoothing filter, picture gradient computation, and a cutting-edge damage assessment based on geometrical features make up a three-stage technique.The ANOVA (Analysis of Variance) and fuzzy rule methods [11,12] were used to determine how much the AISI 5140 steel alloy wore down and how much noise it made.The L27 orthogonal array method, the MSER algorithm, and the deep pattern network [13] were used to measure the alloy's surface roughness and flank wear when dry.To determine how long a tool made from AISI 4340 steel will last, the study [14] ran tests on the material with an L9 orthogonal array, analysed the results with an ANOVA, and relied on Gilbert's method.For Gamma-Prime-reinforced alloys, the study [15] employed Kalman filtering to estimate tool wear and reported an 18% filter rate of error.Of these papers, the study [16] MSER Algorithm and DPN, published under the name FlankNet, are the most promising candidates for the method used to assess tool wear, in particular flank wear.
Ant Colony Optimization (ACO) and Canny's Edge Detection (Canny) have been used together to find skin lesions much more effectively in a study of optimisation and edge detection methods [17].As a result, Fuzzy Logic's performance ranges from roughly 87% to 91%, with an average inaccuracy of 87%.The cutting forces and temperature acting cumulatively on the cutting tool throughout the machining operation create normal tool wear.Tool wear would have a significant impact on the surface quality of the machining workpiece.Improving workpiece surface quality is required to increase economic efficiency.A precise tool wear value, which may be utilised to schedule cutting tool replacement properly, can assist in providing optimal machining settings.The ideal machining parameter values can be found.As a result, much emphasis has been placed on developing the tool wear monitoring system [18][19][20][21].Using the FlankPix algorithm, enhancing the accuracy of the Average Error Prediction of Flank Wear in Monel K500 to achieve the target sum (in percentage terms) is essential.If the proposed method succeeds, the typical error rate should decrease by over 90%.
A comprehensive review of existing literature reveals the importance of monitoring cutting tool technology, specifically in assessing the machinability of difficult-to-machine materials.The significance of flank wear in mining and various industries is underscored.Different ways of measuring tool wear have been looked into in the past, including nondecimated wavelet transform, edge recognition, morphological component analysis, neural networks, image processing tools like Matlab, and automated monitoring systems that use neural networks, edge-preserving smoothing filters, and real-time analysis methods.

Research gap
The literature survey revealed a crucial research gap concerning precise and reliable tool wear measurement techniques, particularly in high-temperature alloy applications like Monel K500.Existing methods, while informative, displayed limitations in accuracy and suitability for such specialized materials.There was a clear need for an advanced tool wear assessment approach that could effectively address the challenges posed by background noise, provide higher precision in edge detection, and offer more nuanced measurements of tool wear extent.The research gap made it clear that we need a new and improved way to measure tool wear that can provide higher accuracy, lower sensitivity to image noise, and work with the unique properties of hightemperature alloys like Monel K500.This gap laid the foundation for the development of the FlankPix algorithm as a solution to address these shortcomings and provide an advanced, technically enhanced tool wear measurement method for precise evaluation in challenging industrial settings.

Research objectives
The main research objective is determining the average flank wear error percentage when turning the Monel K500.According to the study [22], steel alloys have several exceptional properties, including excellent corrosion resistance in chloride and Sulphur dioxide environments.In recent years, monitoring cutting tool technology has been applied to evaluate the attributes of cutting tool materials to identify the machinability of cutting tool materials that are notoriously difficult to machine [23][24][25].In addition, stress and cracking are extremely unlikely in these environments.According to the study [26], monitoring tool wear reduces workpiece errors by preventing unexpected breakage or overuse.If wear is not considered, the tool wear may cause damage to the workpiece or the machine itself.The importance of flank wear in the mining sector must be emphasized.According to the study [27], alloys are utilized in various global industries, including manufacturing, aerospace, the military, and medicine.According to the study [28], crater and flank wear are two additional types of tool wear, with the latter being crucial for machine stability, dependability, and diametric accuracy.

Significance of the study
Improving tool wear assessment accuracy is crucial for optimizing machining parameters and workpiece surface quality, enhancing economic efficiency.The development of the FlankPix algorithm is anticipated to fill the existing research gap and provide a technically advanced tool wear measurement method for high-temperature alloy applications.

MATERIAL AND METHODS
The corrosion resistance of Alloy 400 is combined with the high-strength corrosion fatigue and erosion resistance of Monel K500, a nickel-copper alloy that may be age-hardened.MONEL K500 is an aluminium and titanium-added nickelcopper alloy with precipitation-hardening properties.Both 90mm and 180-mm-diameter Monel K500 alloys were evaluated for turning purposes.The workpiece's (in-weight percentage) chemical components are listed as follows: Ni 63.0 Cu 29.5 Al 2.7, Ti 0.6 C 0.18 Fe 2.0 Mn 1.5 Si 0.50 S 0.010.The turning path was constructed using a NAGMATI 175 centre lathe.We employed Cubic Boron Nitride (CBN) inserts manufactured by Sandvik and meeting the requirements of CNGA 120 408S01030A, 7025 Grade, fixed in a PCLNR 2020 K12 tool holder for the experiments.
Mechanical Properties: Monel K500 offers high tensile strength, excellent corrosion resistance, good hardness, and fatigue strength.The hardness of the Monel K 500 is 35HRC.
Temperature Resistance: Exhibits outstanding resistance to a wide range of temperatures, making it suitable for hightemperature applications.
Age-Hardening Alloy: It can be strengthened through precipitation hardening after aging heat treatment.

CBN inserts: Specifications
Material Composition: CBN inserts are made from synthetic crystalline structures of boron and nitrogen.
Hardness: Extremely high hardness comparable to diamond, making them suitable for machining hard materials like hardened steels, cast iron, and superalloys.
High Thermal Conductivity: CBN inserts possess excellent thermal conductivity, aiding in dissipating heat generated during machining processes.
Wear Resistance: Known for their exceptional wear resistance, CBN inserts offer extended tool life even under high-speed machining conditions.
Machining Applications: Often used in machining applications requiring high-speed cutting, high precision, and durability, particularly in hard materials where traditional carbide inserts might wear out quickly.
Investigators regularly measured flank wear offline with a universal measuring microscope.For the experiment, an L27 orthogonal array was used.Table 1 shows the values for the machining parameters feed rate, depth of cut, and cutting speed.Testing was carried out in a dry setting.Images of worn-out equipment were taken using a scanning electron microscope (SEM) for computer vision analysis.

FLANKPIX ALGORITHM
The core steps of the FlankPix algorithm rely on the Canny edge detection technique, a multi-stage process that identifies abrupt changes in intensity within grayscale images.The steps in this method are •Noise reduction using Gaussian blur; •Gradient calculation to find out the strengths and directions of edges; •Non-maximum suppression keeps track of the ridges representing edges, and hysteresis thresholding is used to create edge maps based on high and low thresholds.
FlankPix stands out for its ability to precisely identify tool edges while disregarding background noise, resulting in accurate measurements of tool wear.Its effectiveness lies in the combination of pixel distance measurement and edge detection techniques, which contribute to maintaining a smooth and precise tool contour, which is critical for evaluating the tool's condition.This method demonstrates an average prediction error of just 1.29%, showcasing its high accuracy in assessing tool geometry changes and enhancing product quality in manufacturing processes.
The images of the tool wear were first processed using the Innovative FlankPix algorithm, then submitted to the edge detection algorithm and pixel measurement to estimate the amount of flank wear that each of the respective images has.The % error is the ratio of the difference between the measured value and predicted value to the measured value, as in Eq. (1).
where, M is experimental value of Flank wear, P is predicted value using FlankPix method.

Canny edge detection
A canny edge detector is a multi-stage operator for edge detection that can identify various image edges.Moreover, Canny provided a computational edge detection theory to clarify the efficacy of his approach.It was intended to create a superior edge detector that the Canny operator developed.It takes in a grayscale image and spits out a second image labelled with the coordinates of any abrupt changes in intensity that it detects.There are five stages to the Canny Edge detection method.Methods of reducing noise, calculating gradients, employing non-maximal suppression, utilizing a double threshold, and using hysteresis to track edges are discussed.
Several steps are required for the Canny operator to complete his work.Gaussian convolution is first used to smooth the image.A straightforward 2-dimensional first derivative operator was applied to the smoothed image to draw attention to areas with high first spatial derivatives.With the magnitude of the gradient, edges create ridges.The algorithm then follows the crests of these ridges, performing nonmaximal suppression by setting all pixels that are not actually on the ridge top to zero.This results in a narrow line in the final output.Two thresholds, T1 and T2, govern the hysteresis shown in the tracking process, with T1 being higher than T2.Assuming T1 is the starting location, tracking can only start at a higher ridge.From there, they tracked in both directions until the ridge's elevation was lower than T2.Using hysteresis like this helps to prevent the splintering of loud edges into smaller pieces.

Gaussian Blur Kernel Size (σ):
The size of the Gaussian blur kernel influences the amount of smoothing applied to the image.A larger kernel (higher σ) produces more blur, reducing noise but potentially blurring edges.Common σ values range from 1 to 3.
High and Low Thresholds: The Canny edge detector uses two thresholds to determine which edge pixels to consider as strong, weak, or non-relevant: High Threshold (T₁): Determines the minimum gradient value required for a pixel to be considered a strong edge pixel.
Low Threshold (T₂): Sets the minimum gradient for a pixel to be considered a weak edge pixel.Any pixel with a gradient value between T₁ and T₂ is marked as a weak edge pixel.
Hysteresis Thresholding: This step helps in connecting edge pixels into continuous edges.It involves: Strong Edge Pixel: Pixels above the high threshold (T₁).Weak Edge Pixel: Pixels between the high (T₁) and low (T₂) thresholds.
Non-relevant Edge Pixel: Pixels below the low threshold (T₂) are considered non-relevant.
Edge Connectivity: Weak edge pixels are considered part of the edge if they are connected to strong edge pixels.This connectivity step forms continuous edges.

Noise reduction
One way to remove noise from an image is to apply a Gaussian blur.It is achieved using the Gaussian Kernel (3×3, 5×5, 7×7, etc.) image convolution technique.The degree of blur is the most critical factor when choosing a blur kernel.The blur becomes less apparent as the size of the kernel decreases.This research uses a 5×5 Gaussian kernel. where, Hef = Filter function Eq. ( 2) shows the Gaussian Kernel filter equation.

Gradient calculation
The gradient size throughout the dimensions can be determined by computing the filter's derivative for the X and Y dimensions and then converging that result with I.It is also possible to determine the image's orientation by calculating the tangent of the angle between the two measurements.A gradient vector, complete with magnitude and direction, results from the convolution.In the end, the Gaussian derivatives are responsible for the staleness of the final edges.

Non maximum suppression
Consider the three edge points on edge shown in Figure 1.Consider the coordinates (x,y) as an example, assuming the edge gradient is at its highest level.It must be proven that the gradient perpendicular to the edge is less than (x,y).If the values are less than the (x,y) gradient, the non-maximal locations along the curve can be skipped.

Hysteresis thresholding
When creating an edge map, hysteresis thresholding considers both high and low thresholds before settling on a solution (see Figure 2).A significant improvement over single thresholding can be achieved by appropriately computing both the low and high points and then processing the resulting thresholder images.In contrast to single thresholding, hysteresis thresholding uses low and high thresholds to find edges via a linking procedure.

Flank wear measurement using distancing method
The FlankPix algorithm incorporates distance measurement through the utilization of Canny edge detection.After the Canny edge detection technique identifies edges within grayscale images, the algorithm calculates the distance or extent of flank wear based on these detected edges.Canny edge detection, within the context of FlankPix, helps pinpoint the abrupt changes in intensity that signify the edges of the worn tool.The outcome of the canny edge detection can be seen in Figure 3.The process followed in tool wear detection from SEM images is illustrated in Figure 4, as given below.The input test image is pre-processed by converting it to grayscale binary.The bwconncomp command calculates the binary cumulative area.Moreover, the orientation, minor axis length, and significant axis length at their maximums can be obtained.The pixels of the captured image are determined, as illustrated in Figure 5.After examining the collected image of the interconnected construction blocks, we calculated the size of each pixel in the x and y directions using the number of pixels placed in the x and y directions.The capture event command reads the coordinates of the point in the X and Y directions.Monel K500 was turned with a cubic boron nitride insert.Several experiments were conducted.The edge detection technique was utilized to determine the extent of flank wear.The worn insert would undermine the integrity of the machined surface, diminishing the workpiece's resistance to fatigue and, consequently, its longevity.The aerospace industry uses the alloy known as Monel K500 extensively for high-temperature applications.As a direct result, it is essential that the integrity of the machined surface of this alloy is maintained and that tool wear is minimized.In addition, it is vital to define the proper machining parameters for this insert material and alloy combination.Throughout this investigation, a novel method for measuring flank wear was devised.
Table 2 displays the results of the flank wear analysis performed with FlankPix and the Tool Microscope.It also includes factors, dependents, and error percentages for traditional and non-traditional flank wear measurements.When predicting the flank wear of the insert, FlankPix performs admirably, with impressively high accuracy and a significantly reduced error percentage; the new Edge detection technique has an average error of 1.29%.
For each experimental trial, researchers estimated flank wear width (VB).With FlankPix analysis, captured images are processed.The image processing system known as FlankPix could precisely estimate the amount of flank wear.Unlike previous measuring systems, this one does not require a separate calibration of the visual system.This method is highly accurate for assessing flank wear width, with an average error rate of 1.29% compared to its existing counterparts.
The comparison in Table 3 focuses on the average prediction error as a key metric to evaluate the effectiveness of FlankPix in estimating tool wear compared to conventional methods such as the Tool Maker's Microscope and other established techniques.1.29% Functional Data Analysis [29] 1.9% FlankNet [30] 3.03% CUSUM Algorithm [31] 2.5% The FlankPix algorithm, while innovative, exhibits limitations that warrant consideration.Sensitivity to image quality variations, reliance on specific parameter settings, potential computational demands, and adaptability challenges across diverse machining conditions are primary concerns.Furthermore, its performance may rely heavily on the initial image quality, risking accuracy with poor inputs, and potential overfitting issues could restrict generalizability.Addressing these limitations is crucial for refining the algorithm's robustness and applicability in diverse industrial settings.

CONCLUSIONS
The industrial sector will find this approach of measuring tools wear much more helpful than using a single metric.The Edge Detection Method was developed to measure the amount of wear on the Cubic Boron Nitride insert used to turn Monel K500.It is essential to preserve the integrity of the machined surface and keep tool wear to a minimum.
The subsequent findings are given below: • The FlankPix method may be utilized to measure flank wear.• It is a promising and practicable method for measuring flank wear in-process for industrial applications.• Minimal flank wear was attained at medium and moderate cutting speeds with a low feed rate.Compared to the standard way of evaluating flank wear using a toolmaker's microscope, the flank wear measured with FlankPix yielded greater accuracy, with an average percentage of 1.29 percent.FlankPix algorithm's applications in precision tool wear measurement across aerospace, manufacturing, defense, and medical sectors.
Some potential limitations include susceptibility to image quality variations, sensitivity to lighting conditions, challenges with complex tool geometries, and the need for further validation in diverse industrial settings to confirm its generalizability and performance under varying conditions.Improvements for FlankPix could involve refining the algorithm, integrating advanced technologies like AI, ensuring robustness across varied conditions, validating in different industries, and developing methodologies for quantifying tool life, enhancing its reliability and wider applicability.

Figure 1 .
Figure 1.Non -maximum suppression 3.1.4Hysteresis thresholdingWhen creating an edge map, hysteresis thresholding considers both high and low thresholds before settling on a solution (see Figure2).A significant improvement over single thresholding can be achieved by appropriately computing both the low and high points and then processing the resulting thresholder images.In contrast to single thresholding, hysteresis thresholding uses low and high thresholds to find edges via a linking procedure.

Figure 3 .
Figure 3. (a) Tool wear SEM image, (b) Edge detected image of original SEM imageOnce the edges are identified, FlankPix utilizes distance measurement techniques to determine the amount of wear along these edges precisely.It involves calculating the distance between specific points on the edges, allowing for an accurate estimation of the flank wear's extent.By integrating distance measurement with the information obtained through Canny Edge detection, FlankPix ensures a detailed assessment of the tool's wear, improving accuracy in evaluating tool conditions and ultimately enhancing manufacturing quality.

Figure 5 .Figure 6 .
Figure 5. FlankPix analysis The measured parameters are as follows: Major Axis Length 583.54 mm Minor Axis Length 200.36 mm 3.2.1 Steps in FlankPix algorithm 1. Open CV 2. Create a new file 3. Launch a Python program 4. Import the files that contain the headers 5. Download and install the necessary Python interpreters for the algorithms, such as OpenCV, matplotlib, and NumPy 6. Change the color mode of the image to grayscale 7. To detect edges in the photos, run Canny's Edge Detection Algorithm 8. Fix the threshold value (Edge detection) 9. Accumulate Pixel coordinates in Px and Py 10.Calculate the distance from the pixel coordinates 12. Convert the value from Pixels to mm

Table 2 .
Flank wear was measured using experimental values and the FlankPix algorithm

Table 3 .
Flank wear measurement comparison of FlankPix algorithm with conventional techniques