Environmental cost accounting, as a developing field, has been implemented in enterprises for only a brief duration, revealing several areas necessitating enhancements. This paper presents an environmental cost accounting method based on Support Vector Machines (SVM) to address the challenges posed by large and complex data sets in enterprise ecological cost accounting. The technique employs the Radial Basis Function (RBF) kernel to optimize the SVM model, derives the linear regression equation for the Least Squares SVM (LS-SVM) model, and preprocesses enterprise environmental cost data. It integrates Material Flow Cost Accounting (MFCA) to extract essential environmental cost-related data for enterprises. In the empirical application within a tested enterprise, the total cost attributed to resource loss amounted to 1,423,002.55 yuan, representing 4.89% of total expenses, with material costs accounting for the highest share at 86.35%. The analysis suggests that enterprises should prioritize monitoring and managing material costs to minimize resource wastage. Regarding the accounting for external environmental damage, sulfur dioxide and fluoride emissions from material quantity center 1 were identified as the predominant pollutants, exceeding 90% of emissions. This highlights the need for targeted energy-saving and emission-reduction measures for these pollutants to mitigate their environmental impact.