This project explores the robustness of Multimodal Information Retrieval (MIR) systems against various perturbations and adversarial attacks. It contains pipelines for evaluating CLIP-based models (src/pipe) and UNiME-based models (src/pipe2).
The evaluation pipelines support a variety of image perturbations to test model robustness. These are defined in experiment.py within each pipeline folder.
| Perturbation | Description |
|---|---|
| gauss1 | Gaussian Blur with radius 1. |
| gauss2 | Gaussian Blur with radius 2. |
| grayscale | Converts the image to grayscale. |
| bright | Increases image brightness by a factor of 1.5. |
| flip | Horizontally flips the image. |
| compress | Resizes the image to 80% of its original dimensions (simulating compression/downsampling). |
The project implements gradient-based adversarial attacks to evaluate the security of the models. These attacks are located in src/pipe/attacks.py (for CLIP) and src/pipe2/attacks.py (for UNiME).
src/pipe)Attacks are implemented for CLIP models (e.g., openai/clip-vit-base-patch32).
FGSM (Fast Gradient Sign Method):
fgsm_attack_clipepsilon (perturbation magnitude, default 0.03).PGD (Projected Gradient Descent):
pgd_attack
pgd_attack_to_target_clip
target_text.epsilon (0.0314), alpha (step size, 0.0078), steps (20).src/pipe2)Attacks are implemented for UNiME models (e.g., DeepGlint-AI/UniME-Phi3.5-V-4.2B).
pgd_attack_unime
pgd_attack_to_target
target_text.The experiment.py scripts in src/pipe and src/pipe2 are used to run evaluations on datasets like MMEB-eval. They support passing a list of perturbations to evaluate.
# Example in src/pipe/experiment.py
perturbations = ['gauss1', 'flip', 'pgd']
deliverthegoods(datasets, perturbations, "openai/clip-vit-large-patch14")
You can visualize the effect of attacks using visualize_attack.py.
python src/pipe/visualize_attack.py
This script generates a comparison of attacks on different models (e.g., CLIP Base vs. Large), showing the original image, adversarial images, and similarity scores for original and target texts.
8 commits
Jupyter Notebook
78.9%
Python
21.0%
This project explores the robustness of Multimodal Information Retrieval (MIR) systems against various perturbations and adversarial attacks. It contains pipelines for evaluating CLIP-based models (src/pipe) and UNiME-based models (src/pipe2).
The evaluation pipelines support a variety of image perturbations to test model robustness. These are defined in experiment.py within each pipeline folder.
| Perturbation | Description |
|---|---|
| gauss1 | Gaussian Blur with radius 1. |
| gauss2 | Gaussian Blur with radius 2. |
| grayscale | Converts the image to grayscale. |
| bright | Increases image brightness by a factor of 1.5. |
| flip | Horizontally flips the image. |
| compress | Resizes the image to 80% of its original dimensions (simulating compression/downsampling). |
The project implements gradient-based adversarial attacks to evaluate the security of the models. These attacks are located in src/pipe/attacks.py (for CLIP) and src/pipe2/attacks.py (for UNiME).
src/pipe)Attacks are implemented for CLIP models (e.g., openai/clip-vit-base-patch32).
FGSM (Fast Gradient Sign Method):
fgsm_attack_clipepsilon (perturbation magnitude, default 0.03).PGD (Projected Gradient Descent):
pgd_attack
pgd_attack_to_target_clip
target_text.epsilon (0.0314), alpha (step size, 0.0078), steps (20).src/pipe2)Attacks are implemented for UNiME models (e.g., DeepGlint-AI/UniME-Phi3.5-V-4.2B).
pgd_attack_unime
pgd_attack_to_target
target_text.The experiment.py scripts in src/pipe and src/pipe2 are used to run evaluations on datasets like MMEB-eval. They support passing a list of perturbations to evaluate.
# Example in src/pipe/experiment.py
perturbations = ['gauss1', 'flip', 'pgd']
deliverthegoods(datasets, perturbations, "openai/clip-vit-large-patch14")
You can visualize the effect of attacks using visualize_attack.py.
python src/pipe/visualize_attack.py
This script generates a comparison of attacks on different models (e.g., CLIP Base vs. Large), showing the original image, adversarial images, and similarity scores for original and target texts.
8 commits
Jupyter Notebook
78.9%
Python
21.0%