diff --git a/example_algos/readme.md b/example_algos/readme.md index 4d8963e..b703231 100644 --- a/example_algos/readme.md +++ b/example_algos/readme.md @@ -1,95 +1,95 @@ # Example Algorithms This folder contains a few simple example OoD algorithms for the _Medical Out-of-Distribution Analysis Challenge_. ### Quickstart Install python requirements: ``` -pip install -r requirements_alogs.txt +pip install -r requirements_algos.txt ``` And use the data/preprocess.py script to preprocess the data (you may want to use more sophisticated preprocessing for your own submission): ``` python data/preprocess.py -i input_folder -o output_folder ``` ### Run the example algorithms Basically all the algorithms in the algorithm folder are ready-to-run, or can be used as a starting point for your own algorithms. All algorithms take the same basic command_line arguments: - -r [--run], Which part of the algorithm pipeline you want to run ("train", "predict", "test", "all"). - -d [--data-dir], The directory containing the preprocessed training data. - -o [--log-dir], The directory to which you want the logs to be stored in. - -t [--test-dir], The directory containing the test data (requires a folder with the same name plus the suffix '\_label'). - -m [--mode], pixel-level or sample-level algorithm ('pixel', 'sample'). - --logger, if you want to use a logger, can either use a visdom server (running on port 8080) or tensorboard ("visdom", "tensorboard"). For more arguments checkout the python files. The example Algorithms includes: #### 2D Autoencoder (2d_ae.py) A simple 2d autoencoder which uses the reconstruction error as OoD score: ``` python algorithms/ae_2d.py -r all -o output_dir -t /data/mood/brain/toy --mode pixel --logger visdom -d /data/mood/brain/train_preprocessed ``` #### 3D Autoencoder (2d_ae.py) A simple 3d autoencoder which uses the reconstruction error as OoD score: ``` python algorithms/ae_3d.py -r all -o output_dir -t /data/mood/brain/toy --mode pixel --logger visdom -d /data/mood/brain/train_preprocessed ``` #### ceVAE (ce_vae.py) A simple context-encoding Variational Autoencoder. Can be used as only a VAE or CE as well. ``` python algorithms/ce_vae.py -r all -o output_dir -t /data/mood/brain/toy --mode pixel --logger visdom -d /data/mood/brain/train_preprocessed --ce-factor 0.5 --score-mode combi ``` With additional arguments: - --ce-factor, determins the 'mixing' between VAE and CE (0.0=VAE only, 1.0=CE only). - --score-mode, How to determine the OoD score ("rec", "grad", "combi"). #### fAnoGAN (f_ano_gan.py) A fAnoGAN algorithm build on top of improved Wasserstein GANs. Can use be used as AnoGAN only (without the encoding). ``` python algorithms/f_ano_gan.py -r all -o output_dir -t /data/mood/brain/toy --mode pixel --logger visdom -d /data/mood/brain/train_preprocessed --use-encoder ``` With argument: - --use-encoder/--no-encoder, to determine whether to train an additional encoder (fAnoGAN) to reconstruct the image or use no encoder and use backpropagation for reconstruction. ### More Code While the _example_algos_ code is ready to run there are a lot of excellent code repositories which can also be checked out. Some of the Include: - , if you use tensorflow. - , for more VAE variants. - , for more pointers/ great algorimths. - , , collections of basic, easy-to-use algorithms. - , the original f-AnoGAN implementation. - - - And as always, _Papers With Code_: - [Anomaly Detection](https://paperswithcode.com/task/anomaly-detection/) - [Out-of-Distribution Detection](https://paperswithcode.com/task/out-of-distribution-detection/) - [Outlier Detection](https://paperswithcode.com/task/outlier-detection/) - [Density Estimation](https://paperswithcode.com/task/density-estimation/) Good Luck and Have Fun! =)