  High-redshift quasars ionize HeII into HeIII around them, heating the IGM in
the process and creating large regions with elevated temperature. In this work,
we demonstrate a method based on a convolutional neural network (CNN) to
recover the spatial profile for $T_0$, the temperature at the mean cosmic
density, in quasar proximity zones. We train the neural network with synthetic
spectra drawn from a Cosmic Reionization on Computers simulation. We discover
that the simple CNN is able to recover the temperature profile with an accuracy
of $\approx 1400$ K in an idealized case of negligible observational
uncertainties. We test the robustness of the CNN and discover that it is robust
against the uncertainties in quasar host halo mass, quasar continuum and
ionizing flux. We also find that the CNN has good generality with regard to the
hardness of quasar spectra. Saturated pixels pose a bigger problem for accuracy
and may downgrade the accuracy to $1700$ K in the outer parts of the proximity
zones. Using our method, one could distinguish whether gas is inside or outside
the HeIII region created by the quasar. Because the size of the HeIII region is
closely related to the total quasar lifetime, this method has great potential
in constraining the quasar lifetime on $\sim $Myr timescales.
