Bill data analysis method and system based on multi-modal large model
Through the multi-modal large model analysis method, combined with OCR and image processing technology, bill information is automatically extracted, which solves the problems of low efficiency and high maintenance cost of traditional analysis methods, and achieves efficient processing and accurate analysis of diverse bills.
Patent Information
- Application Number
- CN202411028306.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-07-30
AI Technical Summary
Traditional bill analysis methods are inefficient, error-prone, difficult to handle diverse bills, have high maintenance costs, and cannot adapt to changes in bill format and content.
Adopting a bill data analysis method based on a multi-modal large model, through multi-modal technology of image and text information, combined with OCR, image processing and natural language processing, the key information in the bill is automatically identified and extracted, and a deep learning model is used to detect anomalies Detect and trend analysis, and generate data visualization reports.
It improves the accuracy and efficiency of information extraction, reduces manual intervention, adapts to different formats and types of bills, reduces maintenance costs, and enables flexible processing of changes in bill format and content.
Smart Images

Figure CN118552331A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data analysis, and in particular to a bill data analysis method and system based on a multimodal large model. Background Art
[0002] Traditional bill analysis methods mainly include manual review. Manual review is the manual verification of bill information by financial personnel, while the rule-based system enters the bill information into the system for management according to fixed rules. It relies on experience, is inefficient, and is prone to errors. Manual review and rule-based systems have slow processing speeds and are difficult to handle large numbers of bills. Manual review is prone to errors, and rule-based systems have limited processing capabilities for complex format bills. Therefore, traditional methods have poor adaptability to changes in bill format and content, and are difficult to handle a variety of bills. The cost of manual review and maintenance of rule-based systems is high. Summary of the invention
[0003] The purpose of the present invention is to provide a bill data analysis method and system based on a multimodal large model to solve the problems raised in the above background technology.
[0004] To achieve the above object, the present invention provides the following technical solutions: A bill data analysis method based on a multimodal large model, the method is implemented based on a bill data analysis system, and includes the following steps: S1. Requirements Analysis and Planning: Communicate with relevant stakeholders to determine project requirements and goals, and develop a project plan, including schedule, resource allocation, and key milestones; S2. Data collection: Identify data sources, including paper invoices and electronic invoices, establish data collection pipelines, obtain invoice data through automated tools, and ensure compliance and security of data collection; S3. Data preprocessing: clean the collected ticket data, handle missing values and noisy data, and format the data to ensure a unified input format; S4. Multimodal data processing: Preprocess the bill image, including image enhancement and denoising, extract text information from the image using optical character recognition technology, process the extracted text data, and perform formatting and semantic understanding; S5. Feature extraction and selection: Extract key information from the processed bill data, generate feature vectors, select important features, reduce data dimensions, and improve model training efficiency; S6. Model training: prepare training data sets, including historical bill data and annotation information, select appropriate machine learning or deep learning algorithms for model training, adjust model parameters, and optimize model performance; S7. Model validation and evaluation: Use the validation data set to evaluate model performance, perform cross-validation, ensure the generalization ability of the model, adjust model parameters, and optimize the model based on the evaluation results; S8. Anomaly detection: Apply the trained model to detect anomalies in the bill data, identify obvious anomalies and complex anomaly patterns, and mark suspicious bills; S9. Advanced analysis and prediction: Conduct trend analysis of bill data, predict future bill flows, perform data classification and group analysis, and identify different types of bill patterns; S10. Data visualization: Generate various data charts to intuitively display the results of bill data analysis, and prepare data analysis reports including key findings and suggestions; S11. System integration and testing: Integrate each module into a complete system, conduct system testing, ensure the normal operation of each functional module, fix problems found in the test, and optimize system performance; S12. Deployment and launch: Deploy the system to the production environment, ensure the stability and security of the system, monitor the system, and promptly identify and resolve potential problems; S13. User training and support: Provide users with system training, improve their operating skills, provide technical support, and answer questions they encounter during use; S14. Continuous optimization and maintenance: Collect user feedback, optimize the system based on the feedback, perform regular system maintenance to ensure long-term stable operation of the system, update and upgrade system functions to meet ever-changing needs.
[0005] The present invention also proposes a bill data analysis system based on a multimodal large model, including a data acquisition preprocessing module, a multimodal data processing module, a feature extraction and selection module, an anomaly detection module, a differentiated anti-counterfeiting evaluation module, an advanced analysis and prediction module, a data visualization module, and a service feedback module; The data acquisition preprocessing module is used for data acquisition and data cleaning; The multimodal data processing module is used for image processing and text processing; The feature extraction and selection module is used for feature extraction and feature selection; The anomaly detection module is used for rule-based anomaly detection and machine learning anomaly detection; The differentiated anti-counterfeiting assessment module is used for image comparison and identification, watermark anti-counterfeiting mark recognition, benchmark assessment, peer benchmark assessment, on-chain bill storage and on-chain data verification; The advanced analysis and prediction module is used for trend analysis and classification clustering; The data visualization module is used for chart generation and report generation; The service feedback module is used for sentiment analysis, sentiment feedback integration and feedback improvement, and provides a user-friendly interactive interface.
[0006] Preferably, the data acquisition preprocessing module further includes a data acquisition unit and a data cleaning unit; The data collection unit is used to automatically collect a large number of paper and electronic receipts to improve data collection efficiency; The data cleaning unit is used to process missing values, remove noise data and correct data format to ensure the quality of input data.
[0007] Preferably, the multimodal data processing module further includes an image processing unit and a text processing unit; The image processing unit is used for bill image text recognition, extracting key text information from the scanned bill image, including invoice number and amount; The text processing unit is used to format text data and perform semantic understanding, and convert unstructured text data into structured data for further analysis.
[0008] Preferably, the feature extraction and selection module further includes a feature extraction unit and a feature selection unit; The feature extraction unit is used to extract key information from the bill data, including date, amount, and invoice type, and generate a feature vector for each bill; The feature selection unit is used to screen important features and select the most important features to reduce redundant data, improve model training efficiency and effect, and avoid overfitting.
[0009] Preferably, the anomaly detection module further comprises a rule-based anomaly detection unit and a machine learning anomaly detection unit; The rule-based anomaly detection unit is used to perform abnormal bill detection, and is used to quickly identify obvious anomalies, including bills with amounts outside the expected range; The machine learning anomaly detection unit is used to perform complex anomaly pattern detection, to discover anomaly patterns that are difficult to detect based on historical data, and to improve detection accuracy.
[0010] Preferably, the differentiated anti-counterfeiting assessment module further includes an image comparison and identification unit, a watermark anti-counterfeiting identification unit, a benchmark assessment unit, a peer benchmark assessment unit, a bill chain evidence storage unit, and a chain data verification unit; The image comparison and identification unit is used to identify counterfeit bills using image comparison technology to prevent fraudulent behavior; The watermark anti-counterfeiting mark identification unit verifies the authenticity of the bill by using a digital watermark detection algorithm, and is used to detect the watermark and anti-counterfeiting mark on the bill to ensure the legitimacy and authenticity of the bill; The benchmark evaluation unit performs data status evaluation by using a benchmark comparison algorithm to compare the current status of the bill data with the historical benchmark data and evaluate the changes; The peer benchmarking evaluation unit is used to compare and analyze the bill data of other companies in the same industry, helping enterprises understand their position in the industry and optimize financial management strategies; The bill chain storage unit stores bill data on the chain through the Ethereum smart contract, which is used to store bill data on the chain, ensure the data is tamper-proof, ensure the security and credibility of bill data, and prevent data tampering; The on-chain data verification unit verifies the authenticity of the data through a blockchain verification algorithm, and is used to verify the authenticity of the bill data through the blockchain, quickly verify the legitimacy of the bill data, and improve the credibility of the data.
[0011] Preferably, the advanced analysis and prediction module further includes a trend analysis unit and a classification and clustering unit; The trend analysis unit is used to analyze the time series trend in the bill data, predict the future bill flow trend, and perform financial planning; The classification and clustering unit is used to identify different types of bills and common bill patterns to improve management efficiency.
[0012] Preferably, the data visualization module further comprises a chart generation unit and a report generation unit; The chart generation unit is used to generate pie charts, bar charts and line charts to help users intuitively understand the distribution and changes of bill data; The report generation unit is used to automatically generate a data analysis report, including key findings and suggestions, to provide decision makers with a detailed bill data analysis report to support business decisions.
[0013] Preferably, the service feedback module further includes a sentiment analysis unit, a sentiment feedback integration unit, an interactive interface unit and a feedback improvement unit; The sentiment analysis unit is used to analyze the sentiment tendency in the bill notes, identify positive or negative emotions, understand customer satisfaction with the service, and improve service quality.
[0014] The emotion feedback integration unit integrates the emotion analysis results through the emotion integration algorithm, is used to integrate the emotion analysis results, generate an emotion trend report, provide emotion data support, and assist decision-making and customer relationship management.
[0015] The interactive interface unit is used to support users in querying, filtering and analyzing bill data, thereby improving user experience; The feedback improvement unit is used to continuously collect user feedback, optimize system performance and functions based on the feedback, and ensure continuous improvement of the system.
[0016] Compared with the prior art, the present invention has the following beneficial effects: The modal large model bill data analysis method of the present invention uses multimodal technology to combine image and text information to improve the accuracy of information extraction, quickly processes a large amount of bill data through a large model, reduces manual intervention, reduces human errors, and improves work efficiency. It can continuously learn and optimize to adapt to bills of different formats and types, obtain bill images by scanning or electronic means, use OCR technology to recognize text information, combine image processing technology to analyze the bill layout, use the large model to perform natural language processing, extract key information from the bill, and output the analysis results to the financial system or database for further processing and analysis. It has strong adaptability to changes in bill format and content, is convenient for processing a variety of bills, is easy to maintain, and has low upgrade costs.
[0017] The present invention combines OCR technology to automatically identify text information in bills, uses image processing technology to analyze the layout structure and image information of bills, utilizes natural language processing technology to accurately extract key information in bills, and improves the accuracy and efficiency of information extraction through deep learning models. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 The topology diagram of the bill data analysis system based on the multi-modal large model of the present invention is shown; Figure 2 The flowchart of the bill data analysis method of the present invention is shown. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0020] Example 1: Please refer to Figure 1 ,The present invention proposes a bill data analysis system, which consists of a data acquisition and preprocessing module, a multimodal data processing module, a feature extraction and selection module, an omaly detection module, a differentiated anti-counterfeiting evaluation module, an advanced analysis and prediction module, a data visualization module, and a service feedback module; Among them, it should be noted that this system performs data collection and data cleaning through the data collection and preprocessing module, this system performs image processing and text processing through the multimodal data processing module, this system performs feature extraction and feature selection through the feature extraction and selection module, this system performs rule-based anomaly detection and machine learning anomaly detection through the anomaly detection module, this system performs image comparison and identification, watermark anti-counterfeiting mark recognition, benchmark assessment, peer benchmarking assessment, on-chain storage of bills and on-chain data verification through the differentiated anti-counterfeiting assessment module, this system performs trend analysis and classification clustering through the advanced analysis and prediction module, this system generates charts and reports through the data visualization module, this system performs sentiment analysis, sentiment feedback integration and feedback improvement through the service feedback module, and provides a user-friendly interactive interface.
[0021] In this embodiment, it should also be noted that the data acquisition preprocessing module in this system also includes a data acquisition unit and a data cleaning unit. The data acquisition unit is used to automatically collect a large number of paper and electronic receipts to improve data collection efficiency. The data cleaning unit is used to process missing values, remove noise data and correct data formats to ensure the quality of input data.
[0022] In this embodiment, it should also be noted that the multimodal data processing module in the system also includes an image processing unit and a text processing unit. The image processing unit is used for bill image text recognition and extracts key text information from the scanned bill image, including invoice number and amount. The text processing unit is used for text data formatting and semantic understanding and converts unstructured text data into structured data for further analysis.
[0023] In this embodiment, it should also be noted that the feature extraction and selection module in this system also includes a feature extraction unit and a feature selection unit. The feature extraction unit is used to extract key information from the bill data, including date, amount, and invoice type, and generate a feature vector for each bill. The feature selection unit is used to screen important features and select the most important features to reduce redundant data, improve model training efficiency and effectiveness, and avoid overfitting.
[0024] In this embodiment, it should also be noted that the anomaly detection module in this system also includes a rule-based anomaly detection unit and a machine learning anomaly detection unit. The rule-based anomaly detection unit is used to perform abnormal bill detection, and is used to quickly identify obvious anomalies, including bills with amounts exceeding the expected range. The machine learning anomaly detection unit is used to perform complex abnormal pattern detection, and is used to discover abnormal patterns that are difficult to detect based on historical data, thereby improving detection accuracy.
[0025] In this embodiment, it should also be noted that the differentiated anti-counterfeiting assessment module in this system also includes an image comparison and identification unit, a watermark anti-counterfeiting mark identification unit, a benchmark assessment unit, an industry benchmarking assessment unit, a bill chain evidence storage unit and a chain data verification unit. The image comparison and identification unit is used to use image comparison technology to identify counterfeit bills and prevent fraud. The watermark anti-counterfeiting mark identification unit performs authenticity verification through a digital watermark detection algorithm to detect watermarks and anti-counterfeiting marks on bills to ensure the legality and authenticity of the bills. The benchmark assessment unit performs data status evaluation through a benchmark comparison algorithm to compare the current status of the bill data. The peer benchmarking unit is used to compare and analyze the bill data of other companies in the same industry to help companies understand their position in the industry and optimize financial management strategies. The bill chain storage unit uses the Ethereum smart contract to store bill data on the chain, which is used to put bill data on the chain to ensure that the data cannot be tampered with, ensure the security and credibility of bill data, and prevent data tampering. The on-chain data verification unit verifies the authenticity of the data through the blockchain verification algorithm, which is used to verify the authenticity of the bill data through the blockchain, quickly verify the legitimacy of the bill data, and improve the credibility of the data.
[0026] In this embodiment, it should also be noted that the advanced analysis and prediction module in this system also includes a trend analysis unit and a classification and clustering unit. The trend analysis unit is used to analyze the time series trends in the bill data, predict future bill flow trends, and perform financial planning. The classification and clustering unit is used to identify different types of bills and common bill patterns to improve management efficiency.
[0027] In this embodiment, it should also be noted that the data visualization module in this system also includes a chart generation unit and a report generation unit. The chart generation unit is used to generate pie charts, bar charts and line charts to help users intuitively understand the distribution and changes of bill data. The report generation unit is used to automatically generate data analysis reports, including key findings and suggestions, to provide decision makers with detailed bill data analysis reports to support business decisions.
[0028] In this embodiment, it should also be noted that the service feedback module in this system also includes a sentiment analysis unit, a sentiment feedback integration unit, an interactive interface unit and a feedback improvement unit. The sentiment analysis unit is used to analyze the sentiment tendencies in the bill notes, identify positive or negative emotions, understand customer satisfaction with the service, and improve service quality. The sentiment feedback integration unit integrates the sentiment analysis results through a sentiment integration algorithm, which is used to integrate the sentiment analysis results, generate a sentiment trend report, provide sentiment data support, and assist decision-making and customer relationship management. The interactive interface unit is used to support users in querying, screening and analyzing bill data, and improve user experience. The feedback improvement unit is used to continuously collect user feedback, optimize system performance and functions based on feedback, and ensure continuous improvement of the system.
[0029] Example 2: Please refer to Figure 2 In the actual application of bill data analysis, the multimodal large model bill data analysis method based on the above bill data analysis system specifically includes the following steps: S1. Demand Analysis and Planning: S1.1. Communicate with relevant stakeholders: S1.1.1. Preliminary meeting arrangement: arrange the preliminary meeting time and location through Microsoft Project, and use Zoom or Microsoft Teams for remote meetings; S1.1.2. Requirements gathering: Collect preliminary requirements from stakeholders through Google Forms, and use Miro or MURAL to record stakeholders’ requirements and feedback during meetings; S1.1.3. Confirm requirements: Use Jira or Confluence to record and track confirmed requirements, write requirement documents, and distribute them to stakeholders for confirmation via email or shared folders (Google Drive or Dropbox); S1.2. Determine project needs and goals: S1.2.1. Requirements analysis: Use NVivo or MAXQDA to analyze the collected requirements information, identify key requirements, hold seminars, and use OneNote or Evernote to record discussion results; S1.2.2. Goal setting: Set project goals using SMART (specific, measurable, achievable, relevant and time-bound). Use MindMeister or XMind to present and discuss goals during goal setting meetings. S1.2.3. Goal confirmation: Use Asana or Monday.com to record and track confirmed project goals, and distribute the goal documents to all relevant stakeholders via email or document sharing platform (SharePoint) for final confirmation; S1.3. Develop a project plan: S1.3.1. Schedule Development: Use GanttProject or Microsoft Project to develop a detailed project schedule and discuss with team members to determine the time estimate and deadline for each task; S1.3.2. Resource allocation: Use Smartsheet or Resource Guru to allocate project resources, adopt personnel, equipment and budget, hold resource allocation meetings, and use Jamboard to discuss and record resource allocation; S1.3.3. Key milestone setting: Set key milestones in Wrike or Trello and clearly define the goals and deliverables for each milestone, communicate with stakeholders regularly, and use Status Hero or Weekdone to report and track milestone completion; S2. Data collection: S2.1. Identify the data source: S2.1.1. Data source classification: Paper receipts: from handwritten or printed receipts, invoices and other paper documents; Electronic receipts: from electronic documents such as emails, online payment platforms, enterprise resource planning (ERP) systems and customer relationship management (CRM) systems; S2.1.2. Data source confirmation: Use Microsoft Excel or Google Sheets to list all potential data sources and communicate with the finance and business departments to confirm the accuracy of all data sources; S2.2. Establish data collection pipeline: S2.2.1. Data collection tool selection: Paper receipts: Use OCR (Optical Character Recognition) tools such as Adobe Acrobat, ABBYY FineReader or Tesseract to convert paper receipts into electronic data; Electronic invoicing: Use APIs or automation tools such as Zapier, Integromat or Microsoft Power Automate to pull data directly from email, ERP and CRM systems. S2.2.2. Data collection process design: Use Lucidchart or Visio to draw a data collection process diagram, clarify the specific operation steps of each link, establish a data repository, and use Google BigQuery, Amazon S3 or Microsoft Azure to centrally store the collected data; S2.2.3. Data collection automation: Use Python or R to write automation scripts to regularly obtain and process data from specified data sources, and use data collection and processing frameworks such as Apache Nifi or Talend to create and manage data collection pipelines; S2.3. Ensure compliance and security of data collection: S2.3.1. Compliance Check: Develop and implement compliance standards for data collection and processing in accordance with GDPR and CCPA data privacy regulations, and use OneTrust or TrustArc to conduct regular compliance audits to ensure that data collection complies with relevant regulatory requirements; S2.3.2. Data security measures: Data transmission security: Use SSL / TLS encryption technology to ensure the security of data during transmission; Data storage security: Use AES-256 encryption technology to protect data in storage; S2.3.3. Permission management and access control: Use identity and access management (IAM) tools, such as Okta or AWS IAM, to manage data access permissions, conduct regular security audits and risk assessments, and use tools such as Splunk or ELK Stack to monitor data access and usage; S2.3.4. Data backup and recovery: Establish a data backup strategy, use tools such as Veeam or Acronis to perform regular data backup, and develop a data recovery plan to ensure that data can be restored in a timely manner in the event of data loss or damage; S3. Data preprocessing: S3.1. Data cleaning: S3.1.1. Data deduplication: Use Python’s pandas library to check and delete duplicate data; S3.1.2. Data verification: confirm the completeness and accuracy of the data, check whether important fields conform to the expected format and range, and use regular expressions to validate the bill number, date and amount fields; S3.2. Handling missing values: S3.2.1. Missing value identification: Use the pandas library to identify missing values; S3.2.2. Missing value filling: For numerical missing values, the mean, median or mode can be used to fill in the missing values; for categorical missing values, the mode can be used to fill in the missing values; S3.2.3. Missing value deletion: If the proportion of missing values is high and has a great impact on the analysis, you can choose to delete the rows containing missing values; S3.3. Processing noisy data: S3.3.1. Outlier detection: Use box plot or Z-score method to detect outliers; S3.3.2. Outlier processing: For detected outliers, you can choose to delete or modify them; S3.4. Data formatting: S3.4.1. Unified data format: ensure that the date and amount fields have consistent formats; S3.4.2. Standardize data: Encode categorical data; S3.4.3. Data type conversion: Ensure that the data types of all fields are correct: Through the above steps, ensure that the collected bill data can be uniformly input into the subsequent data analysis or processing flow after cleaning, missing value processing, noise processing and formatting, to ensure the quality and consistency of the data; S4. Multimodal data processing: S4.1. Image preprocessing: S4.1.1. Image enhancement: Use OpenCV or PIL library to enhance the image by adjusting brightness, contrast, cropping, and rotation; S4.1.2. Image denoising: Use OpenCV's Gaussian filtering and bilateral filtering methods to remove noise from images; S4.2.Optical Character Recognition (OCR): S4.2.1.OCR technology application: Use Tesseract or other OCR libraries to extract text information from images; import pytesseract def ocr_image(image_path): image = cv2.imread(image_path) text = pytesseract.image_to_string(image) return text extracted_text = ocr_image('denoised_invoice_image.jpg') print(extracted_text) S4.2.2.OCR result verification and error correction: Verify the extracted text and perform spelling correction; from spellchecker import SpellChecker def correct_text(text): spell = SpellChecker() corrected_text = [] for word in text.split(): corrected_text.append(spell.correction(word)) return ' '.join(corrected_text) corrected_text = correct_text(extracted_text) print(corrected_text) S4.3. Processing of extracted text data: S4.3.1. Text formatting: The extracted text is structured according to a predefined format, using JSON or CSV; S4.3.2. Semantic understanding: Use NLP technology to perform semantic analysis and extract key information. Use amount, date, and product name to extract and structure key text data from bill images through image preprocessing, OCR to extract text information, and subsequent text processing to provide high-quality data input for subsequent analysis and processing; S5. Feature extraction and selection: S5.1. Feature extraction: extract key information from the processed bill data and generate feature vectors; S5.1.1. Extract key information: Extract key information from structured data, using invoice number, date, total amount, and product details; S5.1.2. Generate feature vector: Convert the extracted key information into feature vector for input of machine learning model; S5.2. Feature selection: select important features, reduce data dimensions, and improve model training efficiency; S5.2.1. Feature importance evaluation: Use XGBoost to evaluate the importance of features; S5.2.2. Feature selection: Select important features based on feature importance scores, remove redundant or irrelevant features, extract key information from the processed bill data through feature extraction and selection, generate feature vectors, and select the most important features by evaluating feature importance, reduce data dimensions, and improve model training efficiency, which not only improves data quality and model performance, but also significantly reduces the consumption of computing resources; S6. Model training: S6.1. Prepare training dataset: S6.1.1. Collect historical bill data and annotation information: Ensure that the data set contains sufficient historical bill data and related annotation information (including total amount, date, and commodity category). The data should be diverse and cover different types of bills and different scenarios. S6.1.2. Data preprocessing: Clean and preprocess the data, handle missing values and outliers, encode text data, use bag-of-words model or TF-IDF, process date and time data, and extract year and month features; S6.2. Select an appropriate algorithm for model training; S6.2.1. Select machine learning or deep learning algorithms: Select appropriate algorithms based on the problem type and data size, such as linear regression, random forest, XGBoost, or neural network. from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import mean_squared_error # Using Random Forest Regression X = df.drop(columns=["total_amount"]) y = df["total_amount"] X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) model = RandomForestRegressor(n_estimators=100, random_state=42) model.fit(X_train, y_train) S6.3. Adjust model parameters to optimize model performance; S6.3.1. Adjust model parameters: Use grid search or random search to perform hyperparameter tuning; from sklearn.model_selection import GridSearchCV param_grid = { 'n_estimators': [50, 100, 200], 'max_depth': [None, 10, 20, 30] } grid_search = GridSearchCV(estimator=model, param_grid=param_grid, cv=5, scoring='neg_mean_squared_error') grid_search.fit(X_train, y_train) best_model = grid_search.best_estimator_ print(grid_search.best_params_) S6.3.2. Evaluate model performance: Use cross-validation to evaluate model performance and calculate error and accuracy metrics; y_pred = best_model.predict(X_test) mse = mean_squared_error(y_test, y_pred) print(f"Mean Squared Error: {mse}") # Other evaluation indicators, using R^2 from sklearn.metrics import r2_score r2 = r2_score(y_test, y_pred) print(f"R^2 Score: {r2}") S6.3.3. Further optimization: If the model performance does not meet the requirements, you can try more feature engineering, use more complex models, or integrate multiple model methods for further optimization. By preparing sufficient training data sets, selecting appropriate algorithms, adjusting model parameters, and optimizing performance, you can effectively train an efficient bill data processing model that can not only accurately predict and classify bill data, but also provide efficient support in practical applications; S7. Model Validation and Evaluation: S7.1. Evaluate model performance using the validation dataset: S7.1.1. Split the validation data set: Split the validation set from the original data set to ensure that there is no overlap between the training set and the validation set; # Use the previously divided dataset X_train, X_val, y_train, y_val = train_test_split(X, y, test_size=0.2, random_state=42) S7.1.2. Evaluate model performance: Use the validation set to evaluate the model and calculate key metrics such as mean square error (MSE), mean absolute error (MAE), and R^2; y_val_pred = best_model.predict(X_val) mse_val = mean_squared_error(y_val, y_val_pred) mae_val = mean_absolute_error(y_val, y_val_pred) r2_val = r2_score(y_val, y_val_pred) print(f"Validation Mean Squared Error: {mse_val}") print(f"Validation Mean Absolute Error: {mae_val}") print(f"Validation R^2 Score: {r2_val}") S7.2. Perform cross validation: S7.2.1. Cross-validation concept: Cross-validation is a technique that divides a dataset into multiple subsets to train and evaluate models. The most commonly used one is K-Fold Cross-Validation. S7.2.2. Perform K-fold cross validation: Use K-fold cross validation to further verify the generalization ability of the model; from sklearn.model_selection import cross_val_score # Perform 5-fold cross validation cv_mse_scores = cross_val_score(best_model, X, y, cv=5, scoring='neg_mean_squared_error') cv_r2_scores = cross_val_score(best_model, X, y, cv=5, scoring='r2') print(f"Cross-Validation MSE Scores: {-cv_mse_scores.mean()}") print(f"Cross-Validation R^2 Scores: {cv_r2_scores.mean()}") S7.3. Adjust model parameters: S7.3.1. Parameter adjustment method: If the model performance is not ideal, you can optimize the model by adjusting the hyperparameters; commonly used methods include grid search and random search; S7.3.2. Parameter adjustment using grid search: # Grid search has been presented in S6 and will not be repeated here; S7.4. Optimize the model based on the evaluation results: S7.4.1. Analyze the evaluation results: compare the evaluation results of the model under different parameters and select the optimal parameter combination; S7.4.2. Adjust feature engineering: If the model performance is still not ideal, try to adjust feature engineering by adding new features and performing feature selection. Ensure the generalization ability of the model by evaluating model performance using validation data sets and cross-validation. At the same time, further improve model performance by adjusting model parameters and optimizing feature engineering. S8. Anomaly Detection: S8.1. Apply the trained model to detect anomalies in the bill data; S8.1.1. Load the trained model: Ensure that the trained model has been loaded for anomaly detection of bill data; import joblib:model = joblib.load('trained_model.pkl') S8.1.2. Prepare bill data: obtain the bill data to be tested and perform necessary preprocessing; # The ticket data has been loaded as a DataFrame invoices = pd.read_csv('invoices.csv') # Perform data preprocessing, using missing value filling and feature encoding invoices_preprocessed = preprocess_data(invoices) S8.2. Identify obvious abnormalities and complex abnormal patterns: S8.2.1. Identify obvious anomalies: Use simple rules or statistical methods to identify bills that are obviously abnormal, including bills with negative amounts or amounts outside the expected range; def detect_simple_anomalies(df): anomalies = df[(df['amount'] < 0) | (df['amount'] > df['amount'].quantile(0.99))] return anomalies; Simple_anomalies = detect_simple_anomalies(invoices_preprocessed) S8.2.2. Identify complex anomaly patterns: Use trained models to identify complex anomaly patterns; the model can be an anomaly detection model based on supervised learning or unsupervised learning, using isolation forests and local anomaly factors (LOF); from sklearn.ensemble import IsolationForest # Anomaly detection model using unsupervised learning iso_forest = IsolationForest(contamination=0.01, random_state=42) iso_forest.fit(invoices_preprocessed) invoices_preprocessed['anomaly_score'] = iso_forest.decision_function(invoices_preprocessed) invoices_preprocessed['anomaly'] = iso_forest.predict(invoices_preprocessed) # Identify abnormal tickets complex_anomalies = invoices_preprocessed[invoices_preprocessed['anomaly'] == -1] S8.3. Marking suspicious bills: S8.3.1. Merge abnormal results: Merge the detection results of obvious anomalies and complex anomalies to generate the final list of suspicious bills; suspicious_invoices = pd.concat([simple_anomalies, complex_anomalies]).drop_duplicates() S8.3.2. Mark suspicious bills: Mark suspicious bills for subsequent processing and analysis; invoices['is_suspicious'] = invoices.index.isin(suspicious_invoices.index) S8.3.3. Save or output the results: save the marked ticket data, or output the results for subsequent analysis; invoices.to_csv('suspicious_invoices.csv', index=False) By applying the trained model, combining simple rule detection with complex abnormal pattern recognition, anomalies in bill data can be effectively identified. After suspicious bills are marked, further manual review or automated processing is performed to ensure the accuracy and reliability of bill data. S9. Advanced Analysis and Prediction: S9.1. Perform trend analysis on bill data: S9.1.1. Load and preprocess data: Obtain bill data and perform necessary preprocessing, using missing value filling and feature encoding; import pandas as pd: import matplotlib.pyplot as plt invoices = pd.read_csv('invoices.csv') invoices['date'] = pd.to_datetime(invoices['date']) invoices.set_index('date', inplace=True) S9.1.2. Conduct trend analysis: Use time series analysis methods to analyze the trend of bill amount and quantity; monthly_trend = invoices.resample('M').sum() plt.figure(figsize=(12, 6)) plt.plot(monthly_trend['amount'], label='Monthly Amount') plt.title('Monthly Trend of Invoice Amount') plt.xlabel('Date') plt.ylabel('Amount') plt.legend() plt.show() S9.2. Predict future bill flows: S9.2.1. Select forecasting model: Select a suitable time series forecasting model, such as ARIMA or Prophet; from statsmodels.tsa.arima.model import ARIMA: model = ARIMA(monthly_trend['amount'], order=(5, 1, 0)) model_fit = model.fit() S9.2.2. Make forecasts: Use the selected model to make forecasts of future bill flows; forecast = model_fit.forecast(steps=12) plt.figure(figsize=(12, 6)) plt.plot(monthly_trend['amount'], label='Historical Data') plt.plot(forecast, label='Forecast', linestyle='--') plt.title('Invoice Amount Forecast') plt.xlabel('Date') plt.ylabel('Amount') plt.legend() plt.show() S9.3. Perform data classification and group analysis: S9.3.1. Data feature extraction: Extract features for classification and group analysis, using bill amount, date, and customer information; features = invoices[['amount', 'customer_id', 'category']] S9.3.2. Data standardization: Standardize the data to ensure that the magnitudes of different features are consistent; from sklearn.preprocessing import StandardScaler scaler = StandardScaler() features_scaled = scaler.fit_transform(features) S9.3.3. Use clustering algorithms for group analysis: Select appropriate clustering algorithms, such as K-means and DBSCAN, for group analysis; from sklearn.cluster import KMeans: kmeans = KMeans(n_clusters=3,random_state=42) clusters = kmeans.fit_predict(features_scaled) invoices['cluster'] = clusters S9.3.4. Data visualization: Visualize the results of group analysis to help understand different types of bill patterns; plt.figure(figsize=(12, 6)) plt.scatter(invoices['amount'], invoices['customer_id'], c=invoices['cluster'], cmap='viridis') plt.title('Invoice Clusters') plt.xlabel('Amount') plt.ylabel('Customer ID') plt.show() S9.4. Identify different types of bill patterns: S9.4.1. Analyze clustering results: Analyze the characteristics of different groups and identify different types of bill patterns; cluster_summary = invoices.groupby('cluster').agg({ 'amount': ['mean', 'sum', 'count'], 'customer_id': 'nunique' }) import ace_tools as tools; tools.display_dataframe_to_user(name="Cluster Summary", dataframe=cluster_summary) S9.4.2. Label and explain: Label and explain each cluster, describing its characteristics and patterns; S9.4.3. Save results: Save the analysis results for later use and reference; invoices.to_csv('invoices_with_clusters.csv', index=False) By analyzing the trend of bill data, predicting the future flow of bills, and using clustering algorithms to classify and group data, different types of bill patterns can be identified. These analysis and prediction results are of great reference value for optimizing bill management and formulating relevant strategies; S10. Data Visualization: S10.1. Generate various data charts: S10.1.1. Load and prepare data: Use the pandas library to load the bill data; import pandas as pd:invoices = pd.read_csv('invoices.csv') Convert the date format and set the date as index; invoices['date'] = pd.to_datetime(invoices['date']) invoices.set_index('date', inplace=True) S10.1.2. Draw charts: Use the matplotlib library to draw a time series graph of monthly bill amounts, and use matplotlib to draw a pie chart of bill category distribution; category_distribution = invoices['category'].value_counts() plt.figure(figsize=(8, 8)) plt.pie(category_distribution, labels=category_distribution.index,autopct='%1.1f%%') plt.title('Invoice Category Distribution') plt.show() S10.2. Prepare data analysis report: S10.2.1. Analyze key findings: Use the pandas library to calculate key statistics, using mean, median, and standard deviation, identify trends and patterns in the data through graphical analysis, and record key findings; S10.2.2. Report writing: Use the text editing software Microsoft Word to write a data analysis report, including data description, chart explanation and key findings, and make feasible suggestions based on the data analysis results, adopt optimized bill processing procedures, and identify high-value customers; 1. Focus on bill processing during peak months to ensure timeliness; 2. Develop corresponding optimization strategies for major bill categories; Generate charts that intuitively display the results of bill data analysis through detailed data visualization steps, and prepare data analysis reports containing key findings and recommendations. Use pandas and matplotlib libraries for data processing and chart drawing, and finally write report content in text editing software; S11.System integration and testing: S11.1. Integration of modules: Use Jenkins or GitLab CI / CD integration tools to integrate various functional modules into a complete system, and use Maven or npm dependency management tools to ensure that all module dependencies are correct; S11.2. System testing: Use JUnit or pytest testing framework to write and execute functional tests to ensure that each module functions properly; import unittest class TestModule1(unittest.TestCase): def test_function1(self): result = function1() self.assertEqual(result, expected_result) if __name__ == '__main__': unittest.main() Use Selenium or Postman testing tools to perform integration testing to ensure normal interaction between modules; from selenium import webdriver driver = webdriver.Chrome() driver.get('http: / / localhost:8080') assert 'Welcome' in driver.title driver.close() S11.3. Bug fixes and performance optimization: Bug fixes: Use GDB or Chrome DevTools debugging tools to locate and fix problems found in testing; gdb . / my_program: (gdb) run Use JProfiler or New Relic performance analysis tools for performance analysis and optimization; JProfiler.startCPURecording(); / / code to profile JProfiler.stopCPURecording(); S12. Deployment and launch: S12.1. Deploy to production environment: Use Ansible or Puppet configuration management tools to configure the production environment; - hosts: production: tasks: - name: Install dependencies apt: name={{ item}} state=present with_items: - nginx: - mysql-server Deploy the system using Docker or Kubernetes deployment tools; apiVersion: apps / v1: kind: Deployment metadata: name: my-app; Spec: replicas: 3: template: spec: containers: - name: my-app: image: my-app:latest S12.2. System monitoring and maintenance: System monitoring Use Prometheus or Grafana monitoring tools for system monitoring; global scrape_interval: 15s; Scrape_configs - job_name: 'prometheus' static_configs - targets: ['localhost:9090'] Set alarm rules to promptly handle problems found during monitoring; groups: - name: example rules: - alert: HighMemoryUsage expr: node_memory_Active_bytes > 1e+09: for: 5m: labels: severity: page annotations: summary: "High memory usage detected" S13. User training and support: S13.1. User training: Online training courses using Zoom or Microsoft Teams; S13.2. Technical Support: Support channels: Set up support channels (including email and work order system) and answer user questions in a timely manner through support channels; S14.Continuous optimization and maintenance; S14.1. User feedback collection and analysis: Use SurveyMonkey or Google Forms to collect user feedback and use Excel or Python to analyze the feedback data; S14.2. System optimization and maintenance: Optimize the system based on feedback, add new features or improve existing features, use Git and Shell scripts to regularly maintain the system, and back up scripts regularly.
[0030] In summary, the present invention combines OCR technology to automatically identify text information in bills, uses image processing technology to analyze the layout structure and image information of bills, utilizes natural language processing technology to accurately extract key information in bills, and improves the accuracy and efficiency of information extraction through deep learning models.
[0031] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A bill data analysis method based on a multimodal large model, the method is implemented based on a bill data analysis system, and is characterized in that: The following steps are involved: S1. Communicate with relevant stakeholders, determine project requirements and goals, and develop project plans; S2. Identify paper and electronic invoices and establish data collection pipelines; S3. Clean the collected ticket data, process missing values and noisy data, and format the data to ensure a uniform input format; S4. Preprocess the bill image and extract text information from the image using optical character recognition technology; S5. Extract key information from the processed bill data; S6. Prepare a training data set containing historical bill data and annotation information for model training; S7. Use the validation data set to evaluate the model performance, perform cross-validation, and optimize the model based on the evaluation results; S8. Apply the trained model to detect anomalies in the bill data and mark suspicious bills; S9. Conduct trend analysis of bill data; S10. Generate data charts, intuitively display the results of bill data analysis, and prepare data analysis reports; S11.System integration and testing; S12. Deploy the system to the production environment to ensure the stability and security of the system; S13. Provide system usage training for users to improve their operating skills; S14. Collect user feedback, optimize the system based on the feedback, perform regular system maintenance to ensure long-term stable operation of the system, update and upgrade system functions to meet changing needs.
2. According to claim 1, a bill data analysis system based on a multimodal large model bill data analysis method is characterized in that: The bill data analysis system includes a data collection preprocessing module, a multimodal data processing module, a feature extraction and selection module, an anomaly detection module, a differentiated anti-counterfeiting evaluation module, an advanced analysis and prediction module, a data visualization module, and a service feedback module; The data acquisition preprocessing module is used for data acquisition and data cleaning; The multimodal data processing module is used for image processing and text processing; The feature extraction and selection module is used for feature extraction and feature selection; The anomaly detection module is used for rule-based anomaly detection and machine learning anomaly detection; The differentiated anti-counterfeiting assessment module is used for image comparison and identification, watermark anti-counterfeiting mark recognition, benchmark assessment, peer benchmark assessment, on-chain bill storage and on-chain data verification; The advanced analysis and prediction module is used for trend analysis and classification clustering; The data visualization module is used for chart generation and report generation; The service feedback module is used for sentiment analysis, sentiment feedback integration and feedback improvement, and provides a user-friendly interactive interface.
3. The bill data analysis system based on a multimodal large model according to claim 2 is characterized by: The data acquisition preprocessing module also includes a data acquisition unit and a data cleaning unit; The data collection unit is used to automatically collect a large number of paper and electronic receipts to improve data collection efficiency; The data cleaning unit is used to process missing values, remove noise data and correct data format to ensure the quality of input data.
4. The bill data analysis system based on a multimodal large model according to claim 3 is characterized by: The multimodal data processing module also includes an image processing unit and a text processing unit; The image processing unit is used for bill image text recognition, extracting key text information from the scanned bill image, including invoice number and amount; The text processing unit is used to format text data and perform semantic understanding, and convert unstructured text data into structured data for further analysis.
5. The bill data analysis system based on multimodal large model according to claim 4 is characterized by: The feature extraction and selection module also includes a feature extraction unit and a feature selection unit; The feature extraction unit is used to extract key information from the bill data, including date, amount, and invoice type, and generate a feature vector for each bill; The feature selection unit is used to screen important features and select the most important features to reduce redundant data, improve model training efficiency and effect, and avoid overfitting.
6. The bill data analysis system based on multimodal large model according to claim 5 is characterized by: The anomaly detection module also includes a rule-based anomaly detection unit and a machine learning anomaly detection unit; The rule-based anomaly detection unit is used to perform abnormal bill detection, and is used to quickly identify obvious anomalies, including bills with amounts outside the expected range; The machine learning anomaly detection unit is used to perform complex anomaly pattern detection, to discover anomaly patterns that are difficult to detect based on historical data, and to improve detection accuracy.
7. The bill data analysis system based on multimodal large model according to claim 6 is characterized by: The differentiated anti-counterfeiting assessment module also includes an image comparison and identification unit, a watermark anti-counterfeiting mark identification unit, a benchmark assessment unit, a peer benchmark assessment unit, a bill chain evidence storage unit, and a chain data verification unit; The image comparison and identification unit is used to identify counterfeit bills using image comparison technology to prevent fraudulent behavior; The watermark anti-counterfeiting mark identification unit verifies the authenticity of the bill by using a digital watermark detection algorithm, and is used to detect the watermark and anti-counterfeiting mark on the bill to ensure the legitimacy and authenticity of the bill; The benchmark evaluation unit performs data status evaluation by using a benchmark comparison algorithm to compare the current status of the bill data with the historical benchmark data and evaluate the changes; The peer benchmarking evaluation unit is used to compare and analyze the bill data of other companies in the same industry, helping enterprises understand their position in the industry and optimize financial management strategies; The bill chain storage unit stores bill data on the chain through the Ethereum smart contract, which is used to store bill data on the chain, ensure the data is tamper-proof, ensure the security and credibility of bill data, and prevent data tampering; The on-chain data verification unit verifies the authenticity of the data through a blockchain verification algorithm, and is used to verify the authenticity of the bill data through the blockchain, quickly verify the legitimacy of the bill data, and improve the credibility of the data.
8. The bill data analysis system based on multimodal large model according to claim 7 is characterized by: The advanced analysis and prediction module also includes a trend analysis unit and a classification and clustering unit; The trend analysis unit is used to analyze the time series trend in the bill data, predict the future bill flow trend, and perform financial planning; The classification and clustering unit is used to identify different types of bills and common bill patterns to improve management efficiency.
9. The bill data analysis system based on multimodal large model according to claim 8 is characterized by: The data visualization module also includes a chart generation unit and a report generation unit; The chart generation unit is used to generate pie charts, bar charts and line charts to help users intuitively understand the distribution and changes of bill data; The report generation unit is used to automatically generate a data analysis report, including key findings and suggestions, to provide decision makers with a detailed bill data analysis report to support business decisions.
10. The bill data analysis system based on multimodal large model according to claim 9 is characterized by: The service feedback module also includes a sentiment analysis unit, a sentiment feedback integration unit, an interactive interface unit and a feedback improvement unit; The sentiment analysis unit is used to analyze the sentiment tendency in the bill notes, identify positive or negative emotions, understand customer satisfaction with the service, and improve service quality; The emotional feedback integration unit integrates the emotional analysis results through the emotional integration algorithm, is used to integrate the emotional analysis results, generate emotional trend reports, provide emotional data support, and assist decision-making and customer relationship management; The interactive interface unit is used to support users in querying, filtering and analyzing bill data, thereby improving user experience; The feedback improvement unit is used to continuously collect user feedback, optimize system performance and functions based on the feedback, and ensure continuous improvement of the system.
Citation Information
Patent Citations
Corporate bill selling system with anti-counterfeiting verification
CN102663648A
Invoice management method and device based on data statistical analysis
CN109614416A
Universal multi-engine bill identification system and method
CN109858453A
Bill auditing method and device
CN111382279A
Negative sample labeling training method and highly automatic bill identification method
CN111626279A
Cited By
Bill risk data analysis method and device based on large model and context information
CN118735687A
Industrial chain risk assessment and early warning system and method based on multi-dimensional data atlas
CN119026919A
Data processing method and system based on financial information bill
CN119249105A
Mobile payment trusted data processing method and system based on block chain
CN119477309A
Electric power business data analysis processing method and system
CN120449066A
