Skip to content
Physics and the sciencesExperiments

Verace Filament

A neuro-symbolic pipeline for instance segmentation of solar filaments in full-disc H-alpha images, tuned for Panoptic Quality.

Verace Research
  1. Filament probability map: Neural stage output that every later step reads
  2. Physics enhancement filters: Turn an H-alpha image into three contrast channels
  3. Symbolic instance extraction: Rules convert the map into non-overlapping instances
  4. Out-of-fold tuner: Grid search scored by the competition PQ
Figure 1. Neural probability map and symbolic rules in Verace Filament. Schematic: in Verace Filament, a neural stage predicts a per-pixel filament probability map, and rule-based stages around it turn that map into disjoint filament instances tuned for Panoptic Quality.
Open the simulator on its own pageA loop that checks before it commits: an interactive toy model of the principle. You can also try it below

Overview

Verace Filament is the lab's system for segmenting solar filaments in full-disc H-alpha images of 2048 by 2048 pixels from the ground-based GONG observations, as the design specification names them. It was built for a 2026 segmentation competition scored by Panoptic Quality (PQ). Filaments are cool, dense plasma structures that appear as dark, elongated absorption features on the solar disc. The design specification names four difficulties: thin barbs branching off a spine, limb darkening of the background, over-fragmentation that inflates false positives, and a rule that submitted instance masks must not overlap. Training labels come from the MAGFiLO annotations, an external dataset in COCO format with several annotators per image.

The method splits the task into a neural stage that predicts a per-pixel filament probability and a rule-based stage that turns that map into disjoint instances. The networks are U-Net style encoder-decoders built with segmentation_models_pytorch, a library by others. The system has two generations. The legacy pipeline feeds hand-crafted physics channels to SolarFilamentNet, a ResNet-34 U-Net with SCSE decoder attention, and splits instances by watershed. The solarfil package trains on soft annotator-consensus targets with random crops, CoordConv position channels, weight EMA and 5-fold cross-validation, then tunes post-processing on out-of-fold predictions and ensembles folds in logit space.

Both generations are implemented, with a test suite, an exact re-implementation of the competition metric, a speed benchmark and shell queues for an encoder comparison (resnet34, convnext_tiny, efficientnet-b4), a clDice ablation and 5-fold training. The design specification reports a projected score of Dice 0.9577 and PQ 0.7132, with SQ 0.9332 and RQ 0.7642 on 180 test images as part of the same projected evaluation. The specification also describes a Hessian ridge filter and 8-fold test-time augmentation, while the code implements black top-hat ridge filters and 4-flip augmentation at two scales.

The training, inference, post-processing tuning and submission code are implemented and tested. The only recorded figures are the Dice, PQ, SQ and RQ values in the design specification, which presents them as a projected score; no per-run logs, no outcome of the encoder comparison and no result of the clDice ablation are recorded. Whether the solarfil ensemble improves on the legacy pipeline is not established in the lab's records.

Status

Experiments. Training, cross-validation, tuning and ablation code exists with a test suite, and the design specification reports Dice, PQ, SQ and RQ figures that it labels a projected score.

Simulator

An agent runs sixty tasks whose steps sometimes fail. Choose whether each step is checked, how often a step fails and how long the tasks are.

  • pale: worked first time · colour: caught and repeated · white: failed unnoticed · crossed: given up
Tasks finished correctly
60 of 60
Finished with a hidden error
0
Given up after three tries
0
Extra work spent on retries
12%
After each step

Turn the check off: the same failures now finish unnoticed. Lengthen the tasks and see how fast unchecked errors add up.

This simulator is an illustration of the principle, with made-up numbers. It does not run the lab's code or show the lab's data, and nothing in it is a measurement.

