Skip to Content
Technical Articles
Author's profile photo Supriya Malakar

Visual Inspection with SAP Digital Manufacturing Cloud

Artificial intelligence in manufacturing is a trendy term. AI-Based Visual Inspection for Defect Detection is a feature that every manufacturing company is looking for. This not only increases productivity of shop floor but also ensures product quality. The goal of this article is to describe how to enable AI-based visual inspection in a Production Operator Dashboard in SAP Digital Manufacturing Cloud.

 

Step 1: Build Your Own Model

SAP Digital Manufacturing Cloud allows you to deploy a trained Machine Learning model. So as a first step to start with we need to build one deep learning model for Visual inspection. I have developed the model using Python and save the model as saved as an HDF5 file. For data set you can refer Kaggle dataset.

https://www.kaggle.com/ravirajsinh45/real-life-industrial-dataset-of-casting-product

Once the model training is over , test the model accuracy before deploying it to Digital Manufacturing Cloud.

Here one important point to mention is in SAP Digital Manufacturing Cloud it only supports JSON and Binary file so you need to convert your model into JSON and Binary file format. You can use following command to convert model (example: keras model) .

tensorflowjs_converter --input_format=keras /tmp/model.h5 /tmp/tfjs_model

 

Step 2: Create AI/ML Scenario in SAP Digital Manufacturing Cloud

As a Next step you need to create a AI/ML Scenario in SAP Digital Manufacturing Cloud.

Step 2.1: In SAP Digital Manufacturing Cloud tenant look for AI/ML Scenarios Management application and then select Manage AI/ML Scenarios and create one Visual Inspection scenario.

Step 2.2: Using Scenario Availability Combination you can configure Plant, Material, Operation, Routing, Resource for which this scenario is applicable.

Step 2.3: In the Scenario Configuration section you need to choose Visual Inspection Type, Inspection mode as Assisted and upload model files (JSON and binary files generated in Step 1), and define input and preprocessing steps. In preprocessing  steps choose height ,width, colour mode , pixel scale method as per your model input.

Image Source: SAP Digital Manufacturing Cloud

Step 2.4: In Scenario Deployment define classes according to your model output and configure NC code for Non conformance class.

Image Source: SAP Digital Manufacturing Cloud

Step 2.5: Test you model performance before activating it. In Scenario Testing section select one image file you want to test and check your model prediction.

Image Source: SAP Digital Manufacturing Cloud

Step 2.6: If you are satisfied with your model performance you can review and activate your model by clicking save and activate button.

 

Step 3: Create and Configure Production Operator Dashboard for Visual Inspection

In this step I will explain how to create and configure a Production operator dashboard in SAP Digital Manufacturing Cloud.

Step 3.1: Go to POD Designer application in Digital Manufacturing Cloud and create a POD for Visual Inspection by copying from existing POD and Create a page for Visual Inspection.

Step 3.2: Remove the Non conformance Data Entry plugin.

Step 3.3: Drag a Plugin Container into your page and drag the SFC Card plugin from the Plugins list into the Plugin Container.

Step 3.4: Drag another Plugin Container into your page and drag the Visual Inspector plugin from the Plugins list into the Plugin Container.

Step 3.5: To log non conformance codes directly without any plugin assigned during visual inspection in the POD, set the Enable Direct NC Logging configuration option to On for the Visual Inspector plugin.

Step 3.6: Add an action button to your main page and go to button configuration and select Visual Inspection page(Created in Step 3.2) in Navigate to Page drop down.

Step 3.7: Save and Publish your POD.

 

Step 4: Work with Visual Inspection in Shop Floor:

Now we are ready to use AI based Visual Inspection application. Open Production Operator Dashboard from Manufacturing Execution menu and select any SFC and click on Visual Inspector button created in Step 3.6. Capture product image and Visual Inspector will automatically show inspection result.

Image Source: SAP Digital Manufacturing Cloud

Conclusion:

From this blog you will get a overview knowledge on how to enable Visual Inspection capability to Production Operator Dashboard using SAP Digital Manufacturing Cloud .Please provide your valuable feedback and feel free to ask any clarifying questions regarding your content in the comment section.

 

 

 

Assigned Tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo SatheeshKumar Dhandapani
      SatheeshKumar Dhandapani

      Hi,

      Nice as newbie , for visual inspection is any Hardware is already included for scanning of this images?

      Author's profile photo Vinutha B
      Vinutha B

      Thanks Supriya for the detailed blog.

      we have tried the similar kind of approach and we are facing the error while converting to JSON and binary format from .h5 file

      we have used the same model as provided by you and we have replaced the directory wherever required and we are able to train the model as well with our datasets but getting the error while converting it to the JSON and Binary

      Author's profile photo Vinutha B
      Vinutha B

      Can you please help me in resolving this issue?

      Regards,

      Vinutha.B

      Author's profile photo Roman Gonzalez
      Roman Gonzalez

      Hello,

      what are the requirements in order to use the visual inspection type "Object Detection".

      What should be taken into consideration.

      Thank you in Advance

      R.G

       

      Author's profile photo Philipp Raub
      Philipp Raub

      Hi R.G.,

      first of all object detection makes only sense for inspections where (i) it is relevant to identify location of a defect in the image and/or (ii) defects can occur several times (like a cosmetic inspection).

      The effort to train an object detection model is as simple as a classification model, it has also some other advantages described before (works often very good with high resolution images), but it requires more time on labeling the images using bounding boxes. You can configure a visual inspection scenario in SAP Digital Manufacturing Cloud in inspection mode "manual" and use the POD Plugin Visual Inspector to annotate images with such bounding boxes and then export the data as Analytical Data Set to train an object detection model. In practice this is done by the operator and would require little more effort then a classification model.

      I would recommend to use an AI service like Vertax AI AutoML Vision from Google, it trains object detection models with few data/images and provides option to export them as Edge model (use Tensorflow Javascript) which can be uploaded and used within SAP Digital Manufacturing Cloud.

      Hope this helped you do understand the requirements and considerations for the inspection type "Object Detection".

      BR
      Philipp