Spectral Energy Centroid: a Metric for Improving Performance and Analyzing Spectral Bias in Implicit Neural Representations
Tomasz Dądela · Adam Kania · Maciej Rut · Przemysław Spurek
This repository provides the official implementation of Spectral Energy Centroid (SEC), a robust metric for quantifying signal complexity and analyzing the spectral bias of Implicit Neural Representations (INRs).
Setup environment:
conda env create --file environment.yaml
conda activate sec
Log into Weights & Biases:
wandb login
The algorithm of SEC-Conf is relatively straightforward:
- Calculate the Spectral Energy Centroid (SEC) of the target signal.
- Select the reference target image where the SEC value is the most similar to your target.
- Train the model using the best configuration associated with the reference.
Instructions for using SEC-Conf:
usage: find_optimal_config.py [-h] [--size {S,M,L}] [--architecture {siren,finer,relu,wire,all}] image_path
Evaluate image frequency and find the best network configuration.
positional arguments:
image_path Path to the input image.
options:
-h, --help show this help message and exit
--size {S,M,L} Network size (S=2, M=3, L=4 hidden layers). Default: M
--architecture {siren,finer,relu,wire,all}
Network architecture. Default: all
Example:
python find_optimal_config.py example_image.png --size=M --architecture=wire
Calculating frequency for image: example_image.png...
Calculated Target Frequency (Center of Mass): 5
Found 21 configurations matching the closest frequency (Delta: 0).
==================================================
BEST CONFIGURATION (Highest Mean PSNR)
==================================================
Architecture : wire
Hidden Layers : 3
Hidden Features : 180
Sigma : 1
Mean PSNR : 38.6479
==================================================
python src/train.py --datasets='["example_image.png"]' --conf=configs/wire_base.yaml model.omega_0=1 model.hidden_layers=3 model.hidden_features=180
==================================================
To train a SEC-configured model use the command returned by find_optimal_config.py.
In general, to train a model use the src/train.py script and pass appropriate parameters.
E.g. for Siren (ω = 100):
python src/train.py --datasets='["Animal/pexels-photo-69350_1__13.png",]' \
--conf=configs/siren_base.yaml model.omega_0=100 \
logger.save_dir=... checkpoints_path=...
To change which model is trained, select appropriate config from:
configs/siren_base.yamlconfigs/relu_base.yamlconfigs/finer_base.yamlconfigs/wire_base.yaml
Debugging: By default, models are trained on GPU but debugging on CPU is also possible:
python src/train.py --datasets='["Animal/pexels-photo-69350_1__13.png"]' \
--conf=configs/siren_base.yaml \
epochs=200 logger.val_check_interval=20 \
accelerator=cpu \
logger.group=debug
For our experiments, we used 100 images randomly selected from LIU4K-v2 Dataset (25 per category). You can find the specific list of selected images in image_names.txt.
@misc{dadela2026sec,
title={Spectral Energy Centroid: a Metric for Improving Performance and Analyzing
Spectral Bias in Implicit Neural Representations},
author={Tomasz Dądela and Adam Kania and Maciej Rut and Przemysław Spurek},
booktitle = {arXiv},
year={2026}
}