This repository allows you to anonymize sensitive information in images/videos. The solution is fully compatible with the DL-based training/inference solutions that we already published/will publish for Object Detection and Semantic Segmentation.

Overview

BMW-Anonymization-Api

Data privacy and individuals’ anonymity are and always have been a major concern for data-driven companies.

Therefore, we designed and implemented an anonymization API that localizes and obfuscates (i.e. hides) sensitive information in images/videos in order to preserve the individuals' anonymity. The main features of our anonymization tool are the following:

  • Agnostic in terms of localization techniques: our API currently supports Semantic segmentation or Object Detection.
  • Modular in terms of sensitive information: the user can train a Deep Learning (DL) model for object detection and semantic segmentation (the training gui will be published soon) to localize the sensitive information she/he wishes to protect, e.g., individual's face or body, personal belongings, vehicles...
  • Scalable in terms of anonymization techniques: our API currently supports pixelating, blurring, blackening (masking). Also, additinal anonymization techniques can be configured as stated below. For the highest level of privacy, we recommend using the blackening technique with degree 1.
  • Supports DL-based models optimized via the Intel® OpenVINO™ toolkit v2021.1 for CPU usage: DL-based models optimized and deployed via the Openvino Segmentation Inference API and the Openvino Detection Inference API can also be used.
  • Compatible with the BMW Deep Learning tools: DL models trained via our training and deployed via our inference APIs are compatible with this anonymization API.

animated

General Architecture & Deployment Mode:

Our anonymization API receives an image along with a JSON object through which the user specifies mainly:

  • The sensitive information she/he wishes to obfuscate.
  • The anonymization technique.
  • The anonymization degree.
  • The localization technique.

You can deploy the anonymization API either:

  • As a standalone docker container which can be connected to other inference APIs (object detection or semantic segmentation) deployed within a standalone docker container as well.
  • As a network of docker containers along with other inference APIs running on the same machine via docker-compose. (please check the following link for the docker-compose deployment).

Prerequisites:

  • docker
  • docker-compose

Check for prerequisites

To check if docker-ce is installed:

docker --version

To check if docker-compose is installed:

docker-compose --version

Install prerequisites

Ubuntu

To install Docker and Docker Compose on Ubuntu, please follow the link.

Windows 10

To install Docker on Windows, please follow the link.

P.S: For Windows users, open the Docker Desktop menu by clicking the Docker Icon in the Notifications area. Select Settings, and then Advanced tab to adjust the resources available to Docker Engine.

Build The Docker Image

As mentioned before, this container can be deployed using either docker or docker-compose.

  • If you wish to deploy this API using docker-compose, please refer to following link. After deploying the API with docker compose, please consider returning to this documentation for further information about the API Endpoints and use configuration file sample sections.

  • If you wish to deploy this API using docker, please continue with the following docker build and run commands.

In order to build the project run the following command from the project's root directory:

 docker build -t anonymization_api -f docker/dockerfile .

Build behind a proxy

In order to build the image behind a proxy use the following command in the project's root directory:

docker build --build-arg http_proxy='your_proxy' --build-arg https_proxy='your_proxy' -t anonymization_api -f ./docker/dockerfile .

In case of build failure, the docker image python:3.6 should be updated to a newer version:

docker pull python:3.6

Run the docker container

To run the API, go to the API's directory and run the following:

Using Linux based docker:

sudo docker run -itv $(pwd)/src/main:/main -v $(pwd)/jsonFiles:/jsonFiles -p <port_of_your_choice>:4343 anonymization_api
Behind a proxy:
sudo docker run -itv $(pwd)/src/main:/main -v $(pwd)/jsonFiles:/jsonFiles  --env HTTP_PROXY="" --env HTTPS_PROXY="" --env http_proxy="" --env https_proxy="" -p 5555:4343 anonymization_api

Using Windows based docker:

docker run -itv ${PWD}/src/main:/main -v ${PWD}/jsonFiles:/jsonFiles -p <port_of_your_choice>:4343 anonymization_api

The API file will be run automatically, and the service will listen to http requests on the chosen port.

API Endpoints

To see all available endpoints, open your favorite browser and navigate to:

http://<machine_IP>:<docker_host_port>/docs

Endpoints summary

Configuration

/set_url (POST)

Set the URL of the inference API that you wish to connect to the Anonymization API. If the specified URL is unreachable due to connection problems, it will not be added to the JSON url_configuration file. The URL should be specified in the following format "http://ip:port/".

/list_urls (GET)

Returns the URLs of the inference APIs that were already configured via the /set_url POST request.

