Gentiana rigescens Franch. (G. rigescens) is a unique traditional medicinal herb from southwestern China, and its clinical mechanism for the treatment of hepatitis and the quality differences between different origins are not clear. The research aims to analyze the mechanisms for the treatment of hepatitis and differences in inter-origin differences using analytical techniques, chemometrics, and network pharmacology. Through infrared spectroscopy, spectral images, and high-performance liquid chromatography (HPLC) analysis, it was found that there were differences in absorbance intensity and significant differences in compound content among the samples' origin. G. rigescens iridoids and flavonoids exert therapeutic effects on hepatitis through multiple targets (GAPDH, EGFR, and MMP9, etc.) and multiple pathways (non-small cell lung cancer, hepatitis C, etc.). The above HPLC, chemometrics, and network pharmacology results revealed that gentiopicroside, and swertiamarine was the best quality marker among origins. The accuracy of the ResNet model train, test, and external validation sets for synchronous spectral images were 100 %, which could be utilized as an effective tool for tracing G. rigescens's origins. The R2 of the calibration and validation sets of the PLSR model was higher than 0.70. This model had excellent predictive performance in determining the content of gentiopicroside and swertiamarine, and could quickly, accurately, and effectively predict these two compounds. The research investigates the differences in G. rigescens origins from multiple perspectives, establishes image recognition models and prediction models, and provides new methods and theoretical basis for quality control of G. rigescens.