Institutional Repository
Technical University of Crete
EN  |  EL

Search

Browse

My Space

Motion and object detection from streaming video on Apache Flink

Banelas Dimitrios

Full record


URI: http://purl.tuc.gr/dl/dias/241E662D-CBF7-4647-9786-CB3D1227C812
Year 2023
Type of Item Diploma Work
License
Details
Bibliographic Citation Dimitrios Banelas, "Motion and object detection from streaming video on Apache Flink", Diploma Work, School of Electrical and Computer Engineering, Technical University of Crete, Chania, Greece, 2023 https://doi.org/10.26233/heallink.tuc.97992
Appears in Collections

Summary

In this thesis, we present distributed video processing system, built with Apache Flink and Apache Kafka, and deployed on the cloud using the Kubernetes orchestration platform. The system facilitates multiple object tracking and motion pattern extraction from multiple streaming or batch video sources. The goal of implementing this system is to observe whether such a system is feasible on Apache Flink. Additionally, we aim to explore the performance, both in terms of theoretical expectations and practical benchmarks. Our focus will be on assessing the accuracy of the results and evaluating the speed and scalability of the system. Leveraging the distributed stream processing capabilities of Apache Flink and Apache Kafka as an intermediate message broker, this system utilizes a combination of computer vision algorithms, including background subtraction, connected component labeling, and centroid-based tracking. These algorithms are implemented using the dataflow model that Flink provides. Hence, each algorithm is implemented within a Flink operator. In order to achieve the full utilization of the distributed architecture, each frame is split into smaller blocks, which are distributed and processed by a number of different Flink operators. Initially, the blocks are evenly distributed to multiple partitions of an input topic in Kafka. Then equal number of Flink pipelines consume the blocks in parallel. In the first stage, each block undergoes background subtraction and component labeling. This process results in the bounding box and centroid of each object present in the blocks. Then, all the connected components from each frame are grouped, and the eligible components are merged into objects. In the last stage of the pipeline, all objects from each frame are concentrated in an operator responsible for creating the trajectory of each object present in the video. When every frame of the video has been processed, the extracted trajectories are announced to another Kafka topic. The application is deployed as a Flink cluster on top of a Kubernetes one, using the newly established Flink Kubernetes Operator. Experimenting in a 7 machine environment (1 CPU from each machine is allocated to Flink), we observed that the system both scales and outperforms a single machine monolith implementation, while providing accurate motion patterns for each video. In fact, the Flink application, configured with a parallelism setting of 7, attained a speedup of up to 6x in comparison to a single-node monolithic implementation, and up to 4.9x compared to the Flink application with a parallelism setting of 1.

Available Files

Services

Statistics