Synthetic LIGO gravitational-wave glitch generator (cDVGAN architecture)
Project description
GlitchGAN
Conditional Dual-discriminator Variational GAN (cDVGAN) for synthesising LIGO gravitational-wave glitch signals. Trained on seven Gravity Spy glitch classes from the O3 observing run.
Overview
GlitchGAN uses a Wasserstein GAN with gradient penalty (WGAN-GP) augmented by a first-derivative discriminator. The derivative discriminator encourages the generator to produce signals with realistic time-domain structure, not just realistic amplitude distributions.
Architecture: Generator + Discriminator + Derivative Discriminator
Classes: Blip, Fast Scattering, Koi Fish, Low Frequency Burst, Scattered Light, Tomte, Whistle
Signal length: 8192 samples @ 4096 Hz (~2 s)
Repository structure
glitchgan/
├── evaluation.ipynb # UMAP + GravitySpy evaluation notebook
├── src/cdvgan/
│ ├── tf/
│ │ ├── model_components.py # Generator / discriminator layers
│ │ ├── gan_models.py # cWGAN, cDVGAN, cDVGAN2, GlitchGAN
│ │ ├── train.py # Training entry point
│ │ └── utils.py # Dataset, callbacks, checkpointing
│ └── utils.py # Signal processing utilities
├── weights/tensorflow/
│ └── generator_210_keras3.keras # Trained generator (epoch 210)
├── models/ # GravitySpy CNN weights (gitignored — see below)
├── data/ # Training data (gitignored — see below)
└── environment.yml
Setup
conda env create -f environment.yml
conda activate cdvgan
The environment installs TensorFlow, Keras 3, GWpy, PyCBC, umap-learn, and GravitySpy.
Note:
environment.ymltargets Apple Silicon (tensorflow-macos / tensorflow-metal). On Linux/HPC replace those withtensorflowand removetensorflow-metal.
Data
The training data (~2.3 GB) is not included in this repository.
Download from Zenodo: (link TBD — will be added before publication)
Place the downloaded files in data/:
data/
├── glitch_GAN_samples_scaled_balanced.npy # (N, 8192) float32 signals
├── glitch_GAN_labels_balanced.npy # (N, 7) one-hot labels
└── glitch_GAN_label_order.npy # class name ordering
GravitySpy model
The GravitySpy O3 CNN (sidd-cqg-paper-O3-model.h5) is not included. It ships with the gravityspy package or can be found in a local GravitySpy clone.
- Install GravitySpy:
pip install gravityspy - Copy the model to
models/sidd-cqg-paper-O3-model.h5 - Set
PATH_TO_REPOinevaluation.ipynbto your GravitySpy clone path
Training
python -m cdvgan.tf.train \
--data-dir data/ \
--variant cDVGAN \
--epochs 500 \
--output-dir GAN_outputs/
See src/cdvgan/tf/train.py for all options.
Evaluation
Open evaluation.ipynb and run all cells. The notebook:
- Loads real glitch data and the trained generator
- Visualises real vs generated waveforms
- Embeds real and generated signals jointly in 3D UMAP space (correlation metric)
- Injects generated signals into whitened H1 background and classifies with GravitySpy
Citation
(BibTeX will be added upon publication)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file glitchgan-0.1.3.tar.gz.
File metadata
- Download URL: glitchgan-0.1.3.tar.gz
- Upload date:
- Size: 15.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63b892f8ad03d081a3292c251a04b3d987fa662f170c7f1b2d14b5b94bc3eaa0
|
|
| MD5 |
d47194d8a9901de1101a4c506a7ad285
|
|
| BLAKE2b-256 |
28cdd355609151f1d94437e603e17de78dac415fbcece394436649c98b40882d
|
Provenance
The following attestation bundles were made for glitchgan-0.1.3.tar.gz:
Publisher:
publish.yml on tomdooney95/glitchgan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
glitchgan-0.1.3.tar.gz -
Subject digest:
63b892f8ad03d081a3292c251a04b3d987fa662f170c7f1b2d14b5b94bc3eaa0 - Sigstore transparency entry: 1719369646
- Sigstore integration time:
-
Permalink:
tomdooney95/glitchgan@7595ef07c711294072df043cb24f4823b27ba279 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/tomdooney95
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7595ef07c711294072df043cb24f4823b27ba279 -
Trigger Event:
push
-
Statement type:
File details
Details for the file glitchgan-0.1.3-py3-none-any.whl.
File metadata
- Download URL: glitchgan-0.1.3-py3-none-any.whl
- Upload date:
- Size: 23.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
921808e7158fa4470aec3aba40fe1a7fcbc2af600bff4901f45c0c97229d2c9b
|
|
| MD5 |
361221ded4f297938fff409d0d778524
|
|
| BLAKE2b-256 |
928b650262bbadaafabfdd3eaed9ecc2c84ce8b45753f1e14ad2e58292576f9b
|
Provenance
The following attestation bundles were made for glitchgan-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on tomdooney95/glitchgan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
glitchgan-0.1.3-py3-none-any.whl -
Subject digest:
921808e7158fa4470aec3aba40fe1a7fcbc2af600bff4901f45c0c97229d2c9b - Sigstore transparency entry: 1719369850
- Sigstore integration time:
-
Permalink:
tomdooney95/glitchgan@7595ef07c711294072df043cb24f4823b27ba279 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/tomdooney95
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7595ef07c711294072df043cb24f4823b27ba279 -
Trigger Event:
push
-
Statement type: