Ensuring AI Success in Manufacturing

By Philipp Wallner

Industry Manager for Industrial Automation & Machinery


October 14, 2021


Ensuring AI Success in Manufacturing

AI offers a number of new applications for engineers in the manufacturing industry. In order to provide full value, the AI model needs to be integrated into the whole manufacturing process, which is running nonstop, seven days a week.

For full integration, engineers then also need to focus on multiple aspects of AI. Beginning with data preparation, then modeling, followed by simulation and test, and then finally deployment, this four-step workflow allows for an AI model to be successfully integrated into a 24/7 manufacturing process.

Figure 1. The four steps that engineers should consider for a complete, AI-driven workflow. © 1984–2021 The MathWorks, Inc.

It’s Not All About Modeling

Engineers using machine learning and deep learning often expect to spend a large percentage of their time developing and fine-tuning AI models. Yes, modeling is an important step in the workflow, but the model is not the end of the journey. The key element for success in practical AI implementation is uncovering any issues early on and knowing what aspects of the workflow to focus time and resources on for the best results—and it’s not always the most obvious steps.

Two important sides to consider before diving into the complete workflow:

  1. Most often, AI is only a small piece of a larger manufacturing system, and it needs to work correctly in all scenarios with all other working parts of the continuously running manufacturing line. This includes data collected from sensors on the equipment through industrial communication protocols like OPC UA as well as other pieces of the machine software such as control, supervisory logic, and HMI.
  2. Engineers in this scenario already have the skills to successfully incorporate AI. They have inherent domain knowledge about the equipment, and with tools for data preparation and designing models, they can get started even if they’re not AI experts, allowing them to leverage their existing areas of expertise.

The AI-Driven Workflow

Now we can dive into the four steps for the AI-driven complete workflow and better understand how each step plays its own critical role in successfully implementing AI on manufacturing equipment.

Step 1: Data Preparation

Data preparation is arguably the most important step in the AI workflow: Without robust and accurate data as input to train a model, projects are more likely to fail. If an engineer gives the model “bad” data, he or she will not get insightful results—and will likely spend many hours trying to figure out why the model is not working.

To train a model, you should begin with clean, labeled data, as much as you can gather. This may also be one of the most time-consuming steps of the workflow. When deep learning models do not work as expected, many often focus on how to make the model better—tweaking parameters, fine-tuning the model, and providing multiple training iterations. However, engineers would be better served focusing on the input data: preprocessing and ensuring correct labeling of the data is being fed into a model to ensure that the data can be understood by the model. Another challenge typically experienced in the manufacturing industry is that those companies that operate the machines have access to the operation data of the equipment, while machine builders are the ones who require the data to train the AI models for deployment on the equipment. Many machine builders and their customers (machine operators) have thus developed agreements and business models for sharing measured sensor data for training and improving AI models.

One example of the importance of data preparation is from construction machinery and equipment company, Caterpillar, which takes in high volumes of field data from various machines. This plethora of data is necessary for accurate AI modeling, but the sheer volume of data can make the data cleaning and labeling process even more time intensive than usual. To streamline that process, Caterpillar uses automatic labeling and integration with MATLAB to quickly develop clean, labeled data to input into machine learning models, providing more promising insights from field machinery. The process is scalable and gives users the flexibility to use their domain expertise without having to become experts in AI.

Step 2: AI Modeling

Once the data is clean and properly labeled, it’s time to move on to the modeling stage of the workflow, which is where data is used as input, and the model learns from that data. The goal of a successful modeling stage is creating a robust, accurate model that can make intelligent decisions based on the input. This is also where deep learning, machine learning, or a combination thereof comes into the workflow as engineers decide what will be the most accurate, robust result.

At this stage, regardless of deciding between deep learning (neural networks) or machine learning models (SVM, decision trees, etc.), it’s important to have direct access to many algorithms used for AI workflows, such as classification, prediction, and regression. You may also want to use a variety of prebuilt models developed by the broader community as a starting point or for comparison.

Using flexible tools, like MATLAB and Simulink, offers engineers the support needed in an iterative environment. While algorithms and prebuilt models are a good start, they’re not the complete picture. Engineers learn how to use these algorithms and find the best approach for their specific problem by using examples, and MATLAB provides hundreds of examples for building AI models across multiple domains.

AI modeling is an iterative step within the complete workflow, and engineers must track the changes they are making to the model throughout this step. Tracking changes and recording training iterations, with tools like Experiment Manager, is crucial as it helps explain the parameters that lead to the most accurate model and create reproducible results.

Step 3: Simulation and Test

AI models exist within a larger system and must work with all other pieces in the system. In the manufacturing industry the AI model might take care of predictive maintenance, dynamic trajectory planning or visual quality inspection while the rest of the machine software includes controls, supervisory logic, and more. Simulation and testing for accuracy are key to validating that the AI model is working properly, and everything works well together with other systems, before deploying a model into the real world.

To build this level of accuracy and robustness prior to deployment, engineers must ensure that the model will respond the way it is supposed to, no matter the situation. Questions you should ask in this stage include:

  • What is the overall accuracy of the model?
  • Does the model perform as expected in each scenario?
  • Does it cover all edge cases?

Trust is achieved once you have successfully simulated and tested all cases you expect the model to see and can verify that the model performs on target. By using simulation tools like Simulink, engineers can verify that the model works as desired for all the anticipated use cases prior to deployment on the equipment, avoiding redesigns that are costly both in money and time.

Step 4: Deployment

Once you are ready to deploy, the target hardware is next—in other words, readying the model in the final language in which it will be implemented. This step typically requires design engineers to share an implementation-ready model, allowing them to fit that model into the designated industrial controls hardware environment.

That designated hardware environment can range from embedded controllers and PLCs to edge devices and industrial PCs to the cloud, and MATLAB can handle generating the final code in all scenarios. These types of flexible tools will offer engineers the leeway to deploy their model across a variety of environments from different hardware vendors without having to rewrite the original code.

Take the example of deploying a model directly to a PLC: Automatic code generation eliminates coding errors that could be introduced through manual programming and provides optimized C/C++ or IEC 61131 code that will run efficiently on PLCs from major vendors.

Figure 2. Several control manufacturers support automatic generation of PLC code (IEC 61131 or C/C++) from MATLAB and Simulink. © 1984–2021 The MathWorks, Inc.

Stronger Together

Engineers don’t have to become data scientists or even AI experts in order to achieve success with AI. Tools designed for engineers and scientists, functions and apps to integrate AI into your workflow, deployment options for 24/7 in-operation use, and available experts to answer questions related to AI integration are crucial resources for setting up engineers—and their AI models for success. Ultimately, engineers are at their best when they can focus on what they do best and build on it with the right resources to help them bring AI into the picture.

As the Industry Manager for Industrial Automation & Machinery at MathWorks, I am working closely with the local teams in our worldwide offices, with innovation leaders among our key customers and with our development teams to sharpen MathWorks' strategy and offering for Digital Transformation, AI and Industry 4.0.

More from Philipp