Magnetic Flux in the Sun Emerges Unaffected by Supergranular-scale Surface Flows

Magnetic flux emergence from the convection zone into the photosphere and beyond is a critical component of the behavior of large-scale solar magnetism. Flux rarely emerges amid field-free areas at the surface, but when it does, the interaction between the magnetism and plasma flows can be reliably explored. Prior ensemble studies have identified weak flows forming near emergence locations, but the low signal-to-noise ratio (S/N) required averaging over the entire data set, erasing information about variation across the sample. Here, we apply deep learning to achieve an improved S/N, enabling a case-by-case study. We find that these associated flows are dissimilar across instances of emergence and also occur frequently in the quiet convective background. Our analysis suggests the diminished influence of supergranular-scale convective flows and magnetic buoyancy on flux rise. Consistent with numerical evidence, we speculate that small-scale surface turbulence and/or deep convective processes play an outsized role in driving flux emergence.


INTRODUCTION
Active regions (ARs) are spatially and temporally extensive magnetic phenomena, extending from the solar interior to the corona, with a lifetime marked by formation, emergence, and eventual decay (van Driel-Gesztelyi & Green 2015) through dispersion of magnetic elements (Strous et al. 1996;Schunker et al. 2019Schunker et al. , 2020) ) into the background turbulent convective field.Most ARs play host to sunspots (Rempel & Schlichenmaier 2011;Rempel 2012) -magnetic features characterized by evolving umbrae, penumbrae, and fine-structures, with high field strengths (few ∼kG, Siu-Tapia et al. 2019).The dynamics of tangled magnetic field lines in morphologically complex active regions and sunspots underpin high-energy eruptive events such as flares (Toriumi & Wang 2019) and coronal mass ejections (Webb & Howard 2012).A detailed inquiry into large-scale solar magnetism, vis-a-vis ARs, has indirect implications for understanding space-weather (Temmer 2021).
ARs are hypothesized to be the surface manifestations of thin magnetic flux tubes (Cheung & Isobe 2014) generated in the interior (Charbonneau 2020), which then rise up (Birch et al. 2016) to the surface and above through a collection of processes termed emergence.The precise location of the dynamo is contested, with suggestions ranging from the base of the convection zone (Spiegel & Weiss 1980) to the near-surface layers (Brandenburg 2005).A comprehensive understanding of solar magnetism warrants that ARs be studied over the full domain -from birth to decay.Their associated flows have drawn attention (Gizon et al. 2001;Komm et al. 2008;Hindman et al. 2009) since magnetic fields and solar convection are thought to be intertwined (Stein 2012).A medley of findings, courtesy of individual emerging-active-region (EAR) studies (Kosovichev 2009;Zharkov & Thompson 2008;Komm et al. 2008;Hartlep et al. 2011), fail to form a coherent picture of flux-emergence physics.This has motivated ensemble studies of isolated ARs, which report near-surface flows forming around an averaged EAR several hours prior to emergence.Chiefly, precursor-like horizontal convergent flows (inflows) in the vicinity of EARs (Martin-Belda & Cameron 2017;Löptien et al. 2017;Birch et al. 2019;Braun 2019;Gottschling et al. 2021) are commonly found to be correlated with emerging prasad.subramanian@tifr.res.inarXiv:2403.00295v1[astro-ph.SR] 1 Mar 2024 flux.Other studies show rotating magnetic features (Snodgrass 1983;Howard 1992;Kutsenko 2021) and circulating flows near ARs (Hindman et al. 2009;Komm et al. 2012).
Ensemble studies aim to mitigate the strong supergranular background flow (∼ 300 m/s, Rieutord & Rincon 2010) by averaging over many EARs, in order to examine the weaker precursor flows (∼ 40 − 50 m/s, Birch et al. 2019;Gottschling et al. 2021).However, when undertaking ensemble studies, one must ensure minimal variance in the different properties of ARs such as its field morphology, surface area, net flux content, and the solar cycle to which it belongs.The latter requires accounting for Hale's law (Hale & Nicholson 1925) -magnetic polarities in the two hemispheres are statistically opposite in sign, and Joy's law (Hale et al. 1919) -the leading polarity is tilted towards the equator in both the hemispheres.Target selection thus plays a vital role in the proper interpretation of results.The LBB survey (Leka et al. 2013;Birch et al. 2013; Barnes et al. 2014) is a helioseismology program that documents the properties of over 100 EARs -emergence time, location, and area, and investigates their subsurface dynamics.We use the SDO/HEAR (Helioseismic Emerging Active Region) survey of Schunker et al. (2016) and Schunker et al. (2019) that improved upon LBB survey and obtained close to 180 ARs for the time period 2010-2014.The averaging process in ensemble studies sacrifices crucial information about individual EARs in favor of suppressing background noise.Traditional investigations may well benefit from novel deep-learning techniques that are able to analyze poor signal to noise (SNR) data with more finesse (Lenssen. et al. 2018;Ju et al. 2023).We demonstrate using convolution neural networks that even in a dataset thought to be consistent and minimally variant, flows around different ARs behave substantially differently.
2. DATA ANALYSIS Time-series of continuum intensity and magnetograms, which capture variations in surface brightness and line-ofsight (LOS) magnetic field, respectively, are obtained from the Helioseismic and Magnetic Imager on board the Solar Dynamics Observatory (SDO/HMI, Scherrer et al. 2012;Schou et al. 2012).The observed spatial map size is 32 • × 32 • (∼ 389 × 389 Mm 2 ), centered on the EAR location, with a duration of 54 hours at a cadence of 45s (4320 frames).The spatial resolution for intensity-cubes is 0.04 • = 0.486Mm, and for magnetogram-cubes is 0.08 • = 0.972Mm.Regions are tracked at Snodgrass rotation rate (Snodgrass 1984) and Postel projected.
From the list of ARs catalogued in the SDO/HEAR survey (Schunker et al. 2016(Schunker et al. , 2019)), we pick 115 that emerge amidst a relatively quiet-Sun region (i.e., P ≤ 2 in the survey -a number assigned by visual inspection of the active region and its surroundings; the lower the number, the lesser any pre-existing magnetic field).We use their definition of emergence time -first compute the maximum absolute flux (corrected for LOS projection) in a 36-hr window after NOAA records the first appearance of sunspot, and subsequently fix emergence time to correspond to when the flux reaches 10% of the maximum in that 36-hr window.The emergence location is defined as the flux-weighted centre of the LOS magnetic field at the emergence time.With x pointing prograde (in the direction of rotation), y pointing solar north, the emergence location is (x, y) = (0, 0).The total observed time of 54 hours is split into 36 hours pre-emergence and 18 hours post-emergence.We select ARs that lie within 50 • of central meridian in order to avoid limb effects.Each AR has a unique flux history depending on its magnetic field properties and the amount of pre-existing field in the vicinity of emergence (Leka et al. 2013).Thus, the proposed thresholds for emergence time and location are intended only to aid statistical studies as opposed to making strong claims about emergence physics.
The evolution timescales of ARs may vary from tens of hours to a few days, depending on their flux content (van Driel-Gesztelyi & Green 2015).In order to better capture all the variations, the 54-hr observed duration is partitioned into nine contiguous 6-hr intervals and analyzed independently.Stipulating the central-meridian distance condition, we obtain a total of 88, 93, 98, 107, 115, 115, 115, 113, and 113 ARs for the nine intervals: [12,18], with the numbers denoting hours from emergence time t = 0. Ensembleaveraged LOS magnetic fields and horizontal-divergence of the flows (∇ h • v, see equation 1) for the nine intervals are shown in Figure 1.Bipolar magnetic fields (A) steadily rise in strength as emergence time approaches (left to right in the figure).Our goal is to understand if the flows (B) drive / are driven by the emerging magnetic flux.To correctly interpret AR ensemble-study results, i.e., to identify whether a flow signal is correlated with flux emergence and not attributable to background noise, it must be compared against quiet-Sun flows.We build a deep-learning network that will predict the presence/absence of AR-like flow features in individual flow images with sufficient conviction.

