Lightning-AI / Lightning-AI/pytorch-lightning
Add an end-to-end anomaly detection tutorial using PyTorch Lightning
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 31.4k
- Forks
- 3.8k
- Avg merge
- 6d 7h
- Merged PRs (30d)
- 6
Description
### 📚 Documentation
## Motivation
PyTorch Lightning is widely used for supervised learning tasks, but there is currently no end-to-end tutorial demonstrating anomaly detection.
Anomaly detection is an important application in industrial inspection, healthcare, cybersecurity, and time-series monitoring. A beginner-friendly tutorial would help users understand how Lightning can simplify training and evaluation for these workflows.
## Proposed tutorial
I would like to contribute a tutorial that demonstrates:
- Building an Autoencoder (or Variational Autoencoder) using LightningModule
- Organizing datasets with LightningDataModule
- Training only on normal samples
- Computing reconstruction-error anomaly scores
- Selecting an anomaly threshold using validation data
- Evaluating on normal and anomalous samples
- Logging metrics with Lightning loggers
- Visualizing reconstructed images and anomaly scores
The tutorial would follow Lightning's recommended coding style and be suitable for beginners.
## Possible extensions
Depending on maintainer feedback, the tutorial could later include:
- Callbacks for reconstruction visualization
- TensorBoard logging
- Multiple datasets
- Industrial anomaly detection examples
I'd be happy to implement this if the maintainers think it would be a useful addition.
cc @lantiga
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file, test, or entry point is named. Start by reviewing the repository's recommended tutorial coding style and maintainer feedback, then define a beginner-friendly end-to-end example covering the proposed LightningModule, LightningDataModule, training, threshold selection, evaluation, logging, and visualizations; done means the complete tutorial is clear and runnable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- documentation, machine-learning
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100