DAMPE space-borne cosmic ray experiment has been collecting data since December 2015. Many high-impact results on the ion, electron and photon fluxes were obtained. This submission presents the carbon flux analysis with DAMPE using machine learning techniques. The readout electronics would saturate at energy deposits above several TeV in a single BGO bar of the DAMPE calorimeter. The total energy loss per event due to saturation can sometimes reach over a hundred TeV. We present a convolutional neural network model which can accurately recover the energy lost due to saturation and thus significantly increase the dynamic range of DAMPE. Another machine learning model combines the resolution of the hodoscopic BGO calorimeter and the high-resolution tracker of DAMPE to provide the best possible prediction of the direction of the incoming particle. This allows measuring charges at energies up to several hundred TeV. In this work, we present the application of these methods to carbon flux analysis.