Investigation of Correlation between Image Features of Machined Surface and Surface Roughness

Alternative approach to surface roughness evaluation is mostly based on the analysis of digital images of machined surfaces i.e. on extracting various features from the matrix mathematically representing a digital image. This paper analyses correlation between 23 different digital image features and the surface roughness for two different materials: aluminium and stainless steel. Machined surfaces for both materials were acquired by face milling. Factorial design 6 × 5 × 2 with two replicates was conducted for each material with cutting parameters being varied on various numbers of levels. Based on the correlation coefficients the results showed that the best ranked features regardless of the machined material were the features based on statistic measures.


INTRODUCTION
Machine part surfaces machined by some of the chipforming machining operations or some of the operations without chip forming are defined by the term technical surface. From the microscopic point of view, technical surfaces are rough surfaces characterised by a series of uneven spots of various sizes, forms and arrangements that divide two neighbouring media. Terms and regulations in connection with technical surfaces are defined and introduced by ISO-4287 norm. In engineering, surface roughness is often taken as a mark of quality of machined surfaces [1,2]. The arithmetic mean deviation of the surface profile Ra and mean square deviation of the surface profile Rq are the parameters most often used in measuring the profile roughness and are expressed in micrometers. In production, the mentioned parameters are most often measured with electronic-mechanic devices with a pick-up due to their availability and a relatively acceptable cost.
An often investigated alternative approach to the profile roughness parameter measurement is the surface roughness evaluation based on the digital image features of the machined surface. It is assumed that a digital image of a machined surface i.e. technical surface represents the surface texture (surface roughness) with quite a good correlation with the real surface texture (real surface roughness) so that it could be used as a basis for the profile roughness parameter evaluation. Thus, a number of the digital image features are used to evaluate the profile roughness parameter and are based on various texture, transformation, statistic and wave measures that can be quantified from the digital image matrix.
Authors in the paper [3] investigate the relationship between 22 different texture features generated from Graylevel Co-occurrence matrix (further GLCM) and machining parameters (feedrate, cutting speed and depth of cut) in milling. Influence of the surface incline (X-Z plane) at the acquisition of digital image is investigated in the paper [4]. The investigation showed that the analysed features were correlated best at the angle 0° so that it could be concluded that it was of the highest importance to provide verticality of acquisition device to the analysed surface. Flank wear of the insert in a turning operation in view of the change of the features generated from GLCM matrix is investigated in the paper [5]. In their study, the authors proved the possibility of detecting tool condition from images of the turned surfaces based on changes of features acquired from GLCM matrix after the passage of machining time. During acquisition of digital images, the authors in the paper [6] investigated the influence of a work piece orientation (X-Y plane) on the quantification of features subsequently used for surface roughness evaluation. The results demonstrated that the highest correlation of investigated features and surface roughness was reached at angles 0° and 180° except for the feature named "correlation" generated from GLCM matrix which had the highest correlation with surface roughness at an angle of 90°. Different from the workpiece inclination (X-Z plane) and workpiece orientation (X-Y plane) authors in the paper [7] investigate direction (0°, 45°, 90° and 135°) of GLCM matrix generation at constant distance between pixels and its influence on the correlation of features extracted from GLCM matrix and surface roughness. Surface texture features based on a digital image GLCM matrix are not used for the surface roughness evaluation and description only. Authors in the paper [8] investigate connection between the texture features extracted from GLCM matrix and the tool cutting time in turning.
In addition to the GLCM matrix the Run-Length matrix proposed in the paper [9] is also used to describe surface texture. Author in the paper [10] collected and presented the most frequently used features generated from the Run-Length matrix. Authors in the paper [11] investigate the possibility of monitoring cutting tool condition based on texture analysis of the workpiece machined surface digital image. For the texture analysis, they apply six features acquired from the Run-Length matrix. The results showed that the machined surface texture analysis based on the Run-Length matrix can be applied for efficient tool condition monitoring.
The above mentioned features (variables) refer to the surface texture while another group of features often used in evaluating surface roughness based on the machined surface image is founded on transformation. When a digital image processing is in question, the Fourier transform is most often used to extract various useful features. Authors in the paper [12] study the connection between the digital image features originating based on the Fourier transform (major peak frequency F 1 , principal component magnitude squared F 2 ) and the surface roughness. Similar to paper [4], paper [13] also investigates machined surface incline angle in relation to the horizontal plane. However, in this case digital image features based on the Fourier transform are used: major peak frequency F 1 , principal component magnitude squared F 2 , average power spectrum F 3 , central power spectrum percentage F 4 and ratio of major axis to minor axis F 5 . Authors in the paper [14] investigated a super resolution reconstruction algorithm on the problem of surface roughness evaluation. Quantification of digital image features for surface roughness evaluation is conducted using the Fourier transform two parameters (major peak frequency F 1 , principal component magnitude squared F 2 ) and standard deviation of gray-level intensity values. In a similar way authors in the papers [15] and [16] study roughness prediction of milled surfaces. As input variables for milled surface roughness prediction, they use a combination of digital image features (major peak frequency F 1 , principal component magnitude squared F 2 and standard deviation of gray-level intensity values) and cutting parameters (cutting speed, feedrate and depth of cut).
The third group of digital image features includes the features quantified from digital image matrices based on classic statistical measures such as: arithmetic average of gray-level intensity, standard deviation of gray-level intensity, entropy etc. Authors in the paper [17] apply Adaptive Neuro-Fuzzy Inference System (ANFIS) for surface roughness evaluation by the digital image features in turning. The authors use the following digital image features as input variables: spatial frequency, arithmetic average of gray-level intensity and standard deviation of gray-level intensity. Authors in the paper [18,19] created a system based on evolutionary and neuro-fuzzy computing for surface roughness evaluation. The following features are used for surface roughness evaluation: arithmetic average of gray-level intensity, standard deviation of gray-level intensity and ratio. On the restored, blurred digital images authors in the paper [20] use the following digital image features for surface roughness evaluation by machine vision: spatial frequency, arithmetic average of gray-level intensity and standard deviation of gray-level intensity. Authors in the paper [21] conducted feasibility studies on surface roughness contactless measuring by the digital image features. In this paper, authors use a new digital image feature called image texture gradient. Authors in the papers [21] and [22] use a combination of machining parameters (cutting speed, feedrate and depth of cut) and digital image features of machined surface (standard deviation of gray-level intensity and arithmetic average of gray-level intensity) for surface roughness evaluation.
Authors in the paper [23] apply one-level Haar wavelet transform to original digital image of machined surface. In a vertical detail sub-image an analysis is conducted of the gray-level intensity, the results of which are used in evaluating surface roughness and in classifying the surface roughness into four different groups. Author in the paper [24] conducted wavelet decomposition of the machined surface images on the basis of which five cross-sections of an image were separated and six statistical parameters calculated.
The present paper is aimed at analysing the digital image features that were most often applied by different authors in solving the problem of surface roughness estimation. Out of the analysed features found in literature, 23 features were selected. For each of the features the correlation with surface roughness was defined and a ranking of the features was made according to the criterion of the calculated correlation coefficients. As the study was very extensive, two different materials were used for machining workpieces.

