Papers
Topics
Authors
Recent
Search
2000 character limit reached

Inspectorch: Solar Rare-Event Detection Framework

Updated 5 July 2026
  • Inspectorch is an open-source Python framework for rare-event discovery in solar observations, modeling normal data distributions to highlight anomalies.
  • It leverages normalizing flows for exact likelihood evaluation, enabling efficient identification of low-probability, scientifically significant events.
  • The framework supports diverse solar data forms and implements a triage workflow to focus computational resources on anomalous observations.

Inspectorch is an open-source Python framework for rare-event discovery in solar observations that formulates anomaly detection as probabilistic density estimation in high-dimensional observation space. Rather than searching for predefined signatures, it learns the multidimensional distribution of normal observations directly from the data and assigns each sample a probability; samples with very low probability are interpreted as rare, unusual, or anomalous. In the formulation introduced in "Inspectorch: Efficient rare event exploration in solar observations" (Baso et al., 23 Feb 2026), the framework is intended for solar datasets whose spatial, spectral, temporal, and polarimetric resolution makes manual inspection infeasible, standard clustering insensitive to distribution tails, and full physics-based inversions too expensive to apply everywhere.

1. Scientific setting and conceptual definition

Inspectorch is motivated by a basic asymmetry in modern solar observations: the most scientifically informative phenomena are often precisely those that occur least frequently. Large multidimensional datasets from instruments such as Hinode/SP, IRIS, MiHI/SST, SDO/AIA, and Solar Orbiter/EUI contain signatures of magnetic reconnection, extreme flows, transient heating, field intensification, and unusual atmospheric stratification, but these signatures are embedded in a much larger background of common profiles and ordinary temporal behavior (Baso et al., 23 Feb 2026). The framework is designed to triage such datasets so that scientific attention and computational resources can be concentrated on the rare tail rather than the bulk distribution.

The central definition is statistical. If observations are samples xx from an unknown distribution p(x)p(x), then common solar states occupy high-density regions and rare physical states inhabit low-density tails. Inspectorch formalizes an anomaly as any sample satisfying

p(x)<ϵ,p(x) < \epsilon,

for a user-defined threshold ϵ\epsilon (Baso et al., 23 Feb 2026). This makes rarity a property of the learned data distribution rather than of a hand-crafted event catalog.

This framing also distinguishes Inspectorch from clustering-based unsupervised methods. The paper argues that global-trend methods such as k-means emphasize dominant structure and can miss tails of the distribution unless one uses many clusters, strong tuning, or biased training. A plausible implication is that Inspectorch is best understood not as a replacement for clustering, but as a prior ranking stage that isolates statistically rare observations before downstream interpretation or categorization.

2. Probabilistic formulation and anomaly score

Inspectorch uses normalizing flows, i.e., invertible generative models with exact likelihood evaluation, to model a complicated solar data distribution pX(x)p_X(x) by transforming a simple latent density pZ(z)p_Z(z), usually a standard multivariate Gaussian, through an invertible differentiable mapping x=f(z)x=f(z) (Baso et al., 23 Feb 2026). In one dimension, probability conservation gives

pX(x)=pZ(z)dzdx.p_X(x)=p_Z(z)\left|\frac{dz}{dx}\right|.

In multiple dimensions, the paper writes

pX(x)=pZ(z)det(zx)=pZ(z)det(f(z)z)1=pZ(f1(x))det(f1(x)x).p_X(x) = p_Z(z) \left| \det \left( \frac{\partial z}{\partial x} \right) \right| = p_Z(z) \left| \det \left( \frac{\partial f(z)}{\partial z} \right)^{-1} \right| = p_Z(f^{-1}(x)) \left| \det \left( \frac{\partial f^{-1}(x)}{\partial x} \right) \right|.

If the mapping is composed of KK simpler invertible transformations,

p(x)p(x)0

then the log-density is accumulated over the layers. The manuscript gives

p(x)p(x)1

