A deep ensemble approach to X-ray polarimetry

A.L. Peirson∗, R.W. Romani
Kavli Institute for Particle Astrophysics and Cosmology
Stanford University
alpv95@stanford.edu

Abstract
X-ray polarimetry will soon open a new window on the high energy universe withthe launch of NASA’s Imaging X-ray Polarimetry Explorer (IXPE). Polarimeters
are currently limited by their track reconstruction algorithms, which typicallyuse linear estimators and do not consider individual event quality. We present a
modern deep learning method for maximizing the sensitivity of X-ray telescopic
observations with imaging polarimeters, with a focus on the gas pixel detectors(GPDs) to be flown on IXPE. We use a weighted maximum likelihood combinationof predictions from a deep ensemble of ResNets, trained on Monte Carlo event
simulations. We derive and apply the optimal event weighting for maximizing thepolarization signal-to-noise ratio (SNR) in track reconstruction algorithms. For
typical power-law source spectra, our method improves on the current state of theart, providing a ∼ 40% decrease in required exposure times for a given SNR.

1

Introduction

Measuring X-ray polarization, the degree of order in X-ray electric field oscillations, has been a major
goal in astrophysics for the last 50 years. X-ray polarization measurements offer rich opportunities toprobe the magnetic field topology and emission physics of high energy astrophysical sources, such as
accreting black holes and astrophysical jets [1, 2]. The recent development of photoelectron tracking
detectors [3] has greatly improved the prospects of doing so. The gas pixel detector (GPD) [4] hasbrought soft X-ray polarimetry (1-10 keV) to the PolarLight CubeSat test [5], the scheduled NASA
IXPE mission [6], and the potential Chinese mission, eXTP [7].
Imaging X-ray polarization telescopes feed GPDs which directly image charge tracks formed fromphotoelectrons scattered by incoming X-ray photons. IXPE [2, 8, planned for launch December
9th 2021] will use three co-aligned X-ray telescopes, whose focal planes are imaged by GPDs withhexagonal pixels. IXPE’s sensitivity is limited by the track analysis algorithm used to recover source
polarization, spatial structure and energy, given a measured set of electron track images. In the 1 − 10
keV range, the cross-section for photoelectron emission is proportional to cos2 (θ), where θ is theangle between the normal incidence X-ray’s electric vector position angle (EVPA) and the azimuthal
emission direction of the photoelectron. By measuring a large number of individual photoelectron
emission angles θ, one can recover the above distribution to extract the source polarization parameters:
polarization fraction (0 ≤ p0 ≤ 1) and electric vector position angle (EVPA, −π/2 ≤ φ < π/2). In
practice, the recovery of photoelectron emission angles from track images is imperfect. Track images
are noisy due to Coulomb scattering and diffusion, and, especially for low energies, are often barely
resolved. Emission angle estimates are highly heteroskedastic.
The current track reconstruction method for GPDs is a moment analysis described by [3]. Impressive
accuracies are achieved from a simple weighted combination of track moments. However, simple
moments cannot capture all of the image information, especially for long high energy tracks, and so a∗

https://www.alpeirson.com

Fourth Workshop on Machine Learning and the Physical Sciences (NeurIPS 2021).

20
15
10
5
0

0.2
0.0
0.2
0.4
0.6
0.2

0.0

0.2

0.4

0.6

20
15
10
5
0

0

0

10

20

10

20

20
15
10
5
0
20
15
10
5
0

0

0

10

10

20

20

20
15
10
5
0
20
15
10
5
0

600
500
0

10

20

400
300
200
100
0

0

10

20

