Abstract Unveiling the thermal history of the intergalactic medium (IGM) at 4 ≤ z ≤ 5 holds the potential to reveal early onset He ii reionization or lingering thermal fluctuations from H i reionization. We set out to reconstruct the IGM gas properties along simulated Lyman-alpha forest data on pixel-by-pixel basis, employing deep neural networks. Our approach leverages the Sherwood-Relics simulation suite, consisting of diverse thermal histories, to generate mock spectra. Our convolutional and residual networks with likelihood metric predicts the Lyα optical depth-weighted density or temperature for each pixel in the Lyα forest skewer. We find that our network can successfully reproduce IGM conditions with high fidelity across range of instrumental signal-to-noise. These predictions are subsequently translated into the temperature-density plane, facilitating the derivation of reliable constraints on thermal parameters. This allows us to estimate temperature at mean cosmic density, T0 , with one sigma confidence, $\delta {\rm T_{\rm 0}}\,$≲ 1000K, using only one 20h−1cMpc sightline (Δz ≃ 0.04) with a typical reionization history. Existing studies utilize redshift pathlength comparable to Δz ≃ 4 for similar constraints. We can also provide more stringent constraints on the slope (1σ confidence interval, δγ ≲ 0.1) of the IGM temperature-density relation as compared to other traditional approaches. We test the reconstruction on a single high signal-to-noise observed spectrum (20h−1cMpc segment), and recover thermal parameters consistent with current measurements. This machine learning approach has the potential to provide accurate yet robust measurements of IGM thermal history at the redshifts in question.