DESCRIPTION OF PERFORMED EXPERIMENTAL INVESTIGATIONS
Experimental investigations were performed on two different materials: aluminium EN AW-6060 (WNr 3.3206) and stainless steel EN X5CrNi18-10 (WNr 1.4301). Chemical composition is shown in Tabs. 1 and 2.  Test samples of dimensions 100 × 60 × 10 mm for both materials were made from flat bars 4000 × 60 × 10 mm.
Stable surface 100 × 60 mm of the samples was machined on a vertical CNC milling machine type VF-2 of power 22,4 kW, produced by HASS. Surfaces of all 100 × 60 mm samples were machined by a face mill of diameter 40 mm in two equivalent longitudinal passes of 100 × 30 mm. Number of depth passes and total path length were also constant values. During machining of each sample the machine repeated the same CNC programme in which only cutting parameters changed: feed per tooth, spindle speed and depth of cut. The objective of the study being to analyse the correlation between different digital image features and surface roughness conseqently mixed-level factorial design with two replicates was selected. The factors were varied at different numbers of levels as all the factors did not influence the surface roughness in the same way. The highest number of levels was taken for a factor with the highest influence on surface roughness while the lowest number of levels was taken for a factor with the least influence on surface roughness. Feed per tooth was varied at six levels, spindle speed at five levels and depth of cut at two levels. Such 6 × 5 × 2 factorial design with two replicates should result in a higher density response spectrum i.e. calculated surface roughness than the factorial design where all the factors were varied at the same number of levels.
With As already mentioned a face mill of diameter 40 mm with four cutting inserts each with two cutting edges was used as a tool for machining. The face mill holder mark was F 4042.B.040.Z04.15 while two different types of inserts were used for machining. Inserts with mark ADMT160608R-F56 WKP35S were used in machining of aluminium and the ones marked ADMT160608R-F56 WXM35 in machining of stainless steel. Both cutting inserts were exposed to extreme cutting conditions so as to cover the widest possible range of the output variable . Fig. 1 shows the tool for face milling and machined test sample on machine tool.

