Presentaion Project
Presentaion Project
On
2020A4PS1917H
HYDERABAD CAMPUS
1
ACKNOWLEDGMENT
I want to express my sincere gratitude to Prof Kundan Kumar Singh who have been
consistently guided me in due course of the project work- Surface Roughness Prediction using
machine learning Alogorithm and to Dr Arshad Javed Sir who helped me in assuring timely
progress and laying down the path that breaks down complex process to project dilevary to
simpler and step by step one . I also thank them for providing this opportunity and giving
their valuable suggestions whenever I felt my knowledge was not sufficient through weekly
updated and by providing materials and references . I am bennifitted a lot by tis project as it
helped to go beyond my course work and think out of the box by applying ML concepts in
traditional mechanical concepts like surface roughness, machining etc. The learnig was a
steep one and I would be looking forward to strive and work continuously under your
guidance.
Yours Sincerely
2020A4PS1917H
2
Birla Institute of Technology and Science - Pilani
Hyderabad Campus
Certificate
This is to certify that the project report entitled “Machine Learning Algorithm for surface
roughness prediction using SVM ”submitted by Mr. AYUSH RANJAN JHA
(ID No. 2020A4PS1917H) in partial fulfillment of the requirements of the course DESIGN
PROJECT (ME F376/377), embodies the work done by him under my supervision and guidance.
3
ABSTRACT
The Primary motive of the project is to build an algorithm for predicting the surface
roughness of a machined surface using machine learning algorithm. Out of the various ML
model possible, we have selected support vector regression and support vector classification
to build our Machine Algorithm model. This will be useful in predeterimining the roughness
if we know the machining condition. Hence we can alter the machining condition and attain
the required accuracy and target condition.
• Machining Condition
• Support Vector Regression
• Support vector classification
• Kernel Method
• Optimisation using various method
• Programming (Python)
Many researched paper were used to draw out the best from the existing results and the same
is utilised along with extra material from the blogs, writeups etc. Effect of vibration and
acceleration is studied to classify the machining conition in good or bad classes using the
hyperplane.
4
CONTENTS
Title/Cover page……………………………………………………….1
Acknowledgementll……………………………………………………..2
6. Conclusion…………………………………………………………..17
7. References…………………………………………………………..18
5
Aim of the project
A material (often metal) is shaped into to the desired ultimate dimensions and shape during
machining operation. The processes that exhibit this characteristics are considered to as
subtractive manufacturing, which involves the use machine tools. Turning, drilling, and milling are
the 3 primary machining processes.
Operations such as turning involve spinning the workpiece as the main means of advancing metal
against the cutting tool. The primary piece of equipment used for turning is a lathe Operations.The
major machine that is used in milling is a milling machine. In drill presses, though occasionally on
lathes or mills, drilling operations are typically carried out.
There are various factor the effets the quality of surface produced that can be estimated in terms
of surface roughness, however the major factors that we are takink into the consideration:
Experiments has been carried out to find the relation between the Roughness of the surface and
the effecting parameters like federate, depth of cut , cutting speed etc. Various methods like CNN,
ANN ect are used and results have been estimated.
In this project, there is work done for finding the roughness of a machined surface if given its
operating condition in terms of feed rate of tool piece , cutting speed , depth of cut in workpiece. A
machine learning alogorith will the try to predict the Surface roughness as it will be trained on the data
that we have got of manual testing. The model that will be selected will have high corellation
coefficient between the Predicted data and the actual data. This will reduce the inspection time and
will insure the quality of product delivered .
Surface roughness is having sever impact on the functioning of a workpiece. Due to irregularity, there
will always be possibility of facture as the stress concentration is high. Due to high concentration, the
stress distribution did not happen as expected and there is chance of fatigue fracture if factor of safety
in not taken into consideration while designing the element.
A the SVM is having 2 types i.e Support Vector Regression and Support Vector Classification, the main
aim of Support vector classification is to differentiate between different clusters and Support Vector
regression is an advance version of regression in which certain error is acceptable. In normal
regression we tend to minimize the error but here we will be assingning an acceptable error limit.
Hence the aim/target of the project is Developing a support vector regression supported model
involving three factors that are depth of cut , feed rate and cutting speed so that it can predict the
roughness of machined surface with least error. Furthe the effect of vibration of the machine will also
be analysed and its impact of surface roughness will be analysed qualitatively and quantetaively.
6
Machine Learning Methords
Machine learning (ML) is a research area centered on understanding and creating "learning"
techniques, or methodologies which use data to improve efficiency on a particular list of tasks. It is
believed to be an element of artificial intelligence. Without even being explicitly programmed to
do so, algorithms for machine learning build a model from data samples, also referred to as
training data, so order to predict or decisions.Machine learning algorithms are used in a wide
range of applications, like speech recognition, spam filtering, computer vision, and healthcare,
where it is difficult or impossible to develop conventional algorithms to perform the required
operations.
Depending on the kind of "input" or "feedback" which is supplied to the learning program,
machine learning approaches are broadly classified into three broad categories which correspond
to learning methords:
• Supervised Learning
• Unsupervised Learning
• Reinforcement Learning
A mathematical formulation of a collection of data that includes the required inputs and outputs is
developed using supervised learning methods. Unsupervised learning algorithms examine a set of
input-only data and identify trends, such as clustering or grouping of pieces of data. Therefore,
data that hasn't been tagged, classified, or sorted is employed to teach the algorithms.
Unsupervised learning algorithms identify commonalities in the data and act based on the presene
or absenc of such similarities in each incoming piece of data, as instead of reacting to feedback. A
branch of machine learning called reinforcement learning focuses at how software components
should act in a specific environment to optimize a notional total reward.
All branches of engineering are impacted by the emerging field of machine learning. These days,
more sectors than simply those with AI professionals may use it. Applying machine learning to a
mechanical device or engineering project that can gather a lot of data may help identify trends
and spot issues that might normally only become apparent after extensive testing.
Regression with multiple is a tedious task to perform and it require high computing power. This is
made easy and assesible using machine learming algorithms .One of the techniques used in
statistics most commonly is regression analysis. Developing a model that best reflects the
connection between a or more predictors and a dependent variables is the fundamental goal of
regression analysis.
• Linear Regression
• Multiple Regression
• Logistics Regression
7
Support Vector Machine
Support Vector Machine (SVMs) constitute models which are supervised and associated with
machine learning that analyse data for :-(1) Classification and (2)Regression analysis in machine
learning. An SVM algoritthm generates a model that allot real examples to one of 2 classes,
creating it a zero probabilistic binary Iinear classifications, given a set of teaching data, each data
as belonging to one of two classes., SVM allocates learned examples to locations in space in order
to increase the space or gap between the two classes. New examples are then mapped into that
same space and categorized according to which side of the gap they fall. In addition to linear
classification, SVMs can also perform non-linear classification effectively via implementing
mathematical kernel method, that includes implicit mapping their data points into high-
dimensional.
Kernel
Kernel is a type of mathematical function. In our case, the kernel's function is there to receive
data as independent variable and transform it into the desired one. When we try to draw the
decision boundary and the data is not linearly seperable or visible, kernel is used to transfor that
data points into high dimension. There are various type of kernel and depend upon the type and
uses of data, we use different type of kernel. Some of the most widely used kernels are:
• Linear kernel
• Nonlinear kernel
• Polynomial kernel
• Radial BF(RBF) kernel
• Sigmoid
Once the data is transformed into multiple dimension through the kernel, it will be more ease to
apply different classification and regression analysis. In the pic shown above, initially the blue and
red dot were in XY plane and were not classifiable but as soon as as they got transformed into YZ
plane, we can see that is separable through Z= Constant plane.
8
❖ Support vector machines can be applied to both classification and regression.Hence it can
be classified as:
• Support Vectors Classification
• Support Vectors Regression
As the hyperplane is drawn between the two clusters, it is important to obtain those clusters This is done
by K-mean cluster Algorithm. K-mean cluster algorithm is an unsuperwised algorithm. This is used to
transform a data set into 2 clusters. In this:
If (X1,.Y1), (X2.,Y2), (X3,.Y3) AND (Xn,Yn) are n points in a data set, we asuume (x1,y1) as the center of one
custer and (x’,y’) is the center of another cluster. Then we take each data point one by one and measure its
distance from both the centers of clusters. The one fro where it is at lowest distance, we group it with
them and find the new centroid of the new 2 data pointe. We repeat this process with all the data points
and at last we obtain our 2 clusters with their centroids.
❖ Importing library
❖ Loading and cleaning the data followed by its standardization
❖ Splitting the data into test and train
❖ Applying SVM from scikit learn
❖ Finding correlation coefficient and selecting appropriate hyderparameters
❖ Using the developed model to get results.
9
Support Vector Regression
The objective of most LR(linear regression) is to minimise sum of square of errors. Lasso, Ridge etc
are all further extensions of this simple equation that add an extra penlty parameter that aims to
reduce the hardness of many variable used in the final model. Nevertheless, the goal with
numerous models is to reduce the testing set's inaccuracy. SVR allows us to determine the extent
of inaccuracy is tolerable in our models and will choose the best line (or hyperplane) to fit the
data.
Here E denotes the acceptable error margin and C denotes how many Noise we are having in the
model i.e now we have follow and optimise:-
As the C and E value changes, the prediction of the model will change and at optimum C and E ,
we will get the best predictive model shown in the figure.
10
Application of SVR in the project
In our project, we are having 3 parameters that will effect the surface roughness, these are:
1. Depths of Cut
2. Feed Rate of tool
3. Cutting Speed
The acceleration of machine is related with the vibration which is measured through sensors. PSD
is also a measure of quality. Hence through SupportVector Classification, we can draw a
hyperplane that will segregate the good or bad quality. In this way, we can achieve uniform quality
and reduce the quality check timing and thereby increasing the efficiency.
1. Read CSV file – The data set that we have manually collected
2. Importing library such as Numpy, panda, Matplotlib, Scikit Learn, Linear Regression,
Statistics, Spicy etc to perform function like Store, visualise, Apply SVM etc.
3. X=np.array (df[[‘X1’,’X2’,’X3’]]) – where X1,X2,X3 are the three independent variable.
4. Y= df[‘Y’].values where Y is the collected surface roughness
5. Filtering of data and converting the numbers into same format.
6. Train+Test:-split(a:b)
7. Select a Kernel that best suits the data.
8. Finding appropriate C and E value using correlation by using a certain set of C and E with
applying forloops.
9. With the C and E obtained, training the model.
10. Test the model and find the accuracy of it.
11. We can also compare the model with that obtained from using ANN, CNN, linear
regression methrds.
12. Calculate and record the error associated.
After the model is developed, it can successfully predict the surface roughness given the three
parameters. Hence in this way we will develop a working model that solves a real life problem and
eliminates Human Error, Reduce the cost, Increase the efficiency etc.
Given below is the dummy code that is implemented with two independent variable that aims to
predicts the Y values given X1 and X2.
11
Classification of Depth of Cut and Speed
SVR classification is being applied to classify the data set into 2 part. The critical acceleration is
kept as 20 m/sec ^2.
We have collected DoC and speed along with acceleration in x and y axis which is then
converted into total acceleration.
Then based on the critical value of acceleration, the 2 class is made namely 1 and 0 i.e
Now the model is trained to separate both the class and draw the hyperplane.
Following are the confusion matrix which will depicts the level of accuracy in training the
model.
Linear kernel is used and hypertuning has been done to select the best parameter.
The accuracy matrix for various sample distribution are as:
12
The accuracy of the model in classifying the acceleration into 2 is 85%. For drawing the
hyperplane,we again devide the data into test and train and develop classification model by using
the train data.The model will then draw hyperplane and hence classify the data into 2 parts.
The three lines are the hyperplane with different test train split.
13
SVR Regression Model Development to obtain Acceleration.
14
References
• Machine Learning Approach to the Prediction of Surface Roughness using Statistical Features
of Vibration Signal Acquired in Turning M. Elangovan1*, N.R.Sakthivel1 , S.Saravanamurugan1 ,
Binoy.B.Nair2 , V.Sugumaran3
• Rehorn, A.G., J. Jiang, and P.E. Orban, State-of-the-art methods and results in tool condition
monitoring: a review. The International Journal of Advanced Manufacturing Technology, 2005.
26(7): p. 693-710.
• Daniel Kirby. E, Z.Z., Joseph C. Chen, Development of an Accelerometer based Surface
Roughness Prediction System in Turning Operation using Multiple Regression Techniques.
Journal of Industrial Technology, 2004. 20(4): p. 408-412.
• Elangovan, M., et al., Evaluation of expert system for condition monitoring of a single point
cutting tool using principle component analysis and decision tree algorithm. Expert Systems
with Applications, 2011. 38(4): p. 4450-4459.
• Zhang, J. Z., Chen, J. C., & Kirby, E. D. (2007). The development of an in-process surface
roughness adaptive control system in turning operations. Journal of Intelligent Manufacturing,
18, 301–311.
• Support vector machines models for surface roughness prediction in CNC turning of AISI 304
austenitic stainless steel
• Smola, A. J., & Schölkopf, B. (1998). A tutorial on support vector regression. Technical Report
NC2-TR-1998-030, ESPRIT Working Group in Neural and Computational Learning.
• Suresh, P. V. S., Rao, P. V., & Deshmukh, S. G. (2002). A genetic algorithmic approach for
optimization of surface roughness prediction model. International Journal of Machine Tools
and Manufacture, 42, 675–680.
• https://en.wikipedia.org/wiki/Hyperparameter_optimization
• https://distill.pub/2020/bayesian-optimization/
• https://towardsdatascience.com/an-introduction-to-support-vector-regression-svr-
a3ebc1672c2
• https://en.wikipedia.org/wiki/Machining
Thank You
15