Advances in scanning transmission electron microscopy (STEM) techniques have enabled us to automatically obtain electron energy-loss (EELS)/energy-dispersive X-ray (EDX) spectral datasets from a specified region of interest (ROI) at an arbitrary step width, called spectral imaging (SI). Instead of manually identifying the potential constituent chemical components from the ROI, it is more effective and efficient to use a statistical approach for the automatic identification of the underlying chemical components and their spectra. This problem of automatic decomposition of chemical components can be formalized as a matrix factorization, which is a common problem setting in statistical machine learning. This paper first reviews several matrix factorization methods and then introduces our extension of a non-negative matrix factorization (NMF). The present NMF solves two problems: i) resolving overlapped spectral profiles, avoiding unnatural crosstalk, and ii) optimizing the number of chemical components. These effectiveness and comparisons with other matrix factorization methods are demonstrated using a real STEM-EELS dataset.