Data products
Horizontal flows are obtained using Local Correlation Tracking (LCT, November & Simon 1988) on the intensitycontinuum data.LCT is an established method of inferring horizontal velocity field [v x , v y ] at the photosphere.The method examines the advection of convective granules (∼1 Mm, see Hathaway et al. 2015) by underlying larger-scale flow systems (e.g., supergranules or EAR flows, 30−40 Mm).Since granules are used as tracers, which are much smaller in size than supergranules, LCT is an effective method (see Rieutord et al. 2001) to produce surface horizontal flows of supergranulation sizes, the length-scale in which we are interested.We use the pyFLCT 0.2.2 (see Appendix A and The SunPy Community et al. ( 2020)) routine to obtain [v x , v y ] and get horizontal divergence div and radial vorticity Global-scale background flows on the Sun, such as differential rotation (Howe 2009) and meridional circulation (Hanasoge 2022), can induce systematic variations in measured local flow velocities.This is undesirable as we are only interested in flow structures associated with AR emergence.This systematic variation is addressed by fitting a 2D polynomial to each of the components [v x , v y ] (similar to Birch et al. 2019) of the form aX 2 +bXY +cY 2 +dX +eY +f .This fitted polynomial, representing slowly varying (large-scale systematic) flows, is then subtracted from [v x , v y ] of every AR.The velocities for all the ARs are then averaged for a given T i and div and curl are obtained using equations 1 and 2.
For the magnetograms, it is imperative to account for Joy's law and Hale's law (as described in section 1).These are respectively taken care of by flipping the southern hemisphere magnetograms about latitude, and flipping the sign of the southern hemisphere magnetograms.Magnetograms for all the ARs are then averaged for a given T i .

