Skip to content
uzayyaydiinPublic

About

SpecLess is an open source Python framework for photometry based machine learning classification of galaxies across multiple astronomical surveys.

Topics

Resources

Stars

6 stars

Watchers

6 watching

Forks

Repository files navigation

SpecLess logo

SpecLess

Photometry Based Galaxy Classification

PyPI Tests Python versions License

Overview

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.

Surveys and Validation

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.

Installation

Install the public release from PyPI:

pip install specless-astro

To verify the installed package version:

python -m pip show specless-astro

To 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, ActivityClassifier

Model 1: Galaxy Morphology

Model 1 performs binary morphological classification:

  • Elliptical
  • Spiral

The pretrained classifier uses XGBoost.

Required photometry

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.

Data

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

Performance

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

Example

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: Galaxy Activity Classification

Model 2 performs four-class activity classification:

  • Seyfert
  • Starburst
  • Star-forming
  • LINER

The pretrained classifier uses XGBoost.

Required photometry

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.

Data

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.

Performance

Metric Score
Accuracy 0.8217
Balanced accuracy 0.7865
Macro F1 0.7637
Macro ROC AUC 0.9572

Example

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",
        ]
    ]
)

Cross-Survey Validation

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

Repository Structure

SpecLess/
├── src/
│   └── specless_astro/
│       ├── morphology/
│       ├── activity/
│       └── resources/
├── tests/
├── examples/
├── validation/
│   ├── model1/
│   └── model2/
├── docs/
│   └── assets/
├── pyproject.toml
├── LICENSE
└── README.md

Testing

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.

Data and Reproducibility

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.

Documentation

Additional model and validation documentation is available in the docs and validation directories.

Citation

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

BibTeX

@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} }

Author

Uzay Aydın
Prof. Dr. Mehmet Tanrıver

Astronomy and Space Sciences
Erciyes University, Türkiye

License

SpecLess is distributed under the BSD 3-Clause License.

See LICENSE for the full license text.

Multi-survey classification

SpecLess 0.3.0 provides survey-specific photometric machine-learning models for galaxy morphology and activity classification.

Morphology classification

Supported photometric domains:

  • sdss: SDSS u, g, r, i, z + AllWISE W1, W2
  • kids: KiDS+VIKING u, g, r, i, Z, Y, J, H, Ks
from specless_astro import MorphologyClassifier

sdss_morphology = MorphologyClassifier(survey="sdss")
kids_morphology = MorphologyClassifier(survey="kids")

Activity classification

Supported photometric domains:

  • sdss: SDSS u, g, r, i, z + AllWISE W1, W2, W3
  • desi: DESI Legacy Surveys g, r, z, W1, W2, W3 magnitudes and their magnitude uncertainties
from specless_astro import ActivityClassifier

sdss_activity = ActivityClassifier(survey="sdss")
desi_activity = ActivityClassifier(survey="desi")

Inspect model requirements

model = MorphologyClassifier(survey="kids")
print(model.required_columns)
print(model.info())

model = ActivityClassifier(survey="desi")
print(model.required_columns)
print(model.info())

Available survey models

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.

About

SpecLess is an open source Python framework for photometry based machine learning classification of galaxies across multiple astronomical surveys.

Topics

Resources

Stars

6 stars

Watchers

6 watching

Forks

Releases

Packages

Contributors

Languages