transfer-learning-model-adaptation
License: restricted — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution.
Summary
Fine-tune a pre-trained graph neural network model on a domain-specific chromatography dataset using PyTorch and PyG to adapt learned representations for improved retention time prediction on new chemical libraries. This skill enables rapid model customization without retraining from scratch.
When to use
You have a pre-trained ABCoRT model checkpoint and a new chromatography dataset (e.g., Eawag_XBridgeC18_364.xlsx with SMILES and measured retention times) from a different column, instrument, or chemical space, and you need to adapt the model's feature extraction layers to this domain without full retraining.
When NOT to use
- The input dataset is not in .xlsx format or lacks SMILES and retention time columns; preprocess to this schema first.
- You are training a model from scratch (no pre-trained checkpoint available); use the main training script (train_SMRT.py) instead.
- The dataset is from the same chromatography platform and chemical space as the original training data; direct inference without fine-tuning may be sufficient.
Inputs
- Pre-trained ABCoRT model checkpoint (.pth or similar PyTorch format)
- Transfer-learning dataset file (.xlsx format with SMILES column and retention time measurements)
- Command-line parameters (--DataSet flag with dataset filename)
Outputs
- Fine-tuned model checkpoint with adapted feature extraction layers
- Training logs and metrics (loss, validation accuracy, monitored via TorchMetrics)
- Retention time predictions on the new chromatography domain
How to apply
Load the pre-trained model checkpoint and the transfer-learning dataset (supplied as .xlsx with SMILES and retention time columns) into memory using Pandas and Python. Execute the train_transfer_FE.py script, passing the dataset filename via the --DataSet command-line flag; the script will convert SMILES to molecular graphs using RDKit, construct feature embeddings via PyG, and perform fine-tuning on the feature extraction layers using PyTorch. Monitor training loss and validation metrics via TorchMetrics throughout the epochs to detect convergence and overfitting. Save the resulting fine-tuned checkpoint and training logs for subsequent inference on new compounds.
Related tools
- train_transfer_FE.py (Main script that orchestrates fine-tuning of the feature extraction layers using the transfer dataset) — github.com/RiverCCC/ABCoRT
- PyTorch (Deep learning framework for model loading, parameter optimization, and checkpoint management)
- PyG (PyTorch Geometric) (Graph neural network library for constructing molecular graphs and graph convolution operations)
- RDKit (Cheminformatics toolkit for converting SMILES strings to molecular graph representations)
- Pandas (Data loading and preprocessing of the .xlsx transfer dataset)
- TorchMetrics (Monitoring training and validation metrics during fine-tuning to assess convergence)
- torch-scatter, torch-sparse, torch-cluster (PyG dependencies providing efficient graph operations and aggregation)
Examples
python train_transfer_FE.py --DataSet Eawag_XBridgeC18_364.xlsx
Evaluation signals
- Training loss converges smoothly over epochs and validation loss plateaus without divergence, as monitored via TorchMetrics.
- Fine-tuned model predictions on a held-out test subset of the transfer dataset exhibit lower mean absolute error (MAE) or root mean squared error (RMSE) in retention time compared to the base pre-trained model, confirming domain adaptation.
- The saved fine-tuned checkpoint loads successfully in PyTorch and produces predictions with the same input/output shape and dimensionality as the original model.
- Training logs record all hyperparameters (learning rate, batch size, number of epochs) and final metric values for reproducibility.
- The fine-tuned model generalizes to new compounds in the same chromatography domain without catastrophic forgetting of pre-trained representations.
Limitations
- Transfer learning performance depends on the size and representativeness of the target dataset; very small datasets (< 50 compounds) may overfit.
- The approach assumes the new dataset uses the same molecular representation (SMILES) and retention time measurement protocol as the pre-training data; incompatible formats will require preprocessing.
- No changelog or version history is documented in the repository, making it difficult to track which pre-trained checkpoint versions are compatible with specific transfer datasets.
Evidence
- [other] Transfer learning on the Eawag_XBridgeC18_364 dataset is executed by running the train_transfer_FE.py script with the dataset name passed as a command-line argument via the --DataSet flag.: "Execute train_transfer_FE.py with the --DataSet parameter set to Eawag_XBridgeC18_364.xlsx"
- [other] The workflow involves loading pre-trained checkpoint, executing the transfer learning script with PyTorch and PyG, monitoring via TorchMetrics, and saving the fine-tuned model.: "Load the pre-trained model checkpoint and transfer-learning dataset (Eawag_XBridgeC18_364.xlsx) using Python and Pandas. 2. Execute train_transfer_FE.py with the --DataSet parameter set to"
- [intro] The project involves training a model and running transfer learning on thirteen transfer learning datasets.: "train the Model and run the transfer learning on thirteen transfer learning data sets"
- [readme] Repository README documents the exact CLI invocation for transfer learning.: "python train_transfer_FE.py --DataSet Eawag_XBridgeC18_364.xlsx"
1---2name: transfer-learning-model-adaptation3description: Use when you have a pre-trained ABCoRT model checkpoint and a new chromatography dataset (e.g., Eawag_XBridgeC18_364.4license: CC-BY-4.05---67# transfer-learning-model-adaptation89> **License: restricted** — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution. <!-- asb-license-banner -->10## Summary1112Fine-tune a pre-trained graph neural network model on a domain-specific chromatography dataset using PyTorch and PyG to adapt learned representations for improved retention time prediction on new chemical libraries. This skill enables rapid model customization without retraining from scratch.1314## When to use1516You have a pre-trained ABCoRT model checkpoint and a new chromatography dataset (e.g., Eawag_XBridgeC18_364.xlsx with SMILES and measured retention times) from a different column, instrument, or chemical space, and you need to adapt the model's feature extraction layers to this domain without full retraining.1718## When NOT to use1920- The input dataset is not in .xlsx format or lacks SMILES and retention time columns; preprocess to this schema first.21- You are training a model from scratch (no pre-trained checkpoint available); use the main training script (train_SMRT.py) instead.22- The dataset is from the same chromatography platform and chemical space as the original training data; direct inference without fine-tuning may be sufficient.2324## Inputs2526- Pre-trained ABCoRT model checkpoint (.pth or similar PyTorch format)27- Transfer-learning dataset file (.xlsx format with SMILES column and retention time measurements)28- Command-line parameters (--DataSet flag with dataset filename)2930## Outputs3132- Fine-tuned model checkpoint with adapted feature extraction layers33- Training logs and metrics (loss, validation accuracy, monitored via TorchMetrics)34- Retention time predictions on the new chromatography domain3536## How to apply3738Load the pre-trained model checkpoint and the transfer-learning dataset (supplied as .xlsx with SMILES and retention time columns) into memory using Pandas and Python. Execute the train_transfer_FE.py script, passing the dataset filename via the --DataSet command-line flag; the script will convert SMILES to molecular graphs using RDKit, construct feature embeddings via PyG, and perform fine-tuning on the feature extraction layers using PyTorch. Monitor training loss and validation metrics via TorchMetrics throughout the epochs to detect convergence and overfitting. Save the resulting fine-tuned checkpoint and training logs for subsequent inference on new compounds.3940## Related tools4142- **train_transfer_FE.py** (Main script that orchestrates fine-tuning of the feature extraction layers using the transfer dataset) — github.com/RiverCCC/ABCoRT43- **PyTorch** (Deep learning framework for model loading, parameter optimization, and checkpoint management)44- **PyG (PyTorch Geometric)** (Graph neural network library for constructing molecular graphs and graph convolution operations)45- **RDKit** (Cheminformatics toolkit for converting SMILES strings to molecular graph representations)46- **Pandas** (Data loading and preprocessing of the .xlsx transfer dataset)47- **TorchMetrics** (Monitoring training and validation metrics during fine-tuning to assess convergence)48- **torch-scatter, torch-sparse, torch-cluster** (PyG dependencies providing efficient graph operations and aggregation)4950## Examples5152```53python train_transfer_FE.py --DataSet Eawag_XBridgeC18_364.xlsx54```5556## Evaluation signals5758- Training loss converges smoothly over epochs and validation loss plateaus without divergence, as monitored via TorchMetrics.59- Fine-tuned model predictions on a held-out test subset of the transfer dataset exhibit lower mean absolute error (MAE) or root mean squared error (RMSE) in retention time compared to the base pre-trained model, confirming domain adaptation.60- The saved fine-tuned checkpoint loads successfully in PyTorch and produces predictions with the same input/output shape and dimensionality as the original model.61- Training logs record all hyperparameters (learning rate, batch size, number of epochs) and final metric values for reproducibility.62- The fine-tuned model generalizes to new compounds in the same chromatography domain without catastrophic forgetting of pre-trained representations.6364## Limitations6566- Transfer learning performance depends on the size and representativeness of the target dataset; very small datasets (< 50 compounds) may overfit.67- The approach assumes the new dataset uses the same molecular representation (SMILES) and retention time measurement protocol as the pre-training data; incompatible formats will require preprocessing.68- No changelog or version history is documented in the repository, making it difficult to track which pre-trained checkpoint versions are compatible with specific transfer datasets.6970## Evidence7172- [other] Transfer learning on the Eawag_XBridgeC18_364 dataset is executed by running the train_transfer_FE.py script with the dataset name passed as a command-line argument via the --DataSet flag.: "Execute train_transfer_FE.py with the --DataSet parameter set to Eawag_XBridgeC18_364.xlsx"73- [other] The workflow involves loading pre-trained checkpoint, executing the transfer learning script with PyTorch and PyG, monitoring via TorchMetrics, and saving the fine-tuned model.: "Load the pre-trained model checkpoint and transfer-learning dataset (Eawag_XBridgeC18_364.xlsx) using Python and Pandas. 2. Execute train_transfer_FE.py with the --DataSet parameter set to"74- [intro] The project involves training a model and running transfer learning on thirteen transfer learning datasets.: "train the Model and run the transfer learning on thirteen transfer learning data sets"75- [readme] Repository README documents the exact CLI invocation for transfer learning.: "python train_transfer_FE.py --DataSet Eawag_XBridgeC18_364.xlsx"