DEEP LEARNING
Deep learning (Krizhevsky et al. 2012;Goodfellow et al. 2016) is a set of machine-learning algorithms capable of locating hidden features and correlations in noisy data.In supervised learning, the machine is trained on labelled data to identify the implicit mapping between input-output pairs (Hastie et al. 2001).The convolutional neural network (CNN, LeCun et al. 2015) is a class of deep-learning algorithms particularly adept at finding features in images by convolving them with multiple filters (convolution kernels).The architecture of CNN used in this work is shown in Figure 2. Various models, employing different configurations such as varying numbers of layers, activation functions, convolution kernel sizes, and learning rates, can statistically achieve identical results (within machine uncertainty of 2% as reported in section 6).Here we use one such architecture that is sufficiently optimal in terms of speed of training, depth of the neural network, their associated parameters, and computational demand .
It is natural to pose the problem of discerning between AR and QS (quiet sun) horizontal divergence images in the form of binary classification, with input-output pairs AR-1 and QS-0.Neural networks recognise patterns well when trained on abundant data sets.However, in the current setup, we only have 115 ARs from the observations.To expand our training dataset, we first collect a large number of images of QS horizontal divergence.We embed synthetic AR inflows (constructed from averaging over many supergranular inflows, as explained in the following Section 4) in some of these images (positives) and the rest are just the convective background (negatives), an approach that allows us to generate as many unique samples as needed for training.The entirety of the observed AR sample is preserved exclusively for testing.Our machine thus is designed to look for AR-like flow feature in images, and a failure to detect one will result in the machine associating an output 0 to that image.Ultimately, if there are features unique to active region emergence, it is expected that our formulation of the problem is equivalent to AR/QS classification.
In effect, once an image is passed through convolution filters, pooling and activation layers, the output neuron, termed sigmoid, produces a number in the range [0, 1].The closer the output is to 0 or 1, the more confidently the machine indicates that the AR flow feature is absent/present.We classify all outputs > 0.5 as containing the feature feature consistent with emergence ('positives'), whereas outputs < 0.5 as 'negatives'.
We train two independent deep-learning classifiers trained on horizontal divergence flow images -an "inflow machine" to recognize pre-emergent AR inflows, and an "outflow machine" to identify post-emergence AR outflows.A machinelearning model that is adequately trained to recognize AR-like flow features should ideally mark all AR images as 1, and assign 0 to QS images.We conduct detailed analysis and interpretation of AR/QS flows in relation to magneticflux emergence based on the model outputs.Here, we primarily investigate horizontal divergent flows (see Figure 5); machine learning results for radial vorticity and magnetograms are shown in Appendix C.
To summarize, our motive behind using machine learning in this work is to 1. appreciate how the flow and magnetic field features in ARs differ from QS areas, 2. investigate if the flow features around the chosen 115 ARs are similar, 3. explore the connections between different processes associated with flux emergence, i.e., examine if ARs that show strong bipolar fields also exhibit strong radial vorticity and/or horizontal divergence.
We shall use the notation for the results of the machine on test data (see Table 1): • AR(1) -machine detects flow/magnetic field feature in an AR image, • AR(0) -machine does not detect flow/magnetic field feature in an AR image, • QS(0) -machine does not detect flow/magnetic field feature in a QS image, • QS(1) -machine detects flow/magnetic field feature in a QS image.

GENERATING SYNTHETICS
From previous statistical studies (Birch et al. 2019;Braun 2016), EAR horizontal divergence images presumably, on average, contain the weak, signature inflow close to the emergence location (see Figure 1 B, first six panels).Based on this assumption, we will generate synthetic AR inflows using the algorithm described in Birch et al. (2019) (see for example Figure 9, bottom row).
Using synthetics in training provides a great deal of flexibility in managing the training data.Benefits include the ability to generate a large, unique training sample with desired feature shapes at specified SNR.All the samples are first normalized by their absolute maximum value.Then we incorporate supergranular noise in synthetic AR inflows (see section 4.3), i.e., we add random QS images amplified by a factor chosen from N (6, 1) in order to imitate the poor S/N of observed AR inflows (∼ 50 m/s, compared to the ∼ 300 m/s background).The mean S/N of noisy AR flows here is thus 1/6 (results for other values of S/N are shown in Figure 3).That is, during training, the machine is exposed to two categories of images only, synthetic AR flows embedded in realistic noise, and QS flows.Both of these datasets predominantly contain supergranluar flows.
We wish to highlight the other benefits derived by using synthetics in this work.
• It allows for an unbiased analysis of the 115 observed ARs as these are not used in training the machine, • Successful feature engineering implies we will have no shortage of training data -class imbalance issue (e.g.Dhuri et al. 2020) is fully mitigated.That is, neural network training will not suffer due to unavailability of more than 115 observed ARs.
• As all the 115 ARs qualify as unseen data for the machine, we overcome the need to cross-validate (divide training data into subsets and train/test over different subsets to derive uncertainty).
AR flows evolve over time -Figure 1 shows that EAR inflows are strongest / appear most prominently at -15 hrs., and rapidly change into outflows near and after emergence.Whereas the background convective field (outflow structures around the AR inflow) is a more slowly evolving phenomena, in line with the commonly reported lifetime of 1.5 days of supergranules (see Rincon & Rieutord 2018).As the EAR inflow has been the flow structure previously associated

