Tutorials

Monitoring and alert system

In this tutorial, you will learn how to automate your AI pipeline by connecting your devices with mpVision. You will also learn how to configure an alert system for your monitoring objectives.

mpVision allows devices to be connected through device access points. They provide secure REST API endpoints, which can be used to automatically send images from any image-capturing device to the mpVision application. Every access point is unique and represents a single model that is assigned to the device during the configuration. We will cover device integration in this tutorial.

Upon receiving images, mpVision will automatically process them by running inference with a selected model. Reports are automatically generated that will give you insights about your image data.

Creating a device access point

After logging in to the application, click on the "Models" navigation link in the left sidebar menu. It will navigate you to the view containing list of your models (if you are continuing previous tutorials, it should only contain one BCCD model).

To start adding a new device access point, click on the "Deploy" button located on the right side from the model name. This will open a form where you will be able to input an access point name and description.

Next, we will need to configure alert groups to be notified when certain criteria is met. For simplicity in this tutorial, we will use our BCCD model that we have built in the training tutorial, and we will configure access point to alert us when the model detects more than 4 RBC cells in the image. This is a simplified example to demonstrate how to configure alert groups. In real-world scenarios, you will have multiple alert groups configured with different parameters. Refer to the alert groups documentation for more detailed specifications for different types of alerts.

Select an input name and description for the device access point (you can use "BCCD detection" for name and "Tutorial access point: alert when more than 4 RBC cells detected" for description). Since we navigated to this from the model view, our BCCD model will already be selected in the "Model" select input field.

Now we can start adding alert groups. This will enable us to get notified over email when more than 4 RBC cells are detected in the image provided by our hypothetical device that we will mock by sending images directly to our REST API from your browser. To create an alert group, click on the "Add alert group" button. This will open a form where you can input alert group name and select detection boundaries to trigger the alert.

For this tutorial we will use "RBC Count Alert" for the name and set the "RBC" label to have a minimum of 4 detections (leave the maximum blank). This means that if more than 4 RBC cells are detected in the image, the alert will be triggered. If you provide a range, the alert will be triggered if the number of detections is within the range. If any of the inputs are left blank, the alert will be triggered if the number of detections is greater than the minimum or less than the maximum.

Configuring alert groups

Next, configure the alert frequency to be "Real time". This will make sure that for this tutorial, we will get notified as soon as the alert is triggered. In real-world scenarios, you might want to configure different alert frequencies based on your needs and risks. Then input your email address in the "Email" input field and press enter on your keyboard (alternatively, you can click on "+" button inside the input field). This is where the alert notification will be sent when the alert is triggered. You can add as many emails as you desire by repeating the process. Alerts also can be configured to be sent to other software systems by using the REST API endpoints that are provided by mpVision. But that is outside of the scope of this tutorial. You can reference the alert groups documentation for more information.

After filling out the form, click on the "Createa access point" button located on the bottom left corner of the form. This will create a new access point, and you will see a dialog with the access point details. Copy the access point address along with the API key and store them — we will need them in the next step to send data to the access point.

Sending images to the access point

Now that we have created a device access point, we can start sending images to it. The access point and credentials that we have created in the previous step will be used to authenticate the request to run inference with the assigned model. In order to do so, you will need to configure your device to send images to the access point address with the API key in the authentication headers of the request. But to test the endpoint and quickly see how it works as well as the outputs, we can use mpVision's REST API documentation that has forms allowing you to send images manually directly from your browser.

Navigate to the mpVision REST API documentation (check user manual provided with your company's deployed mpVision version), and click on the "Authorize" button located in the top right corner. This will open a dialogue where you can input your endpoint authorization token key that you copied in the previous step. Since this is a service token, you need to input in the ServiceJWTAuth (http, Bearer) field. Click "Authorize" and close the dialog. This way your requests will be authenticated for our test purposes. Scroll down and locate the endpoint titled "POST /api/service/inference/{endpoint_id}/", and click on the title to expand the endpoint form. Then click on the "Try it out" button.

Input fields of the form should become editable. In the "endpoint_id" input field, input the access point address that you copied in the previous step. In the "image" input field, click on the "Choose file" button and select an image from your computer that you want to send to the access point. Then click on the "Execute" button. This will send the image to the access point, and you should see a success message with the response data that contains the identificator assigned to this request.

Monitoring and alerts dashboard

Now that we have sent an image to the access point, we can check to see how it looks in the application. Navigate to the "Dashboard" page of the application (link is located in the left-side navigation menu) that contains the alert monitoring chart. On the chart, you should be able to see that for the date and time when you sent the image, there is a spike in the chart that represents the number of alerts triggered (you will see only one alert titled "RBC Count Alert"). In case you already have devices configured, you might need to switch to your access point by selecting it from the "Device access point" input field located above the chart.

In this tutorial we have demonstrated a basic example of the alert and monitoring system. mpVision also has additional features that can be used to monitor and analyze your image data. Refer to the user manual for more information.

Previous
Running inference