Segmenting Solar Filaments in H-alpha Images
In November 2026 I entered the Solar Filament Segmentation Challenge 2026 on Kaggle, run by the Earth-Space AI Research Lab. The task was to outline every solar filament in full-disk H-alpha images of the Sun. I made my first submission twelve days before the close and finished 297th on the private leaderboard, with a private score of 0.36 and a public one of 0.37.
That rank is unremarkable, and this post is not a victory lap. The competition was unusual in ways that made it more instructive than most. The annotators agree with each other less than the model agrees with them. The public leaderboard could not tell good changes from noise. Many of the teams above me were later removed. This post covers the science, the metric, the pipeline, what did not work and the lessons I would keep. Every result below comes from the code repository, its decision log and the four-page report.
In short
- One U-Net at 1536 px feeds a tree of candidate filaments from twelve thresholds. A learned scorer picks the best disjoint set exactly, and ten refiners redraw each pick in a crop turned along its axis.
- Out-of-fold Panoptic Quality (PQ) was 0.440 (95 per cent interval 0.431 to 0.449). One human annotator scored against another on the same images reaches only 0.340.
- The public leaderboard scored about 90 images to two decimals and could not resolve most steps. Decisions were made out of fold, from submission 6 on with paired bootstrap tests, and the private score never fell from one submission to the next.
- Lessons: measure the label ceiling first, read the scorer's code, optimise what the metric pays for, and fix the adoption rule before seeing the result.
What a solar filament is
A filament is a cloud of cool, dense plasma held above the Sun's surface by magnetic fields. The competition describes filaments as dense "clouds" of solar material suspended by magnetic field lines above photospheric neutral lines. The MAGFiLO paper explains why they are visible at all. The cool material absorbs H-alpha light from the photosphere beneath it, so the filament appears dark against the disk. Seen beyond the edge of the disk against dark sky, the same structure is bright, and is then called a prominence.
They matter for space weather. MAGFiLO's authors write that filaments are closely associated with solar eruptive events: coronal mass ejections (CMEs), solar flares and solar energetic particle storms. NOAA's Space Weather Prediction Center notes that a suspended filament can collapse back to the surface and be quietly reabsorbed, or a CME may result. The competition page lists what an Earth-directed CME can do: damage the power grid, disrupt GPS and create radiation hazards on polar flights. Outlining filaments automatically, image after image, is a building block for monitoring them.
The images come from the Global Oscillation Network Group (GONG), which the National Solar Observatory describes as a worldwide network of six identical telescopes designed to observe the Sun around the clock. It offers 2K by 2K H-alpha images at a 20-second cadence. The labels come from MAGFiLO, which holds 10,244 annotated filaments from 1,593 GONG observations between 2011 and 2022. The competition used only its segmentation masks. MAGFiLO also records each filament's spine and magnetic chirality, which this task left aside.
The data and the metric
The training set had 707 images of 2,048 by 2,048 pixels, saved as 8-bit greyscale JPEGs, with 8,199 annotated filaments. The median was seven per image. The test set had 180 images. One detail shaped everything: 296 training images were annotated by two or three people, and each annotator's set was scored separately against the same prediction.
The metric was Panoptic Quality (Kirillov et al.). A predicted and an annotated filament form a true positive (TP) when their intersection over union (IoU) exceeds 0.5. Then
PQ = sum of IoU over TP / (TP + 0.5 FP + 0.5 FN),
pooled over every annotator-image pair. Two consequences follow. Every false positive (FP) adds 0.5 to the denominator, so deciding which candidates to submit matters as much as drawing them well. And a prediction can never match every annotator when the annotators disagree, so the best achievable score is far below 1.
Reading the organisers' scoring notebook turned up a third point. It does not enforce one-to-one matching, so two overlapping copies of one confident mask would both count as true positives. I reproduced the scorer exactly in my own code, and every submission was disjoint by construction. That loophole was never used on the leaderboard.
Measure the ceiling before modelling
The most useful number in the project needed no model at all. On the 296 images with several annotators, I scored each annotator's masks as if they were predictions against each of the others. The result was PQ 0.340, with segmentation quality (the mean IoU of matched pairs) 0.634.
| On the same 296 images | PQ | SQ | RQ |
|---|---|---|---|
| One annotator vs the others | 0.340 | 0.634 | 0.536 |
| Final pipeline, out of fold | 0.441 | 0.677 | 0.651 |
SQ is segmentation quality and RQ recognition quality; PQ is their product. On the same images, a model trained on the consensus scores higher against each annotator than the annotators score against each other, because it predicts where annotators agree rather than one person's habits. The same number also set expectations. When human annotators reach 0.34 against each other, public scores of 0.55 and above were hard to read as better modelling, which mattered when reading the leaderboard.
It also gives a rule for when a doubtful prediction pays. A prediction matching k of the n annotators of an image raises PQ only if k/n exceeds PQ/(2 SQ), about 0.32 at the final scores. A filament marked by one annotator of three is roughly break-even. That is why lowering the size or confidence thresholds never helped.
A validation I could trust
The public leaderboard scored about 90 test images and showed two decimals. Scaling the out-of-fold bootstrap interval to about 90 images gives roughly plus or minus 0.027 for one pipeline, larger than any single improvement I made. So decisions were made out of fold. The first experiments compared settings on one fold or on pooled out-of-fold scores. Later ones followed the rules below.
- Split by calendar month. Filaments persist for days, so images from the same week are near-duplicates. Five folds grouped by month keep all annotators of an image on one side, and most of its neighbouring days with it.
- Exact metric. My PQ code gives the same score as the organisers' notebook, to six decimals, on 15 check pairs.
- Paired bootstrap. Resample whole images 2,000 times and compute the gain of a change over the current pipeline on the same images. From submission 6 on, a change was adopted only if the 95 per cent interval excluded zero.
- A stricter rule for the last rounds. For the refiner blends and the final adoption round, the rule was written down before each experiment: the interval must exclude zero and the gain must be positive on all five folds.
The rule was tested at the end. A UNet++ refiner on the jittered crops scored 0.4422 out of fold, above the final 0.4399, with an interval of +0.0001 to +0.0044. But it improved only three of five folds, so it was rejected, and the submission stayed as it was. Picking the higher number would have been picking noise from the best of many tries.
The pipeline
Stage 1, the probability map. A U-Net (Ronneberger et al.) with an ImageNet ResNet-34 encoder from segmentation_models.pytorch, one input channel, trained for 40 epochs at 1536 px with binary cross-entropy plus soft Dice. The target is the fraction of annotators marking each pixel, so the network learns the probability that an annotator marks it, which is what a multi-annotator metric rewards. 1536 px beat 1024 px on four of five folds, and native 2048 px was no better. At test time the image is run in four flipped views. Their mean is the probability map, and their per-pixel standard deviation, the "view spread", marks where the model is unsure.
Candidates as a tree. The map is thresholded at twelve levels from 0.25 to 0.80. At each level, a closing with a 31 px disk decides which fragments belong together, and connected components of at least 100 px become candidates. A component at a higher threshold always lies inside one at the next lower threshold, so the candidates form a forest. A filament can be taken whole at a low level, thinner at a high one, or split from a neighbour it merges with lower down.
Scoring and exact selection. Every node gets a predicted contribution to PQ: its matched IoU averaged over the image's annotators, with zero for an annotator it does not match. A hurdle model predicts this as the probability that the node matches anyone, times the expected value if it does. Both parts are gradient-boosted trees from scikit-learn, trained on out-of-fold nodes with 32 features: shape, probability statistics, contrast with a ring around the node, position on the solar disk, place in the tree and view spread. The submission is the set of disjoint nodes that maximises the sum of (score minus 0.26). On a forest this is exact by dynamic programming: each node takes the larger of its own score and the best total of its children. The masks are disjoint by construction, with no overlap rules to tune.
Stage 2, rotated-crop refiners. A threshold of one map cannot draw every filament well. Each selected filament is redrawn at native resolution in a 384 by 128 crop turned along its principal axis. The four input channels are the image, the stage-1 probability, the filament itself and the other selected filaments. Ten refiners (a UNet++ and a U-Net per fold, the U-Net trained with extra crops of fragments and a small jitter) are averaged over four flips, thresholded at 0.40 and pasted back so that masks stay disjoint. Stage 2 gained +0.013 (interval 0.010 to 0.016) over stage 1, on all five folds. With the first refiner, most of the gain came through recognition quality: redrawn fragments crossed the IoU 0.5 line.
The tree, the hurdle target, the exact selection and the stage-2 design follow a public notebook, Solar Filament Segmentation 2026 (0.40). The implementation, the features including the view spread, and the refiner ensemble are my own. The whole pipeline takes about 16 seconds per image on an Apple M3 Max, and a notebook in the repository reproduces the submission byte for byte.
Results, submission by submission
The first four submissions used a hand rule: a fixed threshold, a closing, a minimum area and a minimum mean probability, tuned on the validation folds. From submission 5 on, a learned scorer chose the instances instead.
| Sub | Pipeline | Out of fold | Public | Private |
|---|---|---|---|---|
| 1 | U-Net, 1024 px, fold 0, 10 epochs, hand rule | 0.389 (fold 0) | 0.32 | 0.30 |
| 2 | The same, 40 epochs | 0.415 (fold 0) | 0.35 | 0.33 |
| 3 | Average of five fold models | 0.410 | 0.35 | 0.33 |
| 4 | One model on all images | 0.409 | 0.35 | 0.33 |
| 5 | 1536 px, four views, learned scorer | 0.422 | 0.35 | 0.34 |
| 6 | Twelve-level tree, hurdle scorer, exact selection | 0.427 | 0.36 | 0.34 |
| 7 | + one U-Net refiner per fold | 0.433 | 0.37 | 0.36 |
| 8 | + UNet++ and jitter refiners (final) | 0.440 | 0.37 | 0.36 |
Out of fold ran 0.06 to 0.07 above the public leaderboard for every submission. Two public notebooks validated out of fold report a similar gap, 0.05 to 0.06, and attribute it to the labels; one of them finds the test images indistinguishable from the training images. I did not test that. The gap was stable, so out-of-fold differences remained a usable guide. The private score never fell from one submission to the next, even where the public board could not separate the steps.
What did not help, and why
Each of these was measured on fold 0 or out of fold, with its own tuned post-processing. The numbers are in the decision log.
- A detector. Mask R-CNN learns grouping explicitly, but its masks were coarser: segmentation quality 0.642 against 0.657 for a U-Net trained for a similar number of epochs, and PQ 0.377 against 0.416 for the fully trained U-Net on fold 0. Adding its extra instances to that U-Net changed PQ by less than 0.002.
- Bigger or different encoders. ResNet-50 scored 0.414 against 0.416. A ConvNeXt-T member gained 0.0016 on one fold, below what one fold resolves.
- Ensembles of equals. The average of five fold models scored the same on the public board as one model trained on everything.
- Loss and input changes. A Lovász hinge loss dropped PQ to 0.390. Correcting for limb darkening (the disk is dimmer towards its edge) made the network more confident but not more accurate.
- Post-processing rules. Hysteresis thresholds, size-dependent confidence, and growing or shrinking every mask by one pixel. Dilation cost 0.03, erosion 0.01.
One explanation covers most of the list. The models share their errors because the errors come from the annotators. Two equally good networks disagree with the labels in the same places, so averaging them gives the score of the better one. Apart from the move to 1536 px, the gains came from changes that targeted the metric's structure: which candidates to submit, and redrawing the ones near the IoU 0.5 line.
Where the remaining PQ is lost
An error count on every third out-of-fold image (236 images), run with the first refiner version (submission 7), found 1,629 true positives, 769 false positives and 1,141 false negatives. Of the false negatives, 661 overlapped no prediction at all, and 341 were near misses with IoU between 0.3 and 0.5. So 769 of the 2,398 predicted filaments, 32 per cent, matched no annotation at the IoU threshold of 0.5.
Small filaments dominate the misses, and the annotators rarely agree on them either. An oracle that dropped every prediction with a net negative effect would reach 0.474 on this subset, against 0.426, but nothing in the refiners' output predicted which ones those were. Extent errors behave the same way. In the earlier 1024 px pipeline, 37 per cent of false negatives were near misses; the prediction was smaller than the annotation in 46 per cent of them and larger in 34 per cent. Growing or shrinking every mask lost PQ, so no global rule fixes them.
Where the physics entered
Domain knowledge helped most in the validation and the features, not the network.
- Time. Filaments last for days and drift across the disk as the Sun rotates. A random split would leak near-copies of validation images into training, so the folds were grouped by month.
- Geometry. Only 2.0 per cent of annotations reach beyond 70 degrees from the central meridian, so predictions near the east and west limb are mostly false positives. A hard 70-degree cut-off still changed nothing: the model had already learned that annotators skip the limb. Disk position went into the scorer's features.
- Fitting the disk. A fit to the bright pixels included the scattered-light halo and overestimated the radius. A Hough circle on the limb gave radii of 889 to 912 px across all images, consistent with the small annual change in the Sun's apparent size.
- Ground-based imaging. GONG telescopes look through the atmosphere. The MAGFiLO paper lists anomalies such as clouds, airplanes, birds and tree branches, estimates that 3 to 5 per cent of GONG's H-alpha observations are badly affected, and took steps to minimise them in the dataset. Mildly blurred frames count as normal, and noise remains, which is part of why the competition stresses separating dark filament material from background structures.
The leaderboard above me
While the competition ran, the public board had a cluster of 104 teams at exactly 0.55 and a leader at 0.70, far above any pipeline with a published out-of-fold score (the best, 0.46 out of fold, scored 0.39 on the board). Reading the public notebooks explained why 104 teams had the same score: they were copies of one notebook that decoded a hard-coded submission file rather than running a model. Where that file's masks came from is not stated. Against an annotator ceiling of 0.34, those scores did not look like better methods, so I did not chase them.
After the close, the organisers cleaned up the leaderboard twice. In the first round they eliminated about 100 teams (99 by my count of the totals, 1,567 to 1,468), including the 0.70 leader and 78 of the 104 teams at 0.55, and stated that the removed teams had intentionally leaked information from the ground truth into their models. A second round the next day brought the top private score from 0.54 to 0.42. My private rank went from 406 to 297 without a single new submission.
Lessons I would keep
- Measure the label ceiling first. Scoring annotator against annotator needs no model, and it explained why bigger models and ensembles bought little.
- Read the scorer's code, not only its formula. It revealed the missing one-to-one matching. A probe with empty masks scored 0.00, which confirmed that by then the board computed a real PQ.
- Optimise what the metric pays for. With every false positive adding 0.5 to the denominator, choosing which instances to submit paid off most. The learned selection beat the hand rule on every fold.
- Fix the adoption rule before the result. A pre-registered paired test rejected a change that looked better by 0.002, and kept the work honest about noise.
- Trust a stable gap, not a noisy board. Out of fold sat 0.06 to 0.07 above public throughout, and as out of fold rose, the private score never fell.
- Budget shapes the search. I trained on an Apple M3 Max shared with other jobs and on rented A100s through Hugging Face Jobs, about USD 1.70 per 40-epoch fold at 1536 px. An EfficientNetV2 encoder at 1536 px did not finish one epoch in 30 minutes on the M3 Max and went past 43 GB of memory, so it was dropped.
- Write everything down. Every experiment, including the failures, went into a dated decision log as it happened. This post and the report were written from it, not from memory.
Limits of this post
- All scores are on MAGFiLO's labels and this competition's metric. They say nothing about how the pipeline would serve forecasters or solar physicists.
- The out-of-fold numbers carry some selection optimism: the scorer threshold, stage-1 settings and the refiner blend were chosen on the same folds.
- The label-side explanation of the leaderboard gap comes from other entrants' notebooks and was not tested here.
- The method is not novel. The tree, hurdle scorer and refiner design come from a public notebook, credited above.
Code, report and how to cite
The repository holds the code under the MIT licence, the weights, the decision log, the report and a notebook that reproduces the submission. The competition data may be used for non-commercial purposes only, so the weights and figures are shared for the competition's evaluation, research and education. The solution write-up on Kaggle has a DOI:
@article{mukharbek_organokov_2026,
title = {Public 0.37 / Private 0.36: U-Net, a threshold tree and rotated-crop refiners},
url = {https://www.kaggle.com/w/127014},
DOI = {10.34740/KAGGLE/W/127014},
journal = {Kaggle},
publisher = {Kaggle},
author = {Mukharbek Organokov},
year = {2026}
}
Data credits. The images and annotations are those of the Solar Filament Segmentation Challenge 2026 (A. Ahmadzadeh, D. J. Kempton, Q. Li and A. A. Pevtsov), built from the MAGFiLO dataset (Ahmadzadeh et al. 2024). This work utilizes GONG data obtained by the NSO Integrated Synoptic Program, managed by the National Solar Observatory, which is operated by the Association of Universities for Research in Astronomy (AURA), Inc. under a cooperative agreement with the National Science Foundation and with contribution from the National Oceanic and Atmospheric Administration. The GONG network of instruments is hosted by the Big Bear Solar Observatory, High Altitude Observatory, Learmonth Solar Observatory, Udaipur Solar Observatory, Instituto de Astrofísica de Canarias, and Cerro Tololo Interamerican Observatory.
Sources
- Kaggle: Solar Filament Segmentation Challenge 2026
- Ahmadzadeh et al.: A dataset of manually annotated filaments from H-alpha observations (Scientific Data 11, 1031, 2024)
- National Solar Observatory: GONG
- NOAA Space Weather Prediction Center: Coronal Mass Ejections
- Code, weights, decision log and notebook (GitHub)
- Four-page report (PDF)
- Kaggle solution write-up, DOI 10.34740/KAGGLE/W/127014
- tushhaaarrrr: Solar Filament Segmentation 2026 (0.40), Kaggle notebook
- Kirillov et al.: Panoptic Segmentation (CVPR 2019)
- Ronneberger, Fischer, Brox: U-Net (MICCAI 2015)
- Zhou et al.: UNet++ (DLMIA 2018)
- segmentation_models.pytorch