Mani et al.
with flux emergence, our main interest lies in replicating this pattern implanted in a supergranular convective flow field, with variance in the morphology, S/N, location, etc programmed for in the synthetics algorithm.
It is worth noting that the AR inflows for an ensemble of ∼110 instances are surrounded by the background convective field, which are stochastic realizations of supergranules not thoroughly cancelled upon averaging.Superimposing over a larger number of "clean" emergence instances might well yield a more distinguishable flow feature, free from excessive background noise.Thus in this work, given what we observe in an ensemble averaged 110 ARs, we seek to build a machine that detects this most prominent flow feature in a slowly-varying, yet prominent background.The overall objective during training of the machine learning model is not to maximize the number of positive detections.It is rather to study the specific pattern that, in previous studies, has been correlated with magnetic flux emergence, and which can appear in all manner of convective flow-field.Subsequently from studying these AR flows in relation to the magnetic fields, we might hope to make statements about the driving forces behind flux emergence.Hence, we do not pay specific attention to the temporal evolution of stochastic background flows, but rather focus on generating realistic flow pattern of interest and embed it in quiet Sun fields (see section 4.3).

Flows
Our goal in synthetics will be to emulate ensemble-averaged AR horizontal divergence images; procedure for radial vorticity remains the same.
• Identify: features of supergranular scale of around 25-35 Mm using the blob log routine from the python package skimage 0.19.2.
-Input: a flow map and amplitude threshold of the feature (which we set to be 1e-5 in an ad hoc fashion, as strong supergranular features in horizontal divergence flow images are roughly of this amplitude), -Output: radius and center of the outflows/inflows.
• Reject: from the list those features if, within their 120 Mm the smoothed (σ = 5 pixels), unsigned magnetic field exceeds 120 G.
• Select: 20 features (randomly) from the remaining list.
• Shift: features to desired region.
We then shift locations for the 1000 identified inflows are picked such that the final inflow is elongated in east-west direction with an offset to retrograde (Birch et al. 2019).A synthetic AR inflow is thus constructed by shifting and superimposing 1000 supergranular inflows, diminishing background supergranular noise by a factor of ∼ 1/ √ 1000.

Magnetic fields
Generation of synthetic bipolar fields, similar to those seen in an ensemble-averaged AR magnetograms follows in a straightforward manner.Populate a region in a horizontal band (∼ 30Mm wide, chosen in an ad-hoc manner) around the center of a blank image with positive (negative) pixels in retrograde (prograde) direction.Ensure that the polarities close to each other, often times with slightly random tilts about the horizontal to account for Joy's law in observations.

Adding background noise to synthetics
The signal-to-noise of EAR inflows is poor (given that Birch et al. (2019) averaged 57 AR samples to image the preemergent inflows, SNR∼ 1/ √ 57).We should also expect our machine to perform robustly on observations only if our synthetics possessed realistic background properties (supergranular-scale flows and network fields, de Wijn et al. 2009).These are satisfied by adding random QS images of same size and suitable amplitudes to pure features generated in 4.1 and 4.2 (see Figure 10).We label the amplitude by which we scale this added QS image 'inverse-SNR' / 'i-SNR'.More the value of i-SNR, more the noise dominates the AR feature.We choose i-SNR from a random normal distribution N (i-SNR, 1) for the different AR images motivated by ensemble studies consideration, where it is only possible to quote the mean SNR of the feature.
i-SNR is a hyperparameter of the machine, in that we control it externally and it influences the prediction accuracy of the machine.Thus, it is natural to anticipate different training accuracy and predictions based on different input i-SNR.This is demonstrated for the ensemble-averaged EAR images of bipolar fields, radial vorticity and horizontal divergence, in the [-24, -18] hrs.period in Figure 3.We interpret this figure as follows: the machine learns to detect increasing numbers of poor-SNR AR features as it is trained on noisier synthetic AR images (top panel showing increasing number of positive ("TP"/ True Positive) detections with increasing i-SNR/noisier data), but at the same time, it becomes more susceptible to false-positive predictions in QS images (suggested by the bottom panel, with the drop in validation accuracy with increasing i-SNR/noisier data).

TRAINING AND TESTING ON SYNTHETICS
Although the goal is to understand the predictions of machine on observed AR images, it is useful to first illustrate the predictions on synthetic ARs and observed QS.

Training
Datasets in machine-learning are conventionally split into "training", "validation", and "test".During training, the machine is only allowed access to training data and does not use validation data to adjust the weights and biases of the neural network.Rather, at every epoch, machine performance is evaluated on validation data.Therefore, the criteria that all the samples in the test dataset remain unseen by the machine during training may be satisfied by using the same dataset for "validation" and "test".Below are the train/test data split and model parameters.

Testing
The machine is tested on 1000 synthetic AR and 1000 observed QS images.Table 1 summarizes the results for test dataset, with i-SNR chosen from the random normal distribution N (6, 1).AR(1) and QS(0) in Figures 4 (and 11) (the first two columns in the figure) are where features are correctly detected to be present and absent, respectively.Two other results that the test on synthetic AR and observed QS demonstrate: 1) As seen from the average of all the AR(1) and QS(1) in Figure 4 (and 11), the model has learned to identify the desired magnetic and flow features in both active region and quiet Sun images.2) It also misses detection when the feature is dominated by large background noise, as evidenced by the average of all the AR(0).As explained in 4.3 and Figure 3, increasing i-SNR might increase AR(1) in observed AR but will simultaneously increase QS(1) in QS, reducing overall accuracy.The discussion on accuracy is limited to testing on synthetics merely as an illustration, as our primary aim is to study if the AR-like flow and magnetic field features are unique to active regions alone.
True Skill Statistics (TSS ) provides a measure of the accuracy of machine in feature detection / classification tasks.It is computed using the rate of correct detections of both the classes (1 & 0) in the test sample, that is, how many AR and QS are mapped to 1 and 0 as a fraction of their total sample size, respectively.For our case, we use the below formula.

