raman-data 0.2.3__tar.gz → 0.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. {raman_data-0.2.3 → raman_data-0.3.4}/.github/workflows/ci.yml +1 -1
  2. {raman_data-0.2.3 → raman_data-0.3.4}/.gitignore +1 -0
  3. raman_data-0.3.4/PKG-INFO +320 -0
  4. raman_data-0.3.4/README.md +285 -0
  5. raman_data-0.3.4/examples/example_all.py +46 -0
  6. raman_data-0.3.4/examples/example_single.py +14 -0
  7. {raman_data-0.2.3 → raman_data-0.3.4}/examples/utils.py +16 -7
  8. {raman_data-0.2.3 → raman_data-0.3.4}/pyproject.toml +4 -0
  9. {raman_data-0.2.3 → raman_data-0.3.4}/raman_data/__init__.py +11 -5
  10. {raman_data-0.2.3 → raman_data-0.3.4}/raman_data/datasets.py +45 -9
  11. raman_data-0.3.4/raman_data/loaders/FigshareLoader.py +137 -0
  12. raman_data-0.3.4/raman_data/loaders/GitHubLoader.py +238 -0
  13. raman_data-0.3.4/raman_data/loaders/GoogleDriveLoader.py +187 -0
  14. raman_data-0.3.4/raman_data/loaders/HuggingFaceLoader.py +388 -0
  15. raman_data-0.3.4/raman_data/loaders/KaggleLoader.py +364 -0
  16. {raman_data-0.2.3 → raman_data-0.3.4}/raman_data/loaders/LoaderTools.py +48 -17
  17. raman_data-0.3.4/raman_data/loaders/MiscLoader.py +724 -0
  18. raman_data-0.3.4/raman_data/loaders/RWTHLoader.py +587 -0
  19. {raman_data-0.2.3 → raman_data-0.3.4}/raman_data/loaders/ZenodoLoader.py +84 -101
  20. {raman_data-0.2.3 → raman_data-0.3.4}/raman_data/loaders/__init__.py +11 -2
  21. {raman_data-0.2.3 → raman_data-0.3.4}/raman_data/loaders/helper/__init__.py +1 -5
  22. raman_data-0.3.4/raman_data/loaders/helper/rruff.py +76 -0
  23. raman_data-0.3.4/raman_data/loaders/utils.py +20 -0
  24. {raman_data-0.2.3 → raman_data-0.3.4}/raman_data/types.py +116 -48
  25. raman_data-0.3.4/raman_data.egg-info/PKG-INFO +320 -0
  26. {raman_data-0.2.3 → raman_data-0.3.4}/raman_data.egg-info/SOURCES.txt +4 -4
  27. raman_data-0.3.4/raman_data.egg-info/requires.txt +19 -0
  28. raman_data-0.3.4/requirements.txt +16 -0
  29. {raman_data-0.2.3 → raman_data-0.3.4}/scripts/generate_readme_datasets.py +14 -23
  30. {raman_data-0.2.3 → raman_data-0.3.4}/tests/test_loaders.py +31 -9
  31. {raman_data-0.2.3 → raman_data-0.3.4}/tests/test_raman_data.py +12 -16
  32. raman_data-0.2.3/PKG-INFO +0 -285
  33. raman_data-0.2.3/README.md +0 -227
  34. raman_data-0.2.3/examples/example_all.py +0 -38
  35. raman_data-0.2.3/examples/example_single.py +0 -7
  36. raman_data-0.2.3/raman_data/loaders/HuggingFaceLoader.py +0 -227
  37. raman_data-0.2.3/raman_data/loaders/KaggleLoader.py +0 -416
  38. raman_data-0.2.3/raman_data/loaders/MiscLoader.py +0 -783
  39. raman_data-0.2.3/raman_data/loaders/ZipLoader.py +0 -215
  40. raman_data-0.2.3/raman_data/loaders/helper/bacteria.py +0 -148
  41. raman_data-0.2.3/raman_data/loaders/helper/organic.py +0 -44
  42. raman_data-0.2.3/raman_data/loaders/helper/prepare_data.py +0 -528
  43. raman_data-0.2.3/raman_data/loaders/helper/rruff.py +0 -554
  44. raman_data-0.2.3/raman_data/loaders/utils.py +0 -9
  45. raman_data-0.2.3/raman_data.egg-info/PKG-INFO +0 -285
  46. raman_data-0.2.3/raman_data.egg-info/requires.txt +0 -42
  47. raman_data-0.2.3/requirements.txt +0 -39
  48. {raman_data-0.2.3 → raman_data-0.3.4}/.idea/.gitignore +0 -0
  49. {raman_data-0.2.3 → raman_data-0.3.4}/LICENSE +0 -0
  50. {raman_data-0.2.3 → raman_data-0.3.4}/examples/demo.ipynb +0 -0
  51. {raman_data-0.2.3 → raman_data-0.3.4}/raman_data/exceptions.py +0 -0
  52. {raman_data-0.2.3 → raman_data-0.3.4}/raman_data/loaders/BaseLoader.py +0 -0
  53. {raman_data-0.2.3 → raman_data-0.3.4}/raman_data.egg-info/dependency_links.txt +0 -0
  54. {raman_data-0.2.3 → raman_data-0.3.4}/raman_data.egg-info/top_level.txt +0 -0
  55. {raman_data-0.2.3 → raman_data-0.3.4}/setup.cfg +0 -0
  56. {raman_data-0.2.3 → raman_data-0.3.4}/tests/test_readme_datasets.py +0 -0
@@ -12,7 +12,7 @@ jobs:
12
12
  runs-on: ubuntu-latest
13
13
  strategy:
14
14
  matrix:
15
- python-version: ["3.11", "3.12", "3.13"]
15
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
16
16
 
17
17
  steps:
18
18
  - uses: actions/checkout@v4
@@ -208,3 +208,4 @@ __marimo__/
208
208
 
209
209
  # IDE
210
210
  .idea/
