Photometry Based Galaxy Classification
SpecLess is an open-source Python package for photometry-based machine-learning classification of galaxies.
The package provides pretrained classifiers and automated photometric feature construction for galaxy classification without requiring spectroscopy at inference time.
The current release contains two classification models:
- Model 1: Elliptical and Spiral galaxy morphology
- Model 2: Seyfert, Starburst, Star-forming, and LINER activity classification
The package is distributed on PyPI as specless-astro and imported in Python as specless_astro.
SpecLess was developed and evaluated using photometric data from multiple astronomical surveys and catalogues.
Current development and validation work includes:
- SDSS optical photometry and spectroscopic ground-truth samples
- AllWISE mid-infrared photometry used by the pretrained classifiers
- KiDS external optical survey validation
- VIKING near-infrared photometry used together with KiDS in cross-survey validation
- DESI Legacy Surveys external survey testing and cross-survey portability analysis
SpecLess is designed for photometry-based galaxy classification across heterogeneous survey data, with scalability toward upcoming large imaging datasets such as LSST.
Install the public release from PyPI:
pip install specless-astroTo verify the installed package version:
python -m pip show specless-astroTo verify the installed package version:
python -m pip show specless-astro
The two classifiers can then be imported with:
```python
from specless_astro import MorphologyClassifier, ActivityClassifierModel 1 performs binary morphological classification:
- Elliptical
- Spiral
The pretrained classifier uses XGBoost.
Seven photometric bands are required:
- SDSS
u,g,r,i,z - WISE
W1,W2
SpecLess automatically constructs 21 colour features from the seven input magnitudes, producing a total of 28 model features.
| Sample | Number of galaxies |
|---|---|
| Training sample | 142,212 |
| Independent test sample | 35,554 |
| Elliptical galaxies in test sample | 12,888 |
| Spiral galaxies in test sample | 22,666 |
| Metric | Score |
|---|---|
| Accuracy | 0.9375 |
| Balanced accuracy | 0.9388 |
| Macro F1 | 0.9332 |
| ROC AUC | 0.9826 |
| Elliptical recall | 0.9434 |
| Spiral recall | 0.9341 |
import pandas as pd
from specless_astro import MorphologyClassifier
catalog = pd.read_csv("catalog.csv")
model = MorphologyClassifier()
result = model.predict(catalog)
print(
result[
[
"specless_label",
"p_elliptical",
"p_spiral",
"confidence",
]
]
)Model 2 performs four-class activity classification:
- Seyfert
- Starburst
- Star-forming
- LINER
The pretrained classifier uses XGBoost.
Eight photometric bands are required:
- SDSS
u,g,r,i,z - WISE
W1,W2,W3
SpecLess automatically constructs 28 colour features from the eight input magnitudes, producing a total of 36 model features.
The spectroscopically labelled parent sample contains 133,886 galaxies.
The final SDSS and WISE photometric sample contains 84,652 galaxies:
| Class | Number of galaxies |
|---|---|
| Star-forming | 37,518 |
| Starburst | 36,924 |
| Seyfert | 5,990 |
| LINER | 4,220 |
The independent test sample contains 16,931 galaxies.
| Metric | Score |
|---|---|
| Accuracy | 0.8217 |
| Balanced accuracy | 0.7865 |
| Macro F1 | 0.7637 |
| Macro ROC AUC | 0.9572 |
import pandas as pd
from specless_astro import ActivityClassifier
catalog = pd.read_csv("catalog.csv")
model = ActivityClassifier()
result = model.predict(catalog)
print(
result[
[
"specless_label",
"p_seyfert",
"p_starburst",
"p_starforming",
"p_liner",
"confidence",
]
]
)The repository contains validation products associated with external and cross-survey experiments.
These include:
- KiDS and VIKING validation products
- SDSS and WISE to KiDS and VIKING transfer experiments
- feature-importance products
- SHAP-based interpretation products
For Model 2, the SDSS and WISE trained XGBoost classifier obtained the following results in the KiDS and VIKING external validation experiment:
| Metric | Score |
|---|---|
| Accuracy | 0.7935 |
| Balanced accuracy | 0.7586 |
| Macro F1 | 0.7528 |
| Macro ROC AUC | 0.9533 |
SpecLess/
├── src/
│ └── specless_astro/
│ ├── morphology/
│ ├── activity/
│ └── resources/
├── tests/
├── examples/
├── validation/
│ ├── model1/
│ └── model2/
├── docs/
│ └── assets/
├── pyproject.toml
├── LICENSE
└── README.md
The repository contains regression tests for both classifiers, photometric feature construction, required input handling, model metadata, and frozen reference predictions.
Tests are also run through GitHub Actions.
Large survey catalogues used during model development are not distributed directly with the Python package.
The public repository contains the pretrained model files, feature definitions, model metadata, compact reference samples, regression tests, validation metrics, cross-survey results, and interpretation products required for software use and verification.
Additional model and validation documentation is available in the docs and validation directories.
If you use SpecLess in your research, please cite the following paper:
Aydin, U., & Tanriver, M. (2026).
SpecLess: A Multi Survey Python Package for Machine Learning Classification of Galaxy Morphology and Activity from Photometry.
arXiv:2610.31545 [astro-ph.GA].
Paper: https://arxiv.org/abs/2610.31545
@misc{aydin2026specless, title = {SpecLess: A Multi Survey Python Package for Machine Learning Classification of Galaxy Morphology and Activity from Photometry}, author = {Aydin, Uzay and Tanriver, Mehmet}, year = {2026}, eprint = {2610.31545}, archivePrefix = {arXiv}, primaryClass = {astro-ph.GA}, url = {https://arxiv.org/abs/2610.31545} }
Uzay Aydın
Prof. Dr. Mehmet Tanrıver
Astronomy and Space Sciences
Erciyes University, Türkiye
SpecLess is distributed under the BSD 3-Clause License.
See LICENSE for the full license text.
SpecLess 0.3.0 provides survey-specific photometric machine-learning models for galaxy morphology and activity classification.
Supported photometric domains:
sdss: SDSSu, g, r, i, z+ AllWISEW1, W2kids: KiDS+VIKINGu, g, r, i, Z, Y, J, H, Ks
from specless_astro import MorphologyClassifier
sdss_morphology = MorphologyClassifier(survey="sdss")
kids_morphology = MorphologyClassifier(survey="kids")Supported photometric domains:
sdss: SDSSu, g, r, i, z+ AllWISEW1, W2, W3desi: DESI Legacy Surveysg, r, z, W1, W2, W3magnitudes and their magnitude uncertainties
from specless_astro import ActivityClassifier
sdss_activity = ActivityClassifier(survey="sdss")
desi_activity = ActivityClassifier(survey="desi")model = MorphologyClassifier(survey="kids")
print(model.required_columns)
print(model.info())
model = ActivityClassifier(survey="desi")
print(model.required_columns)
print(model.info())print(MorphologyClassifier.available_surveys())
print(ActivityClassifier.available_surveys())The DESI activity classifier expects the same prepared photometric representation used during model development. Catalogue cross-matching, source-quality selection, flux-to-magnitude conversion and extinction correction remain upstream operations.
