Skip to content

Feature Engineering Still Beats End-to-End Deep Learning on ZTF Light Curves

THE ARGUMENT

On a single ZTF StarEmbed split, classical models trained on physically motivated features outperform from-scratch LSTM and Transformer models across nearly every metric, and the gap traces back to limited labeled data rather than to architecture alone.

On this page

You have 41,357 labeled light curves and budget for exactly one pipeline, but the pitch you heard last week says end-to-end deep learning makes hand-built features obsolete. The usual advice is to skip feature engineering and feed raw observations straight into a sequence model. This comparison on the ZTF StarEmbed dataset (41,357 objects, seven imbalanced classes) says otherwise: the feature-based pipeline reaches 0.907 accuracy, while an unaugmented LSTM reaches 0.609 and an unaugmented Transformer 0.588 [1]. Below is what was actually measured, where the gap comes from, and the conditions under which the ordering could flip.

What the benchmark actually contains: 41,357 curves, seven classes

The benchmark is ZTF StarEmbed, a subset of the Zwicky Transient Facility (ZTF) survey at Palomar Observatory. A light curve is simply a record of how bright an object is over time. The seven classes are EW and EA (eclipsing binaries), RRab, RRc and RRd (three subtypes of RR Lyrae pulsating stars), RS CVn (binary systems), and LPV (long-period variables). The dataset holds roughly 40,000 objects, with Table 1 reporting exactly 41,357, about 35 million individual observations, and a median light-curve length of about 770 data points.

Each observation is a tuple of time in Modified Julian Date, magnitude, magnitude error, and passband. Three passbands are recorded: g, r and i. Data are stored in nested-pandas format, with each light curve held as a nested table inside a row of the main dataframe, which allows vectorized operations across the whole set. Training, validation and test splits follow a 7:1:2 ratio while preserving class proportions.

ClassEWRRcEARRabRS CVnLPVRRdTotal
Objects27,9494,7924,2512,0681,40145743941,357

That table is the first warning: the largest class, EW, holds 27,949 objects while the smallest, RRd, holds 439.

Why accuracy misleads here: four metrics under a 64x gap

The largest class, EW, contains roughly 64 times more objects than the smallest, RRd. A classifier that simply ignores rare classes can still post high accuracy, so the paper reports accuracy only as a reference baseline. The primary metrics are balanced accuracy (mean per-class recall), macro-averaged F1, and macro-averaged ROC-AUC, all of which weight every class equally.

That choice reorders the leaderboard. CatBoost posts the best accuracy at 0.907 but only 0.742 balanced accuracy. Logistic regression drops to 0.787 accuracy yet takes the best balanced accuracy at 0.801. The authors attribute this to the linear model overfitting less to majority classes and therefore holding up better on rare ones.

The feature pipeline: 25 physical features per passband

The classical route computes 25 features per passband with the light-curve-python library, then concatenates the three passbands. The features are physically interpretable quantities: amplitude, the Anderson-Darling normality statistic, Cusum, Eta, EtaE, excess variance, inter-percentile range, kurtosis, maximum slope, mean, median, median absolute deviation, percent amplitude, reduced chi-squared, Roms, skew, standard deviation, StetsonK, weighted mean, and a periodogram that yields two outputs.

Three classifiers are trained on these features: one-vs-rest logistic regression, CatBoost, and a multilayer perceptron. On the held-out test set, CatBoost reaches 0.907 accuracy, 0.742 balanced accuracy, 0.771 macro F1 and 0.981 macro ROC-AUC. The MLP reaches 0.903, 0.762, 0.779 and 0.981; logistic regression reaches 0.787, 0.801, 0.661 and 0.955. The near-tie between CatBoost and the MLP suggests the extracted features form a nearly linearly separable representation.

Figure 2 of the paper shows the nine features CatBoost ranked as most important, but the body text does not name them individually, and this article does not fill that gap.

How end-to-end models eat raw observations, and the 512-point ceiling

The second route drops feature extraction entirely. Each light curve becomes a sequence of at most 512 observations, each described by four numbers: days since the first observation, the logarithm of the passband wavelength, normalized flux, and normalized flux uncertainty obtained by dividing the measurement error by the flux standard deviation. Shorter curves are zero-padded, and a padding mask excludes those positions from computation. Models train with the AdamW optimizer and a class-weighted cross-entropy loss.

