Data Analytics Using Open Source Tools for a Smart City Situational Awareness Solution at the Edge

Written by Neethu Elizabeth Simon and Samantha Coyle

Smart cities need smart security solutions to keep assets and the public safe and secure. Surveillance cameras are installed across various parts of smart cities to ensure the safety of everyone as well as their surrounding environment. With the advent of the Internet of Things (IoT) combined with advancements in computer vision (CV) and AI/ML, security-as-a-service solutions are becoming more important in enhancing safety in a smart city.


This paper proposes a CV-based Security-as-a-Service Smart City Solution using AI/ML. This solution provides a framework and processing pipeline for deploying an AI-assisted, multi-camera Smart City Solution for monitoring vehicular and walkway traffic. Analytics dashboard displays camera installation locations on the smart city map such that data analytics captured across the city can improve situational awareness. They can also be leveraged to provide notifications and safety-related alerts.

The proposed solution illustrates a web user-interface (UI) architecture that utilizes Open-Source software tools for data visualization to improve situational awareness. It covers various Grafana [1] dashboards and plugins used along with metrics captured via AI model inferencing to provide insights about their surroundings.  We also discuss privacy and security considerations concerning the use of security cameras while developing a CV-based AI/ML data visualization solution for situational awareness.

 

Design & Architecture

This implementation enables an AI-assisted reference design achieving situational awareness and property security and management data analytics. It focuses on user interface pieces leveraging Open-Source software tooling that interact with several Go [2] microservice APIs to search camera metadata for registered cameras, attain a list of indexed models, layers, and labels, and to find video sessions assigned to a particular label by an inference model, and a video service providing endpoints to serve playlists and video segment data. Go microservices interface with the Open-Source Postgres [3] database for data storage and retrieval.

Figure 1 shows the frontend architecture leveraging a containerized microservice-based architecture for storing and displaying Smart City Situational Awareness solution data analytics. The diagram displays the flow of data with Go APIs interfacing with data storage, and Web UI framework built to display Smart City data to include Angular [4] UI framework and Grafana dashboards.

The data stored includes:

  • Camera metadata: location, RTSP URI, direction facing, description, ML pipeline to run for camera feed
  • Binary data for video frames using Binary Columns & PostgreSQL’s [3] declarative partitioning, to allow easier lookups
  • Inference results from applying ML models using the OpenVINO [5] Inference Engine

 

fig 1 solutions architecture

 Figure 1: Solution Architecture.

 

Go microservices are primarily used by the Angular Web UI framework to access APIs and display data for live camera streaming, interfacing with one click to Grafana through a navigation bar and display previous video recordings using VideoJS. VideoJS is an HTML5 media player framework to show video in a browser served via a typical HTTP server.

Figures 2-6 demonstrate key features of the UI leveraged for a Smart City Data Analytics Solution including the home page, camera configuration, visualization of live camera, and stored video stream. By having a single UI, it enables a seamless flow to navigate analytics from adding cameras, to visualizing inference results in Figure. 7.

 

fig 2 web ui home page

 Figure 2: Web UI – Home Page.

 

fig 3 web ui add camera

 Figure 3: Web UI – Add Camera.


fig 4 web ui view cameras

 Figure 4: Web UI – View Cameras.

 

fig 5 web ui view camera live feeds

 Figure 5: Web UI – View Camera Live Feeds.

 

fig 6 web ui view available cameras with feed

 Figure 6: View Available Cameras with Feed.

 

fig 7 web ui view cameras feed inference results

 Figure 7: Web UI – View Camera Feed Inference Results.

 

Grafana is a data visualizations, insights, and metrics Open Source tool leveraged to further enhance the data analytics for this Smart City solution. It is configured with a world map plugin to visualize edge device (i.e. camera) locations and contains custom queries leveraging Postgres solution storage and Go microservices APIs. It uses read-only database credentials where credentials populate data source configuration files. Upon startup, a default dashboard is provisioned for camera location visualization. A user may navigate to the default dashboard, shown in Figure 8, by selecting the Grafana tab in Angular UI top navigation bar (Figure 2).

 

fig 8 grafana

 Figure 8: Grafana – Default Dashboard.

 

fig 9 grafana edge device locations

 Figure 9: Grafana – Edge Device Locations on World Map.

 

Figures 10 and 11 highlight the value Grafana custom dashboards enable. Dashboards demonstrate inference results from applying person, vehicle, and bicycle detection, and age and gender recognition models from OpenVINO Model Zoo to video data to derive meaning of video data. This shows the locale-based inference results and expand with additional dashboards and dashboard playlists.

 

fig 10 grafana inference analytics

 Figure 10: Grafana - Inference Analytics.

 