Architecture

  1. Physics enhancement filters

    Hand-crafted image processing that turns a grayscale H-alpha image into three channels: local contrast, absorption contrast against the disc background, and dark-ridge response.

  2. SolarFilamentNet

    The legacy segmentation network: a U-Net with SCSE decoder attention and a ResNet-34 encoder by default, trained with a Dice and focal compound loss.

  3. Advanced asymmetric-loss model

    An alternative network (UNet++, U-Net or DeepLabV3+) trained with a combined focal, Tversky and Dice loss; one training run uses a ResNet-50 SCSE U-Net at 1024 resolution.

  4. Solarfil training package

    A cross-validated training system with a memory-mapped data cache, soft consensus targets, crop sampling, EMA weights and PQ-based checkpoint selection.

  5. Tiled test-time inference

    Full-frame inference that blends overlapping tiles, averages flipped and rescaled predictions, and returns a probability map.

  6. Out-of-fold post-processing tuner

    A grid search over thresholds, morphology and component filters, scored by the competition PQ on out-of-fold probability maps.

  7. Symbolic instance extraction

    Rules that convert a probability map into non-overlapping filament instances through thresholding, morphology, connected components or watershed, and a disjoint partition.

  8. Competition metric re-implementation

    An exact implementation of the per-annotator Panoptic Quality on COCO run-length encodings, with a dense reference used in tests.

Implementation

Mechanisms as they are implemented in the source code, with the constants the code uses.

Three-channel physics enhancement
Channel 0 is CLAHE with clipLimit 2.0 on 8×8 tiles. Channel 1 is c1=clip(3(bg−I)/bg,0,1)c_1 = \mathrm{clip}(3(bg - I)/bg, 0, 1) with bgbg a 31-px median blur that corrects limb darkening. Channel 2 is the mean of black top-hats with 15×3 and 3×15 kernels, min-max normalised as a curvilinear dark-ridge detector.
Annotator-consensus soft target
The cache stores m=round(255⋅v/n)m = \mathrm{round}(255 \cdot v / n), where vv is the number of annotators marking a pixel and nn the number of annotators. Thresholding at 0.5 gives the majority-vote mask, and training against the fraction makes the network estimate annotation probability.
CoordConv full-frame position channels
The input is the normalised intensity (g/255−0.35)/0.25(g/255 - 0.35)/0.25 plus xx and yy coordinates in [−1,1][-1, 1] over the full 2048 frame. A crop-trained model can then locate the limb, which matters because annotation ignores filaments beyond ±70° longitude.
Foreground-biased crop sampling
Foreground points are precomputed from the soft mask at stride 17. 75% of the 768 crops centre on one of them with jitter and the rest are uniform, which counters the sparsity of filament pixels; random zoom 0.8-1.25 and photometric augmentation are added.
Soft skeleton clDice
Following Shit et al. 2021, erosion is −maxpool3(−x)-\mathrm{maxpool}_3(-x) and dilation is maxpool3(x)\mathrm{maxpool}_3(x). The skeleton starts as relu(x−open(x))\mathrm{relu}(x - \mathrm{open}(x)) and each iteration erodes xx, computes δ=relu(x−open(x))\delta = \mathrm{relu}(x - \mathrm{open}(x)) and adds relu(δ−sδ)\mathrm{relu}(\delta - s\delta). clDice is the harmonic mean of skeleton precision and sensitivity, configured with skel_iters 6.
Asymmetric Tversky, focal and Dice loss
The focal term is mean((1−pt)2⋅BCE)\mathrm{mean}((1 - p_t)^2 \cdot \mathrm{BCE}) and the Tversky index is T=TP+sTP+0.3FP+0.7FN+sT = \frac{TP + s}{TP + 0.3 FP + 0.7 FN + s} on soft counts, with s set to 1e-5. The total is L=0.4Lf+0.8(1−D)+0.8(1−T)L = 0.4 L_f + 0.8(1 - D) + 0.8(1 - T), so misses are penalised more than false alarms.
Warmup EMA of weights
A frozen copy of the model is updated after every optimizer step and is the only model validated and exported. The decay defaults to 0.999 but is ramped as (1+n)/(10+n)(1+n)/(10+n) early so the average tracks quickly at the start; best.pt stores the EMA weights and best threshold whenever PQ improves.
Warmup and cosine schedule with floor
During warmup η=η0(s+1)/w\eta = \eta_0 (s+1)/w, with warmup defaulting to one epoch of optimizer steps. Afterwards η=η0(0.02+0.98⋅0.5(1+cos⁡πt))\eta = \eta_0 (0.02 + 0.98 \cdot 0.5 (1 + \cos \pi t)) with tt the fraction of post-warmup steps completed, so the rate never falls below 2% of base.
Hann-window tile blending
Each tile's logits are multiplied by W=ww⊤W = w w^\top, where ww is a square-rooted Hann window floored at 0.05, then summed and divided by the summed window. This keeps tile seams from creating false component boundaries.
Logit-space ensemble, probability-space scales
Flips and tiles are averaged in logit space, and different scales are averaged in probability space after resizing back because their calibrations differ. Across folds and tags, logits are multiplied by normalised per-tag weights and summed, and the sigmoid is applied only after summing.
Hysteresis thresholding and tile fusion
The high-resolution pipeline fuses a global 1024 pass with four 1152 quadrant tiles overlapping by 256 px, weighted by a sine window to the power 0.5 times 1.5. Pixels at or above 0.24 are kept only when connected to cores at or above 0.42, so thin barbs attached to spines survive; components of area at least 280 are scored by area times the square root of mean probability and the top 16 kept.
Distance-transform marker watershed
The thresholded mask (0.40, then opening) is distance-transformed, peak_local_max with min_distance 12 and threshold_abs 2.0 gives markers, and watershed runs on the negated distance. It falls back to connected components when no peaks exist, and instances under 40 px are dropped.
Greedy disjoint mask partition
Instances are sorted by score or area in descending order, and each takes only pixels not already claimed. An instance is kept only if its remaining area clears a minimum, which guarantees non-overlapping submission masks.
Per-annotator Panoptic Quality
Each image is scored once per annotator entry; a prediction and ground truth pair is a hit when IoU exceeds 0.5. Globally PQ=∑IoUTP+0.5FP+0.5FNPQ = \frac{\sum \mathrm{IoU}}{TP + 0.5 FP + 0.5 FN}, with SQ the mean IoU of hits and RQ the hit count over the same denominator. The fast tuner caches component statistics and IoU matrices so each filter combination is a boolean column mask.

