Fast(er) Reconstruction of Shredded Text Documents via Self-Supervised Deep Asymmetric Metric Learning
This repository comprises datasets and source codes used in our CVPR 2020 paper.
Preparing the enviroment with virtualenv
- python 3.6
For a fully-automatic setup of the virtual environment (tested on Linux Ubuntu 18.04), set the variable
scripts/install.sh to a valid directory, and then run
You should have sudo privileges to run properly the installation script.
By default, the virtual environment will be created at
$BASE_DIR/envs/deeprec-cvpr20. When finishing, the script will automatically activate the just created environment.
Download the datasets
The datasets comprise the (i) integral documents where the small samples are extracted and (ii) the mechanically-shredded documents collections D1 and D2 used in the tests. To download them, just run
It will create a directory
datasets in the local directory.
A reconstruction demo is available by running
python demo.py. By default, the script uses a pretrained model available in the
traindata directory. Here is an example of output of the demo script:
For details of the parameters, you may run
python demo.py --help.
Reproducing the experiments
To ease replicability, we created bash scripts with the commands used in each experiment. You can just run
bash scripts/experiment<ID>.sh replacing
<ID> by 1, 2, or 3. As described in the paper, each id corresponds to:
- 1: single-reconstruction experiment
- 2: multi-reconstruction experiment
- 3: sensitivity analysis
Results are stored as
.json files containing, among other things, the solution, the initial permutation of the shreds, accuracy, and times. The files generated by the experiments 1 and 3 are at
results/sib18, while those generated by the experiment 2 are at
results/sib18_multi. Results can be visualized through the scripts in the