Applications of Machine Learning in Mechanical Engineering, with Examples

Five places machine learning is used in mechanical engineering, each with a sourced example: predictive maintenance on bearing vibration, visual defect detection, CFD and FEA surrogates, process optimisation (Bosch's 35% shorter pump tests) and generative design, plus two worked examples and the limits.

Applications of Machine Learning in Mechanical Engineering, with Examples

Machine learning is used in mechanical engineering in five main places. It predicts machine failures from vibration and sensor data, spots defects in camera images, stands in for slow CFD and FEA runs as a surrogate model, tunes manufacturing processes from test data, and helps generate and screen design options. Each one works only where there is enough good data and an engineer checks the answer against physics. Below, each application gets a real, sourced example and its limits.

In short

  • Bosch cut test and calibration time in mobile hydraulic pump production by 35%. It did this by predicting test results from fewer measurements with a boosted-tree model (Bosch talk slides, KDD 2016).
  • In a 2018 GM and Autodesk proof of concept, generative design produced more than 150 seat-bracket options. The chosen one was 40% lighter and 20% stronger and replaced eight parts with one 3D-printed part (Autodesk News, 3 May 2018).
  • Skill-Lync's worked example: when 0.6% of parts are defective, an inspection model with 95% recall and a 2% false-alarm rate is 98% accurate. Yet only 22% of the parts it rejects are actually bad.
  • A second worked example: fitting tool-life tests and then optimising cutting speed gives about 110 m/min and ₹34 per part. Running at 200 m/min costs ₹66 per part with the same illustrative shop rates.
  • Public benchmarks exist for each application: CWRU bearing vibration, NASA C-MAPSS engine histories, 5,354 MVTec AD inspection images and more than 8,000 DrivAerNet++ car CFD cases.

This article is part two of our pair on machine learning for mechanical engineers. Part one, machine learning for mechanical engineers, covers the maths, Python and scikit-learn you need and a worked CAE-surrogate model. Here we look at where industry uses it. For courses, tools and jobs, see the AI and ML for mechanical engineers hub.

Where is machine learning used in mechanical engineering?

Machine learning is used across the whole life of a product. It appears in design (generative design), in simulation (surrogate models), on the factory floor (process optimisation and visual inspection) and in service (predictive maintenance). Each step uses different data and a different kind of model, as the map below shows.

Five rows: Design - generative design, loads and constraints to candidate shapes; Simulation - surrogate models, past CFD/FEA runs to regression; Manufacturing - process optimisation, process and test data to regression then optimisation; Quality - defect detection, camera images to classification or anomaly detection; Operation - predictive maintenance, vibration and sensor data to fault class and remaining life.
The five applications in this article, with the data each one learns from and what the model outputs.
ApplicationTypical dataTypical modelMain risk
Predictive maintenanceVibration, temperature, current, run hoursFeature-based classifiers, remaining-life regressionFew real failures to learn from
Visual defect detectionCamera images of parts or surfacesCNN classifiers, anomaly detection trained on good partsRare defects, so false alarms swamp real ones
CAE/CFD surrogate modelsInputs and results of past simulationsRegression, Gaussian processes, graph and point-cloud networksWrong answers outside the training range
Process and quality optimisationMachine settings, test-bench resultsRegression and boosted trees, then an optimiserTests are costly, so the data is thin
Generative designLoads, constraints, material, manufacturing methodOptimisation, with learned models in researchShapes that are hard to make or certify

How is machine learning used for predictive maintenance?

Predictive maintenance uses sensor data, most often vibration, to spot a developing fault and estimate how long a machine can safely keep running. The model learns what healthy and faulty signals look like, then flags a machine whose signature drifts. Maintenance is then scheduled when needed, rather than on a fixed calendar or after a breakdown.

The standard example is rolling-element bearings. Case Western Reserve University's Bearing Data Center seeded single-point faults, 0.007 to 0.040 inch across, into the bearings of a 2 hp Reliance Electric motor by electro-discharge machining. It then recorded vibration at loads from 0 to 3 hp (1,797 to 1,720 rpm). The drive-end bearing is an SKF 6205-2RS.

A damaged spot sends a small impact each time a ball rolls over it. That repeats at a frequency fixed by the bearing's geometry, so a mechanical engineer can predict where the fault will show up in the spectrum before training any model. For a fault on the outer race:

The 6205 has 9 balls, ball diameter in and pitch diameter in, with contact angle . That gives:

This matches the multiple CWRU publishes. At 1,797 rpm ( Hz) it is 107.4 Hz, an impact every 9.31 ms. The inner-race frequency works out to 5.4152 times shaft speed, or 162.2 Hz.

Features built around these frequencies are what make a fault classifier work. Our bearing fault detection project builds the full model on the CWRU data with code, including envelope analysis.

There is a caution. CWRU has become the standard test set for new diagnostic algorithms, but for years there was no agreed benchmark of what is diagnosable in it. Smith and Randall (2015) applied three established diagnostic techniques to every CWRU recording to provide one. Before claiming 99% accuracy on this data, compare your model against what their benchmark found diagnosable.

The second standard example is remaining useful life. NASA's C-MAPSS data has simulated turbofan engines run until failure. Four subsets cover different operating conditions and fault modes. The task is to predict how many cycles an engine has left from its sensor history. Our predictive maintenance project does this in Python. A random forest predicts the remaining life of the test engines with an RMSE of 17.9 cycles. It is the aviation form of the oldest maintenance question: when to take an engine off the wing before it fails.

The hard part in industry is not the algorithm. Real machines rarely fail, so there are few labelled failures to learn from, and seeded lab faults are cleaner than worn ones. Many plants therefore start with anomaly detection: learn "normal" from healthy machines and flag anything that departs from it.

How does machine learning detect defects in manufacturing?

Visual inspection systems use cameras and image models to flag scratches, cracks, inclusions, porosity and assembly errors on a production line. There are two approaches. A classifier is trained on labelled images of each defect type. An anomaly detector is trained only on good parts and flags anything unusual. The second needs no defect examples, which suits lines where defects are rare.

Two public datasets show the range:

  • NEU surface defect database (Northeastern University, China): 1,800 greyscale images of hot-rolled steel strip, 200 × 200 pixels. There are 300 images of each of six defects: rolled-in scale, patches, crazing, pitted surface, inclusion and scratches. It is a classification task. Our steel surface defect detection project works through it with code.
  • MVTec AD (Bergmann et al., CVPR 2019): 5,354 high-resolution colour images across 15 object and texture categories, with more than 70 defect types such as scratches, dents and contamination. Training images are defect-free only. The authors' first benchmark found "considerable room for improvement" in the anomaly-detection methods they tested.

Worked example: why 98% accuracy can mean a bad inspector

Defects are rare, and that changes what a good score means. Take a line where 0.6% of parts are bad, the same failure share as in Bosch's public production-line dataset. In 10,000 parts that is 60 defective and 9,940 good.

Suppose a model catches 95% of real defects (its recall) and wrongly rejects 2% of good parts (its false-alarm rate):

  • It catches 57 defects and misses 3.
  • It raises false alarms.
  • Of the 256 parts it rejects, only 57 are real defects, a precision of 22.3%.
  • Its accuracy is .
  • A "model" that passes every part scores 99.4% accuracy and catches nothing.
Left: of 10,000 parts with 60 defective, the model flags 256: 57 real defects and 199 false alarms, and misses 3. Right: the model's accuracy is 98%, recall 95%, precision 22%; a pass-everything rule has 99% accuracy, 0 recall and 0 precision.
The same model judged three ways. With a 0.6% defect rate, accuracy rewards doing nothing. Recall and precision show the real trade-off.

To get precision up to 80% at the same recall, false alarms must fall to 0.14% of good parts, about 14 in 9,940. That is why inspection teams quote recall and false-call rates, not accuracy, and why a person usually reviews the rejects.

The same arithmetic applies to any rare event: bearing faults, leak-test failures, cracks. Our explainer on the confusion matrix in machine learning covers the terms.

Can machine learning replace CFD and FEA simulations?

Not replace, but speed up. A surrogate model is trained on the inputs and results of many past simulations and then predicts new designs in seconds instead of hours. That suits design exploration and optimisation loops. It does not suit final sign-off, because a surrogate is only trustworthy close to the designs it has seen.

Two open research datasets show what is now possible and where the limits are:

  • DrivAerNet++ (Elrefaie, Morar, Dai and Ahmed, NeurIPS 2024): 8,000 car designs simulated with high-fidelity CFD. The cars include fastback, notchback and estateback bodies, with different underbody and wheel designs. The release has meshes, parametric models, aerodynamic coefficients and flow fields, more than 39 TB in all, plus benchmark results for drag prediction.
  • AirfRANS (Bonnet et al., NeurIPS 2022): 2D steady RANS simulations around airfoils at subsonic speeds. Its four benchmark tasks deliberately include a scarce-data case and extrapolation in Reynolds number and angle of attack, because those are where surrogates break.

Part one of this pair builds a small surrogate from scratch. On a pipe-flow formula, a physics-shaped model missed by 3.9% inside its training range and 4.5% beyond it. A random forest missed by 60.7% beyond it. The full worked example is in machine learning for mechanical engineers. For when to trust commercial tools, read AI surrogate models vs CFD and FEA solvers.

How is machine learning used to optimise manufacturing processes?

In process optimisation, a model learns how machine settings and upstream measurements affect quality, cost or cycle time. An optimiser or engineer then picks better settings. Often the biggest saving is not a better setting but a skipped step: if a model can predict a test result reliably, part of the test can go.

Bosch hydraulic pumps. In a 2016 talk, Bosch described a bottleneck on the test benches of a mobile hydraulic pump line. The team used feature selection to find the least informative test measurements and removed them. They trained a model to predict the test outcome from the measurements that remained. The result was a 35% reduction in test and calibration time.

The model was boosted trees developed in R. It was deployed to the line through PMML, a standard format for exchanging models, in about a month. Bosch also released a public dataset from a production line on Kaggle. It has about 3 million samples and 4,000 features, and the rare class (failed parts) is 0.6% of the data, the rate used in the inspection example above.

Worked example: from tool-life tests to the cheapest cutting speed

This example shows the "learn, then optimise" pattern on a classic machining problem. All inputs are illustrative. Taylor's tool-life law relates cutting speed (m/min) to tool life (min):

A cutting test is expensive, so you get only a few points. We simulated 12 tests, two at each of six speeds from 100 to 240 m/min. They came from an assumed true law with and , plus the kind of scatter real tool-life tests show. Taking logs makes this a straight-line fit, . Least squares gives and m/min.

Now the economics. We assumed turning a 60 mm × 250 mm shaft at 0.25 mm/rev, so cutting time is min. Machine and operator cost = ₹15 per minute, a cutting edge = ₹250, and a tool change = 2 min. The cost per part is:

The minimum is at a tool life of:

For the true process that is min, so m/min, at ₹34.38 per part.

Left: 12 tool-life tests from 100 to 240 m/min on log axes with the fitted Taylor line n = 0.256, C = 304, close to the true line. Right: cost per part against cutting speed, minimum Rs 34.38 at 110 m/min; Rs 66 at 200 m/min; the 90% bootstrap band of the chosen speed spans 106-113 m/min.
Learn the process from a few tests, then optimise with it. The shaded band shows how much the chosen speed would vary if the 12 tests were repeated (bootstrap, 90%).

What the numbers show:

  • The fitted model finds the optimum. It picks 109.2 m/min, and the true cost there is the same ₹34.38 to two decimal places. Resampling the 12 tests 2,000 times (a bootstrap) puts the chosen speed between 106 and 113 m/min 90% of the time.
  • Intuition can be expensive. At 200 m/min a tool lasts 5.1 min and a part costs ₹66.26, 93% more. At 150 m/min a part costs 19% more.
  • Where you test matters more than how much. Using only the four quick tests at 200-240 m/min, the fit gives and a chosen speed of 122 m/min. Its 90% bootstrap range is 99-138 m/min, because the model is extrapolating to speeds it never saw.

Real shops add constraints such as surface finish, chatter, machine power and delivery dates. The pattern stays the same: fit a model to the data you have, check it against the physics, then optimise. The textbook economics behind this, including the maximum-production speed, are in Kalpakjian and Schmid's chapter on machining economics.

What is generative design, and is it machine learning?

Generative design software proposes many part shapes that meet given loads, fixing points, material and manufacturing method. The engineer then chooses among them. Whether it counts as machine learning depends on the tool. In the GM example below, the software worked from the engineers' requirements, not from a library of past brackets. Deep generative models that learn from past designs are still mainly a research field.

GM's seat bracket. In an initial proof of concept at GM's Tech Center in Warren, Michigan, GM and Autodesk engineers applied generative design to a seat bracket where seat belts are fastened. The software produced more than 150 valid design options from the required connection points, strength and mass. The chosen design was 40% lighter and 20% stronger than the original, and it consolidated eight components into one 3D-printed part (Autodesk News, 3 May 2018). The words "proof of concept" matter. A lighter bracket still has to pass crash tests and be made at volume and cost.

The limits. Regenwetter, Nobari and Ahmed's 2022 review of deep generative models in engineering design found strong growth in such models since 2016. They named open challenges: design creativity, handling constraints and objectives, and modelling form and functional performance together. In plain terms, a model that learns to draw plausible shapes does not automatically learn to make strong, manufacturable ones. Every candidate still goes through FEA, design for manufacture and testing.

What are the limits of machine learning in mechanical engineering?

Machine learning is weakest where mechanical engineering is strictest. Data on rare failures is scarce, predictions beyond the training data can be badly wrong without warning, and safety-critical parts must be certified against standards and tests. Used as a fast first opinion that an engineer checks, it saves time. Used as the final word, it carries risks that need managing.

  • Data scarcity and labels. Failures and defects are rare by design, and seeded lab faults differ from real wear.
  • Extrapolation. Surrogates and process models fail quietly outside their training range, as both worked examples show.
  • Drift. A new supplier, worn fixture, different lighting or new sensor changes the data, and a model trained on old data degrades.
  • Accountability. An engineer signs off the design, the maintenance interval or the inspection result, not the model.

None of this argues against using machine learning. It argues for people who understand both the model and the machine. Process and automation engineers, reliability engineers, CAE engineers and data scientists with a mechanical background are the roles that do this work. Many also need SQL for data work and data analytics skills.

Skill-Lync's Machine Learning Fundamentals In Depth course teaches the classic methods on engineering problems. The Math behind Machine Learning and AI course covers the maths, and the PG Program in Data Science and Machine Learning covers a full switch into data roles.

Frequently asked questions

What is the most common use of machine learning in mechanical engineering?

Predictive maintenance and visual quality inspection are the most common in plants, because sensors and cameras already produce the data. In design and simulation teams, surrogate models trained on past CFD and FEA runs are growing fastest. All of them start as supervised learning on data the company already collects.

How much computing power do these applications need?

Less than most people expect for tabular and signal data. Classic models on tables of features, like the tool-life example here, run comfortably on a laptop. Image inspection needs a GPU to train but not always to run. 3D CFD surrogates are the heavy end: the full DrivAerNet++ release is 39 TB, though its parametric drag tables are small.

How are machine learning and IoT different?

IoT (the Internet of Things) is the network of connected sensors and machines that collects and moves data. Machine learning is what turns that data into a prediction or decision, such as "this pump's bearing is degrading". A predictive maintenance system usually needs both. IoT gets the vibration data off the machine, and a model interprets it.

Can machine learning be used in CAE?

Yes. The main uses are surrogate models that predict results such as stress, drag or pressure drop from design parameters, and automation of repetitive pre-processing. Mesh setup and CAD clean-up are examples, increasingly helped by AI assistants. Results near or outside the training range still need a full solver run.

Why use machine learning instead of if-else rules?

Fixed rules work when you know the logic and there are few inputs, such as "alarm if vibration exceeds a limit". Machine learning helps when the pattern depends on many inputs together, such as a fault signature spread across a spectrum. If a simple rule does the job, use the rule. It is easier to verify.

Sources and further reading

Want this on your résumé?

Talk to a counsellor.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.