devjas1 commited on
Commit
232a935
Β·
1 Parent(s): a08022e

(DOCS)[README]: Update and enhance description to include FTIR support; refine current scope and usage instructions

Browse files
Files changed (1) hide show
  1. README.md +54 -60
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: AI Polymer Classification
3
  emoji: πŸ”¬
4
  colorFrom: indigo
5
  colorTo: yellow
@@ -8,19 +8,21 @@ app_file: app.py
8
  pinned: false
9
  license: apache-2.0
10
  ---
11
- ## AI-Driven Polymer Aging Prediction and Classification (v0.1)
12
 
13
- This web application classifies the degradation state of polymers using Raman spectroscopy and deep learning.
14
 
15
- It was developed as part of the AIRE 2025 internship project at the Imageomics Institute and demonstrates a prototype pipeline for evaluating multiple convolutional neural networks (CNNs) on spectral data.
 
16
 
17
  ---
18
 
19
  ## πŸ§ͺ Current Scope
20
 
21
- - πŸ”¬ **Modality**: Raman spectroscopy (.txt)
22
- - 🧠 **Model**: Figure2CNN (baseline)
 
23
  - πŸ“Š **Task**: Binary classification β€” Stable vs Weathered polymers
 
24
  - πŸ› οΈ **Architecture**: PyTorch + Streamlit
25
 
26
  ---
@@ -29,84 +31,76 @@ It was developed as part of the AIRE 2025 internship project at the Imageomics I
29
 
30
  - [x] Inference from Raman `.txt` files
31
  - [x] Model selection (Figure2CNN, ResNet1D)
 
 
 
32
  - [ ] Add more trained CNNs for comparison
33
- - [ ] FTIR support (modular integration planned)
34
  - [ ] Image-based inference (future modality)
 
35
 
36
  ---
37
 
38
  ## 🧭 How to Use
39
 
40
- 1. Upload a Raman spectrum `.txt` file (or select a sample)
41
- 2. Choose a model from the sidebar
42
- 3. Run analysis
43
- 4. View prediction, logits, and technical information
44
 
45
- Supported input:
46
 