RESULTS ON OBSERVATIONS AND INTERPRETATION
To make predictions in the observations, we use the inflow machine at pre-emergence times (t < 0), and the outflow machine on post-emergence (t > 0) flow images.The model outputs for the ARs in the nine time intervals are noted.AR flow images in each interval are categorized containing or not showing flow signal (machine output 1/0).The results are plotted in Figure 5A.
Contrary to the impression gained from average measurements in ensemble studies, only some ARs contain inflow signatures.We find that the category of 'AR flows' is broad, i.e., there exists a sub-class of ARs that do not show any flow features.In each time interval, the contrast between the middle and bottom rows in Figure 5A shows that the model was able to pick out those particular ARs that contain the AR-like inflow (t < 0) and outflow (t > 0) feature from the entire set.The fraction of total ARs in a given interval with or without these AR-like flow features is shown at the top of each panel in the middle and bottom rows.Based on this model, anywhere between 40-60% of ARs contain the feature.For instance, in the fourth column (T i = −15 hrs.), there are 107 ARs, of which 58% (62 ARs) contain the inflow, whereas it is absent in the other 42% (45 ARs).We trained multiple independent machines, on training samples generated afresh each time, to check for consistency in the predictions, i.e., to test whether the same set of ARs is categorized as 1/0.We find that the predictions remain consistent to within 3%, i.e., for an observational sample size of 100, outputs for only 3 ARs vacillate around 0.5 in the sigmoid output, where in different models, one or more of these 3 may switch between 1/0 -samples that are close to the decision boundary since they are harder to classify.This is understood to be machine error, rather than the actual noise statistics of observed AR flows.
A cursory glance at the middle row of Figure 5A reveals that ARs with pre-emergence inflows seemingly evolve into outflows post-emergence.To verify if this is the case, we plot a Venn diagram (Figure 6A) for two representative sets -( 62) ARs that show inflows at -15 hrs.and (64) ARs that show outflows at +15 hrs.We refer to these two sets as 'inflow ARs' and 'outflow ARs', respectively.Roughly equal numbers of ARs are present in the three regions of the Venn diagram, i.e., ARs with pre-emergence inflows may or may not show outflows post-emergence.
The overlaid magnetic field contours in the middle and bottom rows of Figure 5A indicate an absence of meaningful correlation between flow features and magnetic fields, i.e., the presence of bipoles has little-to-no bearing on the presence of inflows/outflows in their vicinity.

Weak evidence for the existence of signature flows in ARs
In order to ascribe flow features as ARs, a comparison with QS flows allows for establishing a baseline, the threshold above which flow features may be correlated to large-scale magnetic fields with appropriate confidence.For this purpose, we collect 110 QS horizontal divergence flow images, evolve them for 54 hours / nine contiguous 6-hr intervals (the same duration over which flows around ARs are studied).To place error-bars, we evolve 30 different batches of 110 samples over the nine intervals to obtain the mean and standard deviations.
Figure 5B shows the ensemble average of 110 samples (top row) and the fraction of samples with/without identified AR-like flow features in the middle and bottom rows, respectively.The CNN model does not recognize AR-like flow features as unique to only active regions.There is a non-negligible baseline rate (35-40%) with which these features also appear in quiet-Sun flow fields.Since we train our model on synthetic flows, which are averaged over many supergranules in QS, it may be predisposed to finding AR-like flow features in QS.That the CNN model finds these features in both AR and QS images indicates that flows associated with active regions may not be physically distinct from background supergranular flows.
In Figure 6B we compare the rate with which AR-like inflows and outflows (fraction of total samples in which flow features are detected by the CNN model) appear in both AR and QS vs time t before and after emergence.For sake of completeness, ARs in all nine intervals are passed through both inflow and outflow CNN models to estimate the corresponding occurrence rates over the course of emergence.30 batches of 110 QS samples are also evolved and tested by the CNN model to obtain mean and 1-σ standard deviations of the quiet-Sun rates (shaded blue and red curves on the left and right panels).The AR prediction rate is almost constant with time for the QS maps, indicating that the background is statistically time-invariant.We apply the same QS error-bars to AR rates, with the assumption that noise statistics are similar.Consequently, these features are present in only a fraction of AR samples, and the statistical significance of the rate with which they appear above the background (≃ 3-σ only at -15 hrs.) may be debatable, indicating the lack of robust emergence-related flow signatures (from the current sample size).The results indicate a weak tendency for flux to emerge near supergranular inflows.Surface AR-inflow amplitudes of 60 m/s are much weaker than supergranular speeds of ∼ 300 m/s, pointing towards an imperfect alignment of emergence location and supergranular cell boundaries.While the correlation between AR inflows and emergence location and supergranular boundaries was explored in Birch et al. (2013) and Birch et al. (2019), conclusive evidence was lacking until present.