with p(x)p(x)2; despite typesetting corruption, the intended expression is the standard normalizing-flow log-likelihood accumulation over composed transforms (Baso et al., 23 Feb 2026).

Training is by maximum likelihood, equivalently minimization of the negative log-likelihood over the dataset: p(x)p(x)3 By minimizing this objective, the model maps correlated solar spectra into an approximately uncorrelated latent space where exact probabilities can be computed. After training, the anomaly score is simply p(x)p(x)4, or equivalently its negative; lower probability means greater anomaly (Baso et al., 23 Feb 2026).

A recurring point in the paper is that low-probability samples are not restricted to rare physical events. They can also correspond to instrumental artifacts. Operationally this is a feature rather than a defect: the low-probability tail surfaces observations that merit inspection, irrespective of whether the cause is astrophysical or instrumental.

3. Architecture and implementation

Inspectorch is implemented in PyTorch and relies on the nflows library. Its discrete-flow backbone uses Rational-Quadratic Spline coupling layers, invertible linear transformations based on LU decomposition, and permutation layers (Baso et al., 23 Feb 2026). This is a coupling-based spline-flow design for exact density estimation in high dimensions.

In the coupling transform, an input vector of dimension p(x)p(x)5 is split into two parts. The first part is unchanged, while the second is transformed by an invertible function whose parameters depend on the first: p(x)p(x)6

p(x)p(x)7

with final output p(x)p(x)8. Because this yields a lower-triangular Jacobian, determinant evaluation is efficient. Permutation layers are inserted between coupling blocks so that the same coordinates are not left unchanged at every stage. The elementwise map p(x)p(x)9 is implemented with monotonic neural splines whose knot locations, values, and derivatives are predicted by a neural network from the conditioning input (Baso et al., 23 Feb 2026).

The paper presents this architecture as expressive enough for multimodal or quasi-discontinuous densities and sufficiently fast for large solar datasets. Training uses Adam or AdamW with learning rate p(x)<ϵ,p(x) < \epsilon,0 to p(x)<ϵ,p(x) < \epsilon,1 for roughly 10–50 epochs until convergence. The authors state that all reported results were obtained with the same overall configuration and minimal hyperparameter tuning, which they treat as evidence of cross-instrument robustness rather than of dataset-specific optimization (Baso et al., 23 Feb 2026).

An extension discussed in the paper is Flow Matching as a possible route to scaling beyond standard discrete normalizing flows. In this continuous-time formulation, the discrete composition is replaced by a neural vector field p(x)<ϵ,p(x) < \epsilon,2 satisfying

p(x)<ϵ,p(x) < \epsilon,3

with

p(x)<ϵ,p(x) < \epsilon,4

The corresponding continuous change-of-variables relation is

p(x)<ϵ,p(x) < \epsilon,5

Conditional Flow Matching with optimal transport paths is then used to avoid ODE solves during training. On a Hinode/SP dataset of p(x)<ϵ,p(x) < \epsilon,6 spectra, Flow Matching trained in 0.8 minutes versus 4.5 minutes for the discrete flow, but full-dataset inference took nearly 5 minutes versus only 10 seconds for the discrete flow, leading to a pragmatic recommendation in favor of standard normalizing flows when rapid interactive anomaly mapping is desired (Baso et al., 23 Feb 2026).

4. Data representations and operational workflow

A notable property of Inspectorch is that it is not tied to a single observational modality. The user first chooses a feature representation, which may be a spectral profile, a concatenated set of channels, a flattened spatial patch, a temporal window, or a Fourier-domain temporal descriptor. The data are then arranged as vectors, often under the simplifying assumption that each pixel or patch is an independent sample. A separate model is trained for each dataset, and inference consists of evaluating p(x)<ϵ,p(x) < \epsilon,7 for every sample and mapping those values back into image space or time (Baso et al., 23 Feb 2026).

