# Evolutionary Design of a System for Online Surface Roughness Measurements

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Related Work

## 3. Online Surface Roughness Measurement System

- Online capturing of images;
- Preprocessing of images;
- Extraction of attributes from the preprocessed images;
- Prediction of commutator mounting hole roughness based on the ML model.

#### 3.1. Data Preparation

#### 3.2. Image Capturing and Preprocessing

#### 3.3. Attribute Extraction

#### 3.4. Roughness Prediction

## 4. Optimization of Algorithm Parameters

## 5. Experimental Setup and Validation Procedure

#### 5.1. Setup

`++`programming language.

`++`interface. Two regression algorithms available in Weka were used to generate the roughness predictive models:

- M, the minimum number of instances per leaf in the tree, $\{1,2,\dots ,20\}$;
- N, use of tree pruning, $\{true,false\}$;
- U, use of smoothing in predictions, $\{true,false\}$.

- Depth, the maximum depth of the tree, $\{1,2,\dots ,150\}$;
- K, the number of attributes to randomly investigate, $\{1,2,\dots ,25\}$;
- I, the number of iterations, $\{20,21,\dots ,200\}$;
- B, randomly breaking the ties when several attributes are equally good, $\{true,false\}$.

#### 5.2. Validation Procedure

## 6. Results and Discussion

## 7. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Hamed, A.M.; Saudy, M. Computation of surface roughness using optical correlation. Pramana
**2007**, 68, 831–842. [Google Scholar] [CrossRef] - Thomas, T. Rough Surfaces; Imperial College Press: London, UK, 1999. [Google Scholar] [CrossRef]
- Whitehouse, D.J. Handbook of Surface and Nanometrology; CRC Press: Boca Raton, FL, USA, 2010. [Google Scholar] [CrossRef]
- Blunt, L.; Jiang, X. (Eds.) Advanced Techniques for Assessment Surface Topography: Development of a Basis for 3D Surface Texture Standards “Surfstand”; Butterworth-Heinemann: Oxford, UK, 2003. [Google Scholar] [CrossRef]
- Koblar, V.; Pečar, M.; Gantar, K.; Tušar, T.; Filipič, B. Determining surface roughness of semifinished products using computer vision and machine learning. In Proceedings of the 18th International Multiconference Information Society (IS 2015), Ljubljana, Slovenia, 28 September–14 October 2015; Volume A, pp. 51–54. [Google Scholar]
- Storn, R.; Price, K. Differential evolution: A simple and efficient heuristic for global optimization over continuous spaces. J. Glob. Optim.
**1997**, 11, 341–359. [Google Scholar] [CrossRef] - Shahabi, H.H.; Ratnam, M.M. Noncontact roughness measurement of turned parts using machine vision. Int. J. Adv. Manuf. Technol.
**2010**, 46, 275–284. [Google Scholar] [CrossRef] - Jeyapoovan, M.T.; Murugan, M. Surface roughness classfication using image processing. Measurement
**2013**, 46, 2065–2072. [Google Scholar] [CrossRef] - Nithyanantham, N.; Suresh, P. Evaluation of cast iron surface roughness using image processing and machine vision system. ARPN J. Eng. Appl. Sci.
**2016**, 11, 1111–1116. [Google Scholar] - Jibin, G.J.; Arunachalam, N. Illumination compensated images for surface roughness evaluation using machine vision in grinding process. Procedia Manuf.
**2019**, 34, 969–977. [Google Scholar] [CrossRef] - Patel, D.R.P.; Kiran, M. Vision based prediction of surface roughness for end milling. Mater. Today Proc.
**2020**, 44, 792–796. [Google Scholar] [CrossRef] - Fadare, D.A.; Oni, A.O. Development and application of a machine vision system for measurement of surface roughness. ARPN J. Eng. Appl. Sci.
**2009**, 4, 30–37. [Google Scholar] - Ravikumar, S.; Ramachandran, K.I.; Sugumaran, V. Machine learning approach for automated visual inspection of machine components. Expert Syst. Appl.
**2011**, 38, 3260–3266. [Google Scholar] [CrossRef] - Samtaş, G. Measurement and evaluation of surface roughness based on optic system using image processing and artificial neural network. Int. J. Adv. Manuf. Technol.
**2014**, 73, 353–364. [Google Scholar] [CrossRef] - Elangovan, M.; Sakthivel, N.; Saravanamurugan, S.; Nair, B.; Sugumaran, V. Machine learning approach to the prediction of surface roughness using statistical features of vibration signal acquired in turning. Procedia Comput. Sci.
**2015**, 50, 282–288. [Google Scholar] [CrossRef] [Green Version] - Simunovic, G.; Svalina, I.; Simunovic, K.; Saric, T.; Havrlisan, S.; Vukelic, D. Surface roughness assessing based on digital image features. Adv. Prod. Eng. Manag.
**2016**, 11, 93–104. [Google Scholar] [CrossRef] [Green Version] - Yi, H.; Liu, J.; Ao, P.; Lu, E.; Zhang, H. Visual method for measuring the roughness of a grinding piece based on color indices. Opt. Express
**2016**, 24, 17215–17233. [Google Scholar] [CrossRef] [PubMed] - Morales Tamayo, Y.; Beltrán Reyna, R.F.; López Bustamante, R.J.; Zamora Hernández, Y.; López Cedeño, K.; Terán Herrera, H.C. Comparison of two methods for predicting surface roughness in turning stainless steel AISI 316L. Ingeniare. Revista Chilena de Ingeniería
**2018**, 26, 97–105. [Google Scholar] [CrossRef] [Green Version] - Lin, Y.C.; Wu, K.D.; Shih, W.C.; Hsu, P.K.; Hung, J.P. Prediction of surface roughness based on cutting parameters and machining vibration in end milling using regression method and artificial neural network. Appl. Sci.
**2020**, 10, 3941. [Google Scholar] [CrossRef] - Reris, R.; Brooks, J.P. Principal component analysis and optimization: A tutorial. In Proceedings of the 14th INFORMS Computing Society Conference, Richmond, VA, USA, 11–13 January 2015; pp. 212–225. [Google Scholar]
- Grinblat, G.L.; Uzal, L.C.; Verdes, P.F.; Granitto, P.M. Nonstationary regression with support vector machines. Neural Comput. Appl.
**2015**, 26, 641–649. [Google Scholar] [CrossRef] - Gadelmawla, E.; Koura, M.; Maksoud, T.; Elewa, I.; Soliman, H. Roughness parameters. J. Mater. Process. Technol.
**2002**, 123, 133–145. [Google Scholar] [CrossRef] - Trier, O.D.; Jain, A.K. Goal-directed evaluation of binarization methods. IEEE Trans. Pattern Anal. Mach. Intell.
**1995**, 17, 1191–1201. [Google Scholar] [CrossRef] - Hall, M.; Frank, E.; Holmes, G.; Pfahringer, B.; Reutemann, P.; Witten, I.H. The WEKA data mining software: An update. ACM SIGKDD Explor. Newsl.
**2009**, 11, 10–18. [Google Scholar] [CrossRef] - Brest, J.; Greiner, S.; Bošković, B.; Mernik, M.; Žumer, V. Self-adapting control parameters in differential evolution: A comparative study on numerical benchmark problems. IEEE Trans. Evolut. Comput.
**2006**, 10, 646–657. [Google Scholar] [CrossRef] - OpenCV: Open Source Computer Vision. Available online: https://opencv.org/ (accessed on 5 June 2018).
- NVIDIA. CUDA: Parallel Computing Platform and Programming Model. Available online: https://developer.nvidia.com/cuda-zone/ (accessed on 14 May 2018).
- Wang, Y.; Witten, I.H. Inducing model trees for continuous classes. In Proceedings of the 9th European Conference on Machine Learning, Prague, Czech Republic, 23–25 April 1997; pp. 128–137. [Google Scholar]
- Breiman, L. Random Forests. Mach. Learn.
**2001**, 45, 5–32. [Google Scholar] [CrossRef] [Green Version] - Tušar, T.; Gantar, K.; Koblar, V.; Ženko, B.; Filipič, B. A study of overfitting in optimization of a manufacturing quality control procedure. Appl. Soft Comput.
**2017**, 59, 77–87. [Google Scholar] [CrossRef]