Figure 1: Example square conversions of a 6.4 keV hexagonal track (left panel). The six panels to theright show shifts along the 120◦ GPD axes; shifting odd rows (upper) or even rows (lower). For eachhexagonal track, the ResNet-18s are fed column-wise pairs of square conversions, along with theinitial photoelectron direction (blue line) as a label.
more sophisticated image analysis scheme may lead to improved track angle recovery. The problem
of recovering polarization parameters from a dataset of (IXPE) electron track images has recently
been announced as an open problem in the machine learning community [9].
In this work, we aim to both improve individual event estimates and explicitly model their uncertainty
to increase final polarization sensitivity. We demonstrate a two step method: (1) Use a deep ensembleof ResNets [10] to predict electron track angles θ and their uncertainties. (2) Combine predicted
angles and their uncertainties in a weighted estimator of the polarization parameters p0 , φ thatmaximizes the SNR. Our empirical findings indicate a substantial improvement over the current stateof-the-art track reconstruction [3, 11]. While the results shown here are specific to IXPE’s GPDs,
the methods are general, and can be applied to other imaging detector geometries. Extended results,
including spatial and energy resolution are discussed in [12, 13].

2

Step I: deep ensemble

To extract the angles from individual tracks we use a supervised deep learning technique known as
deep ensembles [14]. Deep ensembles are made up of an ensemble of individual neural networkmodels, each trained independently on the same data set to predict the desired output features.
Deep ensembles provide estimates of the predictive uncertainty by exploiting different random
initializations of the same model at the start of training which leads to widely different prediction
functions [15]. In terms of performance and scalability, deep ensembles remain the current state of
the art in uncertainty quantification [16]. In our case, we have an image to feature regression problem.
Convolutional neural networks have been designed with a spatial inductive bias appropriate for image
regression problems. So our deep ensemble will be made up of M individual ResNet-18s [10].
To make the hexagonal track images admissable inputs to standard ResNet architectures, we first
convert the hexagonal images to square image arrays by shifting every other column and rescaling the
distance between points, as described in [17]. Since there are two possible shifts (odd and even rows),
we apply both and stack the two shifted images, similar to color channels in rgb images. We do thisto more closely approximate spatial equivariance of the ResNet convolution kernels in the hexagonal
space. At test time, we apply the deep ensemble to the same track 3 times, each time rotated by120◦ in hexagonal space. We find this reduces all relevant prediction bias on θ (and later p0 , φ)introduced when converting from hexagonal to square coordinates. Fig. 1 summarizes this process.
An alternative solution is to use a model with native hexagonal convolutions, such as [17]. In practice,
we found it more effective and expedient to leverage existing square convolution architectures.
For part (1) of our method, we need to predict emission angle θ and its associated uncertainty foreach track. Instead of the Gaussian negative log-likelihood (NLL) used in [14], we use the von Mises(VM) distribution NLL as our loss function, the maximum entropy distribution for circular data withspecified expectation value. This more appropriately reflects the distribution of our estimators θ̂,which are clearly periodic. The VM distribution is parameterized by concentration parameter κ; forlarge κ the VM converges to a Gaussian with variance σ 2 = 1/κ and for small κ it approaches auniform distribution. We parameterize the true angle θ as a 2D vector v = (cos2θ, sin2θ) to capture2

