Upload model card README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- model-protection
|
| 5 |
+
- intellectual-property
|
| 6 |
+
- image-classification
|
| 7 |
+
- oxford-pets
|
| 8 |
+
- modellock
|
| 9 |
+
datasets:
|
| 10 |
+
- oxford-iiit-pet
|
| 11 |
+
pipeline_tag: image-classification
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# ModelLock: Locking Your Model With a Spell
|
| 15 |
+
|
| 16 |
+
Official model repository for the paper: [ModelLock: Locking Your Model With a Spell](https://arxiv.org/abs/2405.16285)
|
| 17 |
+
|
| 18 |
+
## Overview
|
| 19 |
+
|
| 20 |
+
This repository contains the locked model checkpoint for the Oxford-IIIT Pet dataset using the ModelLock framework with style-based transformation.
|
| 21 |
+
|
| 22 |
+
## Checkpoint Information
|
| 23 |
+
|
| 24 |
+
**Model**: MAE (Masked Autoencoder) fine-tuned on Oxford-IIIT Pet dataset
|
| 25 |
+
**Lock Type**: Style transformation
|
| 26 |
+
**Dataset**: Oxford-IIIT Pet (38 classes)
|
| 27 |
+
|
| 28 |
+
## Model Hyperparameters
|
| 29 |
+
|
| 30 |
+
The model was locked using the following configuration:
|
| 31 |
+
|
| 32 |
+
### Diffusion Model
|
| 33 |
+
- **Model**: `timbrooks/instruct-pix2pix` (InstructPix2Pix)
|
| 34 |
+
|
| 35 |
+
### Transformation Parameters
|
| 36 |
+
- **Prompt**: `"with oil pastel"`
|
| 37 |
+
- **Alpha** (blending ratio): `0.5`
|
| 38 |
+
- **Inference Steps**: `5`
|
| 39 |
+
- **Image Guidance Scale**: `1.5`
|
| 40 |
+
- **Guidance Scale**: `4.5`
|
| 41 |
+
|
| 42 |
+
## Download Checkpoint
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
huggingface-cli download SFTJBD/ModelLock pets_mae_style_checkpoint-best.pth --local-dir ./checkpoints
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
Or using Python:
|
| 49 |
+
```python
|
| 50 |
+
from huggingface_hub import hf_hub_download
|
| 51 |
+
checkpoint_path = hf_hub_download(
|
| 52 |
+
repo_id="SFTJBD/ModelLock",
|
| 53 |
+
filename="pets_mae_style_checkpoint-best.pth"
|
| 54 |
+
)
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
## Usage
|
| 58 |
+
|
| 59 |
+
To evaluate the locked model, use the key prompt `"with oil pastel"` with the same hyperparameters listed above to unlock the model's full performance.
|
| 60 |
+
|
| 61 |
+
## Citation
|
| 62 |
+
|
| 63 |
+
```bibtex
|
| 64 |
+
@article{gao2024modellock,
|
| 65 |
+
title={ModelLock: Locking Your Model With a Spell},
|
| 66 |
+
author={Gao, Yifeng and Sun, Yuhua and Ma, Xingjun and Wu, Zuxuan and Jiang, Yu-Gang},
|
| 67 |
+
journal={arXiv preprint arXiv:2405.16285},
|
| 68 |
+
year={2024}
|
| 69 |
+
}
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
## License
|
| 73 |
+
|
| 74 |
+
MIT License
|
| 75 |
+
|