fig 11 grafana more inference analytics

 Figure 11: Grafana – More Inference Analytics.

 

By enabling data analytics through queries to Postgres on configured cameras, inference results as well as camera data, it is possible to then enable notifications through alert rules and notifications capabilities within Grafana. Alerting may leverage labels like security levels, or within certain namespaces of solution to then kick-off notification policies through Slack, email, or so on. For example, in this Smart City Situational Awareness Solution, alerting may be enabled when someone is in a place where they are not allowed. Security personnel could use this notification to better protect the area in real-time and take appropriate action thanks to data analytics from this Smart City data analytics solution.

 

Security & Privacy Considerations

The following considerations were made while designing this secure solution involving potentially identifiable information:

  • Ensured files are inaccessible to unauthorized users.
  • Application service authentication using authorization policies & tokens.
  • TLS encryption for data transferred to/from HTTP APIs and UI.
  • Encrypted RTSP URIs which may contain sensitive information.
  • Vault was used to store sensitive data like username & passwords, certificates and private keys, authorization policies and tokens used by application services, as well as generate dynamic, temporary database credentials by following their baseline production hardening recommendations.
  • Sensitive information is hidden by default in the UI.
  • Mask facial details in video for privacy.

 

Conclusion

Designed as a reference implementation, this solution leverages Docker containers to wrap services with dependencies and deploys solution through Docker compose. It is simple to start services with “docker compose up.” This allows for an easily deployed Smart City data analytics solution with preconfigured dashboards and data sources. However, in a production-grade environment, one might use an elaborate orchestration solution to inject security credentials and handle startup/shutdown of media pipelines in response to configuration changes. This solution leverages Open-Source tooling, thereby eliminating the operational cost associated with deployment; it would be easy to deploy certain aspects of the modular microservice-based solution to Cloud in future larger-deployment-based scenarios. Hence, a highly customizable data analytics solution is enabled for smart city situational awareness at the Edge.

 

 

References

  1. Grafana: The Open Observability Platform. Grafana Labs. https://grafana.com/
  2. Build fast, reliable, and efficient software at scale. Go. https://go.dev/
  3. Group, P. S. Q. L. G. D. (2022, August 2). PostgreSQL. https://www.postgresql.org/
  4. Angular. https://angular.io/
  5. Inference Engine Developer Guide - OpenVINO™ toolkit. OpenVINO. https://docs.openvino.ai/2020.2/_docs_IE_DG_Deep_Learning_Inference_Engine_DevGuide.html

 

This article was edited by Bernard Fong.

To view all articles in this issue, please go to January 2023 eNewsletter. For a downloadable copy, please visit the IEEE Smart Cities Resource Center.

NES Pic
Neethu Elizabeth Simon is a Senior Software Engineer in the Network & Edge Group at Intel Corporation, with vast industrial experience in building smart end-to-end vision-based Machine Learning solutions. She is currently focused on building containerized microservices for computer vision based AI/ML retail & healthcare solutions. Neethu holds a Master’s in Computer Science from Arizona State University. She was the recipient of the 2020 Society of Women Engineers DNE Award for being a powerful technical contributor and advocate for STEM education, for encouraging a diverse and inclusive work environment, and for being an ally for improving diversity through educational outreach. At Intel, she also leads the India AZ Employee Resource Group (ERG) to help create a culture of inclusion and support employee recruitment, retention, and progression efforts by aligning with Intel's Global Diversity & Inclusion Goals. Outside of work, she volunteers with several nonprofits to promote STEM education. 
sam pic
Samantha Coyle is a Software Engineer within the Internet of Things Group at Intel Corporation with experience building, enabling, and optimizing computer vision based containerized applications within the healthcare and retail space. She also has a history of developing Go-based microservices for industrial applications at the edge. With love for all things Open Source and revolving around the idea of AI democratization, she explores passion projects focused on technical innovation around developer enablement and tooling within the broader ML/AI ecosystem. Additionally, in 2021 she attained her CKAD certificate depicting her knowledge and interest in distributed workloads. In her free time, she volunteers by assisting early career engineers and participates in career panels as opportunities arise. Samantha also attends and presents at various conferences to show her dedication to diversity and inclusion, sustainability and ethics, as well as growing herself as an engineer.

IEEE Smart Cities Publications Journals and Magazines Special Issues

This web page displays the effort of IEEE Smart Cities Publications Committee in proposing and guest editing special issues for IEEE Journals and Magazines which is of interests to IEEE Smart Cities Community. Please click here to view.

Past Issues

To view archived articles, and issues, which deliver rich insight into the forces shaping the future of the smart cities. Older eNewsletter can be found here. To download full issues, visit the publications section of the IEEE Smart Cities Resource Center.