MACHINE LEARNING MODEL FOR

MECHANICAL ENGINEERING APPLICATIONS

PART II

DEVELOPMENT OF CLASSIFICATION ALGORITHM FOR MECHANICAL ENGG. APPLICATIONS.

MACHINE LEARNING MODEL FOR MECHANICAL ENGINEERING APPLICATIONS PART II DEVELOPMENT OF CLASSIFICATION ALGORITHM FOR MECHANICAL ENGG. APPLICATIONS.

Link? for the PART 1 ?of this series:

LinkedIn: https://www.dhirubhai.net/posts/dr-nadakatti-mahantesh-a8787336_machine-learning-models-for-mechanical-engineering-activity-7209416021542146048-o9LA?utm_source=share&utm_medium=member_desktop

?

Machine Learning Models for Mechanical Engineering Applications

Machine learning (ML) has revolutionized mechanical engineering by providing innovative solutions for complex problems across various applications. In predictive maintenance, ML models analyze historical sensor data to forecast equipment failures and optimize maintenance schedules, reducing downtime and operational costs. In manufacturing, ML enhances quality control by detecting defects through image recognition and optimizing processes via predictive analytics. For design and simulation, ML accelerates the development of new materials and components by predicting their properties and performance under different conditions. Additionally, in energy systems, ML models optimize the efficiency and reliability of power generation and consumption, contributing to sustainability goals. In robotics, ML algorithms enable advanced control systems for autonomous operation, improving precision and adaptability in tasks like welding, assembly, and inspection. Overall, integrating machine learning into mechanical engineering applications leads to smarter, more efficient systems capable of adapting to changing environments and requirements.

MATLAB CLASSIFICATION LEARNER ?Toolbox for Mechanical Engineering

The Classification Learner app within MATLAB's Statistics and Machine Learning Toolbox empowers mechanical engineers to build intelligent systems for categorizing mechanical components, fault detection, or process control. This user-friendly interface allows them to train various classification models (like decision trees or support vector machines) using real-world data. These models can then classify new data points, enabling applications like:

  • Identifying faulty components: Analyze sensor data to categorize parts as functioning properly or requiring maintenance.
  • Material classification: Train a model to differentiate materials based on vibration or other sensor readings during manufacturing.
  • Predictive maintenance: Classify machine health based on operational data, allowing for proactive maintenance and avoiding downtime.
  • Image-based defect detection: Train a model to identify defects in manufactured parts based on camera images.

By leveraging the Classification Learner's user-friendly interface and powerful algorithms, mechanical engineers can develop data-driven solutions for various classification tasks.

PROCEDURE:

1)?????????? Create a folder in a suitable drive.

2)?????????? Create / add file Excel file containing the Machinery data: Ex.: Temperature, Pressure, Volume, Frequency, Voltage, etc.

Important Note: For using Classfication Learner app, the data must contain “Categorical” field as well. Ex.: “Good, average, high, low,” etc.

3)?????????? Open MATLAB.

4)?????????? Import the Machine Data into MATLAB Directory.

5)?????????? Now, import data into MATLAB workspace by using one of the two methods :

a.??????????? Using “Import” option available in MATLAB

b.??????????? Double-click the excel file, already available in the MATLAB path.

6)?????????? Next step is to scan through variable apps, available in MATLAB and selection of Classification ?Learner App.

7)?????????? Double-click on Classification ?Learner App. Start a NEW SESSION.

8)?????????? The app asks for data about Predicators (Input) and Response (Output). i.e., comparison and generation of Regression Line. ( Ex.: Pressure V/s Volume, Temperature V/s Pressure, etc.)

9)?????????? Select the algorithm (either any one ML algorithm or “ALL”)

a.? Important: The Classificaiton Learner only works with both Number and String Data. Such data is referred to as “Categorial Data” by MATLAB

b.? Hence the data sheet should ?have numbers as Predicators.

c.?? If there is only Number data, then use “Regression Learner” instead of Classificaiton Learner. Ex: Instead of condition of the mechanical element as say “Good,Average,Bad”etc, if the data has entries like “100*C, 200*C” etc., then for analysis, use “Regression Learner” app.

d.? However, rest of the procedure remains exactly the same, as for Regression Learner.

e.? Output from Classification Learner is in the form of %, not the number as in case of Regression Learner.

f.??? Choose that model, which gives best/highest accuracy. That could be exported.

g.? Generate Confusion Matrix when using Classification Algorithm.

h.? Values in Confusion Matrix are in Diagonal way. Any value lying outside the diagonal line indicates some abnormal behavior either in the input values or by the algorithm.