the periodicity. Only −π/2 ≤ θ̂ < π/2, as opposed to −π ≤ θ̂ < π, is required for polarization
estimation since −π/2 ≤ φ < π/2; see eq. 2). Each of the ResNet-18 models in our ensemble
computes the loss as
Loss(v̂, κ̂|v) ∝ −κ̂(v̂.v) + log I0 (κ̂).
(1)
where I0 is the modified Bessel function of the first kind. Each ResNet-18 in the ensemble (j =v̂ 
1 : M ) outputs the 3-vector (v̂ij , κ̂ij ) for track i. Then θ̂ij = arctan v̂ijij2 /2 and κ̂ij defines the1predicted aleatoric uncertainty. The final track angle prediction θ̂i is the circular average over theensemble predictions j = 1 : M . The epistemic uncertainty on θ̂i is also assumed to follow a
VM distribution, with concentration parameter κei ; we estimate it using the appropriate maximum
likelihood estimator for κ̂ei given the independent sample set {θij }M
j=1 , see appendix. The total
predictive error P
on each track angle θ̂i is given by summing the aleatoric and epistemic variances:e
1/κ̂toti = (1/M
j 1/κ̂ij ) + 1/κ̂iData. Our intial dataset consists of 3.5 million GEANT4 [18] Monte Carlo simulated tracks, where
each track is labelled with its 2D emission angle vector, an example of which is shown in fig. 1. The
track energies uniformly span 1.0 − 10.0 keV, IXPE’s most sensitive range, and are unpolarized(uniform track angle distribution). Since we don’t know the true event energy, we want a model thatcan make predictions for tracks of all energies. We have confirmed the simulated track data matches
real flight detector data to extremely high precision, and that our method is robust to any remaining
covariate shift, maintaining the relative improvement shown in §4 for real detector data.
Training. We apply pixelwise normalization to the square track images. Each ResNet-18 model istrained with a Momentum Optimizer, and a step-wise learning rate beginning at 1 × 10−3 and endingat 1 × 10−5 on 2 NVIDIA GeForce RTX 2080 GPUs. ResNets with batch size 512, 1024, 2048 are
all considered for selection in the final ensemble. We randomly select M = 10 trained ResNets tocompose the final ensemble, whose distributed results estimate the epistemic error.

3

Step II: polarization estimation

The basic problem is to estimate p0 and φ from a set of measured track angles {θ̂i }N
i=1 . As describedin the introduction, true track angles exhibit a sinusoidal modulation with period πp(θ|p0 , φ) =
1
1 + p0 cos 2(θ − φ)2π(2)where 0 ≤ p0 ≤ 1, −π/2 ≤ φ < π/2 and −π ≤ θ < π. One could estimate (p0 , φ) using the
maximum likelihood estimator (MLE) for eq.2. Equivalently, [19] have shown that the minimum
variance unbiased estimator for (p0 , φ) is given byq(3)p̂0 = Q̂2 + Û 2 ,1Û
arctan .
(4)
2
Q̂
PN
PN
where Iˆ = N , Q̂ = I1ˆ i=1 2 cos 2θ̂i , and Û = I1ˆ i=1 2 sin 2θ̂i . However, since θ̂i are imperfectlyφ̂ =recovered, we adjust eq. 2 to include the VM uncertainty on our estimates, θ̂ = θ + VM(0, κ).
Computing the convolution of eq. 2 with the VM, we find:p(θ̂|p0 , φ) =
1I1 (κ) 
1 + p0cos 2(θ̂ − φ)2π
I0 (κ)(5)

In other words, θ̂ follow the same distribution as θ but smeared by a modulation factor µ =I1 (κ)/I0 (κ). Current analyses [11, 9] treat µ as constant for all tracks and calculate it basedon broadband calibration measurements: no connection to individual track predictions. In effect, they
assume homoskedastic emission angle measurements. Here, we explicitly model the heteroskedasticity of our predictions θ̂ by using a deep ensemble (§2) to estimate event uncertainties κ̂ and include
them in the likelihood for final (p0 , φ) predictions.
31.0

Modulation factor

0.8
0.6
0.4
0.2
0.00.0Flat spectrum
PL1 spectrum
0.2
0.4
0.6
0.8
1.0
Event weight w

Figure 2: Measured modulation factor µ as a function of predicted track weight w = I1 (κ̂)/I0 (κ̂) forlarge test data sets of 1 − 10 keV simulated events. Each µ bin is calculated from 20,000 individual
track events. Open circles represent a PL1 source, closed circles a flat spectrum.
Table 1: Sensitivity analysis for 105 2-8 keV photons with a dN/dE ∼ E −1 spectrum.
MethodMDP99 (%)

Moment Analysis
Deep ensemble
Deep ensemble w/ weights

4.45 ± 0.02
4.21 ± 0.02
3.38 ± 0.01

Instead of explicitly maximizing a likelihood function based on eq.5 and our predictions {θ̂i , κ̂i }N
i=1
to estimate (p0 , φ), we can define event weights
wi = I1 (κ̂i )/I0 (κ̂i ),

(6)

