AstroWave Intelligence is a cutting-edge deep learning application capable of distinguishing between cosmic gravitational wave signals and background detector noise. By leveraging real data from the Laser Interferometer Gravitational-Wave Observatory (LIGO), this system processes raw strain data into Time-Frequency Q-Transforms and analyzes them using a Convolutional Neural Network (CNN).
- Authentic Scientific Data: Connects directly to the Gravitational-Wave Open Science Center (GWOSC) to fetch real-time observatory data.
- Advanced Signal Processing: Implements whitening, bandpassing, and Constant-Q Transforms to convert raw time-series data into visual spectrograms.
- Deep Learning Architecture: Utilizes a custom-tuned CNN (Convolutional Neural Network) optimized for binary classification of time-frequency images.
- Interactive Web Interface: A sci-fi inspired Flask web dashboard that allows users to scan specific GPS times for cosmic events.
- Battle-Tested Pipeline: robust data generation, automated preprocessing, and model evaluation modules.
Gravitational waves are ripples in the fabric of spacetime caused by some of the most violent and energetic processes in the Universe. This project automates the detection of these signals:
- Input: A GPS timestamp (Time of potential event).
-
Preprocessing: The raw strain data (
$10^{-19}$ meters) is incredibly noisy. We whiten the data to flatten the noise spectrum and apply a bandpass filter (30-400Hz). - Visualization: We generate a Q-Transform, a specialized spectrogram that balances time and frequency resolution, ideal for "chirp" signals.
- Inference: The CNN analyzes the spectrogram image to detect the characteristic "chirp" shape of a binary black hole or neutron star merger.
AstroWave-Intelligence/
├── data/
│ └── processed/ # Generated spectrograms for training
├── models/
│ └── astrowave_cnn.h5 # The trained Neural Network
├── reports/
│ └── figures/ # Confusion matrices and training history
├── src/
│ ├── build_dataset.py # Fetches LIGO data and creates training set
│ ├── data_loader.py # TF Data pipeline for batching and loading
│ ├── evaluate.py # Generates classification reports
│ ├── model.py # CNN Architecture definition
│ ├── preprocess.py # Signal processing (Whitening/Q-Transform)
│ └── train.py # Main training loop
├── static/
│ └── images/ # Dynamic images generated by the web app
├── templates/
│ ├── index.html # Main search interface
│ └── result.html # Prediction results dashboard
├── app.py # Flask Application Entry Point
└── requirements.txt # Python dependencies
- Python 3.8+
- pip (Python Package Manager)
git clone https://github.com/yourusername/astrowave-intelligence.git
cd astrowave-intelligenceIt is highly recommended to use a virtual environment to manage dependencies.
# Windows
python -m venv venv
.\venv\Scripts\activate
# Mac/Linux
python3 -m venv venv
source venv/bin/activatepip install numpy matplotlib tensorflow gwpy gwosc tqdm flask scikit-learn seaborn(Note: gwpy requires TimeSeries libraries that may take a moment to install.)
To train the AI from scratch using fresh LIGO data, follow this pipeline:
-
Generate the Dataset: Downloads real event data and generates noise samples.
python src/build_dataset.py
-
Train the CNN: Loads the dataset, trains the model, and saves
astrowave_cnn_final.h5to themodels/directory (or Desktop).python src/train.py
-
Evaluate Performance: Generates a confusion matrix and classification report.
python src/evaluate.py
Once the model is trained (or if you are using the pre-trained model provided), launch the web dashboard:
-
Ensure the model file is in the right place: Make sure
astrowave_cnn_final.h5is located in themodels/folder. -
Run the Flask App:
python app.py
-
Access the Dashboard: Open your browser and navigate to:
http://127.0.0.1:5000/
Use these GPS times to test the detection capabilities in the web app:
| Event Name | GPS Time | Type | Expected Result |
|---|---|---|---|
| GW150914 | 1126259462.422 |
Binary Black Hole Merger | SIGNAL |
| GW170817 | 1187008882.4 |
Binary Neutron Star Merger | SIGNAL |
| GW151226 | 1135136350.6 |
Binary Black Hole Merger | SIGNAL |
| Random Noise | 1186741861.0 |
Background Noise | NOISE |
| Random Noise | 1126259400.0 |
Background Noise | NOISE |
The model utilizes a robust CNN architecture featuring:
- 2 Convolutional Blocks with MaxPooling and BatchNormalization.
- Dropout regularization to prevent overfitting.
- Binary Crossentropy loss optimization.
Current Accuracy on Validation Set: ~98%
- LIGO Scientific Collaboration: For providing the open data via GWOSC.
- GWpy: For the excellent Python package for gravitational-wave astrophysics.
- TensorFlow: For the deep learning framework.