We present a major overhaul to lepton identification for the Belle II experiment, based on a novel multi-variate classification algorithm. Boosted decision trees are trained combining measurements from the electromagnetic calorimeter (ECL) and the tracking system. The chosen observables are sensitive to the different physics that governs interactions of hadrons, electrons and muons with the calorimeter crystals. Dedicated classifiers are used in various detector regions and lepton momentum ranges. The tree output is eventually combined with classifiers that rely upon independent measurements from other sub-detectors. Using simulation, the performance of the new algorithm is compared against the method used for analysis of the 2018 Belle II data, namely a likelihood discriminator based on the ratio of energy measured in the ECL over the momentum measured by the trackers. In the low momentum region, we largely improve the lepton-pion separation power, decreasing misidentification probability by a factor of 10 for electrons, and 2 for muons at fixed identification efficiency.