PN
(
wi )2
Iˆ = Neff = Pi=1,N
2
i=1 wi(7)

and use eq.3-4 by defining

N

Q̂ =

1X
2wi cos 2θ̂i ,
Iˆ

(8)

i=1
N

Û =

1X
2wi sin 2θ̂i .
Iˆ

(9)

i=1

As N approaches infinity, this converges to the MLE [19]. The posterior distribution p(p0 , φ|p̂0 , φ̂) is
given in appendix §A.2.
Figure of merit. We require a figure-of-merit to define the quality of polarization reconstruction
using different methods. Aligned with prior work, we adopt the standard figure-of-merit used in
X-ray polarimetry: minimum detectable polarization (MDP) [20]. MDP99 is the polarization fractionthat has a 1% probability of being exceeded by chance for an unpolarized (p0 = 0) source.
√ This canbe found by integrating the posterior distribution (see appendix): MDP99 = 4.29/(µ N ) for an
unweighted polarization estimate. Here µ is the empirical modulation factor for the entire set of trackobservations (i.e. µ = p̂0 for p0 = 1). For a weighted estimate N is replaced√ with Neff (eq. 7) [19].
MDP99 is effectively a (inverse) ratio of recovered signal µ to noise ∼ 1/ N . For a given detector,
track reconstruction algorithms with lower MDP99 are better. In the appendix, we prove our chosenweighting minimizes the MDP99 (maximizes SNR).
4

4

Results and discussion

We evaluate our two step method and the standard moment analysis on a power law 1 dataset with
N = 105 tracks. Once emission angles are estimated, all methods use eqs.3-4 for polarization
prediction. To further strengthen our analysis, we ablate using predicted uncertainties weights.
Table 1 shows the results. Our weighted approach using deep ensemble predictions yields significant
improvement over the standard analysis, with a 1 − 3.38/4.45 ∼ 24% decrease in MDP99 . The
equivalent decrease in IXPE’s required exposure times to reach the same SNR is 1 − (3.38/4.45)2 ∼40%. Our method without any uncertainty weighting provides a significantly smaller improvement.
The gain in sensitivity of our method comes in a small part from an improvement in θ̂ accuracy,
and in a larger part from properly modelling θ̂ heteroskedasticity, using deep ensemble predicteduncertainties as appropriate event weights. In fig. 2 we assess the trustworthiness of our deep
ensemble predicted VM uncertainties. We find the empirical modulation factor matches the deep
ensemble predicted modulation factor (event weights) very closely for a selection of test spectra. In
the appendix, we visualize our deep ensemble θ̂ at multiple energies to assess any prediction bias.
Our results on real (non-simulated) detector data indicates similar exposure time reduction. A
decrease in exposure time of 40% adds public value since NASA-funded projects like IXPE canobserve significantly more sources, at better SNR, over the mission lifetime. We expect our approachof using deep ensemble predicted uncertainties to take into account heteroskedasticity could beapplied to other problems in engineering and the physical sciences, for example in high energy
particle physics: fitting Cauchy distributions to the frequencies of noisy (deep learning) measured
decay states.

Acknowledgments and Disclosure of Funding
We would like to thank Christopher Fifty for a thorough read-through of the manuscript and thereferees for helpful and constructive comments. This work was supported in part by the NASA
FINESST program (grant 80NSSC19K1407) and grant NNM17AA26C from the Marshall Space
Flight Center.

