Deep learning framework for predicting acoustic room characteristics from geometric and material properties. This project develops and trains multi-task neural networks to estimate Energy Decay Curves (EDCs) and derived acoustic parameters (Early Decay Time, Reverberation Time T20, Clarity Index C50) from room feature vectors.
Acoustic simulation and room design typically require either expensive physical measurements or computationally intensive geometric acoustics simulations. This project addresses the inverse problem: predicting acoustic characteristics directly from architectural properties using supervised deep learning.
The framework implements multiple neural network architectures (CNN-LSTM multi-head networks, pure LSTM, Transformer variants) trained on 6,000 room configurations with corresponding EDCs computed through room acoustic simulation.
The trained multi-head CNN-LSTM model achieves the following performance metrics on the test set:
| Acoustic Parameter | Mean Absolute Error | Root Mean Squared Error | R² Score |
|---|---|---|---|
| EDC (normalized) | 0.000257 | 0.00213 | 0.9995 |
| T20 (seconds) | 0.0647 | 0.1106 | 0.9530 |
| C50 (decibels) | 0.338 | 0.610 | 0.9917 |
Model specifications:
- Architecture: Multi-head CNN-LSTM with shared fully-connected layers
- Input dimension: 16 room features
- Output dimension: 96,000 EDC samples + scalar T20, C50 predictions
- Parameters: 103,385,218 trainable parameters
- Training: 200 epochs, batch size 8, 94.2 minutes on single GPU
- Python 3.8 or higher
- CUDA 11.8+ (optional, for GPU acceleration)
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtDependencies are specified in requirements.txt and include:
- Core scientific computing: NumPy, Pandas, SciPy, scikit-learn
- Deep learning: PyTorch 2.0+, PyTorch Lightning 2.0+
- Audio processing: librosa, soundfile, pyroomacoustics
- Visualization: Matplotlib, TensorBoard
- Configuration: Hydra, OmegaConf
Before running inference or training, download the required datasets and trained model:
-
Room Features Dataset and Reference EDCs
- Source: Zenodo
- URL: https://zenodo.org/records/17210197
- Contents:
roomFeaturesDataset.csvand EDC reference files - Extract to:
data/raw/
-
Pre-trained Multi-head Model
- Source: TU Ilmenau SharePoint
- URL: https://tuilmenau365-my.sharepoint.com/:u:/g/personal/m_awais_tu-ilmenau_de/IQAOtapPee_oRIy7-nLVouv6AQENaPqAiRMJS90cuvWLfCc?e=YHBc2g
- Contents: Trained checkpoint, scalers, metadata, and predictions
- Extract to:
trained_models/
These downloads are required for:
- Running inference with the pre-trained model
- Evaluating the model on the test set
- Training new models (requires the dataset)
Generate acoustic predictions for room configurations:
# Single room prediction
python inference.py \
--checkpoint trained_models/multihead_edc_baseline_v1_2026_01_23/checkpoints/best_model.ckpt \
--features data/raw/roomFeaturesDataset.csv \
--index 0
# Multiple room predictions
python inference.py \
--checkpoint trained_models/multihead_edc_baseline_v1_2026_01_23/checkpoints/best_model.ckpt \
--features data/raw/roomFeaturesDataset.csv \
--indices 0 1 2 3
# With visualization (generates EDC curve plots)
python inference.py \
--checkpoint trained_models/multihead_edc_baseline_v1_2026_01_23/checkpoints/best_model.ckpt \
--features data/raw/roomFeaturesDataset.csv \
--index 0 \
--visualizeOutput files:
- EDC predictions and acoustic parameters printed to console
- Visualization plots saved to
edc_plots/directory (when using--visualize)
Comprehensive evaluation on test set:
python evaluate.py \
--checkpoint trained_models/multihead_edc_baseline_v1_2026_01_23/checkpoints/best_model.ckpt \
--features data/raw/roomFeaturesDataset.csv \
--edc-dir data/raw/EDCTrain models from scratch or resume training:
# Train new model
python train_multihead.py \
--max-samples 6000 \
--batch-size 8 \
--max-epochs 200
# Resume from checkpoint
python train_multihead.py \
--max-samples 6000 \
--checkpoint trained_models/multihead_edc_baseline_v1_2026_01_23/checkpoints/latest.ckptedc_pred/
├── src/
│ ├── models/
│ │ ├── base_model.py PyTorch Lightning base class
│ │ ├── multihead_model.py Multi-head CNN-LSTM architecture
│ │ ├── lstm_model.py LSTM baseline
│ │ ├── transformer_model.py Transformer variant
│ │ └── hybrid_models.py Alternative CNN-LSTM configurations
│ ├── data/
│ │ └── data_loader.py Data preprocessing and loading
│ ├── evaluation/
│ │ └── metrics.py Evaluation metrics and acoustic parameter computation
│ └── training/
│ └── __init__.py
│
├── data/
│ ├── raw/
│ │ ├── roomFeaturesDataset.csv Input room geometry and material properties
│ │ └── EDC/ Reference Energy Decay Curve files
│ ├── processed/ Placeholder for processed data
│ └── external/ Placeholder for external datasets
│
├── trained_models/
│ └── multihead_edc_baseline_v1_2026_01_23/
│ ├── checkpoints/
│ │ └── best_model.ckpt Trained model weights (PyTorch Lightning checkpoint)
│ ├── metadata.json Training configuration and performance metrics
│ ├── scaler_X.pkl Feature normalization (StandardScaler)
│ ├── scaler_y.pkl Target normalization (StandardScaler)
│ ├── tensorboard_logs/ Training visualization logs
│ ├── edc_predictions.npy Model predictions (test set)
│ ├── edc_targets.npy Reference EDC values (test set)
│ ├── t20_predictions.npy T20 predictions (test set)
│ ├── t20_targets.npy T20 references (test set)
│ ├── c50_predictions.npy C50 predictions (test set)
│ └── c50_targets.npy C50 references (test set)
│
├── edc_plots/ Generated visualization outputs
├── scripts/ Utility scripts for analysis and training
├── evaluate.py Evaluation script
├── inference.py Inference interface
├── train_multihead.py Training script for multi-head model
├── requirements.txt Python package dependencies
└── README.md This file
The model expects 16 room features as input:
- Room length (m)
- Room width (m)
- Room height (m)
- Wall absorption coefficient (4 values, one per pair of opposing walls + ceiling/floor)
- Floor material type (categorical, encoded)
- Ceiling material type (categorical, encoded)
- Additional acoustic properties (variable)
Features must be normalized using the provided scaler (scaler_X.pkl) before inference.
Energy Decay Curves are 96,000-sample arrays representing normalized acoustic energy decay. Computed via:
EDC[n] = 10 * log10(sum(h[k]^2 for k >= n) / sum(h[k]^2 for all k))
where h is the room impulse response.
The multi-head model combines two pathways:
-
CNN Pathway:
- 1D convolutional layers: filters [32, 64], kernel size 3
- BatchNormalization and ReLU activations
- Processes feature vector as single-channel 1D signal
-
LSTM Pathway:
- Bidirectional LSTM: 128 hidden units
- Processes feature sequence with temporal context
-
Fusion:
- Concatenated features passed to shared fully-connected layers
- Architecture: FC(2048) -> ReLU -> Dropout(0.3) -> Output layers
-
Output Heads:
- EDC head: 96,000 values (reconstructed decay curve)
- T20 head: 1 scalar value (reverberation time at -20 dB)
- C50 head: 1 scalar value (clarity index)
Hyperparameters used for the provided trained model:
- Optimizer: Adam with default parameters (lr=0.001)
- Loss function: Weighted multi-task loss
- EDC loss weight: 1.0
- T20 loss weight: 100.0
- C50 loss weight: 50.0
- Gradient clipping: 1.0
- Batch size: 8
- Maximum epochs: 200
- Early stopping: Based on validation loss
The model predicts three standard acoustic parameters:
-
EDT (Early Decay Time): Time for energy to decay 10 dB in the early part of the impulse response. Measured in seconds.
-
T20 (Reverberation Time): Time for sound energy to decay 60 dB, estimated from the 20-30 dB decay range. Measured in seconds. Standard measure for room acoustics.
-
C50 (Clarity Index): Ratio of energy arriving in the first 50 ms to total energy. Measured in dB. Important for speech intelligibility.
The full EDC is a 96,000-sample array representing normalized acoustic energy decay over time. At 48 kHz sample rate, this corresponds to 2 seconds of temporal resolution.
With the --visualize flag, the inference script generates two-panel plots:
- Top panel: Full energy decay curve (0-2 seconds)
- Bottom panel: Early decay detail (0-100 ms)
Plots are saved to edc_plots/ directory as PNG files (150 DPI).
Critical files required for inference:
- Model checkpoint:
trained_models/multihead_edc_baseline_v1_2026_01_23/checkpoints/best_model.ckpt - Feature scaler:
trained_models/multihead_edc_baseline_v1_2026_01_23/scaler_X.pkl - Feature data:
data/raw/roomFeaturesDataset.csv
The scaler file is critical: it ensures input features are normalized identically to training data. If absent, features are re-normalized from the CSV, which introduces data leakage and may degrade predictions.
To reproduce results:
- Use provided trained model checkpoint (no retraining required)
- Ensure Python version matches (3.8+)
- Install exact dependency versions:
pip install -r requirements.txt - Use provided feature and EDC data files unchanged
- Run inference with provided checkpoint path
Training from scratch requires:
- Original raw data (6,000+ room configurations with ground truth EDCs)
- Sufficient GPU memory (16+ GB recommended for batch size 8)
- Equivalent training configuration (see metadata.json)
The repository has been organized to contain only essential project files:
- Training scripts and model definitions in
src/ - Trained model checkpoint and metadata in
trained_models/ - Data loading utilities and evaluation metrics
- Inference interface with visualization support
- Complete dependencies list in
requirements.txt
The .gitignore file excludes:
edc_plots/: Generated visualization outputstrained_models/: Large model checkpoint files (included in submission)- Python cache and build artifacts
- Virtual environment directories
- The model is trained on simulated room acoustics data. Performance on real measured data may differ.
- EDC predictions are normalized. Denormalization requires the target scaler (
scaler_y.pkl) for direct acoustic energy interpretation. - GPU acceleration is recommended for training but not required for inference.
- The sklearn version warning during inference (if present) is harmless and does not affect accuracy.
- Feature normalization using
scaler_X.pklis critical for inference accuracy. The inference pipeline automatically loads this scaler.
For additional information, refer to docstrings and function signatures in the source code.