# Installation

* Install all dependencies via pip:

    ```shell
    pip3 install -r ./DMSR/environment.yaml
    ```

# Dataset

## Use  Existing Dataset
The link to the ID datasets:
* CIFAR10: [link](#)
* CIFAR100: [link](#)
* CelebA: [link](#)

The link to the OOD datasets:

* SVHN: [link](#)
* NotMNIST: [link](#)
* LSUN: [link](#)
* LSUN-R: [link](#)
* MNISIT: [link](#)
* KMISIST: [link](#)
* FMISIST: [link](#)
* Omniglot: [link](#)
* iNaturalist: [link](#)
* Textures: [link](#)
* places365: [link](#)
* SUN: [link](#)

The Data path is: ./data,and you need to create it.

# Pretraining model:

Multi-layer features are extracted under./premodel
eg: efficientNet , Resnet 

# LFDNM model:
The ./LFDNM contains the components of the LFDN(Latent Feature Diffusion NetWork)

./models.py loads the trained LFDN

# Train Our Method:
python3 ./DMSR/main_LFDN.py --opt --batch_size  --config   --data_path
  
# Test Our Method 
Test with Predefined Configuration

Use the command:

python3 ./DMSR/test_MFsim.py --opt  --batch_size --data_path --LFDN_model_cfg   --pretrained_LFDN_cfg  

python3 ./DMSR/test_mse.py --opt --batch_size --data_path  --LFDN_model_cfg   --pretrained_LFDN_cfg  