References[1] Krawczynski, H., Matt, G., Ingram, A.R., Taverna, R., Turolla, R. et al. Using X-Ray Polarimetry
to Probe the Physics of Black Holes and Neutron Stars. 51:150, May 2019. Conference Name:
Bulletin of the American Astronomical Society.
[2] Weisskopf, M. An Overview of X-Ray Polarimetry of Astronomical Sources. Galaxies, 6:33,
March 2018.
[3] Bellazzini, R., Angelini, F., Baldini, L., Brez, A., Costa, E. et al. Novel gaseous x-ray
polarimeter: data analysis and simulation. In Polarimetry in Astronomy, volume 4843, pages
383–393. International Society for Optics and Photonics, February 2003.
[4] Bellazzini, R., Spandre, G., Minuti, M., Baldini, L., Brez, A. et al. A sealed Gas Pixel Detector
for X-ray astronomy. Nuclear Instruments and Methods in Physics Research A, 579:853–858,
September 2007.
[5] Feng, H. and Bellazzini, R. The X-ray polarimetry window reopens. Nature Astronomy,
4(5):547–547, May 2020. Number: 5 Publisher: Nature Publishing Group.
[6] Sgrò, C. and IXPE Team. The Imaging X-ray Polarimetry Explorer (IXPE). Nuclear Instruments
and Methods in Physics Research A, 936:212–215, August 2019.
[7] Zhang, S.N., Feroci, M., Santangelo, A., Dong, Y.W., Feng, H. et al. eXTP: Enhanced X-ray
Timing and Polarization mission. In Space Telescopes and Instrumentation 2016: Ultraviolet
to Gamma Ray, volume 9905, page 99051Q. International Society for Optics and Photonics,
January 2017.
5

[8] O’Dell, S.L., Baldini, L., Bellazzini, R., Costa, E., Elsner, R.F. et al. The Imaging X-ray
Polarimetry Explorer (IXPE): technical overview. 0699:106991X, August 2018. Conference
Name: Space Telescopes and Instrumentation 2018: Ultraviolet to Gamma Ray.
[9] Moriakov, N., Samudre, A., Negro, M., Gieseke, F., Otten, S. and Hendriks, L. Inferring
astrophysical X-ray polarization with deep learning. arXiv:2005.08126 [astro-ph], May 2020.
arXiv: 2005.08126.
[10] He, K., Zhang, X., Ren, S. and Sun, J. Deep Residual Learning for Image Recognition.
arXiv:1512.03385 [cs], December 2015. arXiv: 1512.03385.
[11] Kitaguchi, T., Black, K., Enoto, T., Hayato, A., Hill, J.E., Iwakiri, W.B., Kaaret, P., Mizuno,
T. and Tamagawa, T. A convolutional neural network approach for reconstructing polarization information of photoelectric X-ray polarimeters. Nuclear Instruments and Methods inPhysics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment,
942:162389, October 2019. arXiv: 1907.06442.
[12] Peirson, A.L., Romani, R.W., Marshall, H.L., Steiner, J.F. and Baldini, L. Deep ensemble
analysis for Imaging X-ray Polarimetry. Nuclear Instruments and Methods in Physics Research
Section A: Accelerators, Spectrometers, Detectors and Associated Equipment, 986:164740,
January 2021.
[13] Peirson, A.L. and Romani, R.W. Towards Optimal Signal Extraction for Imaging X-ray
Polarimetry. arXiv:2107.08289 [astro-ph], July 2021. arXiv: 2107.08289.
[14] Lakshminarayanan, B., Pritzel, A. and Blundell, C. Simple and scalable predictive uncertainty
estimation using deep ensembles. In Proceedings of the 31st International Conference on
Neural Information Processing Systems, NIPS’17, pages 6405–6416, Long Beach, California,
USA, December 2017. Curran Associates Inc.
[15] Fort, S., Hu, H. and Lakshminarayanan, B. Deep Ensembles: A Loss Landscape Perspective.
arXiv:1912.02757 [cs, stat], December 2019. arXiv: 1912.02757.
[16] Hoffmann, L. and Elster, C. Deep Ensembles from a Bayesian Perspective. arXiv:2105.13283[cs, stat], May 2021. arXiv: 2105.13283.
[17] Steppa, C. and Holch, T.L. HexagDLy - Processing hexagonally sampled data with CNNs in
PyTorch. SoftwareX, 9:193–198, January 2019. arXiv: 1903.01814.
[18] Agostinelli, S., Allison, J., Amako, K., Apostolakis, J., Araujo, H. et al. Geant4—a simulation toolkit. Nuclear Instruments and Methods in Physics Research Section A: Accelerators,
Spectrometers, Detectors and Associated Equipment, 506(3):250–303, July 2003.
[19] Kislat, F., Clark, B., Beilicke, M. and Krawczynski, H. Analyzing the data from X-ray
polarimeters with Stokes parameters. Astroparticle Physics, 68:45–51, August 2015.
[20] Weisskopf, M.C., Elsner, R.F. and O’Dell, S.L. On understanding the figures of merit for
detection and measurement of x-ray polarization. arXiv:1006.3711 [astro-ph], page 77320E,
July 2010. arXiv: 1006.3711.