This yields anomaly maps, ranked lists of rare spectra, or probability distributions from which thresholds can be selected. In high-volume settings, that ranking is the practical output. The paper repeatedly emphasizes a specific workflow: inspect the lowest-probability tail, cluster only the extremes, or send only those samples to expensive inversion pipelines. Inspectorch therefore functions as a triage layer rather than as a replacement for physical modeling.

The flexibility of the vectorization step is important. In spectroscopy and spectropolarimetry, each pixel spectrum may be used directly. In multi-channel imaging, channels can be concatenated to expose inter-channel correlations. In temporal analysis, short windows can be flattened into feature vectors, or power spectral density descriptors can be used to reduce dimensionality. In spatial anomaly detection, local patches such as p(x)<ϵ,p(x) < \epsilon,8 regions can be flattened and modeled with the same machinery. This suggests that Inspectorch is best viewed as a generic density-estimation framework over user-chosen observation vectors, with the scientific notion of anomaly determined jointly by the learned density and the representation selected by the investigator (Baso et al., 23 Feb 2026).

5. Instrumental demonstrations and empirical findings

The paper demonstrates Inspectorch across several observing modalities and atmospheric regimes, using the same overall framework with minimal tuning (Baso et al., 23 Feb 2026).

Dataset Representation Low-probability signatures
Hinode/SP Stokes p(x)<ϵ,p(x) < \epsilon,9 spectrum per pixel; appendix also Stokes ϵ\epsilon0 Two-component profiles, strong Doppler shifts, magnetically unusual profiles
IRIS Si IV 139.4 nm spectrum per pixel Large shifts, asymmetries, uncommon broadening
MiHI/SST Hyperspectral time series per spatial pixel Strong upflows, strong downflows, extreme downflow family
SDO/AIA Concatenated channels; temporal windows Transition-region brightenings; impulsive Ellerman bombs
Solar Orbiter/EUI PSD of pixel time series Small-scale brightenings, coronal loop oscillations

In the Hinode/SP experiment, the framework analyzes a spectropolarimetric raster of NOAA 10953 observed on 30 April 2007. Using Stokes ϵ\epsilon1 from a single Fe I line over 630.089–630.220 nm and treating each pixel spectrum independently, the learned probability map highlights about ϵ\epsilon2 of pixels for ϵ\epsilon3, concentrated mainly at the penumbra–granulation boundary. These spectra show two-component profiles interpreted as superposed velocity components with relative Doppler shifts, one often corresponding to strong downflows of order ϵ\epsilon4, i.e. supersonic in the photosphere. In the appendix, modeling Stokes ϵ\epsilon5 yields a similar anomaly map but additionally surfaces magnetically unusual profiles suggestive of strong line-of-sight magnetic-field gradients and polarity changes with height (Baso et al., 23 Feb 2026).

The Hinode case also provides the main methodological comparison with Isolation Forest. Using first one wavelength point and then two correlated wavelength points from the Fe I profile, Inspectorch produces more refined and physically coherent anomaly maps as the second correlated feature is added, whereas Isolation Forest remains largely unchanged. Even with the full spectral profile, Isolation Forest extracts much less structure. The paper presents this as evidence that the flow-based model exploits the joint distribution of correlated observables rather than assigning heuristic scores that are relatively insensitive to multivariate spectral structure (Baso et al., 23 Feb 2026).

For IRIS, the framework is applied to a raster of a coronal hole from 9 October 2013, focusing on Si IV 139.4 nm. Pixels with ϵ\epsilon6 comprise about ϵ\epsilon7 of the field and are concentrated mainly in the magnetic network around supergranular boundaries. The low-probability spectra are characterized by large Doppler shifts, asymmetries, and uncommon broadening, corresponding to upflows and downflows up to about ϵ\epsilon8. The paper links these network-scale profiles to supergranular organization and interchange-reconnection jet activity implicated in fast solar-wind generation (Baso et al., 23 Feb 2026).

