agentsclimarketplace

Deep learning training convergence monitoring

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/lc-ms/skills/deep-learning-training-convergence-monitoring

Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill deep-learning-training-convergence-monitoring

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when training a CNN model from scratch on LCMS peak classification tasks (or similar image-like batched data) where you need to confirm the model reaches target performance (e.g., AUC ROC > 0.9) without overfitting.

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

8.6 KB, as published. Nobody here has run it

deep-learning-training-convergence-monitoring

Summary

Monitor and diagnose convergence behavior of CNN models during training by comparing training and validation accuracy curves to detect overfitting and determine when to halt training. This skill is essential for validating that a model learns generalizable patterns rather than memorizing training data.

When to use

Apply this skill when training a CNN model from scratch on LCMS peak classification tasks (or similar image-like batched data) where you need to confirm the model reaches target performance (e.g., AUC ROC > 0.9) without overfitting. Use it after initializing a model and beginning iterative training epochs, especially when the training regime lacks automatic early stopping callbacks.

When NOT to use

  • Input model already has automatic early stopping callbacks enabled; use the callback's built-in monitoring instead.
  • Training dataset contains < 500 peaks per class; full model training from scratch is not recommended; use transfer learning instead.
  • Validation split was set to 0 or no held-out validation set exists; convergence monitoring requires separate training and validation curves.

Inputs

  • Keras/TensorFlow model training logs (accuracy curves per epoch)
  • Validation accuracy curve per epoch
  • True positive and false positive rate vectors from get_true_vs_false_positive_df()

Outputs

  • Training vs. validation accuracy comparison (visual or tabular)
  • ROC curve plot (FPR vs. TPR)
  • AUC ROC score (scalar, target ≥ 0.9)
  • Overfitting diagnosis (present/absent)
  • Training halt decision (continue/stop)

How to apply

After calling train_model() with an initial epoch count (e.g., 1000), inspect the returned Keras/TensorFlow training and validation accuracy logs. Plot or tabulate both curves side-by-side to identify convergence patterns: if training accuracy rises substantially while validation accuracy plateaus or diverges, overfitting is occurring and training should be halted immediately. If neither curve shows a plateau (both still improving), resume training by calling train_model() again with additional epochs. Compute the ROC curve and AUC metric using get_true_vs_false_positive_df() data and scikit-learn's auc() function on False Positive Rate vs. True Positive Rate. The skill is successfully applied when training accuracy ≈ validation accuracy and the final AUC ROC meets or exceeds the target threshold (e.g., 0.9), confirming no overfitting and adequate generalization.

Related tools

  • NeatMS (Provides train_model() method to resume training, get_true_vs_false_positive_df() to extract ROC curve data, and neural network handler to manage batches and model state) — https://github.com/bihealth/NeatMS
  • TensorFlow/Keras (Underlying framework returning training and validation accuracy logs; enables resumable training via train_model() calls)
  • scikit-learn (Computes ROC curve and AUC metric from true and false positive rates)
  • Jupyter Notebook (Interactive environment for plotting and inspecting training curves in real-time)

Examples

from sklearn.metrics import auc
import matplotlib.pyplot as plt
# After calling train_model(1000):
history = model.history
plt.plot(history.history['accuracy'], label='Training Accuracy')
plt.plot(history.history['val_accuracy'], label='Validation Accuracy')
plt.legend()
plt.show()
df_roc = experiment.get_true_vs_false_positive_df()
auc_score = auc(df_roc['fpr'], df_roc['tpr'])
print(f'AUC ROC: {auc_score:.3f}')
if auc_score >= 0.9 and abs(history.history['accuracy'][-1] - history.history['val_accuracy'][-1]) < 0.1:
    print('Training successful, no overfitting detected')

Evaluation signals

  • Training accuracy and validation accuracy curves are visually similar throughout training (divergence < ~5–10%), confirming no overfitting.
  • Final AUC ROC score ≥ 0.9, meeting or exceeding the published target threshold.
  • Training curve shows monotonic or near-monotonic increase with no sharp plateau before validation curve plateaus, indicating effective learning.
  • Halting condition is triggered when training accuracy reaches ~100% while validation accuracy lags significantly, preventing further model degradation.
  • ROC curve passes through expected regions (diagonal baseline for random classifier; concave arc toward top-left for strong classifier).

Limitations

  • NeatMS does not currently provide automatic callback functions to halt training; manual inspection and stopping are required.
  • Convergence monitoring assumes a representative training/validation split (0.1 validation split); biased or unrepresentative splits may yield misleading curves.
  • Training and validation accuracy curves do not directly reveal class imbalance effects; use normalise_class=True during batch creation if class distributions differ significantly.
  • Monitoring requires human judgment to interpret divergence; no formal statistical test for overfitting is embedded in the workflow.
  • Model may achieve high AUC ROC but still suffer from local biases in specific sample cohorts not represented in the validation set.

Evidence

  • [other] Monitor training and validation accuracy on the returned Keras/TensorFlow logs; if no plateau is observed, resume training by calling train_model() again with additional epochs.: "Monitor training and validation accuracy on the returned Keras/TensorFlow logs; if no plateau is observed, resume training by calling train_model() again with additional epochs."
  • [other] Inspect training and validation accuracy curves to confirm no overfitting (training accuracy ≈ validation accuracy); if training reaches ~100% while validation lags significantly, halt training.: "Inspect training and validation accuracy curves to confirm no overfitting (training accuracy ≈ validation accuracy); if training reaches ~100% while validation lags significantly, halt training."
  • [other] Compute ROC curve and AUC using get_true_vs_false_positive_df() data with scikit-learn's auc() function on False Positive Rate vs. True Positive Rate.: "Compute ROC curve and AUC using get_true_vs_false_positive_df() data with scikit-learn's auc() function on False Positive Rate vs. True Positive Rate."
  • [methods] NeatMS does not currently provides callback functions to automatically stop the training. Calling the training method will simply resume the training: "NeatMS does not currently provides callback functions to automatically stop the training. Calling the training method will simply resume the training"
  • [other] Does training the NeatMS CNN model from scratch on the provided example dataset under full training conditions produce an AUC ROC score exceeding 0.9 without evidence of overfitting?: "Does training the NeatMS CNN model from scratch on the provided example dataset under full training conditions produce an AUC ROC score exceeding 0.9 without evidence of overfitting?"

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.