A novel technique based on machine learning is introduced to reconstruct the decays of highly Lorentz-boosted particles. Using an end-to-end deep learning strategy, the technique bypasses existing rule-based particle reconstruction methods typically used in high energy physics analyses. It uses minimally processed detector data as input and directly outputs particle properties of interest. The new technique is demonstrated for the reconstruction of the invariant mass of particles decaying in the CMS detector. The decay of a hypothetical scalar particle Formula Presented into two photons, Formula Presented, is chosen as a benchmark decay. Lorentz boosts Formula Presented are considered, ranging from regimes where both photons are resolved to those where the photons are closely merged as one object. A training method using domain continuation is introduced, enabling the invariant mass reconstruction of unresolved photon pairs in a novel way. The new technique is validated using Formula Presented decays in LHC collision data.