Glowithm Ingredient Conflict Classifier
An experimental machine learning classifier developed as part of Glowithm, an AI-powered skincare routine analysis project.
The model estimates the compatibility classification of two skincare ingredients using ingredient names, categories, and functions.
Important: This is an experimental machine learning model. It is not clinically validated and must not be used as a substitute for dermatological advice or professional medical assessment.
Model Overview
| Property | Description |
|---|---|
| Model type | Random Forest classifier |
| Framework | Scikit-learn |
| Task | Ingredient-pair classification |
| Input | Two skincare ingredients |
| Output | SAFE, CAUTION, or AVOID |
| Supported ingredients | 18 |
| Training dataset | 46 ingredient-pair records |
| Model artifact | conflict_model_candidate.joblib |
Intended Use
This model is intended for:
- Educational exploration of machine learning in skincare-related applications.
- Demonstrating structured ingredient-pair classification.
- Experimenting with feature engineering and model inference.
- Serving as an experimental ML fallback component in the Glowithm project.
It is not intended to diagnose skin conditions, prescribe treatments, or establish the clinical safety of skincare combinations.
How It Works
The model receives six input features:
ingredient_aingredient_bcategory_acategory_bfunction_afunction_b
The trained pipeline processes these features and predicts one of three classes:
| Label | Meaning |
|---|---|
| SAFE | The model predicts a compatible pairing. |
| CAUTION | The model predicts a pairing that may require caution. |
| AVOID | The model predicts a potentially problematic pairing. |
The standalone inference implementation evaluates both ingredient orders:
- Ingredient A + Ingredient B
- Ingredient B + Ingredient A
It selects the more severe prediction. Confidence is used to break ties between predictions with the same severity.
The confidence score is the classifier's predicted probability for its selected class. It should not be interpreted as a clinical probability or a guarantee of correctness.
Supported Ingredients
The current metadata contains 18 ingredients:
- Adapalene
- Azelaic Acid
- Benzoyl Peroxide
- Ceramide
- Copper Peptide
- Glycolic Acid
- High-Concentration AHA
- High-Concentration Vitamin C
- Hyaluronic Acid
- Lactic Acid
- Niacinamide
- Peptide
- Retinal
- Retinol
- Salicylic Acid
- Squalane
- Tretinoin
- Vitamin C
Ingredient names outside this metadata are returned as unsupported rather than being classified as SAFE.
Dataset
The experimental dataset contains 46 curated ingredient-pair records.
| Class | Records |
|---|---|
| CAUTION | 23 |
| SAFE | 18 |
| AVOID | 5 |
| Total | 46 |
The dataset is relatively small and manually curated. Its labels should not be treated as an authoritative clinical reference.
Evaluation
The candidate model was evaluated using cross-validation and an ingredient-held-out evaluation.
| Evaluation | Result |
|---|---|
| 5-fold cross-validation accuracy | 0.80 |
| Ingredient-held-out accuracy | 0.76 |
| AVOID precision (ingredient-held-out) | 1.00 |
| AVOID recall (ingredient-held-out) | 0.40 |
Interpreting the results
- The evaluation dataset is small, so the reported metrics are preliminary.
- Ingredient-held-out evaluation is useful for examining performance when ingredients are held out from training.
- The AVOID class has limited representation.
- An AVOID recall of 0.40 indicates that the model missed some AVOID cases in that evaluation.
- These results do not establish clinical reliability or generalization to real-world skincare routines.
See the Glowithm project's evaluation documentation for further methodology and limitations.
Installation
Clone or download this repository, then install the dependencies:
pip install -r requirements.txt
Usage
from inference import predict_pair
result = predict_pair("retinol", "salicylic_acid")
print(result)
Example response structure:
{
"status": "PREDICTION_AVAILABLE",
"label": "CAUTION",
"confidence": 0.72
}
The exact output depends on the model prediction.
You can also execute the demonstration script:
python inference.py
Repository Files
| File | Purpose |
|---|---|
conflict_model_candidate.joblib |
Trained experimental classifier |
metadata.json |
Ingredient category and function mappings |
inference.py |
Standalone prediction implementation |
requirements.txt |
Required Python dependencies |
README.md |
Model documentation |
Relationship to Glowithm
Glowithm uses a layered ingredient-conflict detection architecture:
- A curated ingredient-pair table acts as the primary source for known combinations.
- High-strength ingredient rules can adjust certain pair classifications.
- The ML classifier acts as a fallback for eligible pairs not covered by the curated table.
- Low-confidence estimates are not used as warnings.
- Reactive combinations that cannot be verified are reported as unverified.
This Hugging Face repository publishes the experimental candidate ML classifier, not the complete Glowithm conflict-detection engine.
The candidate model is separate from the model currently used by the main application. Publishing it does not replace or change Glowithm's active model.
Limitations and Responsible Use
- The training dataset contains only 46 records.
- Ingredient combinations and concentrations are not comprehensively represented.
- The model may produce order-dependent predictions.
- Model confidence does not establish real-world safety.
- The model does not account for individual skin conditions, allergies, formulation differences, product concentrations, or usage frequency.
- A SAFE prediction must not be interpreted as a guarantee that a combination is safe for every individual.
- AVOID and CAUTION predictions are experimental estimates, not medical instructions.
Always follow product instructions and seek advice from a qualified dermatologist when uncertain about ingredient combinations or experiencing irritation.
Project
Glowithm β AI Skincare Routine Analyzer
Developed as part of a BCA final-year project exploring AI-assisted skincare analysis and machine learning-based ingredient compatibility classification.