**Figure 7.**Optimization procedure that searches for the best MV and ML algorithm settings and outputs the best ${R}_{z}$ predictive model.

**Figure 8.**Roughness prediction error (RRSE) estimates for regression trees, random forests and the expert-defined setting. Error estimates for the optimized regression trees and random forests are averaged over ten runs and marked with suffix “OPT”. Error estimates for the expert defined setting are marked with “EXP”. For details see Section 5.2.

**Figure 9.**Comparison of the processed images using the expert and the optimized settings: the original extracted image (

**top**), the image processed with expert-defined MV parameter settings (

**center**), and the image processed with MV and ML parameters set by the optimization algorithm (

**bottom**).

**Figure 10.**Comparison of the measured and predicted values of ${R}_{z}$ for the training and hold-out set, using the best found regression tree model.

**Figure 11.**Comparison of the measured and predicted values of ${R}_{z}$ for the training and hold-out sets, using the best found random forest model.

Algorithm | 10-Fold CV | Hold-Out Set | ||
---|---|---|---|---|

RRSE [%] | MAE [$\mathsf{\mu}$m] | RRSE [%] | MAE [$\mathsf{\mu}$m] | |

M5P-EXP | 28.2 | 0.82 | 26.1 | 0.84 |

RF-EXP | 25.9 | 0.80 | 23.9 | 0.83 |

M5P-OPT | 22.9 | 0.74 | 22.5 | 0.71 |

RF-OPT | 22.4 | 0.71 | 21.9 | 0.70 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Koblar, V.; Filipič, B.
Evolutionary Design of a System for Online Surface Roughness Measurements. *Mathematics* **2021**, *9*, 1904.
https://doi.org/10.3390/math9161904

**AMA Style**

Koblar V, Filipič B.
Evolutionary Design of a System for Online Surface Roughness Measurements. *Mathematics*. 2021; 9(16):1904.
https://doi.org/10.3390/math9161904

**Chicago/Turabian Style**

Koblar, Valentin, and Bogdan Filipič.
2021. "Evolutionary Design of a System for Online Surface Roughness Measurements" *Mathematics* 9, no. 16: 1904.
https://doi.org/10.3390/math9161904