  This paper presents a data processing algorithm with machine learning for
polarization extraction and event selection applied to photoelectron track
images taken with X-ray polarimeters. The method uses a convolutional neural
network (CNN) classification to predict the azimuthal angle and 2-D position of
the initial photoelectron emission from a 2-D track image projected along the
X-ray incident direction. Two CNN models are demonstrated with data sets
generated by a Monte Carlo simulation: one has a commonly used loss function
calculated by the cross entropy and the other has an additional loss term to
penalize nonuniformity for an unpolarized modulation curve based on the
$H$-test, which is used for periodic signal search in X-ray/$\gamma$-ray
astronomy. The modulation curve calculated by the former model with unpolarized
data has several irregular features, which can be canceled out by unfolding the
angular response or simulating the detector rotation. On the other hand, the
latter model can predict a flat modulation curve with a residual systematic
modulation down to $\lesssim1$%. Both models show almost the same modulation
factors and position accuracy of less than 2 pixel (or 240 $\mu$m) for all four
test energies of 2.7, 4.5, 6.4, and 8.0 keV. In addition, event selection is
performed based on probabilities from the CNN to maximize the polarization
sensitivity considering a trade-off between the modulation factor and signal
acceptance. The developed method with machine learning improves the
polarization sensitivity by 10-20%, compared to that determined with the image
moment method developed previously.
