Face Anonymization with Gstreamer
Written by:
Aleix FigueresNov. 7, 2024
Cross-platform Multimedia Edge AI with GStreamer
The rise of Artificial Intelligence (AI) in multimedia has revolutionized tasks like facial recognition and object detection, making them essential features in modern applications. As these capabilities increasingly shift to the edge, achieving smooth, real-time execution is critical. The real challenge lies in delivering custom, accurate AI solutions that perform consistently across diverse edge environments, ensuring reliable results on varying hardware platforms.
Fluendo is a multimedia expert who works with GStreamer. GStreamer is an open-source framework that allows efficient multimedia processing. It ensures real-time streaming, synchronization, and integration of diverse media formats across platforms. Its pipeline-based architecture and support for hardware acceleration are perfectly suited for vision and audio AI tasks, providing a perfect integration of media processing with a Deep Learning model’s inference.
To facilitate the development of custom AI-based solutions based on GStreamer, Fluendo has created Fluendo AI Plugins, a set of GStreamer elements providing support for common vision and audio tasks such as face detection, tracking, or segmentation. Our plugins leverage our in-house AI Engine (Raven AI Engine), which allows us to create custom, boosted, and user-friendly AI solutions.
Face Anonymization with AI
Face anonymization is a crucial technique for protecting individual privacy in images and videos. This process involves using AI technology to detect all faces in a scene and then blurring or pixelating them to obscure them, ensuring identities are hidden while conserving the overall context of the image.
This technology is especially valuable when privacy is a priority, such as public surveillance, social media, or research studies, where images or videos need to be shared, but revealing identities is not permissible. By anonymizing faces, organizations can comply with privacy laws and ethical standards, allowing them to securely share visual data while still using it for analysis or reporting.
Figure 1: Face Anonymization example
Complying with the EU AI Act
In recent years, the European Union introduced the AI Act, a comprehensive law designed to protect individual privacy and ensure the ethical use of AI technologies. Our solution aligns perfectly with this legislation by anonymizing facial data, helping AI companies comply with these strict EU regulations and support privacy-by-design principles while avoiding the "high-risk" classification.
Figure 2: Automotive use case
This approach empowers AI companies to develop and share datasets without facing regulatory barriers, enhancing trust, reducing legal risks, and driving innovation— even in regions with strict privacy laws. Face anonymization is also important in sectors such as surveillance, automotive, TV broadcasting, healthcare, and education, where AI-driven solutions must balance innovation with privacy protection. By adopting this solution, businesses can ensure compliance, safeguard user privacy, and build trust within their industries.
Figure 3: Surveillance use case
AI plugin description
Our plugin employs a CNN (Convolutional Neural Network) architecture specifically trained to identify and locate faces in video streams. Once a face is detected, the model passes the information to the anonymization pipeline, which then applies blurring or pixelation to the identified facial areas, effectively obscuring the personal identities while retaining the overall context of the image.
Figure 4: Plugin architecture
The diagram above illustrates how our GST plugin integrates into the face anonymization process It begins by analyzing the input texture to detect faces, creating a bounding box around each face. , The selected facial areas are then anonymized based on user settings, using either blurring or pixelation usability of the visual data.
Plugin Documentation
Our plugin comes with easy-to-follow instructions and practical code examples to make integration simple. The guide covers installation, setup, and customization, allowing users to quickly implement the plugin and leverage its advanced image upscaling features to enhance their workflow.
Pre-requisites:
This plug-in requires a complete installation of GStreamer MSVC 64-bit version 1.22.3 or above.
Installation:
Inside the bin directory of the provided package, you’ll discover all the necessary binaries. To ensure recognition by GStreamer, these files must be copied to the GStreamer plugins directory. The location of this plugin directory may differ according to your specific GStreamer installation.
As an example, when installing GStreamer v.1.24.4 on Windows 10, the default directory is
C:\gstreamer\1.0\msvc_x86_64\lib\gstreamer-1.0
Alternatively, you can set the GST_PLUGIN_PATH environment variable to include the complete path to the bin directory within the package. Also, ensure that the PATH environment variable contains the complete path to the plugin’s bin directory, for Windows to find the required .dll files.
AI models location:
It’s not mandatory to keep the AI models (*.flu files) in the same directory as the plugin binaries. If you prefer to relocate them elsewhere, set the element property model-path to specify their location.
Simple Webcam Example:
gst-launch-1.0.exe mfvideosrc ! videoconvert ! d3d11upload ! flufaceanonymizer ! autovideosink
Figure 5: Simple webcam example
Custom Pixelation Example:
gst-launch-1.0.exe mfvideosrc ! videoconvert ! d3d11upload ! flufaceanonymizer face-detection-threshold=75 blur-intensity=15 effect=pixelate ! autovideosink
Figure 6: Custom pixelation with 75% detection threshold & 15% blurring intensity
Conclusions
In conclusion, our face anonymizer plugin is a powerful tool for ensuring privacy in real-time video processing. It accurately detects and anonymizes faces, with customizable options for blurring or pixelation, intensity, and face detection confidence. This flexibility allows users to fine-tune the output to meet specific privacy needs, making it an essential GStreamer solution for secure and compliant video content handling.
Ready to enhance privacy and meet AI regulations? Contact us to see how Fluendo’s face anonymization AI plugins for GStreamer can integrate smoothly into your workflows, safeguarding privacy with high-quality, real-time results.