The Internet of Things on AWS – Official Blog

Improving Product Quality with Cognizant APEx 2.0 and AWS IoT SiteWise Edge


Conditions created by COVID-19 stressed supply chains around the world, while exponentially increasing demand for certain products such as personal protective equipment (PPE) overnight. As a result, manufacturers globally are seeking creative solutions to boost their production output. Often, the fastest way to boost output is not by adding additional capacity, but by reducing the waste in the production process. Poor product quality is one of the largest sources of such waste in manufacturing. It is also one of the hardest types of waste to tackle at scale. Many manufacturers rely on manual methods such as visual inspection to detect quality issues. This approach only works on a limited scale when the rate of production is such that quality inspectors can keep up with it. Advances in computer vision technology and edge processing infrastructure means that these manufacturers can equip their quality inspection teams with tools that can help them catch defects that would have otherwise gone undetected at scale.

In this post, we describe how a discrete manufacturer can detect quality issues through real-time analysis of product images using the Asset Performance Excellence (APEx 2.0) solution provided by Cognizant. This solution uses the SiteWise Edge feature of AWS IoT SiteWise to process metrics for operators on the plant floor

Monitoring quality

In high volume production scenarios there are multiple stakeholders involved in managing quality. The workflow to manage product quality can become quite complex depending on the size of the production operation and the type of product. As a result, it is helpful to establish a few fundamental metrics that can give quick insight into product quality. Three common metrics quantifying quality are yield, scrap rate, and rework rate. Yield indicates the share of parts with acceptable quality within a batch. Scrap rate indicates how many parts in a batch have to be discarded due to defects. Rework rate indicates how many parts in a batch are reprocessed to remove defects. These metrics can help operators develop an initial hypothesis about the quality performance of their process before they dive deeper. For example, a process with a higher scrap rate than rework rate indicates that most defects lead to loss of product. This process may be a greater cause for concern than one which has a higher rework rate indicating that most defects are repairable. Armed with this information, operators can focus on the processes causing the greatest waste to identify the most recurring defects among the scrapped products.

APEx 2.0 using AWS IoT SiteWise Edge simplifies this process for operators through a managed quality monitoring experience that can run entirely on-premises. In this solution, APEx 2.0 gathers product images from cameras mounted on the production lines and utilizes computer vision to infer defects in parts produced. It also collects information about parts scrapped and reworked from external manufacturing systems. It then uses SiteWise Edge to compute the yield, scrap, and rework metrics for its custom operator application. Additionally, this application of APEx 2.0 uses machine learning models to describe the quality issues that it detects through the images. For example, it can specify if a particular defect is a crack in the part or missing pieces in a product assembly, making it easy for operators to find the most recurring defect.

Monitoring experience

APEx 2.0 is a solution accelerator built to enable specific use cases and speed up the time to value for end users, while also remaining flexible for myriad applications. In this application of APEx 2.0, it is being used to provide visibility to the Overall Equipment Effectiveness (OEE) of the plant and its machines, and uses image analytics to determine part quality while running the entire application on premises.

This APEx 2.0 application is designed for plant managers and technicians responsible for production. A plant manager can start by selecting the production station or work cell they want to check for performance. The application displays top level metrics (such as yield, scrap rate, cycle time, and OEE) as an overview. Plant managers often rotate across shifts. Production jobs can also vary by shift. For example, beverage processing customers often use the same equipment or workstation to process different types of beverages in different shifts. The application lets them select a shift from a drop-down menu to view data for that given shift rather than all the shifts. For the selected shift, the plant manager may notice that the scrap rate is higher than expected. They can then select the metric to view a historical trend to understand when exactly during the shift the scrap rate began to rise at that particular work station.

Overview of welding station in application

Trend of OEE

Once the plant manager identifies the time, they can switch to the Inspection Details tab to get information about specific scrap or rework events that occurred during that time. The application displays each event on a timeline. The plant manager can select each event to see the image of the part to understand the type of defect. The images are annotated by the application to show areas of interest used to infer the defect. Additional information such as part number and type of defect inferred is also stated. This information can help the plant manager quickly identify the potential issues with the machine and engage the technicians on the plant floor. Additionally, they can use the part number information to physically locate and inspect the part to develop further understanding.

Inspection details of welding station illustrating bad parts

Annotated image and summary of variance

APEx 2.0 architecture using SiteWise Edge

APEx 2.0 unifies data from multiple industrial systems and derives insights to drive excellence across operations, resources and asset performance. The solution incorporates a library of key performance indicators (KPIs), for example, OEE, scrap ratio, and yield that follow ISO 22400 standards. The solution helps to build dashboards at the machine level, plant level, and organizational level.

APEx 2.0 is built using AWS IoT SiteWise. Normally, functions such as calculations, data storage, and the visualization are hosted in a cloud based environment. However, as described earlier in the post this will not meet requirements for all use cases.

SiteWise Edge enables APEx 2.0 to run locally on the customer’s premises while minimizing architectural and code changes. This enables advanced analytics, such as fault detection and visual inspection, without the need to send large amounts of data or sensitive data to the cloud. The production stations and work cells are defined in AWS IoT SiteWise as asset models with measures, transforms, and metrics corresponding to the relevant data and computations. The asset models are cached locally on the edge, with a sync occurring every ten minutes or on-demand via the local configuration interface.