Two architectures are tried. The best recurrent model uses two bidirectional LSTM layers with hidden size 256, masked aggregation over mean, maximum, standard deviation and final state, and a classification head, totaling about 3.7 million parameters. The Transformer uses model dimension 128, four attention heads, feed-forward dimension 512, pre-normalization and fixed sinusoidal positional encodings; the shallowest version has about 0.27 million parameters, while the deeper one stacks four encoder layers with masked mean, maximum and standard deviation pooling and an expanding GELU head.

The 512-observation ceiling collides with a median length of about 770, so most curves cannot be fed in full. The paper turns that constraint into augmentation: each epoch draws 512 real observations, and no synthetic points are ever generated. Three strategies are used. Random subsampling draws 512 points uniformly from the whole curve and keeps chronological order. Random bins selects 24-hour bins at random and keeps every observation inside them until 512 points accumulate. Random window keeps 512 consecutive observations starting from a random position. Figure 5 illustrates all three on a single curve of 2,982 observations.

Head to head: 0.907 versus 0.763, and what augmentation buys back

ModelAccuracyBalanced acc.Macro F1Macro ROC-AUC
Features + CatBoost0.9070.7420.7710.981
Features + MLP0.9030.7620.7790.981
Features + logistic regression0.7870.8010.6610.955
LSTM (linear head), no augmentation0.6090.6530.5080.914
Deep BiLSTM + GELU + random window0.7630.7330.6250.948
Transformer, no augmentation0.588—0.4880.894
Best Transformer (random bins)0.692—0.5560.923

An unaugmented LSTM scores only 0.609 accuracy, 0.508 macro F1 and 0.914 macro ROC-AUC. With augmentation, the best LSTM configuration lifts accuracy from 0.609 to 0.763, macro F1 from 0.508 to 0.625, and macro ROC-AUC from 0.914 to 0.948. The best Transformer lifts accuracy from 0.588 to 0.692, macro F1 from 0.488 to 0.556, and macro ROC-AUC from 0.894 to 0.923.

Even the best deep configuration, at 0.763, sits roughly 14 percentage points below CatBoost at 0.907; both numbers come from Table 2, and the subtraction is mine. Random window and random bins help in most configurations, while random subsampling is the least stable and degrades several runs: the linear-head LSTM with random subsampling falls to 0.437 accuracy, below its own unaugmented 0.609. The authors also note that which of bins or window wins varies by configuration, and that run-to-run variability cannot be separated from these differences without further study.

Where this conclusion stops applying

First, it is a single-dataset, single-survey result. Every experiment runs on the seven classes and 41,357 labeled objects of ZTF StarEmbed. A different survey, a different class taxonomy, or an order of magnitude more labels could reorder the leaderboard. The paper's own wording is careful: current models fail to generalize with the available training set size, which is not the same claim as deep learning being unsuitable for the task.

Second, no pretrained foundation model is tested. The authors explicitly list self-supervised pretraining on large unlabeled surveys as future work, so the deep side has not played its strongest card. This comparison is strictly between from-scratch LSTM and Transformer models.

Third, the 512-observation truncation is an imposed constraint, and the information loss on long curves is structural. Random window and random bins soften it but do not remove it, and results with the sequence cap lifted are not reported. The method also does not apply when your labeled set is far larger than 41,357 objects or when curves are short enough to fit whole, because the data-limitation argument that explains the gap no longer holds.

  • Scope covers only ZTF passbands g, r, i and seven classes; cross-survey transfer is untested
  • Every deep model trains from scratch, with no pretrained weights
  • Even CatBoost reaches only 0.742 balanced accuracy, so rare classes remain weak
  • The bins-versus-window ranking cannot be separated from run-to-run noise

What this work delivers is a ruler, not a verdict: a reproducible quantitative baseline [1] plus an explicit statement that the two preconditions for closing the gap, larger labeled sets and stronger self-supervised pretraining, are still unmet.

References

  1. Feature-Based and Deep Learning Methods for Astronomical Light Curve Classification

Sign in to Padda

A code in your inbox. No password to remember.

Connecting to sign-in…