For MiHI at the Swedish 1-m Solar Telescope, the data consist of a ϵ\epsilon9 pixel integral-field dataset with 3.3 s cadence over 20.8 minutes. The trained model yields a four-dimensional cube of log-probabilities over pX(x)p_X(x)0. The authors track, at each time step, the minimum log-probability over the field of view; sharp dips identify moments when very rare events occur. They then select the rarest pX(x)p_X(x)1 of pixels using pX(x)p_X(x)2 and apply k-means only to that extreme subset. This density-ranking-first, clustering-second workflow reveals three families of unusual photospheric spectra: strong upflows around pX(x)p_X(x)3, strong downflows around pX(x)p_X(x)4 in bright points associated with flux-tube intensification, and a more extreme downflow family approaching pX(x)p_X(x)5 (Baso et al., 23 Feb 2026).

For SDO/AIA, the paper presents both multi-channel and temporal anomaly detection. In a static experiment on NOAA 11084, each pixel is represented by the concatenated 1600 Å and 1700 Å intensities. Inspectorch learns the joint distribution and identifies pixels where 1600 Å is anomalously bright relative to 1700 Å, isolating elongated 1600 Å brightenings without counterparts in 1700 Å and interpreting them as transition-region contributions. In a temporal experiment using windows of 11 consecutive time steps, corresponding to about 4.4 minutes, the method separates Ellerman bombs from network bright points. The low-probability regions coincide with isolated impulsive events and are more selective than simple intensity thresholding, which captures many bright but non-impulsive features (Baso et al., 23 Feb 2026).

For Solar Orbiter/EUI, temporal anomaly detection is applied to HRIpX(x)p_X(x)6 174 Å data from 9 October 2024 with 6 s cadence. After preprocessing to Level 3, including denoising, coalignment, and reprojection, the authors replace raw time series by power spectral density vectors retaining frequencies corresponding to timescales of roughly 12 s to 11 min. Inspectorch then isolates small-scale transient brightenings and coronal loop oscillations as low-probability regions. The paper notes that PSD-based modeling is consistent with raw-time-series modeling while being faster and more stable to optimize (Baso et al., 23 Feb 2026).

6. Interpretation, scope, and limitations

The principal strength claimed for Inspectorch is that it provides exact probabilities rather than arbitrary anomaly scores, while remaining unsupervised and flexible with respect to representation. It can exploit correlations across wavelengths, channels, or time points; it appears usable across spectroscopic, spectropolarimetric, imaging, spatial, and temporal data; and it yields a ranked tail that can be inspected directly or passed to more expensive downstream analysis (Baso et al., 23 Feb 2026).

Interpretability is deliberately limited in the strict explainable-ML sense. The model indicates that an observation is rare, not why in a causal or mechanistic sense. However, the paper argues for a scientific form of interpretability: low-probability outputs can be examined in their native observational domain, where unusual profile shapes, broadening, asymmetry, multi-component structure, or impulsive temporal behavior are often physically recognizable. An additional interpretive advantage is that rarity is tied to an explicit density model rather than to an opaque heuristic (Baso et al., 23 Feb 2026).

The limitations are equally explicit. Threshold choice is user-defined and context dependent. The low-probability tail may contain instrumental artifacts as well as astrophysical events. The meaning of anomaly depends on feature representation, so choosing wavelengths, channels, patch size, or temporal window remains a scientific decision. Validation is mostly qualitative and expert-driven; the paper does not provide large-scale quantitative benchmarks with labeled ground truth. Independence assumptions are often imposed at the sample level unless spatial or temporal context is manually encoded. Finally, while discrete normalizing flows are fast at inference, scaling to larger-than-memory or petabyte-scale regimes may require continuous-flow alternatives whose inference remains comparatively slow (Baso et al., 23 Feb 2026).

Overall, Inspectorch reframes rare-event exploration in solar physics as exact density estimation in observation space. Its contribution lies not only in detecting low-probability samples, but in enabling a workflow in which the full distribution of observations is learned first and scarce scientific and computational resources are then focused on the most informative small subset of the data. The software is publicly available as the Python package inspectorch at https://github.com/cdiazbas/inspectorch (Baso et al., 23 Feb 2026).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Inspectorch.