ction and Motivation
Stellar flares are bursts of vitality launched by stars, believed to be attributable to magnetic line reconnection [1,2]. It’s characterised by a sudden spike within the star’s brightness, adopted by a gradual exponential decay [1,2]. However why care about detecting them? The reason being that they play an necessary position in our understanding of the universe. They assist us acquire perception into subjects similar to stellar magnetic fields, rotation, mass-loss charges, and atmospheric evolution of those stars’ orbiting planets [1,2]. Nevertheless, as you in all probability anticipated, it’s not as straightforward because it sounds. Firstly, stellar flares don’t normally happen at constant time intervals, which makes them laborious to foretell [1]. Secondly, low-energy flares usually stay undetected as data-preprocessing steps are inclined to eradicate their signatures [1]. Thirdly, these datasets are unsupervised, that means that the flares will not be pre-labelled, making it fairly difficult to judge flare detection fashions.
Latest research have proposed a couple of alternative ways to strategy these challenges. One research mixed a hidden Markov mannequin (HMM) with a celerite mannequin to account for quasi-periodic oscillations (i.e., oscillations that comply with a daily sample, however don’t have a hard and fast interval), enhancing the detection of low-energy flares in comparison with conventional strategies [1]. One other research used Recurrent Neural Networks (RNNs) to detect flares [2]. Nevertheless, each approaches are extremely computationally intensive, taking even hours to research knowledge for a single star [1,2]. Furthermore, I felt that these research didn’t discover the potential of constructing prediction fashions to seize future flares. Such a mannequin could be very helpful, as scientists would know when to count on these flares and maybe allocate assets to map these flares extra successfully for in-depth analysis into their traits. In abstract, my objective for this mission was to develop a way that detects stellar flares with excessive accuracy and construct a predictive mannequin able to capturing future flares. Reaching this can present astronomers with a strong device to deepen our understanding of stellar techniques and our universe as an entire.
The Knowledge
For this mission, I analyzed time-series knowledge for star TIC 0131799991, noticed at a two-minute cadence by NASA’s Transiting Exoplanet Survey Satellite tv for pc (TESS). Whereas the unique dataset has a number of options, I centered on simply two for this research: time and PDCSAP (Pre-search Knowledge Conditioning Easy Aperture Photometry) flux. PDCSAP flux represents the brightness of the star corrected for long-term tendencies. Flux measurements are lacking during times when the satellite tv for pc was turned off, leading to a complete of 13,372 legitimate flux observations on this dataset.
The information might be downloaded straight from the TESS web site by following this tutorial. Alternatively, a replica is out there on my GitHub repository for this mission.
Outcomes
Determine 1A reveals the flux measurements of this star over time. Flares are characterised by sharp will increase in flux; nevertheless, it’s clear that they don’t happen at completely constant intervals. My first objective was to impute the lacking values on this time sequence. To know the underlying patterns higher, I plotted the autocorrelation operate (ACF) for the primary 500 lags utilizing the preliminary portion of the information, proven in Determine 1B. We observe that the ACF oscillates with a constant frequency, with the space between consecutive peaks being about 150 time models. Utilizing this periodicity, I utilized STL decomposition to separate the time sequence into pattern and seasonal elements. I then extrapolated these elements to estimate the flux values for the lacking portion of the information, as proven in Determine 1C. This methodology is sort of profitable, as we see that the imputed values protect the general construction of the information.
To construct the flare detection mannequin, I created a couple of further options. One such function was the flux rolling imply. To find out the optimum window measurement, I examined out a number of lags and visualized their results over the primary 2000 time factors. A lag of 10 was extremely erratic and noisy, whereas a lag of 200 resulted in a very smoothed sequence, failing to detect the flare occasion round time level 1500. Between lags of fifty and 100, 100 supplied one of the best stability between smoothing the information but capturing the flare signature at time 1500. Selecting such a window measurement is crucial, because it ensures that the rolling imply acknowledges the periodic construction of the information whereas remaining delicate sufficient to seize flare peaks. Extra options constructed had been flux rolling normal deviation, flux distinction, and flux ratio.
For my flare detection mannequin, I used DBSCAN (Density-Primarily based Spatial Clustering of Functions with Noise). DBSCAN is an unsupervised clustering algorithm that identifies clusters primarily based on knowledge density and flags outliers as noise. For this mission, I outlined a degree to be a flare if it was categorized as noise by DBSCAN and exceeded the ninety fifth percentile of flux values, since flare occasions are thought-about uncommon. I examined out totally different parameter values and selected the set that was delicate sufficient to detect each robust and weak flares, whereas minimizing false positives (proven in Determine 2).

Some time in the past, I discussed one of many main points with the information being its unsupervised nature. So how do we all know whether or not DBSCAN truly detects flares? That is the place simulations turn out to be useful for the reason that floor reality is thought, and we will consider our mannequin accordingly. Desk 1 summarizes the analysis metrics of the 2 simulations I carried out. For the primary one, I used a randomized baseline and injected Pareto-distributed flares on this sequence. The DBSCAN algorithm achieved a sensitivity of 0.9 with no false positives! This robust efficiency is probably going because of the excessive signal-to-noise ratio within the knowledge, because the baseline was sampled from a Regular distribution (imply = 1, sd = 0.02).
For a extra life like strategy, my second simulation used a baseline, in addition to flare intensities, aligned with the precise stellar knowledge. On this case, the sensitivity remained at 0.9, with a barely decrease precision of 0.75. Upon nearer examination, the three false positives detected occurred shortly after the precise flare occasions, simply barely past the outlined flare period. This nevertheless will not be a reason behind main concern for the reason that main flare occasions had been efficiently captured. This side might be improved by consulting area specialists relating to flare morphology and maybe creating tolerance home windows. In abstract, the outcomes recommend that the DBSCAN parameters are optimized and will generalize properly to different stars with related periodicity and flare patterns.