Checklist
1. For all authors...
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s
contributions and scope? [Yes](b) Did you describe the limitations of your work? [Yes](c) Did you discuss any potential negative societal impacts of your work? [N/A](d) Have you read the ethics review guidelines and ensured that your paper conforms tothem? [Yes]2. If you are including theoretical results...
6

(a) Did you state the full set of assumptions of all theoretical results? [Yes](b) Did you include complete proofs of all theoretical results? [Yes]3. If you ran experiments...
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [No] These will be
provided after IXPE’s launch, December 9th(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they
were chosen)? [Yes](c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes](d) Did you include the total amount of compute and the type of resources used (e.g., typeof GPUs, internal cluster, or cloud provider)? [Yes]4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
(a) If your work uses existing assets, did you cite the creators? [Yes](b) Did you mention the license of the assets? [N/A](c) Did you include any new assets either in the supplemental material or as a URL? [N/A](d) Did you discuss whether and how consent was obtained from people whose data you’reusing/curating? [N/A](e) Did you discuss whether the data you are using/curating contains personally identifiable
information or offensive content? [N/A]
5. If you used crowdsourcing or conducted research with human subjects...
(a) Did you include the full text of instructions given to participants and screenshots, if
applicable? [N/A](b) Did you describe any potential participant risks, with links to Institutional Review
Board (IRB) approvals, if applicable? [N/A](c) Did you include the estimated hourly wage paid to participants and the total amountspent on participant compensation? [N/A]A

Appendix

A.1

Epistemic error estimator

With the epistemic uncertainties assumed to follow VM(0, κei ); κei can be estimated from the output
of a deep ensemble with M models {θ̂ij }M
j=1 :


2
M
X
1
cos 2θ̂ij  + 
sin 2θ̂ij 
N j=1
N j=1

1
R̄i2 = 

2

M
X



I1 (κ̂ei )= R̄i ,
I0 (κ̂ei )with the modified Bessel functions I0 and I1 .
7

(10)

(11)

A.2

Posterior distribution on p0 , φ

NFor a weighted polarization estimate with observations {θ̂}Ni=1 and weights {wi }i=1 using eqs. 3–4,
[19] derive the joint error distribution (posterior) for the polarization fraction and EVPA estimators as√
Neff p̂0 µ2
p(p0 , φ|p̂0 ,φ̂) =×" 2πσ(µ2
exp − 2 p̂20 + p20 − 2p̂0 p0 cos(2(φ̂ − φ))
(12)
4σ
)#
p̂2 p2 µ2− 0 0 sin2 (2(φ̂ − φ)) ,
2

where

s
σ=

1
Neff



p2 µ2
1− 0
.
2

(13)

and

PN
(
wi )2
Neff = Pi=1(14)N
2i=1 wiThis assumes a uniform prior over (p0 , φ). Here, µ is the empirical modulation factor for the entire setof track observations (i.e. µ = p̂0 for p0 = 1). µ is effectively the instrument polarization response.
Confidence intervals and the MDP99 (§A.3, the 99% upper limit for p0 = 0) are derived fromthis posterior probability distribution. In cases where µ and p0 are not close to 0, the Gaussian
approximation for the marginalized errors below is sufficients
2 − p̂20 µ2,(15)σ(p0 ) ≈(Neff − 1)µ2
σ(φ) ≈