211
+ /examples/plots/
@@ -0,0 +1,320 @@
1
+ Metadata-Version: 2.4
2
+ Name: raman-data
3
+ Version: 0.3.4
4
+ Summary: A unified Python package for accessing various Raman spectroscopy datasets.
5
+ Author-email: Mario Koddenbrock <mario.koddenbrock@htw-berlin.de>, Oskar Fulde <Oskar.Fulde@Student.HTW-Berlin.de>, Robert Koch <Robert.Koch@Student.HTW-Berlin.de>
6
+ Project-URL: Homepage, https://github.com/ml-lab-htw/raman_data
7
+ Project-URL: Bug Tracker, https://github.com/ml-lab-htw/raman_data/issues
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Topic :: Scientific/Engineering
13
+ Requires-Python: >=3.10
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: cachetools>=5.0.0
17
+ Requires-Dist: datasets>=3.0.0
18
+ Requires-Dist: h5py>=3.10.0
19
+ Requires-Dist: huggingface-hub>=0.20.0
20
+ Requires-Dist: kagglehub>=0.3.0
21
+ Requires-Dist: numpy>=1.26.4
22
+ Requires-Dist: openpyxl>=3.1.0
23
+ Requires-Dist: pandas>=2.1.0
24
+ Requires-Dist: pyarrow>=15.0.0
25
+ Requires-Dist: PyYAML>=6.0
26
+ Requires-Dist: requests>=2.31.0
27
+ Requires-Dist: scipy>=1.13.1
28
+ Requires-Dist: tqdm>=4.66.0
29
+ Requires-Dist: zenodo-get>=3.0.0
30
+ Requires-Dist: spectrochempy>=0.8.0
31
+ Requires-Dist: gdown>=5.2.1
32
+ Provides-Extra: test
33
+ Requires-Dist: pytest; extra == "test"
34
+ Dynamic: license-file
35
+
36
+ # Raman-Data: A Unified Python Library for Raman Spectroscopy Datasets
37
+
38
+ [![PyPI version](https://badge.fury.io/py/raman-data.svg)](https://pypi.org/project/raman-data/)
39
+ [![GitHub](https://img.shields.io/github/license/ml-lab-htw/raman_data)](https://github.com/ml-lab-htw/raman_data/blob/main/LICENSE)
40
+
41
+ This project aims to create a unified Python package for accessing various Raman spectroscopy datasets. The goal is to provide a simple and consistent API to load data from different sources like Kaggle, Hugging Face, GitHub, and Zenodo. This will be beneficial for the Raman spectroscopy community, enabling easier evaluation of models, such as foundation models for Raman spectroscopy.
42
+
43
+ ## ✨ Features
44
+
45
+ - A single, easy-to-use Python package available on [PyPI](https://pypi.org/project/raman-data/).
46
+ - Automatic downloading and caching of datasets from their original sources.
47
+ - A unified data format for all datasets.
48
+ - A simple function to list available datasets, with filtering options.
49
+ - Datasets are annotated with an **application domain** (`APPLICATION_TYPE`) for easy filtering:
50
+ - `MaterialScience` -- mineral identification, pigment libraries
51
+ - `Biological` -- bioprocess monitoring, fermentation, agricultural phenotyping
52
+ - `Medical` -- clinical diagnostics, pathogen identification, disease screening
53
+ - `Chemical` -- fuel analysis, chemical quantification, polymer characterisation
54
+
55
+ ## 📦 Installation
56
+
57
+ Install directly from PyPI:
58
+
59
+ ```bash
60
+ pip install raman-data
61
+ ```
62
+
63
+ Or install from source:
64
+
65
+ ```bash
66
+ # Clone the repository
67
+ git clone https://github.com/ml-lab-htw/raman_data.git
68
+ cd raman_data
69
+
70
+ # Install the package
71
+ pip install -e .
72
+ ```
73
+
74
+ **Note:** For Kaggle datasets, you need to configure your Kaggle API credentials. See [Kaggle API documentation](https://www.kaggle.com/docs/api) for details.
75
+
76
+ ## 🚀 Getting Started
77
+
78
+ The basic interface for the package is defined in `raman_data/__init__.py`. Here's a preview of how it works:
79
+
80
+ ```python
81
+ from raman_data import raman_data
82
+ # To specify a task type or application domain, import these enums as well
83
+ from raman_data import TASK_TYPE, APPLICATION_TYPE
84
+
85
+ # List all available datasets
86
+ print(raman_data())
87
+
88
+ # List only classification datasets
89
+ print(raman_data(task_type=TASK_TYPE.Classification))
90
+
91
+ # List only medical datasets
92
+ print(raman_data(application_type=APPLICATION_TYPE.Medical))
93
+
94
+ # Combine filters: only medical classification datasets
95
+ print(raman_data(task_type=TASK_TYPE.Classification, application_type=APPLICATION_TYPE.Medical))
96
+
97
+ # Load a dataset by name
98
+ dataset = raman_data(dataset_name="codina_diabetes_AGEs")
99
+
100
+ # Access the spectra (intensity data), raman_shifts (wavenumbers), targets, and metadata
101
+ spectra = dataset.spectra # 2D array: (n_samples, n_wavenumbers)
102
+ raman_shifts = dataset.raman_shifts # 1D array: wavenumber values in cm⁻¹
103
+ targets = dataset.targets # Target labels or values
104
+ metadata = dataset.metadata # Dataset metadata (source, paper, description)
105
+
106
+ print(f"Number of spectra: {dataset.n_spectra}")
107
+ print(f"Raman shift range: {dataset.min_shift} - {dataset.max_shift} cm⁻¹")
108
+ print(metadata)
109
+ ```
110
+
111
+ For more detailed examples see [Demo Notebook](examples/demo.ipynb) or [Demo Script](examples/example_all.py).
112
+
113
+ <!-- DATASETS_TABLE_START -->
114
+ <!-- AUTO-GENERATED: START - datasets table. Do not edit manually. -->
115
+
116
+ | Dataset Name | Application | Task Type | Description |
117
+ |--------------|-------------|-----------|-------------|
118
+ | `acid_species_acetic` | Chemical | Regression | Raman spectra and composition data for titration experiments of various acids in aqueous solution. Includes acetic, citric, formic, itaconic, levulinic, oxalic, and succinic acids. Data for concentration monitoring and indirect hard modeling. |
119
+ | `acid_species_citric` | Chemical | Regression | Raman spectra and composition data for titration experiments of various acids in aqueous solution. Includes acetic, citric, formic, itaconic, levulinic, oxalic, and succinic acids. Data for concentration monitoring and indirect hard modeling. |
120
+ | `acid_species_formic` | Chemical | Regression | Raman spectra and composition data for titration experiments of various acids in aqueous solution. Includes acetic, citric, formic, itaconic, levulinic, oxalic, and succinic acids. Data for concentration monitoring and indirect hard modeling. |
121
+ | `acid_species_itaconic` | Chemical | Regression | Raman spectra and composition data for titration experiments of various acids in aqueous solution. Includes acetic, citric, formic, itaconic, levulinic, oxalic, and succinic acids. Data for concentration monitoring and indirect hard modeling. |
122
+ | `acid_species_levulinic` | Chemical | Regression | Raman spectra and composition data for titration experiments of various acids in aqueous solution. Includes acetic, citric, formic, itaconic, levulinic, oxalic, and succinic acids. Data for concentration monitoring and indirect hard modeling. |
123
+ | `acid_species_succinic` | Chemical | Regression | Raman spectra and composition data for titration experiments of various acids in aqueous solution. Includes acetic, citric, formic, itaconic, levulinic, oxalic, and succinic acids. Data for concentration monitoring and indirect hard modeling. |
124
+ | `adenine_colloidal_gold` | Chemical | Regression | Quantitative SERS spectra of adenine measured using colloidal gold substrates across 15 different European laboratories. Benchmarks model reproducibility and inter-instrumental variability. |
125
+ | `adenine_colloidal_silver` | Chemical | Regression | Quantitative SERS spectra of adenine measured using colloidal silver substrates across 15 different European laboratories. Benchmarks model reproducibility and inter-instrumental variability. |
126
+ | `adenine_solid_gold` | Chemical | Regression | Quantitative SERS spectra of adenine measured using solid gold substrates across 15 different European laboratories. Benchmarks model reproducibility and inter-instrumental variability. |
127
+ | `adenine_solid_silver` | Chemical | Regression | Quantitative SERS spectra of adenine measured using solid silver substrates across 15 different European laboratories. Benchmarks model reproducibility and inter-instrumental variability. |
128
+ | `alzheimer` | Medical | Classification | Raman spectra from dried saliva drops targeting Alzheimer's Disease (PD) vs. healthy controls. Reveals hidden trends in proteins, lipids, and saccharides for early detection of cognitive and motor impairment. |
129
+ | `amino_acids_glycine` | Chemical | Regression | Time-resolved (on-line) Raman spectra for Glycine elution using a vertical flow LC-Raman method. Features 785 nm excitation and 0.2s exposure frames to benchmark label-free analyte detection. |
130
+ | `amino_acids_leucine` | Chemical | Regression | Time-resolved (on-line) Raman spectra for Leucine elution using a vertical flow LC-Raman method. Features 785 nm excitation and 0.2s exposure frames to benchmark label-free analyte detection. |
131
+ | `amino_acids_phenylalanine` | Chemical | Regression | Time-resolved (on-line) Raman spectra for Phenylalanine elution using a vertical flow LC-Raman method. Features 785 nm excitation and 0.2s exposure frames to benchmark label-free analyte detection. |
132
+ | `amino_acids_tryptophan` | Chemical | Regression | Time-resolved (on-line) Raman spectra for Tryptophan elution using a vertical flow LC-Raman method. Features 785 nm excitation and 0.2s exposure frames to benchmark label-free analyte detection. |
133
+ | `bacteria_identification` | Medical | Classification | 60,000 spectra from 30 clinically relevant bacterial and yeast isolates (including an MRSA/MSSA isogenic pair). Acquired with 633 nm illumination on gold-coated silica substrates with low SNR to simulate rapid clinical acquisition times. |
134
+ | `bioprocess_substrates` | Biological | Regression | A benchmark dataset of 6,960 spectra featuring eight key metabolites (glucose, glycerol, acetate, etc.) sampled via a statistically independent uniform distribution. Designed to evaluate regression robustness against common bioprocess correlations, including background effects from mineral salts and |
135
+ | `cancer_cell_(cooh)2` | Biological | Classification | SERS spectra of cancer cell metabolites collected on gold nanourchins functionalized with the (COOH)2 moiety. Designed to provide specificity toward specific proteins and lipids for cell line identification. |
136
+ | `cancer_cell_cooh` | Biological | Classification | SERS spectra of cancer cell metabolites collected on gold nanourchins functionalized with the COOH moiety. Designed to provide specificity toward specific proteins and lipids for cell line identification. |
137
+ | `cancer_cell_nh2` | Biological | Classification | SERS spectra of cancer cell metabolites collected on gold nanourchins functionalized with the NH2 moiety. Designed to provide specificity toward specific proteins and lipids for cell line identification. |
138
+ | `covid19_salvia` | Medical | Classification | Curated for non-invasive SARS-CoV-2 screening. Includes ~25 spectral replicates per subject from 101 patients (positive, negative symptomatic, and healthy controls) acquired from dried saliva drops using a 785 nm spectrometer. |
139
+ | `covid19_serum` | Medical | Classification | This study proposed the diagnosis of COVID-19 by means of Raman spectroscopy. Samples of blood serum from 10 patients positive and 10 patients negative for COVID-19 by RT-PCR RNA and ELISA tests were analyzed. |
140
+ | `diabetes_skin_ages` | Medical | Classification | Part of the Diabetes Skin Raman Dataset. This subset focuses on Advanced Glycation End-products (AGEs) signatures in the skin. Data acquired in vivo using a portable 785 nm Raman spectrometer to discern between diabetic patients and healthy controls. |
141
+ | `diabetes_skin_ear_lobe` | Medical | Classification | Part of the Diabetes Skin Raman Dataset. This subset focuses on Advanced Glycation End-products (Ear Lobe) signatures in the skin. Data acquired in vivo using a portable 785 nm Raman spectrometer to discern between diabetic patients and healthy controls. |
142
+ | `diabetes_skin_inner_arm` | Medical | Classification | Part of the Diabetes Skin Raman Dataset. This subset focuses on Advanced Glycation End-products (Inner Arm) signatures in the skin. Data acquired in vivo using a portable 785 nm Raman spectrometer to discern between diabetic patients and healthy controls. |
143
+ | `diabetes_skin_thumbnail` | Medical | Classification | Part of the Diabetes Skin Raman Dataset. This subset focuses on Advanced Glycation End-products (Thumbnail) signatures in the skin. Data acquired in vivo using a portable 785 nm Raman spectrometer to discern between diabetic patients and healthy controls. |
144
+ | `diabetes_skin_vein` | Medical | Classification | Part of the Diabetes Skin Raman Dataset. This subset focuses on Advanced Glycation End-products (Vein) signatures in the skin. Data acquired in vivo using a portable 785 nm Raman spectrometer to discern between diabetic patients and healthy controls. |
145
+ | `ecoli_fermentation` | Biological | Regression | Spectra captured during batch and fed-batch fermentation of E. coli. Measurements were performed on the supernatant using a 785 nm spectrometer to track glucose and acetate concentrations in a dynamic, high-throughput bioprocess environment. |
146
+ | `flow_microgel_synthesis` | Chemical | Regression | This data set contains in-line Raman spectroscopy measurements and predicted microgel sizes from Dynamic Light Scattering (DLS).The Raman spectroscopy measurements were conducted inside a customized measurement cell for monitoring in a tubular flow reactor.Inside the flow reactor, the microgel synth |
147
+ | `fuel_benchtop` | Chemical | Regression | Raman spectra from 179 commercial gasoline samples recorded using a benchtop 1064 nm FT-Raman system. Targets include Research Octane Number (RON), Motor Octane Number (MON), and oxygenated additive concentrations. |
148
+ | `fuel_handheld` | Chemical | Regression | Counterpart to the benchtop fuel dataset, acquired from the same 179 samples using a handheld 785 nm spectrometer. Used for benchmarking model transferability across different hardware and wavelengths. |
149
+ | `microgel_size_lf_fingerprint` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: Linear Fit, spectral range: FingerPrint. Task: predict particle diameter from Raman spectrum. |
150
+ | `microgel_size_lf_global` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: Linear Fit, spectral range: Global. Task: predict particle diameter from Raman spectrum. |
151
+ | `microgel_size_mm_lf_fingerprint` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: MinMax + Linear Fit, spectral range: FingerPrint. Task: predict particle diameter from Raman spectrum. |
152
+ | `microgel_size_mm_lf_global` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: MinMax + Linear Fit, spectral range: Global. Task: predict particle diameter from Raman spectrum. |
153
+ | `microgel_size_mm_rb_fingerprint` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: MinMax + Rubber Band, spectral range: FingerPrint. Task: predict particle diameter from Raman spectrum. |
154
+ | `microgel_size_mm_rb_global` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: MinMax + Rubber Band, spectral range: Global. Task: predict particle diameter from Raman spectrum. |
155
+ | `microgel_size_raw_fingerprint` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: Raw, spectral range: FingerPrint. Task: predict particle diameter from Raman spectrum. |
156
+ | `microgel_size_raw_global` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: Raw, spectral range: Global. Task: predict particle diameter from Raman spectrum. |
157
+ | `microgel_size_rb_fingerprint` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: Rubber Band, spectral range: FingerPrint. Task: predict particle diameter from Raman spectrum. |
158
+ | `microgel_size_rb_global` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: Rubber Band, spectral range: Global. Task: predict particle diameter from Raman spectrum. |
159
+ | `microgel_size_snv_lf_fingerprint` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: SNV + Linear Fit, spectral range: FingerPrint. Task: predict particle diameter from Raman spectrum. |
160
+ | `microgel_size_snv_lf_global` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: SNV + Linear Fit, spectral range: Global. Task: predict particle diameter from Raman spectrum. |
161
+ | `microgel_size_snv_rb_fingerprint` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: SNV + Rubber Band, spectral range: FingerPrint. Task: predict particle diameter from Raman spectrum. |
162
+ | `microgel_size_snv_rb_global` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: SNV + Rubber Band, spectral range: Global. Task: predict particle diameter from Raman spectrum. |
163
+ | `microgel_synthesis` | Chemical | Regression | This data set contains in-line Raman spectroscopy measurements inside a customized measurement cell for monitoring in a tubular flow reactor. The setup aims at monitoring the microgel synthesis in a flow reactor while aiming at a high measurement precision. The measurements include a systematic accu |
164
+ | `organic_compounds_preprocess` | Chemical | Classification | Preprocess Raman spectra of organic compounds collected with several different excitation sources. Designed to benchmark transfer learning and domain adaptation for chemical identification with limited data. |
165
+ | `organic_compounds_raw` | Chemical | Classification | Raw Raman spectra of organic compounds collected with several different excitation sources. Designed to benchmark transfer learning and domain adaptation for chemical identification with limited data. |
166
+ | `parkinson` | Medical | Classification | Raman spectra from dried saliva drops targeting Parkinson's Disease (PD) vs. healthy controls. Reveals hidden trends in proteins, lipids, and saccharides for early detection of cognitive and motor impairment. |
167
+ | `pharmaceutical_ingredients` | Medical | Classification | A Raman spectral dataset comprising 3,510 spectra from 32 chemical substances. This dataset includes organic solvents and reagents commonly used in API development, along with information regarding the products in the XLSX, and code to visualise and perform technical validation on the data. |
168
+ | `ralstonia_fermentations` | Biological | Regression | Monitoring of P(HB-co-HHx) copolymer synthesis in Ralstonia eutropha batch cultivations. Includes a hybrid mix of experimental and high-fidelity synthetic data to handle high multicollinearity between process variables. |
169
+ | `rruff_mineral_preprocess` | MaterialScience | Classification | Comprehensive resource of raw Raman spectra for over 1,000 mineral species, representing a diverse array of crystallographic structures and chemical compositions measured under varying experimental conditions (e.g., 532 nm and 785 nm). |
170
+ | `rruff_mineral_raw` | MaterialScience | Classification | Comprehensive resource of raw Raman spectra for over 1,000 mineral species, representing a diverse array of crystallographic structures and chemical compositions measured under varying experimental conditions (e.g., 532 nm and 785 nm). |
171
+ | `sugar_mixtures_high_snr` | Chemical | Regression | The high signal-to-noise ratio subset of the Sugar Mixtures benchmark (7,680 measurements at 0.5 s integration). Used for evaluating the noise-robustness of hyperspectral unmixing and quantification algorithms. |
172
+ | `sugar_mixtures_low_snr` | Chemical | Regression | The low signal-to-noise ratio subset of the Sugar Mixtures benchmark (7,680 measurements at 0.5 s integration). Used for evaluating the noise-robustness of hyperspectral unmixing and quantification algorithms. |
173
+ | `wheat_lines` | Biological | Classification | Raman spectra from the 7th generation of salt-stress-tolerant wheat mutant lines and their commercial cultivars. Features 785 nm excitation and tracks biochemical shifts in carotenoids and protein-related bands for agricultural phenotyping. |
174
+ | `yeast_fermentation` | Biological | Regression | This dataset contains Raman spectra acquired during the continuous ethanolic fermentation of sucrose using Saccharomyces cerevisiae (Baker's yeast). To facilitate continuous processing and high-quality optical measurements, the yeast cells were immobilized in calcium alginate beads. |
175
+
176
+ <!-- AUTO-GENERATED: END - datasets table. -->
177
+ <!-- DATASETS_TABLE_END -->
178
+
179
+ ## 📊 RamanDataset Class
180
+
181
+ Each loaded dataset returns a `RamanDataset` object with the following attributes and properties:
182
+
183
+ | Attribute/Property | Type | Description |
184
+ |-------------------|------|-------------|
185
+ | `spectra` | `np.ndarray` | Raman spectra intensity data (2D: samples × wavenumbers, or 2D/object array if variable) |
186
+ | `raman_shifts` | `np.ndarray` | Wavenumber/Raman shift values in cm⁻¹ (1D array, or 2D/object array if variable) |
187
+ | `targets` | `np.ndarray` | Target labels (classification) or values (regression) |
188
+ | `metadata` | `dict` | Dataset metadata including source, paper, and description |
189
+ | `name` | `str` | Name of the dataset |
190
+ | `task_type` | `TASK_TYPE` | Classification or Regression |
191
+ | `application_type` | `APPLICATION_TYPE` | Application domain (MaterialScience, Biological, Medical, Chemical) |
192
+ | `n_spectra` | `int` | Number of spectra in the dataset |
193
+ | `n_frequencies` | `int` | Number of frequency points per spectrum |
194
+ | `n_raman_shifts` | `int` | Number of Raman shift values |
195
+ | `n_classes` | `int \| None` | Number of classes (classification only) |
196
+ | `class_names` | `list \| None` | Unique class names (classification only) |
197
+ | `target_range` | `tuple \| None` | (min, max) targets values (regression only) |
198
+ | `min_shift` | `float` | Minimum Raman shift value |
199
+ | `max_shift` | `float` | Maximum Raman shift value |
200
+
201
+ **Support for Datasets with Multiple Raman Shifts:**
202
+
203
+ - If all spectra share identical raman_shifts, `raman_shifts` is a 1D array and `spectra` is a 2D array (n_samples × n_points).
204
+ - If all spectra have the same number of points but different raman_shift values, both `raman_shifts` and `spectra` are 2D arrays (n_samples × n_points).
205
+ - If spectra have different numbers of points, both `raman_shifts` and `spectra` are returned as 1D object arrays, where each entry is a 1D array for that sample.
206
+ - This allows the library to support real-world datasets with variable or non-uniform spectral grids.
207
+
208
+ **Note:**
209
+ - Downstream code should check the shape and dtype of `raman_shifts` and `spectra` to handle all cases robustly.
210
+ - For machine learning, it is recommended to interpolate or pad spectra to a common grid if uniformity is required.
211
+
212
+ The dataset can also be converted to a pandas DataFrame:
213
+
214
+ ```python
215
+ # df = dataset.to_dataframe()
216
+ ```
217
+
218
+ ## 🎯 Milestones
219
+
220
+ - [x] View Datasets
221
+ - [x] Software architecture with dummy data
222
+ - [x] Software tests
223
+ - [x] Integration of Kaggle
224
+ - [x] Integration of Huggingface
225
+ - [x] Integration of Github
226
+ - [x] Integration of Zenodo
227
+ - [x] Code documentation (docstrings)
228
+ - [x] Publish to PyPi
229
+ - [ ] Integration of other datasets
230
+ - [ ] API documentation website
231
+
232
+ ## 🚢 Publishing a New Version to PyPI
233
+
234
+ Releases are automated via GitHub Actions. Pushing a version tag triggers the CI pipeline: tests run first, then the package is built and published to PyPI automatically.
235
+
236
+ ```bash
237
+ # 1. Ensure all changes are committed and pushed to main
238
+ git checkout main && git pull
239
+
240
+ # 2. Create and push a version tag (uses setuptools-scm for the version)
241
+ git tag v1.2.3
242
+ git push origin v1.2.3
243
+ ```
244
+
245
+ The tag format must match `v*.*.*` (e.g., `v1.2.3`). Once pushed, the [CI workflow](https://github.com/ml-lab-htw/raman_data/actions) will:
246
+ 1. Run the test suite across Python 3.10–3.13
247
+ 2. Build the distribution packages
248
+ 3. Publish to [PyPI](https://pypi.org/project/raman-data/) using the `PYPI_API_TOKEN` secret configured in the repository settings
249
+
250
+ > **Note:** The `PYPI_API_TOKEN` secret must be set in GitHub → Settings → Secrets and variables → Actions before the first publish.
251
+
252
+ ## 🤝 Contributing
253
+
254
+ Contributions are welcome! To add a new dataset:
255
+
256
+ 1. Choose the appropriate loader based on the data source:
257
+ - `KaggleLoader` for Kaggle datasets
258
+ - `HuggingFaceLoader` for Hugging Face datasets
259
+ - `ZenodoLoader` for Zenodo datasets
260
+ - `ZipLoader` for other URL-based sources
261
+ - `MiscLoader` for datasets that do not fit into the above categories (e.g., DeepeR)
262
+
263
+ 2. Implement a loader function that returns a tuple of `(spectra, raman_shifts, targets)`:
264
+ - `spectra`: 2D numpy array of intensity values (samples × wavenumbers)
265
+ - `raman_shifts`: 1D numpy array of wavenumber values in cm⁻¹
266
+ - `targets`: numpy array of target labels or values
267
+
268
+ 3. Add the dataset to the loader's `DATASETS` dictionary with appropriate metadata.
269
+
270
+ 4. Add tests for the new dataset.
271
+
272
+ ## 🔮 For Later (Future Datasets)
273
+
274
+ ### Remaining / For Later (still not integrated)
275
+ The following items remain to be added (suggested action: add a `DATASETS` entry under the appropriate loader, or add a loader placeholder with the source link):
276
+
277
+ - High-throughput molecular imaging (DeepeR)
278
+ - URL: https://github.com/conor-horgan/DeepeR?tab=readme-ov-file#dataset
279
+ - Suggested loader: `MiscLoader` or `ZipLoader` depending on availability of packaged data
280
+ - Notes: README points to datasets; may require dataset-specific processing
281
+
282
+ - spectrai raman spectra
283
+ - URL: https://github.com/conor-horgan/spectrai
284
+ - Suggested loader: `MiscLoader` / `ZipLoader`
285
+
286
+ - Quantitative volumetric Raman imaging (Zenodo record)
287
+ - URL: https://zenodo.org/records/256329
288
+ - Suggested loader: `ZenodoLoader`
289
+
290
+ - Spectra of illicit adulterants (Mendeley)
291
+ - URL: https://data.mendeley.com/datasets/y4md8znppn/1
292
+ - Suggested loader: `ZipLoader` / `MiscLoader`
293
+
294
+ - Raman spectra of chemical compounds (Springer / figshare)
295
+ - URL: https://springernature.figshare.com/articles/dataset/Open-source_Raman_spectra_of_chemical_compounds_for_active_pharmaceutical_ingredient_development/27931131
296
+ - Suggested loader: `ZipLoader`
297
+
298
+ - Inline Raman Spectroscopy and Indirect Hard Modeling
299
+ - URL: https://publications.rwth-aachen.de/record/978266/files/
300
+ - Suggested loader: `ZipLoader` (file formats may be non-standard)
301
+
302
+ - The Effect of Sulfate Electrolytes on the Liquid-Liquid Equilibrium
303
+ - URL: https://publications.rwth-aachen.de/record/978265/files/
304
+ - Suggested loader: `ZipLoader`
305
+
306
+ - In-line Monitoring of Microgel Synthesis (weird format)
307
+ - URL: https://publications.rwth-aachen.de/record/834113/files/
308
+ - Suggested loader: `ZipLoader` (may require manual preprocessing)
309
+
310
+ - N-isopropylacrylamide Microgel Synthesis
311
+ - URL: https://publications.rwth-aachen.de/record/959050/files/
312
+ - Suggested loader: `ZipLoader`
313
+
314
+ - Nonlinear Manifold Learning Determines Microgel Size from Raman Spectroscopy
315
+ - URL: https://publications.rwth-aachen.de/record/959137
316
+ - Suggested loader: `ZipLoader`
317
+
318
+ - NASA AHEAD dataset
319
+ - URL: https://ahed.nasa.gov/datasets/f5b6051bfeb18c5a7eaef6504582
320
+ - Suggested loader: `ZipLoader` / `MiscLoader`
@@ -0,0 +1,285 @@
1
+ # Raman-Data: A Unified Python Library for Raman Spectroscopy Datasets
2
+
3
+ [![PyPI version](https://badge.fury.io/py/raman-data.svg)](https://pypi.org/project/raman-data/)
4
+ [![GitHub](https://img.shields.io/github/license/ml-lab-htw/raman_data)](https://github.com/ml-lab-htw/raman_data/blob/main/LICENSE)
5
+
6
+ This project aims to create a unified Python package for accessing various Raman spectroscopy datasets. The goal is to provide a simple and consistent API to load data from different sources like Kaggle, Hugging Face, GitHub, and Zenodo. This will be beneficial for the Raman spectroscopy community, enabling easier evaluation of models, such as foundation models for Raman spectroscopy.
7
+
8
+ ## ✨ Features
9
+
10
+ - A single, easy-to-use Python package available on [PyPI](https://pypi.org/project/raman-data/).
11
+ - Automatic downloading and caching of datasets from their original sources.
12
+ - A unified data format for all datasets.
13
+ - A simple function to list available datasets, with filtering options.
14
+ - Datasets are annotated with an **application domain** (`APPLICATION_TYPE`) for easy filtering:
15
+ - `MaterialScience` -- mineral identification, pigment libraries
16
+ - `Biological` -- bioprocess monitoring, fermentation, agricultural phenotyping
17
+ - `Medical` -- clinical diagnostics, pathogen identification, disease screening
18
+ - `Chemical` -- fuel analysis, chemical quantification, polymer characterisation
19
+
20
+ ## 📦 Installation
21
+
22
+ Install directly from PyPI:
23
+
24
+ ```bash
25
+ pip install raman-data
26
+ ```
27
+
28
+ Or install from source:
29
+
30
+ ```bash
31
+ # Clone the repository
32
+ git clone https://github.com/ml-lab-htw/raman_data.git
33
+ cd raman_data
34
+
35
+ # Install the package
36
+ pip install -e .
37
+ ```
38
+
39
+ **Note:** For Kaggle datasets, you need to configure your Kaggle API credentials. See [Kaggle API documentation](https://www.kaggle.com/docs/api) for details.
40
+
41
+ ## 🚀 Getting Started
42
+
43
+ The basic interface for the package is defined in `raman_data/__init__.py`. Here's a preview of how it works:
44
+
45
+ ```python
46
+ from raman_data import raman_data
47
+ # To specify a task type or application domain, import these enums as well
48
+ from raman_data import TASK_TYPE, APPLICATION_TYPE
49
+
50
+ # List all available datasets
51
+ print(raman_data())
52
+
53
+ # List only classification datasets
54
+ print(raman_data(task_type=TASK_TYPE.Classification))
55
+
56
+ # List only medical datasets
57
+ print(raman_data(application_type=APPLICATION_TYPE.Medical))
58
+
59
+ # Combine filters: only medical classification datasets
60
+ print(raman_data(task_type=TASK_TYPE.Classification, application_type=APPLICATION_TYPE.Medical))
61
+
62
+ # Load a dataset by name
63
+ dataset = raman_data(dataset_name="codina_diabetes_AGEs")
64
+
65
+ # Access the spectra (intensity data), raman_shifts (wavenumbers), targets, and metadata
66
+ spectra = dataset.spectra # 2D array: (n_samples, n_wavenumbers)
67
+ raman_shifts = dataset.raman_shifts # 1D array: wavenumber values in cm⁻¹
68
+ targets = dataset.targets # Target labels or values
69
+ metadata = dataset.metadata # Dataset metadata (source, paper, description)
70
+
71
+ print(f"Number of spectra: {dataset.n_spectra}")
72
+ print(f"Raman shift range: {dataset.min_shift} - {dataset.max_shift} cm⁻¹")
73
+ print(metadata)
74
+ ```
75
+
76
+ For more detailed examples see [Demo Notebook](examples/demo.ipynb) or [Demo Script](examples/example_all.py).
77
+
78
+ <!-- DATASETS_TABLE_START -->
79
+ <!-- AUTO-GENERATED: START - datasets table. Do not edit manually. -->
80
+
81
+ | Dataset Name | Application | Task Type | Description |
82
+ |--------------|-------------|-----------|-------------|
83
+ | `acid_species_acetic` | Chemical | Regression | Raman spectra and composition data for titration experiments of various acids in aqueous solution. Includes acetic, citric, formic, itaconic, levulinic, oxalic, and succinic acids. Data for concentration monitoring and indirect hard modeling. |
84
+ | `acid_species_citric` | Chemical | Regression | Raman spectra and composition data for titration experiments of various acids in aqueous solution. Includes acetic, citric, formic, itaconic, levulinic, oxalic, and succinic acids. Data for concentration monitoring and indirect hard modeling. |
85
+ | `acid_species_formic` | Chemical | Regression | Raman spectra and composition data for titration experiments of various acids in aqueous solution. Includes acetic, citric, formic, itaconic, levulinic, oxalic, and succinic acids. Data for concentration monitoring and indirect hard modeling. |
86
+ | `acid_species_itaconic` | Chemical | Regression | Raman spectra and composition data for titration experiments of various acids in aqueous solution. Includes acetic, citric, formic, itaconic, levulinic, oxalic, and succinic acids. Data for concentration monitoring and indirect hard modeling. |
87
+ | `acid_species_levulinic` | Chemical | Regression | Raman spectra and composition data for titration experiments of various acids in aqueous solution. Includes acetic, citric, formic, itaconic, levulinic, oxalic, and succinic acids. Data for concentration monitoring and indirect hard modeling. |
88
+ | `acid_species_succinic` | Chemical | Regression | Raman spectra and composition data for titration experiments of various acids in aqueous solution. Includes acetic, citric, formic, itaconic, levulinic, oxalic, and succinic acids. Data for concentration monitoring and indirect hard modeling. |
89
+ | `adenine_colloidal_gold` | Chemical | Regression | Quantitative SERS spectra of adenine measured using colloidal gold substrates across 15 different European laboratories. Benchmarks model reproducibility and inter-instrumental variability. |
90
+ | `adenine_colloidal_silver` | Chemical | Regression | Quantitative SERS spectra of adenine measured using colloidal silver substrates across 15 different European laboratories. Benchmarks model reproducibility and inter-instrumental variability. |
91
+ | `adenine_solid_gold` | Chemical | Regression | Quantitative SERS spectra of adenine measured using solid gold substrates across 15 different European laboratories. Benchmarks model reproducibility and inter-instrumental variability. |
92
+ | `adenine_solid_silver` | Chemical | Regression | Quantitative SERS spectra of adenine measured using solid silver substrates across 15 different European laboratories. Benchmarks model reproducibility and inter-instrumental variability. |
93
+ | `alzheimer` | Medical | Classification | Raman spectra from dried saliva drops targeting Alzheimer's Disease (PD) vs. healthy controls. Reveals hidden trends in proteins, lipids, and saccharides for early detection of cognitive and motor impairment. |
94
+ | `amino_acids_glycine` | Chemical | Regression | Time-resolved (on-line) Raman spectra for Glycine elution using a vertical flow LC-Raman method. Features 785 nm excitation and 0.2s exposure frames to benchmark label-free analyte detection. |
95
+ | `amino_acids_leucine` | Chemical | Regression | Time-resolved (on-line) Raman spectra for Leucine elution using a vertical flow LC-Raman method. Features 785 nm excitation and 0.2s exposure frames to benchmark label-free analyte detection. |
96
+ | `amino_acids_phenylalanine` | Chemical | Regression | Time-resolved (on-line) Raman spectra for Phenylalanine elution using a vertical flow LC-Raman method. Features 785 nm excitation and 0.2s exposure frames to benchmark label-free analyte detection. |
97
+ | `amino_acids_tryptophan` | Chemical | Regression | Time-resolved (on-line) Raman spectra for Tryptophan elution using a vertical flow LC-Raman method. Features 785 nm excitation and 0.2s exposure frames to benchmark label-free analyte detection. |
98
+ | `bacteria_identification` | Medical | Classification | 60,000 spectra from 30 clinically relevant bacterial and yeast isolates (including an MRSA/MSSA isogenic pair). Acquired with 633 nm illumination on gold-coated silica substrates with low SNR to simulate rapid clinical acquisition times. |
99
+ | `bioprocess_substrates` | Biological | Regression | A benchmark dataset of 6,960 spectra featuring eight key metabolites (glucose, glycerol, acetate, etc.) sampled via a statistically independent uniform distribution. Designed to evaluate regression robustness against common bioprocess correlations, including background effects from mineral salts and |
100
+ | `cancer_cell_(cooh)2` | Biological | Classification | SERS spectra of cancer cell metabolites collected on gold nanourchins functionalized with the (COOH)2 moiety. Designed to provide specificity toward specific proteins and lipids for cell line identification. |
101
+ | `cancer_cell_cooh` | Biological | Classification | SERS spectra of cancer cell metabolites collected on gold nanourchins functionalized with the COOH moiety. Designed to provide specificity toward specific proteins and lipids for cell line identification. |
102
+ | `cancer_cell_nh2` | Biological | Classification | SERS spectra of cancer cell metabolites collected on gold nanourchins functionalized with the NH2 moiety. Designed to provide specificity toward specific proteins and lipids for cell line identification. |
103
+ | `covid19_salvia` | Medical | Classification | Curated for non-invasive SARS-CoV-2 screening. Includes ~25 spectral replicates per subject from 101 patients (positive, negative symptomatic, and healthy controls) acquired from dried saliva drops using a 785 nm spectrometer. |
104
+ | `covid19_serum` | Medical | Classification | This study proposed the diagnosis of COVID-19 by means of Raman spectroscopy. Samples of blood serum from 10 patients positive and 10 patients negative for COVID-19 by RT-PCR RNA and ELISA tests were analyzed. |
105
+ | `diabetes_skin_ages` | Medical | Classification | Part of the Diabetes Skin Raman Dataset. This subset focuses on Advanced Glycation End-products (AGEs) signatures in the skin. Data acquired in vivo using a portable 785 nm Raman spectrometer to discern between diabetic patients and healthy controls. |
106
+ | `diabetes_skin_ear_lobe` | Medical | Classification | Part of the Diabetes Skin Raman Dataset. This subset focuses on Advanced Glycation End-products (Ear Lobe) signatures in the skin. Data acquired in vivo using a portable 785 nm Raman spectrometer to discern between diabetic patients and healthy controls. |
107
+ | `diabetes_skin_inner_arm` | Medical | Classification | Part of the Diabetes Skin Raman Dataset. This subset focuses on Advanced Glycation End-products (Inner Arm) signatures in the skin. Data acquired in vivo using a portable 785 nm Raman spectrometer to discern between diabetic patients and healthy controls. |
108
+ | `diabetes_skin_thumbnail` | Medical | Classification | Part of the Diabetes Skin Raman Dataset. This subset focuses on Advanced Glycation End-products (Thumbnail) signatures in the skin. Data acquired in vivo using a portable 785 nm Raman spectrometer to discern between diabetic patients and healthy controls. |
109
+ | `diabetes_skin_vein` | Medical | Classification | Part of the Diabetes Skin Raman Dataset. This subset focuses on Advanced Glycation End-products (Vein) signatures in the skin. Data acquired in vivo using a portable 785 nm Raman spectrometer to discern between diabetic patients and healthy controls. |
110
+ | `ecoli_fermentation` | Biological | Regression | Spectra captured during batch and fed-batch fermentation of E. coli. Measurements were performed on the supernatant using a 785 nm spectrometer to track glucose and acetate concentrations in a dynamic, high-throughput bioprocess environment. |
111
+ | `flow_microgel_synthesis` | Chemical | Regression | This data set contains in-line Raman spectroscopy measurements and predicted microgel sizes from Dynamic Light Scattering (DLS).The Raman spectroscopy measurements were conducted inside a customized measurement cell for monitoring in a tubular flow reactor.Inside the flow reactor, the microgel synth |
112
+ | `fuel_benchtop` | Chemical | Regression | Raman spectra from 179 commercial gasoline samples recorded using a benchtop 1064 nm FT-Raman system. Targets include Research Octane Number (RON), Motor Octane Number (MON), and oxygenated additive concentrations. |
113
+ | `fuel_handheld` | Chemical | Regression | Counterpart to the benchtop fuel dataset, acquired from the same 179 samples using a handheld 785 nm spectrometer. Used for benchmarking model transferability across different hardware and wavelengths. |
114
+ | `microgel_size_lf_fingerprint` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: Linear Fit, spectral range: FingerPrint. Task: predict particle diameter from Raman spectrum. |
115
+ | `microgel_size_lf_global` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: Linear Fit, spectral range: Global. Task: predict particle diameter from Raman spectrum. |
116
+ | `microgel_size_mm_lf_fingerprint` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: MinMax + Linear Fit, spectral range: FingerPrint. Task: predict particle diameter from Raman spectrum. |
117
+ | `microgel_size_mm_lf_global` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: MinMax + Linear Fit, spectral range: Global. Task: predict particle diameter from Raman spectrum. |
118
+ | `microgel_size_mm_rb_fingerprint` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: MinMax + Rubber Band, spectral range: FingerPrint. Task: predict particle diameter from Raman spectrum. |
119
+ | `microgel_size_mm_rb_global` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: MinMax + Rubber Band, spectral range: Global. Task: predict particle diameter from Raman spectrum. |
120
+ | `microgel_size_raw_fingerprint` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: Raw, spectral range: FingerPrint. Task: predict particle diameter from Raman spectrum. |
121
+ | `microgel_size_raw_global` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: Raw, spectral range: Global. Task: predict particle diameter from Raman spectrum. |
122
+ | `microgel_size_rb_fingerprint` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: Rubber Band, spectral range: FingerPrint. Task: predict particle diameter from Raman spectrum. |
123
+ | `microgel_size_rb_global` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: Rubber Band, spectral range: Global. Task: predict particle diameter from Raman spectrum. |
124
+ | `microgel_size_snv_lf_fingerprint` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: SNV + Linear Fit, spectral range: FingerPrint. Task: predict particle diameter from Raman spectrum. |
125
+ | `microgel_size_snv_lf_global` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: SNV + Linear Fit, spectral range: Global. Task: predict particle diameter from Raman spectrum. |
126
+ | `microgel_size_snv_rb_fingerprint` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: SNV + Rubber Band, spectral range: FingerPrint. Task: predict particle diameter from Raman spectrum. |
127
+ | `microgel_size_snv_rb_global` | Chemical | Regression | Raman spectra of 235 microgel samples with DLS-measured particle diameters (208–483 nm). Pretreatment: SNV + Rubber Band, spectral range: Global. Task: predict particle diameter from Raman spectrum. |
128
+ | `microgel_synthesis` | Chemical | Regression | This data set contains in-line Raman spectroscopy measurements inside a customized measurement cell for monitoring in a tubular flow reactor. The setup aims at monitoring the microgel synthesis in a flow reactor while aiming at a high measurement precision. The measurements include a systematic accu |
129
+ | `organic_compounds_preprocess` | Chemical | Classification | Preprocess Raman spectra of organic compounds collected with several different excitation sources. Designed to benchmark transfer learning and domain adaptation for chemical identification with limited data. |
130
+ | `organic_compounds_raw` | Chemical | Classification | Raw Raman spectra of organic compounds collected with several different excitation sources. Designed to benchmark transfer learning and domain adaptation for chemical identification with limited data. |
131
+ | `parkinson` | Medical | Classification | Raman spectra from dried saliva drops targeting Parkinson's Disease (PD) vs. healthy controls. Reveals hidden trends in proteins, lipids, and saccharides for early detection of cognitive and motor impairment. |
132
+ | `pharmaceutical_ingredients` | Medical | Classification | A Raman spectral dataset comprising 3,510 spectra from 32 chemical substances. This dataset includes organic solvents and reagents commonly used in API development, along with information regarding the products in the XLSX, and code to visualise and perform technical validation on the data. |
133
+ | `ralstonia_fermentations` | Biological | Regression | Monitoring of P(HB-co-HHx) copolymer synthesis in Ralstonia eutropha batch cultivations. Includes a hybrid mix of experimental and high-fidelity synthetic data to handle high multicollinearity between process variables. |
134
+ | `rruff_mineral_preprocess` | MaterialScience | Classification | Comprehensive resource of raw Raman spectra for over 1,000 mineral species, representing a diverse array of crystallographic structures and chemical compositions measured under varying experimental conditions (e.g., 532 nm and 785 nm). |
135
+ | `rruff_mineral_raw` | MaterialScience | Classification | Comprehensive resource of raw Raman spectra for over 1,000 mineral species, representing a diverse array of crystallographic structures and chemical compositions measured under varying experimental conditions (e.g., 532 nm and 785 nm). |
136
+ | `sugar_mixtures_high_snr` | Chemical | Regression | The high signal-to-noise ratio subset of the Sugar Mixtures benchmark (7,680 measurements at 0.5 s integration). Used for evaluating the noise-robustness of hyperspectral unmixing and quantification algorithms. |
137
+ | `sugar_mixtures_low_snr` | Chemical | Regression | The low signal-to-noise ratio subset of the Sugar Mixtures benchmark (7,680 measurements at 0.5 s integration). Used for evaluating the noise-robustness of hyperspectral unmixing and quantification algorithms. |
138
+ | `wheat_lines` | Biological | Classification | Raman spectra from the 7th generation of salt-stress-tolerant wheat mutant lines and their commercial cultivars. Features 785 nm excitation and tracks biochemical shifts in carotenoids and protein-related bands for agricultural phenotyping. |
139
+ | `yeast_fermentation` | Biological | Regression | This dataset contains Raman spectra acquired during the continuous ethanolic fermentation of sucrose using Saccharomyces cerevisiae (Baker's yeast). To facilitate continuous processing and high-quality optical measurements, the yeast cells were immobilized in calcium alginate beads. |
140
+
141
+ <!-- AUTO-GENERATED: END - datasets table. -->
142
+ <!-- DATASETS_TABLE_END -->
143
+
144
+ ## 📊 RamanDataset Class
145
+
146
+ Each loaded dataset returns a `RamanDataset` object with the following attributes and properties:
147
+
148
+ | Attribute/Property | Type | Description |
149
+ |-------------------|------|-------------|
150
+ | `spectra` | `np.ndarray` | Raman spectra intensity data (2D: samples × wavenumbers, or 2D/object array if variable) |
151
+ | `raman_shifts` | `np.ndarray` | Wavenumber/Raman shift values in cm⁻¹ (1D array, or 2D/object array if variable) |
152
+ | `targets` | `np.ndarray` | Target labels (classification) or values (regression) |
153
+ | `metadata` | `dict` | Dataset metadata including source, paper, and description |
154
+ | `name` | `str` | Name of the dataset |
155
+ | `task_type` | `TASK_TYPE` | Classification or Regression |
156
+ | `application_type` | `APPLICATION_TYPE` | Application domain (MaterialScience, Biological, Medical, Chemical) |
157
+ | `n_spectra` | `int` | Number of spectra in the dataset |
158
+ | `n_frequencies` | `int` | Number of frequency points per spectrum |
159
+ | `n_raman_shifts` | `int` | Number of Raman shift values |
160
+ | `n_classes` | `int \| None` | Number of classes (classification only) |
161
+ | `class_names` | `list \| None` | Unique class names (classification only) |
162
+ | `target_range` | `tuple \| None` | (min, max) targets values (regression only) |
163
+ | `min_shift` | `float` | Minimum Raman shift value |
164
+ | `max_shift` | `float` | Maximum Raman shift value |
165
+
166
+ **Support for Datasets with Multiple Raman Shifts:**
167
+
168
+ - If all spectra share identical raman_shifts, `raman_shifts` is a 1D array and `spectra` is a 2D array (n_samples × n_points).
169
+ - If all spectra have the same number of points but different raman_shift values, both `raman_shifts` and `spectra` are 2D arrays (n_samples × n_points).
170
+ - If spectra have different numbers of points, both `raman_shifts` and `spectra` are returned as 1D object arrays, where each entry is a 1D array for that sample.
171
+ - This allows the library to support real-world datasets with variable or non-uniform spectral grids.
172
+
173
+ **Note:**
174
+ - Downstream code should check the shape and dtype of `raman_shifts` and `spectra` to handle all cases robustly.
175
+ - For machine learning, it is recommended to interpolate or pad spectra to a common grid if uniformity is required.
176
+
177
+ The dataset can also be converted to a pandas DataFrame:
178
+
179
+ ```python
180
+ # df = dataset.to_dataframe()
181
+ ```
182
+
183
+ ## 🎯 Milestones
184
+
185
+ - [x] View Datasets
186
+ - [x] Software architecture with dummy data
187
+ - [x] Software tests
188
+ - [x] Integration of Kaggle
189
+ - [x] Integration of Huggingface
190
+ - [x] Integration of Github
191
+ - [x] Integration of Zenodo
192
+ - [x] Code documentation (docstrings)
193
+ - [x] Publish to PyPi
194
+ - [ ] Integration of other datasets
195
+ - [ ] API documentation website
196
+
197
+ ## 🚢 Publishing a New Version to PyPI
198
+
199
+ Releases are automated via GitHub Actions. Pushing a version tag triggers the CI pipeline: tests run first, then the package is built and published to PyPI automatically.
200
+
201
+ ```bash
202
+ # 1. Ensure all changes are committed and pushed to main
203
+ git checkout main && git pull
204
+
205
+ # 2. Create and push a version tag (uses setuptools-scm for the version)
206
+ git tag v1.2.3
207
+ git push origin v1.2.3
208
+ ```
209
+
210
+ The tag format must match `v*.*.*` (e.g., `v1.2.3`). Once pushed, the [CI workflow](https://github.com/ml-lab-htw/raman_data/actions) will:
211
+ 1. Run the test suite across Python 3.10–3.13
212
+ 2. Build the distribution packages
213
+ 3. Publish to [PyPI](https://pypi.org/project/raman-data/) using the `PYPI_API_TOKEN` secret configured in the repository settings
214
+
215
+ > **Note:** The `PYPI_API_TOKEN` secret must be set in GitHub → Settings → Secrets and variables → Actions before the first publish.
216
+
217
+ ## 🤝 Contributing
218
+
219
+ Contributions are welcome! To add a new dataset:
220
+
221
+ 1. Choose the appropriate loader based on the data source:
222
+ - `KaggleLoader` for Kaggle datasets
223
+ - `HuggingFaceLoader` for Hugging Face datasets
224
+ - `ZenodoLoader` for Zenodo datasets
225
+ - `ZipLoader` for other URL-based sources
226
+ - `MiscLoader` for datasets that do not fit into the above categories (e.g., DeepeR)
227
+
228
+ 2. Implement a loader function that returns a tuple of `(spectra, raman_shifts, targets)`:
229
+ - `spectra`: 2D numpy array of intensity values (samples × wavenumbers)
230
+ - `raman_shifts`: 1D numpy array of wavenumber values in cm⁻¹
231
+ - `targets`: numpy array of target labels or values
232
+
233
+ 3. Add the dataset to the loader's `DATASETS` dictionary with appropriate metadata.
234
+
235
+ 4. Add tests for the new dataset.
236
+
237
+ ## 🔮 For Later (Future Datasets)
238
+
239
+ ### Remaining / For Later (still not integrated)
240
+ The following items remain to be added (suggested action: add a `DATASETS` entry under the appropriate loader, or add a loader placeholder with the source link):
241
+
242
+ - High-throughput molecular imaging (DeepeR)
243
+ - URL: https://github.com/conor-horgan/DeepeR?tab=readme-ov-file#dataset
244
+ - Suggested loader: `MiscLoader` or `ZipLoader` depending on availability of packaged data
245
+ - Notes: README points to datasets; may require dataset-specific processing
246
+
247
+ - spectrai raman spectra
248
+ - URL: https://github.com/conor-horgan/spectrai
249
+ - Suggested loader: `MiscLoader` / `ZipLoader`
250
+
251
+ - Quantitative volumetric Raman imaging (Zenodo record)
252
+ - URL: https://zenodo.org/records/256329
253
+ - Suggested loader: `ZenodoLoader`
254
+
255
+ - Spectra of illicit adulterants (Mendeley)
256
+ - URL: https://data.mendeley.com/datasets/y4md8znppn/1
257
+ - Suggested loader: `ZipLoader` / `MiscLoader`
258
+
259
+ - Raman spectra of chemical compounds (Springer / figshare)
260
+ - URL: https://springernature.figshare.com/articles/dataset/Open-source_Raman_spectra_of_chemical_compounds_for_active_pharmaceutical_ingredient_development/27931131
261
+ - Suggested loader: `ZipLoader`
262
+
263
+ - Inline Raman Spectroscopy and Indirect Hard Modeling
264
+ - URL: https://publications.rwth-aachen.de/record/978266/files/
265
+ - Suggested loader: `ZipLoader` (file formats may be non-standard)
266
+
267
+ - The Effect of Sulfate Electrolytes on the Liquid-Liquid Equilibrium
268
+ - URL: https://publications.rwth-aachen.de/record/978265/files/
269
+ - Suggested loader: `ZipLoader`
270
+
271
+ - In-line Monitoring of Microgel Synthesis (weird format)
272
+ - URL: https://publications.rwth-aachen.de/record/834113/files/
273
+ - Suggested loader: `ZipLoader` (may require manual preprocessing)
274
+
275
+ - N-isopropylacrylamide Microgel Synthesis
276
+ - URL: https://publications.rwth-aachen.de/record/959050/files/
277
+ - Suggested loader: `ZipLoader`
278
+
279
+ - Nonlinear Manifold Learning Determines Microgel Size from Raman Spectroscopy
280
+ - URL: https://publications.rwth-aachen.de/record/959137
281
+ - Suggested loader: `ZipLoader`
282
+
283
+ - NASA AHEAD dataset
284
+ - URL: https://ahed.nasa.gov/datasets/f5b6051bfeb18c5a7eaef6504582
285
+ - Suggested loader: `ZipLoader` / `MiscLoader`