A C++/CUDA neural network trained on fragrance data to predict gender and main accord from perfume notes and accords.
Download the dataset from Kaggle and place it in a datasets/ directory at the project root:
Dataset: Fragrantica Fragrance Dataset
fragNN/
└── datasets/
└── fra_cleaned.csv
Run the preprocessing script before building:
cd datasets/
python3 ../preprocess.pyThis will generate train.csv, test.csv, note_vocab.txt, and accord_vocab.txt inside data/.
cmake -B .build
cmake --build .buildOr use the run script:
./runfragNN/
├── data/ # generated by preprocess.py — do not edit manually
├── datasets/ # place fra_cleaned.csv here
├── python/
│ ├── preprocess.py # data preprocessing
│ ├── metrics.py # WIP — ROC/precision visualization
│ └── post_nn_views.py # WIP — results display
├── src/
│ ├── headers/
│ │ ├── dataloader.hpp
│ │ └── nn.hpp
│ ├── dataloader.cpp
│ └── nn.cpp
├── cuda/
│ ├── kernel.cuh # master header — enum + includes all sub-headers
│ ├── headers/
│ │ ├── activations.cuh # __device__ activation functions
│ │ ├── backprop.cuh # backward pass kernels
│ │ ├── fwd.cuh # forward pass kernels
│ │ ├── init.cuh # initialization kernels
│ │ ├── loss.cuh # __device__ loss functions
│ │ ├── metrics.cuh # metrics structs + router
│ │ ├── nn.cuh # NeuralNetwork class declaration
│ │ └── utils.cuh # optimizer/utility kernels
│ ├── activations.cu
│ ├── backprop.cu
│ ├── fwd.cu
│ ├── init.cu
│ ├── loss.cu
│ ├── metrics.cu
│ ├── nn.cu
│ └── utils.cu
├── utils/
│ ├── embellish.cuh # terminal aesthetics (colors, separators)
│ └── embellish.cu
├── main.cpp
├── preprocess.py
├── CMakeLists.txt
├── README.md
└── NN.md # architecture docs & dictionary
- CUDA-capable GPU (tested on RTX 2050)
- CUDA Toolkit
- CMake >= 3.24
- C++17
python/metrics.py— ROC/precision/recall visualization from CSVpython/post_nn_views.py— results display- Web interface: images, note pyramids...
- When to use: 'morning', 'office', 'date', 'home'...