Figure 1 Tool and machined test sample
In accordance with the selected factorial design, 120 test samples were prepared for each material. In machining of aluminium the cutting edges of inserts were changed after every 40 test samples while in machining of stainless steel they were changed after every 20 test samples. High pressure machine vice of mark Alfa NCO_A was used for the test samples clamping. Cooling lubricant Maxol at maximal flow rate was used for the samples cooling/lubricating during machining.
After machining, arithmetical mean roughness in accordance with norm ISO 4288 was measured on each test sample. Portable surface roughness tester (model: Surtronic S128) and the accompanying software Talyprofile 6.2 by manufacturer Taylor Hobson were used for measuring and processing the results. Extreme values (minimum and maximum) for aluminium were Ramin, max = (0,194; 0,189) µm and for stainless steel Ra min, max = (0,241; 7,12) µm. The areas of surface roughness measuring for each sample are presented in Fig. 2.
For quantification purposes of the digital image examined features, acquisition was performed of the machined surface digital images on all test samples. For every test sample two digital images were acquired i.e. one digital image for every longitudinal pass. A Scanjet 3100 table scanner with optical resolution of 1200 points per inch was used for acquisition. The type of acquired digital images was grayscale with resolution 250 × 250 pixels and with 256 intensity levels of gray i.e. 8 bits per pixel. The scanner was used to get and analyse the results under a uniform light that can be later compared to other sources of light Figure 2 Areas of surface roughness measuring on a test sample Fig. 2 shows the areas of interest of experimental samples on which surface roughness was measured using the Surtronic S128 portable device. First, the digital image of the entire surface was acquired and then the interest areas were cut and saved as two new digital images of the resolution 250 × 250 i.e. one digital image for every longitudinal pass. For the quantification of features, a digital image was used of the pass where a higher value of surface roughness was measured. All digital images of resolution 250 × 250 (total of 240 but 120 selected for further analysis) are quantified into 250 × 250 matrices where each member represents the gray level. Each pixel is written with one bit, or 256 different gray levels are displayed, meaning that each member of the matrix can be of any value from 0 to 255. Fig. 3a) shows one such digital image. In Fig. 3b), axes x and y represent the position of the member in the 250 × 250 matrix and the z axis (ordinate) represents its value i.e. the gray level. The threedimensional surface shown in Fig. 3b) is a wired network where the coordinates of each point (x, y, z) represent the intersection of the wire network and the color is dependent on the value on the ordinate. In fact, Fig. 3b) represents the approximated three-dimensional reproduction of the treated surface but is not its actual representation. If the profile of the treated surface would be ꞌextractedꞌ, it would represent only approximation of the actual profile but could not represent the actual profile from which the various surface roughness parameters can be calculated.

DESCRIPTION OF THE RESEARCHED FEATURES (VARIABLES) OF THE MACHINED SURFACE DIGITAL IMAGE
Various mathematical procedures can often be applied to generate new matrices from digital image matrix to analyse the texture. Texture analysis refers to the characterization of surfaces represented by a digital image that shows the contents of their texture. In what follows an explanation is given of the various features of a machined surface digital image devided into three categories: features connected with texture, features acquired based on transformations in domain of spatial frequency and features represented by different statistical measures.