With a detection algorithm in place, my subsequent step was to construct a mannequin that might predict flares. Since conventional ML algorithms assume impartial observations, I included lagged options within the function record to seize the time-dependent nature of the information. The binary flare variable (‘flare’ vs ‘not flare’) from DBSCAN served because the response. To respect the temporal construction of the information, I educated the mannequin on the primary 80% of the information and evaluated it on the final 20%. Desk 2 summarizes the analysis metrics on the check knowledge from the XGBoost classification mannequin. The mannequin performs exceptionally properly on non-flare factors, whereas the sensitivity and precision are decrease for flare factors.

Upon visible inspection of the check set (Determine 3A), we see that the expected flare factors seem very near the precise flare occasions. This implies that the mannequin can predict the proper occasions; nevertheless, since XGBoost evaluates predictions at a person time level stage, even small misalignments result in lowered reported accuracy. This side might be improved by session with area specialists, maybe by defining tolerance home windows such that predictions inside such a window are thought-about an accurate detection. Total, the XGBoost mannequin reveals good potential as a device to forecast future flares, on condition that efficiency is assessed at an occasion stage quite than actual pointwise matches.
To check the above mannequin with a extra conventional time series-based mannequin, I additionally educated an LSTM. Not like XGBoost the place a degree is both labelled ‘flare’ or ‘non-flare’, the LSTM mannequin predicts flux values straight. Thus, to outline a flare level on this case, I set the edge to be the minimal flux worth amongst all factors labeled as flares by DBSCAN on this star’s knowledge. Determine 3B visually summarizes the LSTM check set outcomes. On evaluating the XGBoost and LSTM fashions, it’s evident that XGBoost efficiently captured a number of smaller flares that the LSTM mannequin didn’t. This can be a good signal, contemplating LSTM fashions are thought-about the go-to for time sequence predictions. One may argue that the smaller flares detected by XGBoost that LSTM missed are false positives; nevertheless, it’s unlikely, since we noticed in the course of the simulation stage that every one false positives detected occurred on the finish of precise flare occasions. Thus, we will moderately assume that the flares captured by DBSCAN on this case are legitimate detections. One other benefit of the XGBoost mannequin is the coaching time. Whereas the LSTM mannequin took practically thirty minutes to coach, the XGBoost took lower than ten seconds, additional highlighting its potential as a computationally pleasant predictive mannequin.

Conclusion and Future Work
In abstract, this mission used DBSCAN to detect stellar flares in time-series flux knowledge from star TIC 0131799991, recorded by TESS. The chosen parameters supplied a powerful stability between detecting each robust and weak flares, whereas additionally minimizing false positives. Simulations demonstrated that these parameters are well-suited for this star and may generalize properly to others with related flare patterns and traits. Future work might look into testing whether or not these parameters generalize properly to different stars, notably ones with extra irregular flare patterns or excessive noise. Moreover, we might additionally evaluate DBSCAN’s efficiency with current strategies on the identical dataset to test relative mannequin efficiency.
With flare detection mannequin in place, I then constructed a flare prediction mannequin using XGBoost, with the flare labels generated by DBSCAN serving because the response. The XGBoost mannequin did job, however tended to detect factors near (however not precisely) the precise flare occasions. Since XGBoost evaluates mannequin efficiency on a pointwise stage, these minor misalignments impacted the reported accuracy. We are able to cut back these false negatives through dialogue with area specialists, who can maybe assist outline tolerance home windows that will account for such temporal proximity. In comparison with LSTM, the XGBoost mannequin was capable of detect smaller flares and take far much less coaching time, proving to be a computationally pleasant device as properly.
This research combines unsupervised clustering with supervised studying to current a strong, generalizable and computationally environment friendly pipeline for stellar flare detection and prediction, one that may be tailored to totally different households of stars. It makes use of a novel strategy for detection, and explores the opportunity of prediction – a path that has been largely unexplored in literature. Trying forward, enhancing the mannequin’s flare labeling accuracy and validating the strategy throughout totally different stellar environments might be key for the broader adoption of this strategy for flare detection and prediction. Finally, this work lays the inspiration to help deeper insights into stellar conduct and our understanding of the universe.
References
[1] Esquivel, J. A., Shen, Y., Leos-Barajas, V., Eadie, G., Speagle, J. S., Craiu, R. V., Medina, A., and Davenport, J. R. A. (2025). Detecting Stellar Flares in Photometric Knowledge Utilizing Hidden Markov Fashions. The Astrophysical Journal, 979(2), 141. https://doi.org/10.3847/1538-4357/ad95f6
[2] Vida, Okay., Bódi, A., Szklenár, T., and Seli, B. (2021). Discovering flares in Kepler and TESS knowledge with recurrent deep neural networks. Astronomy & Astrophysics, 652(107). https://doi.org/10.1051/0004-6361/202141068
GitHub repo for this mission might be discovered here.