The lepton identification is essential for the physics programs at high-energy frontier, especially for the precise measurement of the Higgs boson. For this purpose, a Toolkit for Multivariate Data Analysis (TMVA) based lepton identification (LICH) has been developed for detectors using high granularity calorimeters. Using the conceptual detector geometry for the Circular Electron-Positron Collider (CEPC) and single charged particle samples with energy larger than 2 GeV, LICH identifies electrons/muons with efficiencies higher than 99.5% and controls the mis-identification rate of hadron to muons/electrons to better than 1%/0.5%. Reducing the calorimeter granularity by 1-2 orders of magnitude, the lepton identification performance is stable for particles with E > 2 GeV. Applied to fully simulated eeH/$mumu$H events, the lepton identification performance is consistent with the single particle case: the efficiency of identifying all the high energy leptons in an event, is 95.5-98.5%.