47
- - Plaintext `.txt` files with 1–2 columns
48
- - Space- or comma-separated
49
- - Comment lines (#) are ignored
50
- - Automatically resampled to 500 points
51
 
52
- ---
53
-
54
- ## Contributors
55
 
56
- πŸ‘¨β€πŸ« Dr. Sanmukh Kuppannagari (Mentor)
57
- πŸ‘¨β€πŸ« Dr. Metin Karailyan (Mentor)
58
- πŸ‘¨β€πŸ’» Jaser Hasan (Author/Developer)
59
 
60
- ## 🧠 Model Credit
 
 
 
61
 
62
- Baseline model inspired by:
63
 
64
- Neo, E.R.K., Low, J.S.C., Goodship, V., Debattista, K. (2023).
65
- *Deep learning for chemometric analysis of plastic spectral data from infrared and Raman databases.*
66
- _Resources, Conservation & Recycling_, **188**, 106718.
67
- [https://doi.org/10.1016/j.resconrec.2022.106718](https://doi.org/10.1016/j.resconrec.2022.106718)
68
 
69
  ---
70
 
71
- ## πŸ”— Links
72
-
73
- - πŸ’» **Live App**: [Hugging Face Space](https://huggingface.co/spaces/dev-jas/polymer-aging-ml)
74
- - πŸ“‚ **GitHub Repo**: [ml-polymer-recycling](https://github.com/KLab-AI3/ml-polymer-recycling)
75
-
76
-
77
- ## 🎯 Strategic Expansion Objectives (Roadmap)
78
-
79
- **The roadmap defines three major expansion paths designed to broaden the system’s capabilities and impact:**
80
-
81
- 1. **Model Expansion: Multi-Model Dashboard**
82
-
83
- > The dashboard will evolve into a hub for multiple model architectures rather than being tied to a single baseline. Planned work includes:
84
 
85
- - **Retraining & Fine-Tuning**: Incorporating publicly available vision models and retraining them with the polymer dataset.
86
- - **Model Registry**: Automatically detecting available .pth weights and exposing them in the dashboard for easy selection.
87
- - **Side-by-Side Reporting**: Running comparative experiments and reporting each model’s accuracy and diagnostics in a standardized format.
88
- - **Reproducible Integration**: Maintaining modular scripts and pipelines so each model’s results can be replicated without conflict.
89
 
90
- This ensures flexibility for future research and transparency in performance comparisons.
91
 
92
- 2. **Image Input Modality**
93
 
94
- > The system will support classification on images as an additional modality, extending beyond spectra. Key features will include:
 
 
 
95
 
96
- - **Upload Support**: Users can upload single images or batches directly through the dashboard.
97
- - **Multi-Model Execution**: Selected models from the registry can be applied to all uploaded images simultaneously.
98
- - **Batch Results**: Output will be returned in a structured, accessible way, showing both individual predictions and aggregate statistics.
99
- - **Enhanced Feedback**: Outputs will include predicted class, model confidence, and potentially annotated image previews.
100
 
101
- This expands the system toward a multi-modal framework, supporting broader research workflows.
102
 
103
- 3. **FTIR Dataset Integration**
 
104
 
105
- > Although previously deferred, FTIR support will be added back in a modular, distinct fashion. Planned steps are:
106
 
107
- - **Dedicated Preprocessing**: Tailored scripts to handle FTIR-specific signal characteristics (multi-layer handling, baseline correction, normalization).
108
- - **Architecture Compatibility**: Ensuring existing and retrained models can process FTIR data without mixing it with Raman workflows.
109
- - **UI Integration**: Introducing FTIR as a separate option in the modality selector, keeping Raman, Image, and FTIR workflows clearly delineated.
110
- - **Phased Development**: Implementation details to be refined during meetings to ensure scientific rigor.
111
 
112
- This guarantees FTIR becomes a supported modality without undermining the validated Raman foundation.
 
 
 
 
 
 
 
 
1
  ---
2
+ title: AI Polymer Classification (Raman & FTIR)
3
  emoji: πŸ”¬
4
  colorFrom: indigo
5
  colorTo: yellow
 
8
  pinned: false
9
  license: apache-2.0
10
  ---
 
11
 
12
+ ## AI-Driven Polymer Aging Prediction and Classification (v0.1)
13
 
14
+ This web application classifies the degradation state of polymers using **Raman and FTIR spectroscopy** and deep learning.
15
+ It is a prototype pipeline for evaluating multiple convolutional neural networks (CNNs) on spectral data.
16
 
17
  ---
18
 
19
  ## πŸ§ͺ Current Scope
20
 
21
+ - πŸ”¬ **Modalities**: Raman & FTIR spectroscopy
22
+ - πŸ’Ύ **Input Formats**: `.txt`, `.csv`, `.json` (with auto-detection)
23
+ - 🧠 **Models**: Figure2CNN (baseline), ResNet1D, ResNet18Vision
24
  - πŸ“Š **Task**: Binary classification β€” Stable vs Weathered polymers
25
+ - πŸš€ **Features**: Multi-model comparison, performance tracking dashboard
26
  - πŸ› οΈ **Architecture**: PyTorch + Streamlit
27
 
28
  ---
 
31
 
32
  - [x] Inference from Raman `.txt` files
33
  - [x] Model selection (Figure2CNN, ResNet1D)
34
+ - [x] **FTIR support** (modular integration complete)
35
+ - [x] **Multi-model comparison dashboard**
36
+ - [x] **Performance tracking dashboard**
37
  - [ ] Add more trained CNNs for comparison
 
38
  - [ ] Image-based inference (future modality)
39
+ - [ ] RESTful API for programmatic access
40
 
41
  ---
42
 
43
  ## 🧭 How to Use
44
 
45
+ The application provides three main analysis modes in a tabbed interface:
 
 
 
46
 
47
+ 1. **Standard Analysis**:
48
 
49
+ - Upload a single spectrum file (`.txt`, `.csv`, `.json`) or a batch of files.
50
+ - Choose a model from the sidebar.
51
+ - Run analysis and view the prediction, confidence, and technical details.
 
52
 
53
+ 2. **Model Comparison**:
 
 
54
 
55
+ - Upload a single spectrum file.
56
+ - The app runs inference with all available models.
57
+ - View a side-by-side comparison of the models' predictions and performance.
58
 
59
+ 3. **Performance Tracking**:
60
+ - Explore a dashboard with visualizations of historical performance data.
61
+ - Compare model performance across different metrics.
62
+ - Export performance data in CSV or JSON format.
63
 
64
+ ### Supported Input
65
 
66
+ - Plaintext `.txt`, `.csv`, or `.json` files.
67
+ - Data can be space-, comma-, or tab-separated.
68
+ - Comment lines (`#`, `%`) are ignored.
69
+ - The app automatically detects the file format and resamples the data to a standard length.
70
 
71
  ---
72
 
73
+ ## Contributors
 
 
 
 
 
 
 
 
 
 
 
 
74
 
75
+ Dr. Sanmukh Kuppannagari (Mentor)
76
+ Dr. Metin Karailyan (Mentor)
77
+ Jaser Hasan (Author/Developer)
 
78
 
79
+ ## Model Credit
80
 
81
+ Baseline model inspired by:
82
 
83
+ Neo, E.R.K., Low, J.S.C., Goodship, V., Debattista, K. (2023).
84
+ _Deep learning for chemometric analysis of plastic spectral data from infrared and Raman databases._
85
+ _Resources, Conservation & Recycling_, **188**, 106718.
86
+ [https://doi.org/10.1016/j.resconrec.2022.106718](https://doi.org/10.1016/j.resconrec.2022.106718)
87
 
88
+ ---
 
 
 
89
 
90
+ ## πŸ”— Links
91
 
92
+ - **Live App**: [Hugging Face Space](https://huggingface.co/spaces/dev-jas/polymer-aging-ml)
93
+ - **GitHub Repo**: [ml-polymer-recycling](https://github.com/KLab-AI3/ml-polymer-recycling)
94
 
95
+ ## πŸš€ Technical Architecture
96
 
97
+ **The system is built on a modular, production-ready architecture designed for scalability and maintainability.**
 
 
 
98
 
99
+ - **Frontend**: A Streamlit-based web application (`app.py`) provides an interactive, multi-tab user interface.
100
+ - **Backend**: PyTorch handles all deep learning operations, including model loading and inference.
101
+ - **Model Management**: A registry pattern (`models/registry.py`) allows for dynamic model loading and easy integration of new architectures.
102
+ - **Data Processing**: A robust, modality-aware preprocessing pipeline (`utils/preprocessing.py`) ensures data integrity and standardization for both Raman and FTIR data.
103
+ - **Multi-Format Parsing**: The `utils/multifile.py` module handles parsing of `.txt`, `.csv`, and `.json` files.
104
+ - **Results Management**: The `utils/results_manager.py` module manages session and persistent results, with support for multi-model comparison and data export.
105
+ - **Performance Tracking**: The `utils/performance_tracker.py` module logs performance metrics to a SQLite database and provides a dashboard for visualization.
106
+ - **Deployment**: The application is containerized using Docker (`Dockerfile`) for reproducible, cross-platform execution.