This is the Source code repository for IMWUT paper: Probing Sucrose Contents in Everyday Drinks Using Miniaturized Near-Infrared Spectroscopy Scanners (IMWUT)
We show a generic and mobile method to estimate concentration level for a specific ingredient in a solution (e.g., sugar concentration in soft-drinks), identify liquids (e.g., discriminate different drinks or alcohols), or even detect counterfeit liquids (e.g., detect counterfeit perfume or alcohols), etc.
-
Hardware schemetics.
-
Python library with source code for NIRScan Nano that works for Linux, Mac and Raspberry Pi.
-
Example Python code for training regression models.
-
Example Python code for training classification models.
Hardware
- Texas Instruments NIRScan Nano.
- Makerbot Replicator Z18 or equivalent (recommended to use a 3D printing service for minimal cost).
(Optional for standalone mode)
- Raspberry Pi A+.
- Adafruit 2.8-inch PiTFT.
- Li-Po battery.
- PowerBoost 1000C or equivalent.
For compiling the Python library
Please refer to this repository.
For running the Python scripts
- Python3
- Numpy
- Matplotlib
- Seaborn
- Scikit-learn
- Pandas
- Jupyter Notebook or Jupyter Lab (recommended)
- In your console, using the cd command to change your current path to this repository.
- Run jupyter notebook or jupyter lab.
- In Jupyter open the quick_start.ipynb file.
- Execute the cells to train/test/export your models using your data.
- Assemble the device as shown in the paper.
- Copy the src/standalone/ folder to Raspberry Pi.
- Copy your sklearn model file into standalone/model/regressor/ folder for regression tasks, or standalone/model/classifier for classification tasks.
- Run the main.py script.
- Follow the protocol and collect your data as described in the paper.
- Controlling the optical path is the key when you re-design a 3D-print case for your application.
- Calibrition may be critical to aqcuire consistent results across different conditions.
- Try different filtering methods.
- Keep calm and cite my paper ;-)
Please send me an email if you have any question.
weiweijiangcn[at]gmail.com