Weak evidence for magnetic buoyancy-assisted emergence
Next, we carry out tests to explore two phenomena predicted to be associated with magnetic buoyancy-assisted flux emergence: (1) a hypothesised retrograde flow (Fan 2008;Weber et al. 2011) (−v x feature) that appears in numerical simulations and has been explained as arising due to angular momentum conservation, and (2) an enhanced time rate of change for flux (appearing at the surface due to additional upward force), as compared with the purely convectively driven flux scenario.In numerical simulations of buoyancy-boosted flux emergence in near-surface layers (Cheung et al. 2010;Rempel & Cheung 2014), and in observations (Toriumi et al. 2012), outflows of the order of km/s magnitude (as compared to inflows of ∼ 50 m/s amplitudes seen in Birch et al. 2019) are seen near the emergence location.Therefore, we check if outflow ARs show retrograde flows and/or elevated flux growth rates at the surface compared to inflow ARs, a possible sign that magnetic buoyancy is a driver.
The average velocity in the x direction, v x = v x dA dA , is computed as the average over a contour enclosing the inflow region for the 62 inflow ARs, and outflow region for the 64 outflow ARs (Figure 7A and B), as these are the characteristic flow features of these two sets of ARs.We only include a sufficiently strong boundary around the inflow  / outflow; weak portions of the inflow / outflow feature merge into the neighbouring convective background features and we therefore choose to avoid including them.This is achieved by trial and error and setting the threshold to be 1.5 × 10 −6 s −1 in the horizontal divergence image.We obtain v x vs time for both inflow and outflow ARs by evolving them over the nine intervals and plot them in Figure 7D as solid lines.To ensure that the v x in ARs is above the background, we compute QS values of v x .We gather 30 batches of 62 QS images containing AR-like inflows (output 1 in the inflow machine), and 30 batches of 64 QS images containing AR-like outflows (output 1 in outflow machine) over the nine intervals.Mean and 1-σ standard deviations of the baseline v x are plotted as shaded regions in the two panels.We again place the same QS error-bars on the AR v x .We measure no statistically significant retrograde flow (negative v x ) at the surface in either outflow or inflow ARs.However, we detect a strong prograde flow in outflow ARs, post-emergence, that might be correlated with the leading polarity of the bipoles moving faster away from the polarity inversion line than the following polarity (Schunker et al. 2019).
To check if flux emerges at a more rapid rate in outflow ARs compared to inflow ARs, we choose a contour such that it sufficiently encloses the bipoles in the ensemble averaged magnetograms of these two sets (Figure 7C).We then compute Φ = |B| dA within that contour, using the same contour for both the sets, which is in turn obtained from the ±25 G contours associated with the average of 113 magnetograms at +15 hrs.Φ is plotted in Figure 7E, left panel.To place 1-σ error-bars, we estimate the standard deviation from within the 62 inflow-AR magnetograms and 64 outflow-AR magnetograms.Next, to compare the time rate of change of flux, dlnΦ dt is obtained (right panel), which may tell us if the flux of outflow ARs rises faster, i.e., if their net unsigned flux at the surface increases faster than that of inflow ARs before emergence time.Figure 7E shows the time rate of change of flux for the small number of outflow and inflow ARs in our data set.We find that for most time periods the rate of change is consistent between the inflows and outflows.However, at T = −3 hrs. the outflow's rate of change is greater than the inflow by 2-3 σ.This coincides with the maximal time rate of change for both inflow and outflow ARs.We note that the small number of samples available for both inflow and outflows likely leads to poor estimates of the error bars, and caution must be taken when interpreting the significance of these two data points.Overall, the time rate of change of flux in the emerging inflow and outflow ARs is fairly consistent (compared to the order of magnitude difference suggested by previous authors) lending little support to the hypothesis that outflow ARs, enhanced by magnetic buoyancy, emerge considerably faster.
7. DISCUSSION: COMPARISON WITH SIMULATIONS Helioseismic studies of EARs, which attempt to infer pre-emergent signatures below the surface using acoustic waves, suffer from low S/N beneath the photosphere, leading to a large spread among the findings (see for instance the introduction section of Birch et al. (2013)).It is not possible to make assertions about the subsurface flow and magnetic field dynamics from this present study, although we may possibly rule out flux emergence models that misalign with our observations.A major difficulty in modeling the flux emergence process over the vertical extent of the convection zone is the stark density contrast between the top and the bottom layers, placing a steep cost on numerical calculations.Simulations are thus carried out sometimes by only modeling emergence in the top ∼ 20 Mm (including the photosphere), over which density drops sharply and the thermodynamics of the plasma is complicated by ionization and radiative effects (Nordlund et al. 2009).A challenge in these setups is the initiation of flux emergence, since these simulations do not capture large-scale dynamo processes that produce the emerging magnetic field in the first place.Common approaches are passive flux emergence by imposing magnetic field in convective inflow regions, active flux emergence in which a flux structure (typically a semi-torus) is driven into the simulation domain across the bottom boundary, and the insertion of a buoyant flux tube.The details of the resulting flux emergence in terms of speed are dependent on the specifics of the setup.We briefly review results from relevant, near-surface simulations to compare with our inferences.
Radiative MHD simulations of uniform, untwisted, weak (1 kG) magnetic field rising from 20 Mm below the photosphere (Stein et al. 2011;Stein & Nordlund 2012) (passive flux emergence) find the rise speed to be of the same order as the simulated convective upflows at these depths.Their study further implies that downflow lanes in intermediate-sized convective cells (presumably supergranular boundaries) mainly serve to dictate the locations where bipolar fields form, commensurate with the findings of simulations of AR formation in global-scale solar convective dynamos (Chen et al. 2017).Our conclusions also moderately align with this scenario.Supergranular boundaries and emergence locations are correlated (although weakly).Moreover, Stein & Nordlund (2012) suggest that the combined actions of up and downflows on flux tubes in a supergranular-sized region (∼ 30 Mm) is sufficient for them to form ARs of similar sizes, i.e., magnetoconvection alone is enough to produce ARs.
Active flux emergence setups in which a magnetic half-torus was kinematically driven across the bottom boundary condition were considered by (Cheung et al. 2010;Rempel & Cheung 2014).Birch et al. (2016) showed that the resulting horizontal flows were too strong compared to observations unless vertical flows associated with flux emergence were comparable to typical convective upflows (< 150 m/s in a depth of 20Mm), also indicative of a more passive flux emergence process.
Recent attempts (Toriumi & Hotta 2019;Hotta & Iijima 2020) to overcome the drawbacks of flux-emergence simulations over limited vertical extents have focused on expanding the domain to cover the entire convection zone and to allow the dynamics of the flux tube to naturally play out through the interaction of convective flows and magnetic fields.Unlike previous setups, they started from a buoyant magnetic flux tube inserted in the volume of the simulation domain.They found that the rise speed of the flux tube is ∼ 250 m/s at 18 Mm below the photosphere; this exceeds the upper limit of 150 m/s at 20 Mm reached in a study Birch et al. (2016) of magnetoconvection simulations constrained by observed surface flows around 70 active regions.Recent follow-up work by Kaneko et al. (2022) showed that flux emergence is strongly influenced by the interaction with convective flows throughout the convection zone.To that end, they repeated their flux emergence setup more than 90 times, exploring a variety of initial locations for the flux tube.
The lack of correlation between AR-like flow features and large-scale magnetic fields, as seen from the present analysis, suggests that flux emergence is dominated neither by supergranular-scale convective flows nor by magnetic buoyancy.Other near-surface simulations (Cheung et al. 2010;Rempel & Cheung 2014;Chen et al. 2017), reasonably in line with conclusions of previous (Stein et al. 2011;Stein & Nordlund 2012) studies, have found that supergranularscale mean flows tend to oppose the assimilation of magnetic elements into similar polarities.This assimilation is counteracted by a Lorentz force due to correlation between small-scale fluctuations in velocity and magnetic fields.We thus speculate that flux emergence and the formation of coherent bipoles and monolithic sunspot structures are driven by small-scale turbulent flows (of the order of few granules, or a few Mm length scale), rather than large-scale mean flows with supergranular length scales (∼ 30Mm), as obtained here using LCT.Although here we only analyze near-surface flows, convection in the deeper layers (below 20 Mm), imaged using seismic techniques, may also likely play a role in setting up the observed active-region scale magnetic fields at the surface.

