American ginseng is widely in demand as a famous medicinal herb, but the production conditions affect the content of ginsenosides in American ginseng, which in turn affects its medicinal value. Currently, it remains a challenge to simultaneously identify the origin and ginsenoside content of American ginseng in a non-destructive manner. In this study, we developed a mixed multi-task deep learning network, MMTDL, combined with near-infrared (NIR) spectroscopy, for the origin traceability and total ginsenoside content prediction of American ginseng. The MMTDL model integrates residual networks, attention mechanisms, and mixed head networks, utilizing residual modules, channel attention, and self-attention mechanisms to enhance feature extraction from NIR spectral data. The network with mixed classification and regression heads is designed to address the effects of spectral overlap and mixed effective bands. MMTDL and its four competitors are trained and tested using a dataset containing 150 samples from four different origins. The experimental results demonstrated that the proposed method outperformed the other four methods, achieving R