Surface Texture Features as Variables in Evaluating Profile Roughness Parameters
Texture analysis is aimed at quantifying intuitive features described by quality terms such as: rough, smooth, wrinkled or uneven as a function of spatial variations of gray-level intensity values. Gray-Level Co-occurrence Matrix or GLCM matrix is a statistical method of texture evaluation whose members represent spatial relationships of pixels i.e. spatial dependence of gray-levels intensity. The GLCM matrix members describe the texture of digital image representing how often the pairs of pixels appear in the image with exactly defined values and in strictly defined spatial detachments. The present paper investigates five features that represent statistical measures extracted from a GLCM matrix: contrast, energy, homogeneity, maximal probability and correlation.
Contrast is a statistical measure of local variations in GLCM matrix i.e. it gives the measure of intensity level of contrast between a pixel and its neighbour over a complete image: Energy or uniformity is a statistical measure that gives the sum of squared members of a GLCM matrix: Homogeneity is a statistical measure of the GLCM matrix elements homogeneity with the GLCM matrix diagonal: Maximal probability is represented by the biggest member of glcm(i, j) matrix: Correlation is a statistical measure representing the probability of co-occurrence of certain pairs of pixels i.e. correlation of a pixel and its neighbour over a whole image: where: The following is valid for expressions (1) to (7): glcm (i,j) is a normalized GLCM matrix acquired from the matrix of the machined surface input digital image while (i,j) are indexes of the glcm(i,j) matrix rows and columns.
The other matrix that informs on surface texture and that is used in this study for acquiring different features i.e. variables, is called Run-Length matrix. The Run-Length matrix is formed based on the gray-level intensity of run lengths. Run-Length matrix rnl(i,j) is defined as the number of runs with pixels of gray-level intensity and run length j. Author [9] suggested the use of Run-Length matrix for acquiring the features of surface texture. Eleven features of surface texture generated from the Run-Length matrix as variables for surface texture evaluation are analysed in this paper, as follows: where: n r -total number of runs, n p -number of pixels in the image, rnl(i,j) -Run-Length matrix, i,j -matrix or vector indexes, rnl r (j) -runs number vector and rnl g (i)pixel vector.

Features Based on Fourier Transform as Variables in Evaluation of Profile Roughness Parameters
Continuous gray-level image can be demonstrated by a two-dimensional function fCI(x,y) where x and y mark the coordinates in plane and f CI gray-level in point (x,y). Continuous image is not suitable for showing on electronic devices because its coordinates are continuous. Recent information technology uses digital image f DI (x,y) acquired by complete discretization of a continuous image coordinates and is most often entered in a matrix form with each element being quantified using a finite number of bits.
The following four digital image features (F 1 , F 2 , F 3 , F 4 ) are acquired by 2D Fourier transform in a space frequency domain. Let the value f DI (x,y) be a pixel (gray-level value) in point (x,y) of original image of size N × N pixels that is centered at the origin. The 2D Fourrier transform of function f DI (x,y) can then be written as: The Fourrier transform is usually of a complex character and for short it can be written as: where R(u,v) and I(u,v) are real and imaginary parts of function F(u,v). Strength of spectrum P(u,v) of function F(u,v) is defined as: Normalized power spectrum p(u,v) with characteristics of probability distribution can be written in the following way: where P(u,v) represents the power of the digital image spectrum I(x,y).

Principal component magnitude squared
where λ 1 is the maximum of unique value of the covariance matrix of p(u,v). The covariance matrix is given by the following expression: (24) for which the following is valid: where: Mean -Arithmetic average of gray-level intensity value of the machined surface digital image matrix. Entropy E is a statistical measure of randomness of a data set. Entropy of a digital image matrix gray-level intensity values is defined by the following expression: where: E -scalar value that represents entropy of gray-level intensity value and p is the gray-level intensity value histogram.

OBTAINED RESULTS
In the text that follows the correlation coefficients are given between 23 digital image features and the arithmetical mean roughness Ra. Spearmanꞌs coefficient of correlation was selected as the main correlation coefficient because most of the researched variables showed that the correlation between them and the arithmetical mean roughness Ra was monotonous. Naturally, for all of the studied features Pearsonꞌs coefficient of correlation (referring to the linear connection between variables) with the arithmetical mean roughness Ra was also calculated. However, taken as a whole, lower values of correlation between variables were achieved. Spearmanꞌs coefficient of correlation rs (rank-order correlation) based on consistency of correlation between ranked variables was calculated according to the following expression: where: d i -difference in value between ranks of the variables and n -each variable total number of evaluations. Pearsonꞌs coefficient of correlation r that refers to the linear connection between variables is calculated according to: where: SS xx -sum of squared deviations of variable X from its mean value , X SS yy -sum of squared deviations of variable Y from its mean value Y and S xy -sum of products of deviations of variables X and Y from their mean values X and Y .

Results Obtained for Aluminium EN AW-6060
Tab. 3 gives Spearmanꞌs coefficients of correlation r s between 23 studied digital image features and the surface profile arithmetical mean roughness Ra for aluminium. From Tab. 3 the ranking of variables in view of the value of coefficient r s can be obtained. The first ten values are ranked as follows: Std, E, ꞌEnergyꞌ, ꞌCorrelationꞌ, F 1 , ꞌMax probabilityꞌ, SRLGE, ꞌContrastꞌ, ꞌHomogeneityꞌ and GLN.
Tab. 4 shows Pearsonꞌs coefficients of correlation between 23 digital image features and the surface profile arithmetical mean roughness Ra.