1p.
p̂0 µ 2(Neff − 1)

(16)High µ and high Neff are both desirable to minimize the errors on recovered polarization parameters.
A.3

Minimum detectable polarization (MDP99 )The MDP99 is calculated for an unpolarized p0 = 0 source and is given by (using posterior eq. 12)
Z MDP99 Z π/2p(p0 , φ|p̂0 , φ̂)dφdp0 = 0.99
(17)
0

−π/2

MDP99 =
A.4

4.29√
µ Neff(18)

Maximising the SNR

We define the signal-to-noise ratio (SNR)p
SNR ∝ 1/MDP99 ∝ µ Neff .

(19)This is simply the inverse of the MDP99 (without constants); an optimal weighting scheme should
maximize the SNR for a fixed number of events N . We can expand the SNR explicitly using ourweighted estimators from §3,
v
u P
2 P
2
u
N
N
2wi cos 2θ̂i +2wi sin 2θ̂i
u
i=1
i=1
SNR ∝ t.
PN
2
i=1 wi8(20)Expanding, squaring, and dropping constants (which do not affect maximization) we obtainPˆ
i,j,i6=j wi wj cos 2(θ̂i − θj )
2
P 2
.
SNR ∝
k wi

(21)

The estimators θ̂i are random variables. The true values θi , also random variables, follow the
distribution eq. 2 (since they are perfectly known). Assuming the θ̂i are unbiased estimators of θi(approximately true for both moment analysis and ResNet-18s, §A.5) we can sayθ̂i = θi + i(22)where the measurement errors i are independent random variables drawn from the same family of
distributions withE[i ] = 0, Var[i ] = σi2 .
(23)
The specific distribution of the measurement errors i will depend on the θ̂i estimation method;
however since θ̂i are periodic, i should follow a periodic distribution. For any i distribution withthe above properties, we can find the distribution for θ̂i as the convolution of the θi , i distributions
θ̂i ∼


1
1 + µi p0 cos[2(θ̂i − φ)] ,
2π

(24)

where 0 ≤ µi < 1 and µi (σi2 ). In other words, the distribution of estimators θ̂i are the same as the
distribution of the true values θi but with a reduced modulation factor µi . The measurement noise
will decrease the sinusoidal modulation by a factor µi for the specific event i.
Knowing the distributions of θ̂i , eq. 24, we take the expectation over SNR2 (dropping constant p0 )P
i,j,i6=j wi wj µi µj
2
P 2
E SNR ∝.
(25)
k wk
Finally maximizing this expression with respect to {wi } in the large N limit, we find
wi = µi ,(26)i.e., the optimal weight for an event with observation θ̂i is given by its expected µ. Note for N ∼ 20
this already holds with high accuracy; useful polarization measurements typically have N > 1000.
Under the assumption of von Mises distributed θ̂ errors
i ∼ VM(0, κ),(27)

we have shown in §3 thatwi = µi =I1 (κi ).
I0 (κi )(28)

These weights maximize the SNR.
A.5

Recovered emission angles

We show the recovered θ̂ distribution for our deep ensemble and the moment analysis at two example
energies in fig.3. The unpolarized examples show negligible residual polarization in our method
while the polarized examples suggest an increase in deep ensemble polarization signal (µ), especiallyat higher energies. As described in the main text, the improvement in the actual polarization estimatoris even greater when weighting using event uncertainties. All plots suggest a lack of θ̂ prediction bias
in our method.

9Normalized Counts [rad 1]

4.0 keV

1

0
[rad]

7.0 keV

NN
True
Mom.
1

1

0
[rad]

4.0 keV

1

1

0
[rad]

7.0 keV

1

1

0
[rad]

1

Figure 3: Track angle recovery for unpolarized, p0 = 0, (left two panels) and 100% polarized, p0 = 1,(right two panels) simulated data for 4.0 and 7.0 keV. The true photoelectron angle distribution isshown in black; standard moment analysis reconstruction is in blue and ResNet-18 deep ensemble inred.

10