The paper describes a methodology for calculating carbon units of heterogeneous territories based on machine learning. The hierarchical structure of areal territories and the structure of the interconnection of of various scales images are described. The approach for identifying and classifying terrain objects for more accurately calculation of the carbon stock of the territory is presented.