Project
Chemlab - Molecule Generation for Cosmetic Research
A team project exploring molecule generation for cosmetic applications using an LSTM, reinforcement learning, and a Django interface.
View on GitHub- Team
- 3
- Role
- Front-end & Machine-Learning Engineer
- Duration
- 09/2024–01/2025
Stack
- Python
- TensorFlow
- RDKit
- Django
- Selenium
- NumPy
- Pandas
Gallery

Overview
Chemlab is a three-person project exploring molecule generation for cosmetic research. My role covered frontend development and machine learning. The application generates SMILES strings, a text representation of molecular structures, and uses RDKit to check validity and calculate molecular properties.
A Django interface supports generating and inspecting candidates, viewing their structures, and adjusting model parameters.
Model and Data Pipeline
- Prepared a pre-training dataset of 500,000 molecules from ChEMBL, with duplicate removal and sequence-length analysis.
- Scraped a cosmetic-ingredient subset from the EU COSING register for fine-tuning.
- Trained a stacked LSTM to generate SMILES strings, with checkpoint selection to manage overfitting.
- Added reinforcement learning with rewards based on RDKit validity and a target molecular-weight range.
Interface
The Django application uses 3Dmol.js for molecular visualisation. It displays two- and three-dimensional structures alongside descriptors such as molecular weight, LogP, and polar surface area. Generation settings are exposed in the interface so candidates can be compared without editing code.
Engineering Challenges
The main challenges were cleaning molecular datasets, managing overfitting, and handling invalid generated strings. Data filtering, checkpoint selection, and validity-based rewards addressed different parts of that pipeline.
Outcome
The pipeline generates SMILES strings and checks their validity and molecular descriptors with RDKit. The Django interface supports inspecting candidates and adjusting generation parameters.
The result is an exploratory research application. Computational validity and molecular descriptors help filter candidates, but do not establish their suitability for cosmetic use.