The text describes improvements made to the random forest model to enhance its distinctiveness in addressing tax risks within the real estate industry, thereby tackling issues related to tax losses. Firstly, the paper introduces the potential application of the random forest model in identifying tax risks. Subsequently, the experimental analysis focuses on the selection of indicators for tax risk. Finally, the paper develops and utilizes actual taxpayer data to test a risk identification model, confirming its effectiveness. The experimental results indicate that the model’s output report includes basic taxpayer information, a summary of tax compliance risks, value-added tax refund situations, directions of suspicious items, and detailed information on common indicators. This paper comprehensively presents detailed taxpayer data, providing an intuitive understanding of tax-related risks. Additionally, the paper reveals the level of enterprise risk registration assessment, risk probability, risk value, and risk assessment ranking. Further analysis shows that enterprise risk points primarily exist in operating income, selling expenses, financial expenses, and total profit. Additionally, the results indicate significant differences between the model’s judgment values and declared values, especially in the high-risk probability of total operating income and profit. This implies a significant underreporting issue concerning corporate income tax for real estate enterprises. Therefore, this paper contributes to enhancing the identification of tax risks for real estate enterprises. Using the optimized random forest model makes it possible to accurately assess enterprises’ tax compliance risks and identify specific risk points.