?

10)??????? Once everything is set, just click on RUN button. This will train different Machine Learning Algorithms like Linear Regression, Support Vector Machine, Neural Network, Guassian Processor, Kernel,? etc.,

11)??????? Wait for the models to get trained, which may take few minutes depending on the volume of data. Higher data sets may need more time to get trained.

12)??????? Observe the RMSE (Validation) number for each model. (Root Mean Square Error: RMSE)

13)??????? Whichever model delivers highest ?RMSE value, select that algorithm for finalizing the Regression Model.

14)??????? Now, the model could be exported for sharing with others? or for future reference. Export as a “Complete” Model. Assign a suitable name to the model.

?

MATLAB REGRESSION LEARNER ?APP ?SCREENSHOTS

Data Files

1)??? BearingData:? Data about variation of Bearing age, RPM and its temperature

2)??? TestData: Testing data: This will have Bearing RPM but temperature data is absent, which needs to be estimated, using Regression Learner App.

Step1:

1)??? Set MATLAB path with requisite data file (in the present case two files)

2)??? Open Classification Learner App, from MATLAB APP list.

3)??? Import the data into MALTAB workspace, i.e. file no.1 into workspace using IMPORT option.

Step 2)??? Next, import the data and open the Regression Learner App.

Observe that, data set is automatically selected by the app. Responses are also picked up. All that needs to be done is just “START SESSION”

Predictors are Input values and Response is Output value / plot

?

Step 3)? Click Start Session and train the model. Response Plot gets generated.

Step 4: Select? “ALL” Machine Learning Algorithms from the available list.

Step 5)? Click on “TRAIN ALL” : All ML algorithms get activated and the RMSE (VALIDATION) data gets computed. This is training data, developed from the available bearing data. Select the HIGHEST ACCURACY (VALIDATION) value among all these values, in the present case it is 94.7%.

This value gets highlighted automatically in a rectangle, in the whole list of various ML model outcomes as shown below:



Step 6): This model gives the optimum R

MSE value. This is our final model. Export it using “Export Model” option.? The HIGHEST % is highlighted in rectangle.? When asked, give a suitable name to the model, in the present case it is being given as “trainedModel2006”. Make sure that, no space is left between words in the file name, as MATLAB doesn’t recognize file names with spaces.

Immediately, one gets the notification regarding successful export of the model, along with relevant training data, in this case the file containing Bearing Temperature and RPM.

?Step 7) Now, open the main MATLAB environment and save the file generated in the previous step. It will be reflected in the workspace.

?Step 8)

Type Save trainedModel180603 ; This will create a MATLAB file in the folder where the training data is present, as shown below:

Even it is seen in MATLAB workspace as shown below:

Step 9) Import Test Data Set? IN TO MATLAB workspace: File is already created and stored in our problem folder as “ TestDataBearingRPMVsTemp.xlsx”

Open a “NEW SCRIPT” and write a small code as given below”

TestTable=readtable("TestDataBearingRPMVsTemp.xlsx");

load trainedModel2006;

PredictedTemp=trainedModel2006.predictFcn(TestDataBearingRPMVsTemp)

That’s all!!!!. Save the file. And Run it. !!!

Further, add two lines to this code, which can export the predicted values / outcomes in the form an excel data, to the folder from the? data is fetched for modelling and evaluation, as shown below:


TestTable=readtable("TestDataBearingRPMVsTemp.xlsx");

load trainedModel2006;

PredictedTemp=trainedMod

dataToExport = PredictedTemp;

writematrix(dataToExport, 'PredictedTemp.xlsx');


?

Step 10) After execution, the unknown temperature values ( predicted values) are generated and displayed as shown below:

THAT’S ALL:? The predicted Temperature values by the Regression Learner App are displayed right next to the Live Editor App.

Since the code has “EXPORT DATA” embedded in? it, the predicted outcomes are exported as and excel file to the MATLAB folder, as shown below:

Save this data in the TestDataBearingRPMVsTemp table, under the column Predicted Bearing Temperature.

?

CROSS CHECK. : Check for the predicted temperature values and compare them with original training data set. One can observe the similarity between observed bearing RPM, Age and Temperature with that obtained by Classification Learner App, for data with Age and RPM, but without temperature values.

Thus? the data is validated, which could be deployed successfully in to Bearing Monitoring Program.

要查看或添加评论,请登录

Dr.Nadakatti Mahantesh的更多文章

社区洞察

其他会员也浏览了