High-order harmonic generation (HHG), the nonlinear upconversion of coherent radiation resulting from the interaction of a strong and short laser pulse with atoms, molecules and solids, represents one of the most prominent examples of laser–matter interaction. In solid HHG, the characteristics of the generated coherent radiation are dominated by the band structure of the material, which configures one of the key properties of semiconductors and dielectrics. Here, we combine an all-optical method and deep learning to reconstruct the band structure of semiconductors. Our method builds up an artificial neural network based on the sensitivity of the HHG spectrum to the carrier-envelope phase (CEP) of a few-cycle pulse. We analyze the accuracy of the band structure reconstruction depending on the predicted parameters and propose a prelearning method to solve the problem of the low accuracy of some parameters. Once the network is trained with the mapping between the CEP-dependent HHG and the band structure, we can directly predict it from experimental HHG spectra. Our scheme provides an innovative way to study the structural properties of new materials.