B. INPUT IMAGE SIZE
Our tracked data products of 115 ARs are 32 • × 32 • in spatial size.The region of interest is only near the center of the image where active region is set to emerge; prior studies (Birch et al. 2019;Gottschling et al. 2021) have shown flows associated with EARs to be limited (∼ 7 • ) in spatial extent.Therefore we use images of a smaller size, of 10 • × 10 • , for training the machine.Moreover, we interpolate the images onto a coarser grid of resolution 1.4 Mm, as small scale features are not relevant for successful training.Synthetic AR images are generated on this grid and QS images are randomly oversampled from the larger image to reduce computation load.That is, instead of obtaining multiple separate 10 • × 10 • QS observations, 150 different images of the same area are obtained from a 32 • × 32 • image in a process called oversampling (see Figure 8).

C. COMPLETE TEST RESULTS ON SYNTHETICS AND OBSERVATION
The trained model is tested on bipolar fields, radial vorticity, and horizontal divergence images, in the nine time intervals T 1 to T 9 , for all the ARs in a given interval.We do not show results on QS here again.The number of available ARs decreases the farther back from emergence time one observes, as ARs tend to move outside of the desired field of view (±50 • central meridian distance).The total number of ARs for the nine T i 's, along with the number of 1 and 0 detections are tabulated for bipolar fields, radial vorticity, and horizontal divergence images, are noted down in Table 2. Figures corresponding to Table  3. Strength of magnetic field and vorticity, in bipolar fields and radial vorticity images respectively, also steadily increases with time, while the strengths of the inflows in horizontal divergence images peak around -15 hrs.
-   13), we do not measure substantial correlations between flows and magnetic fields in the observations of active regions.Rather than imposing a flow-magnetic field correlation apriori, it is more objective to discover if any such connection exists through independent machines for these features.