/remove_url (POST)

Removes the specified URL from the JSON url_configuration file

/remove_all_urls (POST)

Removes all available urls from the JSON url_configuration file

/available_methods/ (GET)

After setting the inference URLs via the /set_url request, the user can view the Anonymization API's configuration by issuing the /available_methods request. Mainly the user can view (i) the supported sensitive information (label_names) , (ii) the supported localization techniques, (iii) the inference URLs and (iv) the DL model name that are configured in the deployed anonymization API as seen below.

Anonymization

/anonymize/ (POST)

Anonymizes the input image based on the user's JSON configuration file

/anonymize_video/ (POST)

Anonymizes a video based on the user's sensitive info and save the anonymized video in src/main/anonymized_videos under <original_video_name>_TIMESTAMP.mp4

Video Anonymization Time

The video might take a while, actually you can estimate the time that it may take by using the following formula: Video_Anonymization_Time = Video_Length x Number_Of_Frames_Per_Second x Anonymization_Time_Of_Each_Frame

User configuration file sample

In order to anonymize an image, the user should specify the different details in the user's JSON configuration file

Please check a sample in the below image:

Note that the URL field is an optional field that you can add in case you wanted to use a specific URL of a running API. You can just add the URL as an optional field in this file as shown in the first sensitive info. In case this field is not specified, the URL defined in the url_configuration.json file will be used by default if it matches all the requirements.

To add a new technique to the API:

Please refer to the following link add new technique documentation for more information on how to add a new anonymization technique to the APIs with common and custom labels.

Benchmark

Object Detection

GPU Network Width Height Inference time Anonymization time Total
Titan RTX yolov4 640 768 0.2 s 0.07 s 0.27 s
Titan RTX yolov4 1024 768 0.4 s 0.14 s 0.54 s
Titan RTX yolov4 2048 1024 1.2 s 0.6 s 1.8 s
Titan RTX yolov4 3840 2160 4.8 s 0.6 s 5.4 s

Semantic Segmentation

GPU Network Width Height Inference time Anonymization time Total
Titan RTX psp resnet 101 640 768 0.2 s 0.8 s 1 s
Titan RTX psp resnet 101 1024 768 0.3 s 0.8 s 1.1 s
Titan RTX psp resnet 101 2048 1024 0.9 s 1 s 1.9 s
Titan RTX psp resnet 101 3840 2160 2 s 3 s 5 s

Possible Error

  • You may encounter the below error when running the docker container at startup in standalone version or docker-compose version url_error

  • In case you do, please make sure that the URL of the inference APIs listed in the jsonFiles/url_configuration.json are still recheable. A possible solution would be to empty jsonFiles/url_configuration.json as seen below before starting the container:

    {
    "urls": [
    ]
    }
    

Acknowledgments

Ghenwa Aoun, BMW Innovation Lab, Munich, Germany

Antoine Charbel, inmind.ai, Beirut, Lebanon

Roy Anwar, BMW Innovation Lab, Munich, Germany

Fady Dib, BMW Innovation Lab, Munich, Germany

Jimmy Tekli, BMW Innovation Lab, Munich, Germany

Owner
BMW TechOffice MUNICH
This organization contains software for realtime computer vision published by the members, partners and friends of the BMW TechOffice MUNICH and InnovationLab.
BMW TechOffice MUNICH
This is an official implementation for "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows" on Semantic Segmentation.

Swin Transformer for Semantic Segmentation of satellite images This repo contains the supported code and configuration files to reproduce semantic seg

23 Oct 10, 2022
An official PyTorch Implementation of Boundary-aware Self-supervised Learning for Video Scene Segmentation (BaSSL)

An official PyTorch Implementation of Boundary-aware Self-supervised Learning for Video Scene Segmentation (BaSSL)

Kakao Brain 72 Dec 28, 2022
Code for "PVNet: Pixel-wise Voting Network for 6DoF Pose Estimation" CVPR 2019 oral

Good news! We release a clean version of PVNet: clean-pvnet, including how to train the PVNet on the custom dataset. Use PVNet with a detector. The tr

ZJU3DV 722 Dec 27, 2022
Open source annotation tool for machine learning practitioners.

doccano doccano is an open source text annotation tool for humans. It provides annotation features for text classification, sequence labeling and sequ

7.1k Jan 01, 2023
Implement of homography net by pytorch

