NOSE—Neural-Olfactory-Sensing-and-Evaluation

1 minute read

Published:

NOSE: Neural Olfactory Sensing and Evaluation

Repository for Introduction to Machine Learning Course Project, 2025 Spring.

This project provides code for neural-based olfactory (smell) sensing and evaluation using various machine learning models.


Folder Structure

train/

Contains scripts for model training and experiments:

utils/

Helper functions, dataset preparation, and visualization:

custom_utils/

Custom utilities for argument parsing, data handling, encoding, and configuration:

(For the full file listing, see the custom_utils folder here.)


How to Run

  1. Install Requirements

    The environment for this project can be quite tricky. We encourage you follow the exact steps of IBM’s MoLFormer repository to set up the environment. You can find the instructions here

    Warning: The environment includes apex, which may fail in certain CUDA versions. If you encounter issues, try using a different CUDA version or change the optimization method to Adam in the training scripts.

  2. Prepare Datasets

    We use the curated GS-LF dataset. You can download it from here.

    For the Keller-2016 dataset used as test set, you can download it from here. We also add an extra binarization step to the dataset.

  3. Train Models

    Before running the training scripts, ensure you have the datasets prepared and placed in the correct directories. You will also need to download the MoLFormer_Pretrained model from here Notice that the checkpoint files are vital for your fine-tuning process. Make sure to have them before you run the training scripts.

    For fine-tuning specific models:

    python train/finetune_multitask.py
    python train/fine-tuned\ MolFormer.py
    

    For training classification or regression models:

     python train/classification.py
     python train/regression.py
    
  4. Customize Arguments and Hyperparameters

    • Edit YAML config in custom_utils/hparams.yaml for hyperparameters.
    • Use scripts in custom_utils/args.py or custom_utils/args_finetune.py for advanced argument parsing.