  Solar flares are explosions in the solar atmosphere that release intense
bursts of short-wavelength radiation and are capable of producing severe
space-weather consequences. Flares release free energy built up in coronal
fields, which are rooted in active regions (ARs) on the photosphere, via
magnetic reconnection. The exact processes that lead to reconnection are not
fully known and therefore reliable forecasting of flares is challenging.
Recently, photospheric magnetic-field data has been extensively analysed using
machine learning (ML) and these studies suggest that flare-forecasting accuracy
does not strongly depend on how long in advance flares are predicted (Bobra &
Couvidat 2015; Raboonik et al. 2017; Huang et al. 2018). Here, we use ML to
understand the evolution of AR magnetic fields before and after flares. We
explicitly train convolutional neural networks (CNNs) to classify SDO/HMI
line-of-sight magnetograms into ARs producing at least one M- or X-class flare
or as nonflaring. We find that flaring ARs remain in flare-productive states --
marked by recall >60% with a peak of ~ 80% -- days before and after flares. We
use occlusion maps and statistical analysis to show that the CNN pays attention
to regions between the opposite polarities from ARs and the CNN output is
dominantly decided by the total unsigned line-of-sight flux of ARs. Using
synthetic bipole magnetograms, we find spurious dependencies of the CNN output
on magnetogram dimensions for a given bipole size. Our results suggest that it
is important to use CNN designs that eliminate such artifacts in CNN
applications for processing magnetograms and, in general, solar image data.