HomographyNet Implement of homography net by pytorch Brief Introduction This project is based on the work Homography-Net: @article{detone2016deep, t

ronghao_CN 4 May 19, 2022
RepVGG: Making VGG-style ConvNets Great Again

RepVGG: Making VGG-style ConvNets Great Again (PyTorch) This is a super simple ConvNet architecture that achieves over 80% top-1 accuracy on ImageNet

2.8k Jan 04, 2023
Original code for "Zero-Shot Domain Adaptation with a Physics Prior"

Zero-Shot Domain Adaptation with a Physics Prior [arXiv] [sup. material] - ICCV 2021 Oral paper, by Attila Lengyel, Sourav Garg, Michael Milford and J

Attila Lengyel 40 Dec 21, 2022
This is an implementation of PIFuhd based on Pytorch

Open-PIFuhd This is a unofficial implementation of PIFuhd PIFuHD: Multi-Level Pixel-Aligned Implicit Function forHigh-Resolution 3D Human Digitization

Lingteng Qiu 235 Dec 19, 2022
TorchGRL is the source code for our paper Graph Convolution-Based Deep Reinforcement Learning for Multi-Agent Decision-Making in Mixed Traffic Environments for IV 2022.

TorchGRL TorchGRL is the source code for our paper Graph Convolution-Based Deep Reinforcement Learning for Multi-Agent Decision-Making in Mixed Traffi

XXQQ 42 Dec 09, 2022
Domain Generalization for Mammography Detection via Multi-style and Multi-view Contrastive Learning

MSVCL_MICCAI2021 Installation Please follow the instruction in pytorch-CycleGAN-and-pix2pix to install. Example Usage An example of vendor-styles tran

Jaron Lee 11 Oct 19, 2022
Jittor implementation of Recursive-NeRF: An Efficient and Dynamically Growing NeRF

Recursive-NeRF: An Efficient and Dynamically Growing NeRF This is a Jittor implementation of Recursive-NeRF: An Efficient and Dynamically Growing NeRF

33 Nov 30, 2022
Lua-parser-lark - An out-of-box Lua parser written in Lark

An out-of-box Lua parser written in Lark Such parser handles a relaxed version o

Taine Zhao 2 Jul 19, 2022
Alpha-Zero - Telegram Group Manager Bot Written In Python Using Pyrogram

✨ Alpha Zero Bot ✨ Telegram Group Manager Bot + Userbot Written In Python Using

1 Feb 17, 2022
Pytorch implementation for reproducing StackGAN_v2 results in the paper StackGAN++: Realistic Image Synthesis with Stacked Generative Adversarial Networks

StackGAN-v2 StackGAN-v1: Tensorflow implementation StackGAN-v1: Pytorch implementation Inception score evaluation Pytorch implementation for reproduci

Han Zhang 809 Dec 16, 2022
Depth-Aware Video Frame Interpolation (CVPR 2019)

DAIN (Depth-Aware Video Frame Interpolation) Project | Paper Wenbo Bao, Wei-Sheng Lai, Chao Ma, Xiaoyun Zhang, Zhiyong Gao, and Ming-Hsuan Yang IEEE C

Wenbo Bao 7.7k Dec 31, 2022
An image classification app boilerplate to serve your deep learning models asap!

Image 🖼 Classification App Boilerplate Have you been puzzled by tons of videos, blogs and other resources on the internet and don't know where and ho

Smaranjit Ghose 27 Oct 06, 2022
A bare-bones TensorFlow framework for Bayesian deep learning and Gaussian process approximation

Aboleth A bare-bones TensorFlow framework for Bayesian deep learning and Gaussian process approximation [1] with stochastic gradient variational Bayes

Gradient Institute 127 Dec 12, 2022
Go from graph data to a secure and interactive visual graph app in 15 minutes. Batteries-included self-hosting of graph data apps with Streamlit, Graphistry, RAPIDS, and more!

✔️ Linux ✔️ OS X ❌ Windows (#39) Welcome to graph-app-kit Turn your graph data into a secure and interactive visual graph app in 15 minutes! Why This

Graphistry 107 Jan 02, 2023
Implementation of "StrengthNet: Deep Learning-based Emotion Strength Assessment for Emotional Speech Synthesis"

StrengthNet Implementation of "StrengthNet: Deep Learning-based Emotion Strength Assessment for Emotional Speech Synthesis" https://arxiv.org/abs/2110

RuiLiu 65 Dec 20, 2022
Official repository of DeMFI (arXiv.)

DeMFI This is the official repository of DeMFI (Deep Joint Deblurring and Multi-Frame Interpolation). [ArXiv_ver.] Coming Soon. Reference Jihyong Oh a

Jihyong Oh 56 Dec 14, 2022