This solution collects machine data from OPC-UA servers and image data from plant cameras through the AWS IoT SiteWise gateway. It uses custom functions, deployed as Docker containers and AWS Lambda functions, to process the images in the gateway and pass inference results to SiteWise Edge data processing software for metric computation. SiteWise Edge software is packaged as Greengrass components. This means partners like Cognizant can extend it using their own custom AWS IoT Greengrass components. They use the AWS IoT Greengrass stream manager to transfer data between components. This simplifies development of edge applications such as APEx 2.0. For example, to pass inference results to SiteWise Edge, the image processing function simply writes it to the AWS IoT Greengrass Stream consumed by the SiteWise Edge Data Processing pack. Image and metric data is stored locally on the gateway for offline availability. This solution runs all necessary API and front end services needed to render the application experience in containers that are also deployed using AWS IoT Greengrass.

APEx 2.0 solution architecture with AWS IoT SiteWise Edge

SiteWise Edge provides data collection and processing capabilities in the SiteWise gateway for local applications enabled by the Data Processing pack and Data Collection pack. The Data Collection pack is used to retrieve data from the OPC-UA server. Data configured in the asset models is accepted and processed by the Data Processing pack via AWS IoT Greengrass Streams. When data arrives to the Data Processing pack, transforms are performed immediately while metrics are calculated at intervals specified in the asset models. All of the incoming data and computed values are stored on the gateway, but this is configurable in the asset models based on the need to send some or all of the data to the AWS IoT SiteWise service in the cloud. SiteWise Edge supports retaining this data at the edge for up to 30 days (granted sufficient disk space is available on the gateway). Other application processes on the gateway are able to retrieve the data via API calls with those calls remaining local to the device in this particular solution. As a result, Cognizant was able to focus on developing differentiated features by integrating with foundational functionality provided by SiteWise Edge.

Functional overview

Functions to perform advanced aggregations, image classification, image annotation, and process orchestration are integrated with the SiteWise Edge functionality to provide a differentiated customer experience.

The ImageAnalytics function performs both image annotation and image classification. Specifically, it annotates key features of the image, such as the location and orientation of elements. The function makes a decision on the quality of the part, or a classification, and passes the result to SiteWise Edge for eventual use in the OEE calculation function. Key observations from the image are also generated and are used to identify trends in failed parts. The inferred results are then routed back to the asset model in SiteWise Edge for persistence by the Orchestrator via an AWS IoT Greengrass Stream. The quality of the part as well as the key observations are stored within the Data Processing pack on the gateway.

The AdvancedAggregation function post processes metrics computed by SiteWise Edge. For example, in this solution it computes cumulative shiftwise results which are the results over a given period of time and in this case from the beginning of a shift. This enables customers to view cumulative shiftwise OEE calculations in near real time rather than a single batch of post processed results at the end of the day. Specifically, the AdvancedAggregation function calls SiteWise Edge to retrieve data and combines this with shift data from a local postgreSQL database to compute the overall OEE for the shift. The result is stored in SiteWise Edge via an AWS IoT Greengrass Stream for future computations or visualization.

Use of SiteWise Edge also helps Cognizant minimize the differences between the cloud and edge deployments of the APEx 2.0 solution, which reduces development and operating costs while ensuring a consistent customer experience. Key pieces of the architecture include asset models configured in AWS IoT SiteWise, the ImageAnalytics and AdvancedAggregation functions, the VisualizationAPI data access layer, and the user interface components are portable between the cloud and edge. The asset models configured for cloud-based deployments are automatically replicated to the edge and kept up to date by SiteWise Edge. The same measurements, transforms, and metrics expressions are supported at the edge allowing seamless re-use of existing models and the infrastructure to configure them.

The ImageAnalytics and AdvancedAggregation functions run in containers. These containers can be deployed and orchestrated via AWS IoT Greengrass enabling the use of the same business logic between the cloud deployment and the edge deployment. Furthermore, the user interface and data access layers are also containerized and deployed to the edge device.

To develop the edge solution, the configuration of the containers and functions was simply reconfigured to read data from an edge endpoint. No code changes were needed since SiteWise Edge supports the same data retrieval APIs available in the cloud. This hybrid developer experience reduces the need to maintain separate code bases for the edge and cloud solutions and simplifies testing of the many functions. It also simplifies the support requirements for the end customer who might be using both edge and cloud solutions for their factories.


In this blog post we outlined a solution that delivered data collection, processing, analytics, and monitoring capabilities on-premises using SiteWise Edge to perform real time defect detection of parts enabling a plant manager to understand process quality metrics of their plant. The solution provides tools to assist the plant manager to identify the root cause of the part quality issue. This enables the plant manager to take corrective action and ultimately improve their production output by reducing waste. SiteWise Edge enabled Cognizant to port their cloud native connected factory solution with minimal changes to the already existing functions, such as the cumulative shiftwise OEE calculations and the visualization interface, allowing them to focus on differentiating features such as edge based image classification and annotation.

For more information on the Cognizant Connected Factory solution, check out this case study highlighting the approach and benefits of APEx 2.0. To get started using the SiteWise Edge feature, log into the AWS IoT SiteWise console, where you can also create an AWS IoT SiteWise demo and provision a simulated edge data source.

About the authors

Nick White bio pictureNick White is a Senior Partner Solutions Architect with AWS focusing on IoT applications. He joined AWS from a global diversified manufacturer where he led the IoT program for connected mobile equipment and industrial equipment. Nick has also developed systems and advanced controls for industrial machinery where he recognized the value of connected devices throughout the product lifecycle. Nick is passionate about IoT because of the efficiencies and insights that can be unlocked by bringing visibility of the physical world into the business decision making process.


Usman Anwer bio pictureUsman leads the product team for SiteWise Edge and contributes to AWS’ industrial strategy. He has a background in operating system technologies, data services, developer tools, consumer apps, and industrial apps. He has worked in various roles across technology, financial services, and aerospace industries