Results Obtained for Stainless Steel EN X5CrNi 18-10
Tab. 5 presents Spearmanꞌs coefficients of correlation r s between 23 investigated digital image features and the surface profile arithmetical mean roughness Ra for stainless steel.  Tab. 6 presents Pearsonꞌs coefficients of correlation r between 23 investigated digital image features and the surface profile arithmetical mean roughness Ra.
Ranking of variables in accordance with Pearsonꞌs coefficients of correlation (Tab. 6) is the following: Std, F 2 , E, F 3 , ꞌEnergyꞌ, ꞌCorrelationꞌ, LRE, ꞌMax probabilityꞌ, Mean and F 4 . Fig. 6 presents the correlation matrix between the first three ranked variables and the arithmetical mean roughness Ra in view of Spearmanꞌs coefficient of correlation according to Tab. 5. For the cutting inserts used in the machining, recommended machining parameters cover a much smaller range than investigated according to the designed experiment. In machining of aluminium, the cutting edges of inserts were changed after every 40 test samples while in machining of stainless steel they were changed after every 20 test samples. The applied wide range of machining parameters and the wear of the cutting inserts edges at the highest machining parameters resulted in significant deviations and increased number of outliers of measured values of the arithmetical mean roughness Ra for both materials. The stainless steel was more impacted due to its considerably more demanding machining conditions. In addition to the above-mentioned causes, the reflexion of the light plays a very important role. Reflection of light for aluminium is in a much wider spectrum (light to darker) than for stainless steel, while the difference between the largest and smallest surface roughness value for stainless steel is significantly higher than that of aluminium. In addition, two longitudinal passes of tool were made on each experimental sample, where surface roughness was measured, and digital images of both areas were acquired. As the whole sample is scanned at once, the reflection of the light is seen to be considerably different comparing the passes as shown in Fig. 3a). For the processing and the correlation calculation, a digital image of the pass with the higher measured surface roughness was taken. The reason for the generally lower values of the calculated correlations between the digital image features and the mean surface roughness lies in the above-mentioned facts. From Tabs. 3 and 4 that refer to aluminium it can be concluded that the studied features show a much higher monotonous than linear trend. However, the situation is a lot more complex with stainless steel (Tabs. 5 and 6). The analysed variables, in particular those with a higher correlation, display a much higher linear than monotonous trend. It can be also noticed that all the features based on Fourier transform display a much better linear than monotonous trend thus affecting considerably the ranking based on Pearsonꞌs coefficient of correlation.
When observing the ranking of variables according to Spearmanꞌs or Pearsonꞌs coefficient of correlation, it can be seen that standard deviation, entropy and energy always take high positions. According to all rankings standard deviation showed to be the feature displaying the best correlation with arithmetical mean roughness Ra and energy and entropy are the features always among the five best ranked ones. In general, among the five best ranked features there are always two features that represent statistical measures (standard deviation and entropy) while the other three positions are taken by the features generated from the GLCM matrix and those based on Fourier transform that in general display better results in ranking in case of linear correlation. The features generated from the Run-Length matrix showed to be the lowest ranked features according to the correlation coefficient criterion (Spearman and Pearson). In monotonous correlation ranking between ranks five and ten they take two positions while in linear correlation among the same ranks they take only one position. The bad result of the Run-Length matrix generated features can be explained by the fact that it is a specific texture matrix while the GLCM matrix gives more common features that are connected with the surface texture.
In the present research of the correlation between the digital image features and arithmetical mean roughness it is shown that the features that represent statistical measures give the best results. In addition to standard deviation, mean values and entropy, some features generated from the GLCM matrix also represent statistical measures. Fig. 5 and Fig. 6 display the correlation matrix for the first three ranked digital image features. Considerably higher correlations can be observed between the examined variables than with arithmetical mean roughness Ra. This is their additional proof as they mutually have a very approximate or almost the same mutual tendency of behaviour.
Future researches should show whether the appearance of linear trend in the digital image features depends on tool wear or on type of material. It can be presumed that the digital image features have a more complex trend than is the linear one, therefore the reasons should be investigated due to which a more pronounced linearity is observed in some variables, as could be seen on the example of stainless steel. Besides, additional effort could be made at figuring out and researching new textural matrices aimed at the texture features of technical surfaces that considerably depend on the type of applied tool. Similarly, additional effort could be directed to the quantification and research of new digital image features not based on classical statistic measures but on the measures devised by intuition with regard to the profile of a surface roughness and the fact that they were not previously used as the features of textural matrices.