Small-angle X-ray scattering (SAXS) has been widely used as a microstructure characterization technology. In this work, a fully connected dense forward network is applied to inversely retrieve the mean particle size and particle distribution from SAXS data of samples dynamically compressed with high-power lasers and probed with X-ray free electron lasers. The trained network allows automatic acquisition of microstructure information, performing well in predictions on single-species nanoparticles on the theoretical model and in situ experimental data. We evaluate our network by comparing it with other methods, revealing its reliability and efficiency in dynamic experiments, which is of great value for in situ characterization of materials under high-power laser-driven dynamic compression.