Figure 1 .
Figure 1.Ensemble average of all the ARs in the nine time intervals with A: LOS magnetograms, B: horizontal divergence (∇ h • u).The mid-point of the time interval and the number of ARs averaged are stated in the title of each column.Magneticfield contours of ±10 G are overlaid on the flows to aid visualization.The first six columns belong to pre-emergence time (t < 0), while the last three columns denote post-emergence time (t > 0).The white arrows in each panel denote velocity field of the plasma.Only speed>12 m/s are plotted.The top right of the figure denotes the arrow length corresponding to 40 m/s speed.

Figure 2 .
Figure2.CNN architecture: From the left, representative input image (a horizontal divergence map), followed by Conv2D + Max-Pool2D, followed by Flatten, Dense, and the output Sigmoid layer.All the filters in the Conv2D layer operate independently on its input image.Filters of size 3X3 are used in the Conv2D layer -the 20 filters operate independently of each other, scanning the whole image, to produce 20 images of size 85X85 each.

Figure 3 .
Figure 3. Top: Number of positive predictions (TP) of the machine for bipolar fields B, radial vorticity C, and horizontal divergence D for the ARs in [-24, -18] hrs period.Bottom: Accuracy on test data.Both these quantities are plotted as a function of different mean i-SNRs.Figure legend is common for both the panels.

Figure 4 .
Figure 4. Average of the images belonging to the four outcomes.Figures in a row are saturated to the colorscale of AR(1) (the first image in a row).The above results are summarized in Table1.Results corresponding to magnetic bipolar fields and radial vorticity are show in Appendix Figure11.

Figure 5 .
Figure 5. Machine learning classification of horizontal divergence flow images into 1/0, or as images with / without AR-like flow features.Panels A, top row : ensemble averages over all ARs in a given interval, middle row : averages over ARs where flow features are detected, and bottom row : averages over ARs where flow features are not detected by the model.Magnetic field contours of ±10 G are overlaid.Panels B: Same as A, except all the images are QS (110 samples).The fraction of total samples classified as 1/0 are stated at the tops of the middle and bottom rows in both A and B.

Figure 6 .
Figure 6.A: Venn diagram illustrating the correlation between "inflow ARs" and "outflow ARs".B: Statistics of AR (solid lines) and QS (shaded region) vs time, showing the fraction of total samples containing AR-like inflows (left panel) and AR-like outflows (right panel).The vertical green dashed line marks the emergence time t = 0.

Figure 7 .
Figure 7. A: contour for vx for inflow ARs.B: contour for vx for outflow ARs.C: contour for flux and flux rate of change.D: illustration of vx near emergence location (solid lines) in "inflow ARs" (left panel) and "outflow ARs" (right panel) vs time, along with vx in QS (shaded region) inside an area of the same contour as chosen for the ARs.E: Unsigned flux Φ (left panel), and time rate of change of Φ (right panel), for "inflow ARs" and "outflow ARs".The vertical green-dashed line marks the emergence time t = 0. Error-bar heights in D and E are ±1σ.

Figure 8 .
Figure 8.A representative 32 • × 32 • QS horizontal divergence flow map.Black squares overlaid on the map indicate random 10 • × 10 • oversampling.While there is of course a chance of partial overlap between smaller images, machines see them as unique samples.This is also done for bipolar fields and radial vorticity images.
2 are shown in Fig 12.We draw the F following conclusions from the results -1.The model shows all 115 ARs as containing bipolar magnetic fields from T 6 , which is the interval closest to emergence time and forward (see Figure12A, last three columns).2.Number of ARs predicted by the machine as containing bipoles (bipolar fields) and double vortex rolls (radial vorticity) steadily increases with time.But the number of ARs containing inflows/outflows (horizontal divergence) peaks at -15 hrs.and +15 hrs., respectively.

Figure 9 .
Figure 9. Examples of synthetic bipolar fields images (top row ), synthetic radial vorticity images (middle row ), and synthetic horizontal divergence images (bottom row ).

Figure 10 .
Figure 10.Top row : Magnetic field, Middle row vorticity, Bottom row : inflows.Left column: Pure features generated using procedure in 4, Middle column: Observed QS (background), with amplitudes greater than pure features, to imitate signal-tonoise in observations, Right column: Adding left and middle column images and normalizing to 1.D. ABSENCE OF STRONG CORRELATION BETWEEN MAGNETIC FIELDS AND FLOWSPrior studies have shown correlation between emerging active region flows and magnetic flux.As is shown in the Venn-diagram (see Figure13), we do not measure substantial correlations between flows and magnetic fields in the observations of active regions.Rather than imposing a flow-magnetic field correlation apriori, it is more objective to discover if any such connection exists through independent machines for these features.

Table 1 .
Results for synthetics.Figures corresponding to the above is shown in Figure

Table 2 .
Results for observations.1 / 0 denote the number of ARs in which the model detects / fails to detect the flow/magnetic field feature.