A financial statement fraud perception method
By constructing a financial statement fraud detection model and a project fraud detection model based on random forest, and combining them with the TreeSHAP method, the problems of relying on human experience and the complexity of data in existing technologies are solved. This achieves more accurate and efficient financial statement fraud detection and project prediction, and provides interpretable analysis to assist audit decisions.
Patent Information
- Application Number
- CN202311803082.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-25
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-12-25
AI Technical Summary
Existing technologies rely on human experience in detecting financial statement fraud, making it difficult to detect new types of fraud in a timely manner. The data volume is huge and complex, and traditional methods cannot fully cover fraudulent behaviors. The model identification accuracy is poor and lacks interpretability.
A financial statement fraud detection model based on the random forest classification algorithm is constructed. Features are selected by random forest variable importance scoring, and interpretability analysis is performed by combining the TreeSHAP method. A financial statement item fraud detection model is constructed. Sample labeling and feature selection are performed using CSMAR database and CNINFO website data. 3-fold cross-validation and gridded search are used to optimize model parameters.
It improves the accuracy and efficiency of financial statement fraud detection, effectively predicts fraudulent items, provides interpretable analysis, and assists in the collection of audit clues and decision-making.
Smart Images

Figure CN117808488B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to auditing and data processing technology, specifically to a method for detecting financial statement fraud. Background Technology
[0002] Fraud detection refers to the process of identifying and collecting signs or evidence during an audit that may indicate the existence of fraud, misconduct, or other improper conduct, in order to determine whether the audited entity has engaged in fraud. It aims to uncover potential fraudulent activities, including financial fraud, false reporting, theft, corruption, and bribery. Fraud detection is a complex task that requires auditors or investigators to possess keen observation skills, in-depth analytical abilities, and professional knowledge. It helps to uncover hidden fraudulent activities and supports subsequent investigations and actions.
[0003] Current methods for detecting fraud primarily rely on traditional sampling auditing methods, analytical procedures, internal control assessments, and interviews. Internal control assessments focus on the audited entity's internal control system, paying particular attention to the effectiveness of controls related to preventing fraud, identifying deficiencies and weaknesses in internal controls that may indicate a risk of fraudulent activity. Analytical procedures, such as financial analysis, involve in-depth analysis of financial statements and related financial information to identify potential fraudulent activities such as non-compliance with accounting standards, unusual accounting entries, inflated revenue, and fictitious expenditures. Sampling audits involve drawing samples from relevant items in the overall financial statements for detailed examination and analysis, issuing an audit opinion on whether fraud exists in the overall financial statements. Interviews involve communication and inquiries with relevant parties to gather clues and information about potential fraudulent activities.
[0004] Current technologies and methods have numerous problems. Methods such as internal control assessments and analytical procedures heavily rely on auditors' experience; subjective judgment largely determines the discovery and extraction of fraud clues. These methods require auditors or investigators to possess professional knowledge and experience, and are subject to human resource limitations and the risk of subjective judgment, potentially leading to omissions or misjudgments. Furthermore, as technology and the social environment continue to change, fraud methods are also constantly evolving and changing. Traditional fraud auditing methods may fail to detect new types of fraudulent activities in a timely manner, thus requiring continuous updates and improvements to adapt to these changes. Finally, enterprises generate massive amounts of complex data, requiring processing and analysis of enormous quantities of data. This makes fraud clue extraction more difficult, requiring efficient data analysis tools and techniques to process large-scale data and accurately identify potential fraud clues. Fraud clue extraction methods, such as sampling audits, are usually based on specific audit objectives or investigation scopes and cannot cover all potential fraudulent activities. Some fraudulent activities may go undetected or be missed. Therefore, it is necessary to integrate multiple methods and data sources to improve the comprehensiveness of clues. In addition, current fraud detection models that use emerging technologies such as artificial intelligence focus on the effectiveness of identifying whether there is fraud in the overall financial statements, but pay insufficient attention to the extraction of fraud clues and the interpretability of model operation, and the accuracy of fraud identification is relatively poor. Summary of the Invention
[0005] Purpose of the invention: The purpose of this invention is to address the shortcomings of existing technologies and provide a method for detecting financial statement fraud, so as to improve the accuracy of audit activities in identifying financial statement fraud and obtain more clues to fraud.
[0006] Technical solution: The present invention provides a method for detecting financial statement fraud, comprising the following steps:
[0007] Step 1: Construct the dataset for the report fraud detection model. The specific method is as follows:
[0008] Step 1.1: Obtain historical sample data of financial statements (for example, you can select A-share listed manufacturing companies from 2010 to 2019 as samples for research). The sample includes financial statement data, types of audit report opinions, violations and listed company error correction announcements.
[0009] Step 1.2: Treat the question of whether financial statements contain fraud as a binary classification problem. Label the samples to indicate whether they contain fraud, with fraudulent samples marked as 1 and non-fraudulent samples marked as 0. Use whether there is fraud as the target variable. At the same time, match each fraudulent sample with a non-fraudulent sample to build a financial statement fraud detection model dataset. Divide the dataset into a training set and a test set at a ratio of 70% to 30%.
[0010] Step 2: Construct a financial statement fraud detection model based on the random forest classification algorithm, and perform parameter tuning and training to obtain a model with better performance to solve the problem of identifying whether financial statements contain fraud, and make a judgment on whether the financial statements as a whole contain fraud. The specific method is as follows:
[0011] Step 2.1: Use the Variable Importance Measures (VIM) based on random forest to select features, and select a total of 35 features with a VIM greater than 0.01;
[0012] Step 2.2: Use a gridded search with 3-fold cross-validation and F1-score to optimize the model performance. Then, build the model based on the optimized parameters.
[0013] Step 2.3: After the sample data in the training set is input into a single decision tree, the model judges the sample data based on the node features and feature values, starting from the root node, until the leaf node. Finally, the model outputs the classification result of whether the sample is fraudulent. Finally, the model's generalization ability is evaluated to ensure that the optimal financial statement fraud detection model is obtained.
[0014] Step 3: Construct a dataset for the report item fraud detection model. The specific method is as follows:
[0015] Step 3.1: Obtain historical sample data of financial statements (for example, A-share listed manufacturing companies from 2010 to 2019 can be selected as samples for research). The samples include financial statement data, violations, and error correction announcements of listed companies. The feature data used is consistent with the features constructed in the previous chapter.
[0016] Step 3.2: Label the fraudulent and non-fraudulent samples based on the penalty decision and error correction notice; use whether the fraudulent financial statement items (such as operating revenue, cost and expense items) are fraudulent as the target variable; at the same time, for each fraudulent sample, match a sample that does not have any fraud based on industry, year, asset size, capital structure, and company operating revenue, and construct a data set for the fraud identification model of financial statement items. Divide this data set into training set and test set at 80%:20%.
[0017] Step 4: Although the financial statement fraud detection model in Step 2 can identify and determine whether there is fraud in the overall financial statements, it is difficult to determine which financial statement items the fraud occurs in. Therefore, in this step, a financial statement item fraud detection model is constructed. Taking operating revenue, which has a relatively high risk of fraud, as an example, a financial statement item fraud detection model for predicting operating revenue fraud is constructed. The specific method is as follows:
[0018] Step 4.1: Use Variable Importance Measures (VIM) based on random forest to select features, and select a total of 39 features with a VIM feature importance greater than 0.01;
[0019] Step 4.2: Use a gridded search with 3-fold cross-validation and F1-score to optimize the model performance. Build the model based on the optimized parameters.
[0020] Step 4.3: After the training set sample data is input into a single decision tree, the model judges the sample data based on the node features and feature values starting from the root node, until the leaf node. The model will output the classification result of whether the operating income of the sample is fraudulent. Finally, the model's generalization ability is evaluated to ensure that the optimal financial statement item fraud detection model is obtained.
[0021] Step 5: Input the sample data of the financial statements to be evaluated into the two models obtained in Step 2 and Step 4. If the sample is classified as fraud, perform interpretability analysis and visualize the basis for the model's predictions. Collect abnormal features as audit clues to assist decision-making. The specific method is as follows:
[0022] Step 5.1: Use the TreeSHAP method to perform global interpretability analysis on the financial statement fraud detection model and the financial statement item fraud detection model respectively, and derive global fraud anomaly features as part of the audit clues;
[0023] Step 5.2: Use the TreeSHAP method to perform partial interpretability analysis on the financial statement fraud detection model and the financial statement item fraud detection model respectively, and obtain fraud anomaly characteristics based on a single sample, which are output as audit clues.
[0024] Furthermore, the sample data in steps 1 and 3 are obtained from the CSMAR database and CNINFO (China's largest financial information website). Error correction announcements from listed companies are obtained from CNINFO, while other remaining financial statement data comes from the CSMAR database. The CSMAR database adjusts some relevant financial statement data based on the error correction announcements from listed companies, making some fraudulent sample financial statement data correct after correction. This can lead to a decrease in the number of fraudulent samples or even incorrect labeling of fraudulent samples. Therefore, it is necessary to determine whether the financial statement data has been modified based on the data before the correction in the error correction announcements from listed companies. If data modification exists, adjustments are made by directly using a Python web crawler to retrieve the initially published financial statements from CNINFO.
[0025] Furthermore, the sample annotation method in steps 1 and 3 is as follows:
[0026] Based on the type of audit report opinion, penalty decision, and listed company error correction announcement, companies with non-unqualified audit opinions, companies with penalty decisions from the China Securities Regulatory Commission or other entities, and listed companies that corrected their financial statement data in those years are marked as fraudulent; all others are marked as non-fraudulent.
[0027] Furthermore, the features selected in steps 2.1 and 4.1 include financial indicators and the growth rate of financial statement items. The financial indicators include ratio structure, solvency, risk level, operating capacity, cash flow analysis, and profitability.
[0028] Furthermore, to ensure the balance of positive and negative samples in the dataset, for each fraudulent sample, a non-fraudulent sample is matched based on industry, year, asset size, capital structure, and company revenue, and together they form the dataset.
[0029] Furthermore, the evaluation metrics for the model's generalization ability in steps 2.3 and 4.3 include accuracy, precision, recall, and F1 score, calculated using the following formulas:
[0030]
[0031]
[0032]
[0033]
[0034] Based on the actual classification and the model's predicted classification, the classification results are divided into four categories: TP refers to true negatives, including fraud and predicted as fraud; FN refers to false negatives, including fraud and predicted as non-fraud; FP refers to false positives, including non-fraud and predicted as fraud; TN refers to true negatives, including non-fraud and predicted as non-fraud.
[0035] Furthermore, the global interpretability analysis in step 5 includes: for the financial statement fraud detection model and the financial statement item fraud detection model, the TreeSHAP method is used to perform global interpretability analysis respectively; the global interpretability analysis explains the impact of different features on the judgment of whether a sample is fraudulent, that is, it analyzes the role of specific features in the model's fraud prediction from the feature dimension and the predicted results of the model; calculates the SHAP values corresponding to all features of all samples, and selects 20 features in the financial statement fraud detection model that have the greatest impact on the fraud prediction and presents them in the form of a summary diagram. In this summary diagram, the feature names on the y-axis are arranged from largest to smallest in terms of feature importance, from top to bottom. Red dots represent samples with large feature values, and blue dots represent samples with small feature values. The SHAP values on the x-axis increase continuously from left to right. When the SHAP value corresponding to a sample with a specific feature is less than 0, it indicates that the specific feature reduces the model's prediction of the sample's fraud probability, and vice versa. The results provided by this analysis serve as audit clues to assist decision-making.
[0036] For feature i of sample x, its SHAP value φ i The calculation method is as follows;
[0037]
[0038] In the above formula, F is the set of all features, S is the subset of features retained in the model, S∪{i} is the feature subset, and |F|! is the number of all permutations and combinations of features in the set; in the random forest model, for f S (x S ) is defined as expected prediction.
[0039] Beneficial Effects: This invention includes financial statement fraud analysis, financial statement item fraud analysis, and model interpretability analysis. The financial statement fraud analysis, based on the random forest classification algorithm, constructs a financial statement fraud detection model to determine whether fraud exists in the overall financial statements. The financial statement item fraud analysis constructs a report item fraud detection model based on the random forest classification algorithm, effectively predicting specific report items where fraud may have occurred. The model interpretability analysis utilizes the TreeSHAP method to perform interpretability analysis on the models from the first two steps, exploring the degree of influence of features in the model on the output results, visually displaying the basis for the model's predictions, and collecting abnormal features as audit clues to assist in analysis. These two models, together with the interpretability analysis, achieve more accurate prediction of financial statement fraud behavior, while simultaneously enabling fraud clue analysis, identification, and inference of fraud methods, improving audit efficiency and quality. Attached Figure Description
[0040] Figure 1 This is a schematic diagram of the overall process of the present invention.
[0041] Figure 2 This is a schematic diagram of partial sample data for local interpretability analysis according to an embodiment of the present invention.
[0042] Figure 3 This is a list of VIM feature importance for a financial statement fraud detection model according to an embodiment of the present invention.
[0043] Figure 4 This is a visual representation of sample data classification of a financial statement fraud detection model according to an embodiment of the present invention.
[0044] Figure 5 This is a schematic diagram illustrating the generation of target variables in a financial statement fraud identification model according to an embodiment of the present invention.
[0045] Figure 6 This is a visual representation of sample data classification of a financial statement fraud identification model according to an embodiment of the present invention.
[0046] Figure 7 This is a diagram showing the global interpretability analysis results of a financial statement fraud detection model according to an embodiment of the present invention.
[0047] Figure 8 This is a waterfall chart illustrating the partial interpretability analysis of a financial statement fraud detection model according to an embodiment of the present invention. Detailed Implementation
[0048] The technical solution of the present invention will be described in detail below, but the scope of protection of the present invention is not limited to the embodiments described.
[0049] like Figure 1 As shown, the financial statement fraud detection method of the present invention includes the following steps:
[0050] Step 1: Construct the dataset for the report fraud detection model. The specific method is as follows:
[0051] Step 1.1: Obtain historical sample data related to the reports. The samples include financial statement data, types of audit report opinions, and announcements of violations and errors corrected by listed companies.
[0052] Step 1.2: Treat the question of whether financial statements contain fraud as a binary classification problem. Label the samples to indicate whether they contain fraud, with fraudulent samples marked as 1 and non-fraudulent samples marked as 0. Use whether there is fraud as the target variable. At the same time, match each fraudulent sample with a non-fraudulent sample to build a financial statement fraud detection model dataset. Divide the dataset into a training set and a test set at a ratio of 70% to 30%.
[0053] Step 2: Construct a financial statement fraud detection model based on the random forest classification algorithm, and perform parameter tuning and training to obtain a model with better performance to solve the problem of identifying whether financial statements contain fraud, and make a judgment on whether the financial statements as a whole contain fraud. The specific method is as follows:
[0054] Step 2.1: Use the variable importance score (VIM) based on random forest to select features, and select a total of 35 features with a VIM greater than 0.01;
[0055] Step 2.2: Use a gridded search with 3-fold cross-validation and F1-score to perform parameter tuning. Build the model based on the tuned parameters.
[0056] Step 2.3: After the training set data is input into a single decision tree, the sample data is judged based on the node features and feature values starting from the root node, until the leaf node. The model outputs the classification result of whether the sample is fraudulent. Finally, the model's generalization ability is evaluated based on the prediction results of the test set to ensure that the optimal financial statement fraud detection model is obtained.
[0057] Step 3: Construct a dataset for the report item fraud detection model. The specific method is as follows:
[0058] Step 3.1: Obtain historical sample data related to the reports. The samples include financial statement data, violations, and error correction announcements from listed companies. The feature data used is consistent with the features constructed in the previous chapter.
[0059] Step 3.2: Label the fraudulent and non-fraudulent samples based on the penalty decision and error correction notice; set whether the fraudulent financial statement item is fraudulent as the target variable; at the same time, for each fraudulent sample, match a sample without any fraud based on industry, year, asset size, capital structure and company operating income, and construct a data set for the fraud identification model of financial statement items. Divide the data set into training set and test set at 80%:20%.
[0060] Step 4: Construct a fraud detection model for financial statement items related to predicted operating revenue fraud. The specific method is as follows:
[0061] Step 4.1: Use the Variable Importance Index (VIM) based on random forest for feature selection, and select a total of 39 features with a VIM feature importance greater than 0.01;
[0062] Step 4.2: Use a gridded search with 3-fold cross-validation and F1-score to optimize the model performance. Build the model based on the optimized parameters.
[0063] Step 4.3: After the sample data is input into a single decision tree, the model judges the sample data based on the node features and feature values starting from the root node, until the leaf node. The model will output the classification result of whether the operating income of the sample is fraudulent. Finally, the model's generalization ability is evaluated to ensure that the optimal financial statement item fraud detection model is obtained.
[0064] Step 5: Input the sample data of the financial statements to be evaluated into the two models obtained in Step 2 and Step 4. If the sample is classified as fraud, perform interpretability analysis and visualize the basis for the model's predictions. Collect abnormal features as audit clues to assist decision-making. The specific method is as follows:
[0065] Step 5.1: Use the TreeSHAP method to perform global interpretability analysis on the financial statement fraud detection model and the financial statement item fraud detection model respectively. Calculate the SHAP value corresponding to all features for all samples, and select 20 features in the financial statement fraud detection model that have the greatest impact on fraud prediction and present them in the form of a summary diagram. In this summary diagram, the feature names on the y-axis are arranged from largest to smallest in importance, from top to bottom. Red dots represent samples with large feature values, and blue dots represent samples with small feature values. The SHAP value on the x-axis increases continuously from left to right. When the SHAP value corresponding to a sample with a specific feature is less than 0, it indicates that the specific feature reduces the model's prediction of the sample's fraud probability; conversely, it indicates that the specific feature increases the model's prediction of the sample's fraud probability. The results provided by this analysis serve as audit clues to assist decision-making.
[0066] Step 5.2: Use the TreeSHAP method to perform local interpretability analysis on the financial statement fraud detection model and the financial statement item fraud detection model, respectively. Local interpretability analysis at the sample level (the model predicts on a single sample) provides details of the model's predictions, focusing on explaining how individual predictions are generated. It also performs interpretability analysis on the features upon which the financial statement fraud detection model's predictions depend, visually demonstrating the marginal contribution of different features to the prediction results. The results of the local interpretability analysis are shown in the waterfall plot, with the direction and length of arrows illustrating the driving effect of different features on the model's predicted fraud probability, serving as audit clues to aid decision-making.
[0067] Example
[0068] The specific sensing method in this embodiment is as follows:
[0069] Step 1: Select A-share listed manufacturing companies from 2010 to 2019 as samples, including financial statement data, types of audit report opinions, violations, and listed company error correction announcements. Except for the listed company error correction announcements, which are from Juchao Information Network, all other data are from the CSMAR database.
[0070] Step 2: To ensure the accuracy of the number of fraud samples, dynamic financial indicators, and the growth rate of financial statement items, the following processing is performed on consecutive fraud samples: For fraud samples with the same stock code existing in consecutive years, i.e., x... stkcd=i,year=j ,x stkcd,year=j-1 If all samples are fraudulent, then calculate the fraudulent sample x. stkcd,year=j When determining the dynamic financial indicators and the growth rate of financial statement items, the error correction announcement issued by the listed company should be used as a reference, and x should be... stkcd,year=j-1 Adjust the report item data to the correct data in a fraud-free state, and calculate the fraud sample x. stkcd,year=j Dynamic financial indicators and growth rate indicators of financial statement items.
[0071] Step 3: Use financial indicators and the growth rate of financial statement items as features extracted by the model. Financial indicators include six categories: ratio structure, solvency, risk level, operating capacity, cash flow analysis, and profitability. Ratio structure indicators mainly reflect the proportions of different components within a listed company's assets, liabilities, shareholders' equity, revenue, and profit, such as the fixed asset ratio, revenue-generating asset ratio, operating debt ratio, and minority shareholder equity ratio. Solvency indicators measure the debt pressure faced by a listed company and its long-term and short-term solvency, such as the interest coverage ratio, current ratio, and long-term debt-to-equity ratio. Risk level indicators use financial leverage, operating leverage, and combined leverage to measure the company's risk level.
[0072] Operating capability indicators refer to indicators related to the operation of listed companies, reflecting the relevant operating conditions of enterprises, such as inventory turnover rate, accounts receivable turnover rate, and total asset turnover rate; cash flow analysis indicators are the prerequisite for the survival and continuous operation of enterprises, reflecting the quality of enterprise profitability, and related indicators mainly include cash content of operating revenue, operating index, and total cash recovery rate.
[0073] Profitability indicators reflect a listed company's ability to generate profits, such as gross profit margin, administrative expense ratio, return on investment, and return on assets.
[0074] Financial indicators can be further divided into static and dynamic indicators. Static indicators are generated from financial data of the same year, while dynamic indicators are the ratios of static indicators to the same indicators of the previous year. All financial indicators are ratios, generated from various financial statement items of the same year, and can fully reflect and measure the assets, liabilities, operating conditions, and cash flow of listed companies in that year, while also enabling horizontal comparisons with listed companies in the same industry. Dynamic financial indicators are the ratios of the current year's indicators to the previous year's indicators, reflecting changes in the indicators and enabling vertical comparisons of listed companies' financial statements. The growth rate of financial statement items mainly refers to the growth rate of items in the balance sheet, income statement, and cash flow statement disclosed by the listed company.
[0075] With 125 static financial indicators, 125 dynamic financial indicators, and 178 growth rates for financial statement items, totaling 328 features, a relatively comprehensive profile of a listed company can be created.
[0076] Step 4: In this embodiment, the random forest algorithm is used to construct a financial statement fraud detection model. The existence of fraud in financial statements is treated as a binary classification problem. Therefore, samples are labeled to indicate whether fraud exists. Here, the labeling of fraud samples is mainly based on the type of audit report opinion, penalty decision, and listed company error correction announcement:
[0077] (1) Based on the type of audit report opinion: For audit reports with qualified opinion, disclaimer of opinion, or adverse opinion, manual sorting is performed. Audit reports that are not unqualified due to financial statement data are marked as fraudulent, and the rest are marked as non-fraudulent. A variable "audit" is generated, with fraudulent assigned a value of 1 and non-fraudulent assigned a value of 0.
[0078] (2) Based on the penalty decision: The financial statement items involved in the penalty decisions made by the China Securities Regulatory Commission, the stock exchange and other regulatory agencies against the listed companies’ violations are sorted out, and the listed companies involved in the financial statement items are marked as fraudulent in the current year, and the rest are marked as non-fraudulent. The variable “violation” is generated, with fraudulent being assigned a value of 1 and non-fraudulent being assigned a value of 0.
[0079] (3) Based on the error correction announcements of listed companies: crawl the error correction announcements issued by listed companies from January 1, 2009 to August 31, 2022 from Juchao Information Network, and organize the correction data using PDF parsing, OCR and other technologies. The year in which the listed company corrected the financial statement data was marked as fraud, and the rest were marked as non-fraud. The variable "restatement" was generated, with fraud assigned a value of 1 and non-fraud assigned a value of 0.
[0080] Listed companies whose annual audit report type, penalty decision, or listed company error correction announcement is marked as fraudulent are considered fraudulent samples and assigned a value of 1; the rest are considered non-fraudulent samples and assigned a value of 0.
[0081] Fraud=max(audit,violation,restatement)
[0082] Step 5: Based on the features and labeled sample data of the report fraud detection model constructed in the previous steps, using fraud as the target variable, and to ensure the balance of positive and negative samples in the dataset, for each fraud sample, a non-fraud sample is matched according to industry, year, asset size, capital structure, and company operating revenue to construct the report fraud detection model dataset. The dataset is then divided into training and test sets at a ratio of 70%:30%. The dataset contains a total of 670 fraud samples and 670 non-fraud samples, totaling 1340 samples, with 1 target variable. Some sample data is shown below. Figure 2 As shown.
[0083] Step 6: When constructing the dataset, 328 features were built, which provided a foundation for a full and detailed profile of the financial statements of listed companies. However, using too many features for model training can easily lead to the curse of dimensionality.
[0084] This embodiment uses Variable Importance Measures (VIM) based on random forests for feature selection. VIM measures the importance of a feature by calculating its contribution to the random forest model, using the Gini index. For feature N, the decrease in the Gini index of the nodes formed by feature N in each decision tree of the random forest is statistically analyzed, and these decreases are summed to form the decrease in the random forest Gini index caused by feature N. The proportion of the decrease in the random forest Gini index caused by feature N to the total decrease in the random forest Gini index caused by all features in the random forest is the variable importance score of feature N.
[0085] The ViaMetric Index (VIM) was calculated using the `feature importances` attribute of `RandomForestClassifier` in Python. Some features were sorted in descending order of importance, and 35 features with a VIM greater than 0.01 were selected (i.e., features numbered 1-35 in the table). The results are as follows: Figure 3 As shown.
[0086] Step 7: For the random forest classification algorithm, the main hyperparameters to be tuned are n_estimators (the number of decision trees in the random forest), max_features (the maximum number of features used to build each decision tree), min_samples_leaf (the minimum number of samples contained in the leaf nodes of the decision trees), and max_depth (the maximum depth of the decision trees). Other model parameters use default values: criterion = 'gini' (using Gini impurity as the feature selection criterion for building the decision trees), bootstrap = True (using sampling with replacement when building the decision trees), and class_weight = None (each class has a weight of 1).
[0087] A gridded search with 3-fold cross-validation was employed, and the model performance was scored using F1-score. Hyperparameters n_estimators, max_features, min_samples_leaf, and max_depth were assigned ranges with short strides and long lengths. The optimal hyperparameters obtained after training were:
[0088] max_depth=20,max_features=5,min_samples_leaf=1,n_estimators=300,random_state=0
[0089] The improvement in model performance was evaluated using the change in the out-of-bag estimation score (oob_score) of the model's built-in attributes. The model's oob_score improved from 82 to 100.
[0090] Step 8: Visualize a decision tree, or instance, in the random forest. For example... Figure 4 After sample data is input into a single decision tree, the system judges the sample data based on node features and feature values, starting from the root node, until a leaf node is reached. In this case, the data entry "Whether it is fraudulent" is classified as: fraudulent. This model simultaneously classifies the sample data across 300 decision trees, and the category with the most predicted votes is output as the prediction result.
[0091] Step 9: Model performance evaluation is an indispensable part of the model building process, aimed at assessing the model's generalization ability. Model building cannot directly yield the optimal model in one step; it requires continuous optimization to improve the model's generalization ability.
[0092] This embodiment uses accuracy, precision, recall, and F1 score for performance evaluation. These four evaluation metrics can be derived from the confusion matrix, which divides the classification results into four categories based on the actual classification and the model's predicted classification: True Positive (TP): both the actual classification and the predicted classification are fraudulent; False Negative (FN): both the actual classification and the predicted classification are non-fraudulent; False Positive (FP): both the actual classification and the predicted classification are fraudulent; and True Negative (TN): both the actual classification and the predicted classification are non-fraudulent. The specific calculation formula is as follows:
[0093]
[0094]
[0095]
[0096]
[0097] The code calculations show that all four indicators are above 85%, indicating that the model has good performance in identifying financial statement fraud and that it has excellent performance in identifying fraud samples.
[0098] Step 10: Select A-share listed manufacturing companies from 2010 to 2019 as samples for research. The data used mainly includes financial statement data, violations, and listed companies' error correction announcements. The feature data used is consistent with the features constructed by the financial statement fraud identification model.
[0099] Step 11: The sample annotation for the fraud detection model of report items is mainly based on the error correction announcements issued by listed companies and the penalty decisions issued by the listed company's regulatory agencies.
[0100] (1) Based on the error correction announcement: The correction year, correction financial statement item and correction amount involved in the correction announcement are identified and organized using PDF parsing, OCR and other technologies, and identified by stock code (stkcd), year (year) and statement item (subject). If there is a correction, it is marked as fraud, otherwise it is marked as non-fraud, and the variable restatement is generated.
[0101] (2) Based on the penalty decision letter: The penalty decision letter is manually sorted out, the matters related to the financial statements are selected, the financial statement items and fraud amount involved are identified and sorted out, and the stock code, year and statement item are used as identifiers. If the fraud involves fraud, it is fraud; otherwise, it is marked as non-fraud. The target variable violation is generated.
[0102] Fraud subject =max(violation,restatement)
[0103] The target variables generated separately based on the error correction notice and the penalty decision are deduplicated and merged to generate the final target variable, such as... Figure 5 As shown.
[0104] Based on the feature and financial statement item fraud detection model sample annotation data constructed in step 3, the dataset required for the financial statement item fraud detection model is constructed. Whether a financial statement item is fraudulent is taken as the target variable. Simultaneously, to ensure a balance between positive and negative samples in the dataset, for each fraudulent sample, a sample without any fraud is matched based on industry, year, asset size, capital structure, and company operating revenue. To ensure sufficient training dataset samples, the dataset is divided into training and test sets at an 80%:20% ratio. Subsets of data required for the financial statement item fraud detection model are constructed according to the type of fraudulent financial statement item. Taking operating revenue as an example, a subset of operating revenue data is constructed, totaling 512 samples.
[0105] Step 12: Calculate VIM using the feature_importances_ attribute of RandomForestClassifier in Python. For the revenue fraud detection model, some features are sorted in descending order of importance. The same applies to other financial statement item fraud detection models. A total of 39 features with VIM greater than 0.01 are selected.
[0106] Step 13: Parameter tuning of the financial statement fraud detection model is consistent with the method used for the financial statement fraud detection model. The main hyperparameters are also n_estimators, max_features, min_samples_leaf, and max_depth. The optimal parameters are 500, 10, 1, and 20, respectively.
[0107] Step 14: Input the report item fraud detection model. After the sample data is input into a single decision tree, the model judges the sample data based on the node features and feature values, starting from the root node, until the leaf node. This model simultaneously predicts the sample data in 500 decision trees, and the average of the prediction results is output as the prediction result. Yes indicates that the sample is predicted as fraudulent, and No indicates that the sample is not fraudulent. The prediction process for a single sample is as follows: Figure 6 As shown, the sample is clearly classified as non-fraudulent.
[0108] Step 15: Calculate the four key metrics of the model to evaluate its detection capabilities. The model's accuracy, precision, recall, and F1 score are all above 75%, indicating that the model performs excellently in predicting whether there is fraud in the revenue statement items.
[0109] Step 16: Perform a global interpretability analysis to explain the impact of different features on determining whether a sample is fraudulent, that is, analyze the role of specific features in the model's fraud prediction from the feature dimension; TreeSHAP is a combination of SHAP and tree-based machine learning models (such as decision trees, random forests and gradient boosting trees), which has the advantages of fast speed and accurate Shapley value calculation.
[0110] SHAP (Shapley Additive ExPlanations) explains why the model makes a certain prediction by calculating the contribution of each feature to the target variable. The contribution of a feature to the target variable is based on the Shapley value in cooperative game theory. SHAP represents the interpretation of the Shapley value as an additive feature attribution method, i.e., a linear model, specifying the interpretation as:
[0111]
[0112] Where g is the explanatory model, x ′ It is a vector consisting entirely of 1s, φ j φj is the Shapley value for feature j, and φ0 is the predicted value of the mean of all features. The Shapley value calculation process is as follows:
[0113] (1) Exhaustively enumerate the total contribution of all individual features and the total contribution of all unordered combinations of features;
[0114] (2) Exhaustively enumerate the ordered combinations of individual features and remaining features, and calculate the marginal contribution in order;
[0115] (3) Sum the marginal contributions and take the average to obtain the Shapley value φ of the feature. i .
[0116]
[0117] Where F is the set of all features, S is the subset of features retained in the model, and |F|! is the number of all permutations and combinations of features in the set. In the random forest model, for f S (x S The expected prediction is defined as follows. The Shapley value of feature i for a sample x in TreeSHAP based on random forest is calculated as follows:
[0118] First, calculate the expected prediction of sample x and feature subset S in a single decision tree. If S is an empty feature set, the expected prediction is the weighted average of the predictions from all leaf nodes. If S is the complete feature set, the expected prediction is the prediction of the leaf node containing sample x. If S is a proper subset of F and not empty, and the path from the root node to the leaf node includes features not belonging to feature subset S, then ignore the corresponding leaf node. In the remaining leaf nodes, use the number of training samples contained in the leaf node as the weight to calculate the weighted average of the prediction results as the expected prediction. Next, calculate the expected prediction of sample x and feature subset S∪{i} in a single decision tree, and calculate the Shapley value φ of feature i in the single decision tree. i Finally, the Shapley values φ of feature i of each decision tree in the random forest are... i Weighted average.
[0119] This paper explains and analyzes the financial statement fraud audit model from a holistic perspective. Figure 7 This summary figure illustrates 20 features in a financial statement fraud detection model that have the greatest impact on fraud prediction. The feature names on the y-axis are arranged from highest to lowest importance, from top to bottom. Red dots represent samples with large feature values, and blue dots represent samples with small feature values. The SHAP value on the x-axis increases from left to right. When the SHAP value corresponding to a sample with a specific feature is less than 0, it indicates that the specific feature reduces the model's prediction of the sample's fraud probability; conversely, it indicates that the specific feature increases the model's prediction of the sample's fraud probability. For example, a red dot in the equity turnover row with a SHAP value less than 0 indicates that the equity turnover value of that sample is relatively large, and that this feature reduces the model's prediction of the sample's fraud probability.
[0120] A SHAP value less than 0 indicates that a specific feature reduces the model's prediction of the sample's fraud probability, while a higher SHAP value indicates that the specific feature increases the model's prediction of the sample's fraud probability. For example, a red dot in the equity turnover row with a SHAP value less than 0 indicates that the sample's equity turnover value is relatively large, and that this feature reduces the model's prediction of the sample's fraud probability. This summary diagram clearly shows the relationship between feature values and SHAP values; a larger SHAP value indicates a higher risk of fraud in the sample due to the feature. The global interpretability analysis of the financial statement fraud identification model follows the same procedure.
[0121] Step 17: Through local interpretability analysis at the sample level (the model predicts for a single sample), details of the model's predictions are provided, focusing on explaining how individual predictions are generated. Interpretive analysis is performed on the features upon which the predictions of the financial statement fraud detection model and the financial statement fraud item detection model depend, visually demonstrating the marginal contribution of different features to the prediction results. This allows for the discovery of the causes and items of fraud, obtaining crucial audit evidence.
[0122] Regarding the financial statement fraud detection model, the results of the TreeSHAP local interpretability analysis performed using Python are presented in the form of a waterfall chart, as follows: Figure 8 As shown, the steps for partial interpretability analysis of the financial statement fraud identification model are consistent with those steps.
[0123] The waterfall plot quantifies the impact of different features on the model's prediction of fraud probability. Here, f(x) is the model's predicted value, and E(f(x)) is the baseline value, representing the average prediction of the model on the training dataset (i.e., the constant term in equation 3.9 of the linear interpretation model). The average prediction of the model on the training dataset is 0.4925. The dataset was constructed using a 1:1 ratio of fraudulent to non-fraudulent samples. The baseline value and sample category distribution are largely consistent, further demonstrating the accuracy of the report fraud detection model. Red indicates features that positively influence the prediction of fraud, while blue indicates features that negatively influence the prediction; the longer the blue section, the more significant the effect. For finding clues to fraud audits, it is crucial to pay attention to features that positively influence the prediction of fraud, i.e., the features in red, which increase the sample's fraud probability. The above figure shows how the prediction for a sample changes from the baseline value to the model's final value. The prediction for this sample increased from 0.4925 to 0.95, indicating that the model predicts this sample as fraudulent, possessing a high probability of fraud. It is not difficult to identify the main features that drive the model to increase the probability of fraud and their SHAP values, which are important audit clues.
[0124] In summary, this invention integrates two fraud detection models with interpretability analysis to achieve accurate determination of whether sample data contains fraud. Simultaneously, the financial statement item fraud detection model based on the random forest algorithm, taking the determination of whether operating revenue is fraudulent as an example, refines the fraud risk from the report level to the report item level, answering the question of "which report items are fraudulent," and providing audit clues for finding fraudulent report items. More importantly, this invention and the TreeSHAP method perform local interpretability analysis on the two types of models based on the random forest algorithm, uncovering the basis for the model's predictions and visually demonstrating the role of different features in predicting specific sample data, clearly illustrating the function and degree of influence of features on the model's prediction results. It also elevates the abnormal features that increase the probability of fraud in reports and report items, and the linkage between abnormal features, providing a new approach to determining fraud methods and finding fraud clues. Based on this fraud perception, auditors can easily further investigate audit clues and draw audit conclusions.
Claims
1. A method for detecting financial statement fraud, characterized in that, Includes the following steps: Step 1: Construct the dataset for the report fraud detection model. The specific method is as follows: Step 1.1: Obtain historical sample data related to the reports. The samples include financial statement data, types of audit report opinions, and announcements of violations and errors corrected by listed companies. Step 1.2: Treat the question of whether financial statements contain fraud as a binary classification problem. Label the samples to indicate whether they contain fraud, with fraudulent samples marked as 1 and non-fraudulent samples marked as 0. Use whether there is fraud as the target variable. At the same time, match each fraudulent sample with a non-fraudulent sample to build a financial statement fraud detection model dataset. Divide the dataset into a training set and a test set at a ratio of 70% to 30%. Step 2: Construct a financial statement fraud detection model based on the random forest classification algorithm, and perform parameter tuning and training to obtain a model with better performance to solve the problem of identifying whether financial statements contain fraud, and make a judgment on whether the financial statements as a whole contain fraud. The specific method is as follows: Step 2.1: Use the variable importance score (VIM) based on random forest to select features, and select a total of 35 features with a VIM greater than 0.01; Step 2.2: Use a gridded search with 3-fold cross-validation and F1-score to perform parameter tuning. Build the model based on the tuned parameters. Step 2.3: After the sample data in the training set is input into a single decision tree, the sample data is judged based on the node features and feature values starting from the root node until the leaf node is reached, and the classification result of whether the sample is fraudulent is output. Finally, the model's generalization ability is evaluated by the prediction performance of the model in the test set to ensure that the optimal financial statement fraud detection model is obtained. Step 3: Construct a dataset for the report item fraud detection model. The specific method is as follows: Step 3.1: Obtain historical sample data related to the reports. The samples include financial statement data, violations, and error correction announcements from listed companies. The feature data used is consistent with the features constructed in the previous chapter. Step 3.2: Label the fraudulent and non-fraudulent samples based on the penalty decision and error correction notice; set whether the fraudulent financial statement item is fraudulent as the target variable; at the same time, for each fraudulent sample, match a sample without any fraud based on industry, year, asset size, capital structure and company operating income, and construct a data set for the fraud identification model of financial statement items. Divide the data set into training set and test set at 80%:20%. Step 4: Construct a financial statement item fraud detection model to predict fraud in financial statement items. Taking the revenue fraud prediction model as an example, the specific method is as follows: Step 4.1: Use the Variable Importance Index (VIM) based on random forest for feature selection, and select a total of 39 features with a VIM feature importance greater than 0.01; Step 4.2: Use a gridded search with 3-fold cross-validation and F1-score to optimize the model performance. Build the model based on the optimized parameters. Step 4.3: After the training set sample data is input into a single decision tree, the model judges the sample data based on the node features and feature values starting from the root node, until the leaf node. The model will output the classification result of whether the operating income of the sample is fraudulent. Finally, the model's generalization ability is evaluated based on its performance on the test set to ensure that the optimal financial statement item fraud detection model is obtained. Step 5: Input the sample data of the financial statements to be evaluated into the two models obtained in Step 2 and Step 4. If the sample is classified as fraud, perform interpretability analysis and visualize the basis for the model's predictions. Collect abnormal features as audit clues to assist decision-making. The specific method is as follows: Step 5.1: Use the TreeSHAP method to perform global interpretability analysis on the financial statement fraud detection model and the financial statement item fraud detection model respectively, and derive global fraud anomaly features as part of the audit clues; Step 5.2: Use the TreeSHAP method to perform partial interpretability analysis on the financial statement fraud detection model and the financial statement item fraud detection model respectively, and obtain fraud anomaly characteristics based on a single sample, which are output as audit clues.
2. The financial statement fraud detection method according to claim 1, characterized in that, The sample data in steps 1 and 3 are obtained from the CSMAR database and from the error correction announcements of listed companies obtained from CNINFO.
3. The financial statement fraud detection method according to claim 1, characterized in that, The sample labeling method in steps 1 and 3 is as follows: The sample labeling criteria include the type of audit report opinion, penalty decision, and listed company error correction announcement; companies with non-unqualified audit opinions, companies with penalty decisions from the China Securities Regulatory Commission, and listed companies that corrected their financial statement data are marked as fraudulent, while the rest are marked as non-fraudulent.
4. The financial statement fraud detection method according to claim 1, characterized in that, The features selected in steps 2.1 and 4.1 include financial indicators and the growth rate of financial statement items. The financial indicators include ratio structure, solvency, risk level, operating capacity, cash flow analysis, and profitability.
5. The financial statement fraud detection method according to claim 1, characterized in that, To ensure a balance between positive and negative samples in the dataset, for each fraudulent sample, a non-fraudulent sample is matched based on industry, year, asset size, capital structure, and company revenue, and together they form the dataset.
6. The financial statement fraud detection method according to claim 1, characterized in that, The evaluation metrics for the model's generalization ability in steps 2.3 and 4.3 include accuracy, precision, recall, and F1 score, calculated using the following formulas: TP refers to true negatives, including those that are fraudulent and are predicted to be fraudulent; FN refers to false negatives, including those that are fraudulent and are predicted to be non-fraudulent; FP refers to false positives, including those that are non-fraudulent and are predicted to be fraudulent; TN refers to true negatives, including those that are non-fraudulent and are predicted to be non-fraudulent.
7. The financial statement fraud detection method according to claim 1, characterized in that, The specific method for step 5.1, global interpretability analysis, is as follows: Calculate the SHAP values for all features of all samples, and select the 20 features in the model that have the greatest impact on fraud prediction to present them in the form of a summary diagram. Arrange the feature names on the y-axis of the summary diagram in descending order of feature importance from top to bottom, with one point representing one sample. The SHAP values on the x-axis increase continuously from left to right. When the SHAP value corresponding to a sample with a specific feature is less than 0, it indicates that the specific feature reduces the model's prediction of the sample's fraud probability, and vice versa. The results provided by this analysis serve as audit clues to assist decision-making. For feature i of sample x, its SHAP value φ i The calculation method is as follows; In the above formula, F is the set of all features, S is the subset of features retained in the model, S∪{i} is the feature subset, and |F|! is the number of all permutations and combinations of features in the set; in the random forest model, for f S (x S ) is defined as expected prediction.
8. The financial statement fraud detection method according to claim 1, characterized in that, The specific method of step 5.2, Local Interpretability Analysis, is as follows: based on fraud in a single sample, calculate the SHAP value of each feature, and find the features in the sample that have a significant impact on fraud as audit clues; the results of Local Interpretability Analysis are shown by the direction and length of the arrows in the waterfall plot, which demonstrate the driving effect of different features on the model's prediction of fraud probability. The longer the length, the greater the influence; the right arrow indicates that the feature has a positive impact on fraud in the sample, and vice versa, serving as audit clues to assist decision-making.
