Source code and labeled dataset for our Usenix Security'24 paper PixelMoD
Download the evaluation docker image , and volumes associated with Docker image from the Zenodo URL.
(Note: due to refactoring for evaluation workflow, the stable Zenodo URL is updated from the one initially submitted during the AE process. )
List of tarballs to download include:
pixelmod.tar.gz( Docker Image containing Streamlit and benchmarking script )etcd_backup.tar.gz(Docker volume for service etcd)milvus.tar.gz(Docker volume for service Milvus)minio.tar.gz( Docker volume for service Minio)
Download these tar files and place them in the same subdirectory.
First, run the following command to load the docker image containing PixelMod Evaluation infrastructure
sudo docker load < pixelmod.tar.gz
This will load the evaluation image. You can run the following command and expect to see milvus-pixelmod:latest in the list of docker images listed.
sudo docker image ls
In the same directory the three zipped files containing the volumes are located, run the following three commands to load the docker volumes necessary.
sudo bash import_volume.sh milvus.tar.gz milvussudo bash import_volume.sh etcd.tar.gz etcdsudo bash import_volume.sh minio.tar.gz minio
Run the following command to make sure the volumes are loaded properly
sudo docker volume ls
Finally, run the command docker compose up -d to start all the containers. Make sure to download the file docker-compose.yml on the companion repository.
This should start four different containers: milvus-standalone, milvus-etcd, milvus-minio and milvus-pixelmod.
Make sure the container and Milvus index is working properly by running the command sudo docker exec -it $(sudo docker container ls | grep 'milvus-pixelmod' | awk '{print $1}') python3 basic_test.py
Starting the container automatically runs the streamlit web application in port 8501 of the container. Port 8501 of the container is mapped to port 8501 of host machine (evaluators can modify this on client service of the compose file to change the mapping).
Therefore, browsing to localhost:8501 on the host machine should start the streamlit application succesfully.
Users can run the command sudo docker exec -it $(sudo docker container ls | grep 'milvus-pixelmod' | awk '{print $1}') /bin/bash to start a bash terminal in the running container where milvus-pixelmod:latest is the container imported in Section 2.1.
Evaluation can then be performed by running the script python experiment2_evaluating.py
The script evaluates PixelMod's image search system (combination of PDQHash + OCR filtering as described in the paper).
The files used in the script serve the following purpose:
query_pdqhash.txtcontains the set of seed images used to build the GTViz dataset. This list contains the images that we have annotated ground truth information to detect visual matches.index_pdqhash.txtcontains the set of images that are visually and contextually similar to images inquery_pdqhash.txt. These images are used to build the corresponding Milvus collectionusenixtest_pdqhash_v2, which we will be querying to retrieve visually similar matches.final_source_ocr_en.jsonandfinal_manipulation_ocr_en_v2.jsoncontain the pre-computed Optical Character Recognition (OCR) output of the images used inindex_pdqhash.txt, andquery_pdqhash.txt. These will be used to filter for contextual similarity once the visually similar matches are returned by Milvus.
The evaluation workflow follows given steps:
- First, set up configuration and connection parameters to connect
with the Milvus container and loads the appropriate collection
usenixtest_pdqhash_v2used to buildGTViz. - Load query images from
query_pdqhash.txtand generate PDQHash embeddings for query - Load metadata for images that are used to build the
usenixtest_pdqhash_v2collection. Build dictionary containing ground truth for all images.- Ground truth labels follow a simple scheme. Visual matches of img0 will have format
img0_*,img1_* - Indexed images that are not visual matches for any source image will have the format
noise_*
- Ground truth labels follow a simple scheme. Visual matches of img0 will have format
- Finally, iterate through all query images, using the query vectors and get the results. Results are filtered through OCR based filtering mechanism using Jaccard similarity matching and final set of results are checked for Precision / Recall.
@inproceedings {sec24:pixelmod,
title = {PIXELMOD: Improving Soft Moderation of Visual Misleading Information on Twitter},
booktitle = {33rd USENIX Security Symposium (USENIX Security)},
year = {2024},
author={Pujan Paudel, Chen Ling, Jeremy Blackburn, and Gianluca Stringhini}
}