Results

From the lab's own experiments and records. They have not been independently replicated.

  1. Projected Dice 0.9577 and PQ 0.7132

    The design specification reports Dice 0.9577 and PQ 0.7132 and labels them a projected score. In the same projected evaluation it gives SQ 0.9332 and RQ 0.7642 on 180 test images, consistent with PQ as their product.

  2. Majority-vote mask is the best training target

    Code comments record that thresholding the annotator-consensus soft mask at 0.5 was measured as the best target for the per-annotator PQ metric. No figure for the comparison is recorded.

  3. Specification and code differ on filters

    The design specification describes a Hessian curvature ridge filter and 8-fold test-time augmentation, while the implemented filters are median-background contrast and directional black top-hats, with 4-flip augmentation at two scales.

Concepts

Solar filament
A cool, dense plasma structure suspended in the much hotter corona along a magnetic polarity inversion line, visible in H-alpha images as a dark elongated feature. The design specification notes that destabilised filaments can trigger coronal mass ejections.
Panoptic Quality
An instance-level score equal to segmentation quality (mean IoU of matched pairs) times recognition quality (an F1-like count of matches). It is the competition metric every threshold and checkpoint in the system is tuned for.
Limb darkening
The drop in disc brightness towards the edge of the Sun, which makes a fixed intensity threshold unreliable. The system corrects it by comparing each pixel with a median-blurred local background.
Filament barbs
Thin, thread-like extensions branching from a filament's main spine. They motivate hysteresis thresholding and topology-aware losses.
Disjoint instance constraint
The competition requires that no two submitted masks share a pixel. A greedy partition enforces this at submission time.
Neuro-symbolic split
The design that pairs a learned probability map with hand-written rules for cleaning, splitting and ranking instances, instead of predicting instances directly.
clDice
A loss that compares soft skeletons of prediction and target, rewarding preserved connectivity of thin structures rather than pixel overlap alone.
Tversky index
A generalisation of Dice that weights false positives and false negatives separately; here false negatives get 0.7 and false positives 0.3.
Out-of-fold tuning
Each fold model predicts only on images it was not trained on, and post-processing parameters are chosen on those predictions, so the thresholds are not fitted to training data.
Test-time augmentation
Averaging predictions over flipped and rescaled copies of the input. The legacy pipeline uses four flips at scales 1024 and 768 weighted 1.2 and 0.8.
SCSE attention
Concurrent spatial and channel squeeze-and-excitation blocks in the decoder, which reweight feature channels and spatial positions.
COCO run-length encoding
The compressed mask format required for submission, produced with pycocotools on Fortran-ordered masks and decoded back for validation.

About this page

Written from the lab's own documents and source code. Figures and results are the lab's measurements as it recorded them at the time, and have not been independently replicated.

Published under the PolyForm Noncommercial License 1.0.0: free for noncommercial use.