Material shortage prediction methods, cascade classification models, and regression model training methods
By using a cascaded material shortage prediction method, the hierarchical parsing path of the production plan and the bill of materials is dynamically matched, a four-dimensional feature set is constructed, and multi-level cascaded training is adopted. This solves the problems of insufficient data correlation and feature system in the existing material shortage prediction technology, and achieves higher prediction accuracy and precision, supporting precise decision-making in inventory management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HARBIN INST OF TECH
- Filing Date
- 2026-01-23
- Publication Date
- 2026-06-02
AI Technical Summary
Existing material shortage prediction solutions suffer from weak data integration and correlation, insufficient targeting of feature systems, poor adaptability of classification model architecture to data distribution, and low regression prediction accuracy, making it difficult to improve prediction accuracy. In particular, it is difficult to achieve accurate procurement batch and inventory allocation decisions in complex manufacturing scenarios.
By using a cascaded material shortage prediction method, the hierarchical parsing paths of production plans and bill of materials are dynamically matched to construct a four-dimensional feature set. A classification model is built using a multi-level cascaded training method. Combined with routing tables and historical extreme value constraints, a deep correlation and accurate prediction of material demand can be achieved.
It significantly improves the accuracy and precision of material shortage forecasting, better identifies key shortage events and reduces quantity forecasting errors, provides accurate qualitative identification and quantitative assessment, and supports efficient decision-making in inventory management.
Smart Images

Figure CN122132832A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the interdisciplinary technical field of industrial intelligent manufacturing and supply chain management, specifically involving a material shortage prediction method, a cascade classification model, and a regression model training method. Background Technology
[0002] Material shortage forecasting is a core component of supply chain management in manufacturing, and its accuracy directly impacts the efficiency of production planning and operating costs. To overcome the inefficiency and inconsistency of manual judgment, the industry widely adopts data-driven automated forecasting solutions.
[0003] Existing technologies typically integrate production plans, inventory, and historical material shortage data, construct a standard feature set after basic preprocessing, and train a single machine learning model to output a qualitative judgment on whether materials are in short supply.
[0004] However, such solutions have systemic flaws when dealing with complex manufacturing scenarios, making it difficult to improve prediction accuracy. These flaws are mainly reflected in the following aspects: At the data integration level, there is a lack of correlation and traceability: The existing solution only achieves simple data aggregation and fails to dynamically parse the hierarchical relationship between production plans and bill of materials (BOM) tables, resulting in incomplete data links and directly affecting the quality and reliability of the forecasting basis data.
[0005] At the feature engineering level, the feature system lacks specificity: Existing solutions use a general feature set and do not build a specialized feature system that covers the multi-dimensional patterns of material demand, which limits the model's ability to learn complex demand patterns and its generalization performance.
[0006] At the classification model architecture level, it has poor adaptability to the complexity of data distribution: In material shortage classification and prediction, the existing solutions use a single model architecture that is difficult to properly handle the category imbalance and long-tail distribution characteristics in material demand data, resulting in a high rate of missed detection of key material shortage events.
[0007] At the regression prediction level, the prediction error for the quantity of material shortage is relatively large: In scenarios involving quantitative prediction of material shortages, existing solutions lack optimization measures for predicting the quantity of material shortages and have insufficient learning capabilities for abnormal data and quantity range distributions, resulting in large quantity prediction errors. Summary of the Invention
[0008] This application proposes a cascaded material shortage prediction scheme, which aims to overcome the technical bottlenecks of existing technologies caused by weak data integration correlation, insufficient feature system targeting, poor adaptability of classification model architecture to data distribution, and low regression prediction accuracy.
[0009] The first aspect of this application provides a training method for a cascaded material shortage prediction classification model, including: Based on the production plan, the hierarchical parsing path of the bill of materials table is dynamically matched, and production plan data, bill of materials hierarchical structure data, inventory data and historical material shortage data are integrated to form a training data source; A four-dimensional feature set is constructed based on the training data source. The four-dimensional feature set includes multi-order lag features, rolling statistical features, change trend features, and temporal semantic features. Based on the four-dimensional feature set, a cascaded material shortage prediction classification model and corresponding routing table are constructed through a multi-level cascaded training method. This includes: training the first-level model using the full data of the four-dimensional feature set; recording the data features of the correct samples in the classification prediction of this level model to form a mapping relationship; obtaining the samples with incorrect predictions; using the incorrectly predicted samples generated by the previous level model as training data for the next level model; iterating this process until all levels of models are trained; during the training of each level model, recording the data features of the correct samples in the classification prediction of this level model to update the mapping relationship; and generating a routing table based on the finally determined mapping relationship to route the samples to be predicted to the classification model at a specific level.
[0010] In some embodiments of this application, the cascaded material shortage prediction classification model is a cascaded classification model framework containing up to three levels; The framework includes models that, in order, employ the LightGBM framework, the XGBoost framework, and the CatBoost framework. The training process of the model satisfies the following conditions: If the prediction error rate of the current level model on the validation set exceeds the first threshold, then continue training the next level model; The cascaded training process terminates when any of the following conditions are met: Successfully trained to the third-level model within the framework; The prediction error rate of the current level model on the validation set does not exceed the second threshold.
[0011] In some embodiments of this application, the step of dynamically matching the hierarchical resolution path of the bill of materials table according to the production plan includes: Production batches are categorized using both factory identification and date. For each material in a production batch, determine whether it is associated with a work order number; If associated with a work order number, the work order bill of materials table is matched to parse the single-level demand relationship of the materials; If no work order number is associated, the manufacturing bill of materials table is matched to resolve the multi-level structure relationship of the materials.
[0012] In some embodiments of this application, the lag order of the multi-order lag features in the four-dimensional feature set is determined by analyzing the time series autocorrelation of historical material consumption data; and The rolling statistical features are calculated using the sliding window method, wherein the sliding window size is 7 days and the step size is 1 day, and the calculated statistical indicators include one or more of the mean, standard deviation, maximum value and minimum value.
[0013] In some embodiments of this application, the routing table is a sample feature-model level mapping table, which is used to record the correspondence between different data features and the appropriate prediction model level, so that the sample to be predicted can be routed to the most suitable single-level model according to its features during prediction.
[0014] In some embodiments of this application, generating a routing table for prediction based on the finally determined mapping relationship includes: For each level of the model, the set of samples S that are correctly predicted + Performing K-Means clustering yields k cluster centers c1, c2, ..., c k Where k is the preset number of clusters; Based on the principle of minimizing Euclidean distance, set S + Each sample in the sample group is assigned to a corresponding cluster center, forming a sample group partition, wherein the sample group G i The division is defined by the following formula: G i ={x|x∈S + ∧i=argmin j ‖φ(x)-c j ||2} Where φ(x) is the feature vector of sample x, ‖·‖2 represents the Euclidean distance, and G i Represents the i-th sample group; Establish a mapping relationship between each cluster core and its corresponding cascaded model level, thereby forming a sample feature-model level mapping relationship as a routing table.
[0015] In some embodiments of this application, using the prediction error samples generated by the previous-level model as training data for the next-level model includes: Based on the predicted error samples, and by fusing other samples from the original training set, a targeted training set is constructed. The fused samples include the predicted error samples, correctly predicted samples randomly drawn from the original training set, and samples randomly drawn from the original training set, with a ratio of 5:3:2. The next-level model is trained based on the targeted training set.
[0016] A second aspect of this application provides a training method for a material shortage quantity regression prediction model, wherein the regression prediction model is used to predict the quantity of material shortage scenarios identified by the cascaded classification model described in the first aspect of this application, including: Acquire training data, which includes historical bill of materials data, inventory data, and historical shortage data; Based on the historical material shortage data, the extreme range of material shortage quantity for each material is determined, and abnormal data in the training data that exceeds the extreme range is pruned. Divide the cut data into intervals based on the amount of missing material; The regression model is trained using the data after interval division, so that the regression model can learn in a targeted manner for data of different shortage quantity intervals.
[0017] A third aspect of this application provides a material shortage prediction method based on a cascaded model, including: Obtain the production plan data to be predicted; Using the cascaded material shortage prediction classification model and routing table trained by the method described in the first aspect of the present application, the production plan data is classified and predicted to determine whether there is a material shortage, and a first prediction result is obtained. If the first prediction result indicates a material shortage, then the material shortage quantity regression prediction model trained by the method described in the second aspect of the present application is further used to perform a regression prediction of the material shortage quantity on the production plan data to obtain a second prediction result.
[0018] In some embodiments of this application, the classification and prediction of whether the production plan data is in short supply using a cascaded material shortage prediction classification model and a routing table includes: Based on the production plan data, feature vectors consistent with the feature types used in the cascaded material shortage prediction classification model described in the first aspect of this application are extracted; Calculate the matching degree between the feature vector and the multiple cluster centers generated by clustering during the training phase; According to the routing table and based on the matching degree, the feature vector is routed to the corresponding specific level classification model in the cascaded material shortage prediction classification model; The feature vector is processed using a specific level classification model to which the routing is applied, and a binary classification prediction result is outputting whether the material is in short supply.
[0019] In summary, the training methods for the cascaded material shortage prediction classification model, the material shortage quantity regression prediction model, and the material shortage prediction method based on the cascaded model provided in the embodiments of this application, firstly, achieve deep association and integration of multi-source data by dynamically matching the hierarchical parsing paths of the production plan and the bill of materials (BOM) table, thus constructing a complete and traceable high-quality data foundation and fundamentally improving the input conditions for prediction; secondly, by constructing a four-dimensional feature set covering multi-dimensional patterns, the model can deeply learn the inherent patterns of material demand cycles, trends, and business semantics, significantly enhancing the model's representation and generalization capabilities; on this basis, by adopting a multi-level cascaded model architecture and a targeted training strategy based on error samples, the model system can accurately adapt to the class imbalance and long-tail distribution characteristics of material data, thereby significantly improving the ability to capture key material shortage events and the overall prediction accuracy; simultaneously, by introducing a collaborative strategy combining historical extreme value constraint pruning and data binning, the material shortage quantity regression prediction is transformed into a stable classification task, effectively reducing the error in quantity prediction. The deep integration of the above-mentioned technical features constitutes a complete solution from data foundation, feature engineering, model learning to result output, which systematically overcomes the shortcomings of existing technologies and ultimately achieves a substantial leap in the accuracy of material shortage prediction in qualitative identification and quantitative assessment. Attached Figure Description
[0020] The features and advantages of this application will become clearer with reference to the accompanying drawings, which are illustrative and should not be construed as limiting the application in any way. In the drawings: Figure 1 This is a flowchart for predicting traditional material shortages; Figure 2 This is the overall flowchart of the material shortage prediction method based on cascaded machine learning in this application; Figure 3 This is a schematic diagram of the training framework for the cascaded model to which this application applies; Figure 4 This is a flowchart illustrating a training method for a cascaded material shortage prediction classification model according to some embodiments of this application; Figure 5 This is a training method for a material shortage quantity regression prediction model according to some embodiments of this application; Figure 6 This is a material shortage prediction method based on a cascaded model, as shown in some embodiments of this application. Detailed Implementation
[0021] In the following detailed description, numerous specific details of this application are illustrated by example to provide a thorough understanding of the relevant disclosure. However, it will be apparent to those skilled in the art that this application can be practiced without these details. It should be understood that the terms “system,” “apparatus,” “unit,” and / or “module” used in this application are one way of distinguishing different parts, elements, sections, or components at different levels in a sequential arrangement. However, these terms may be replaced with other expressions if other expressions can achieve the same purpose.
[0022] It should be understood that when a device, unit, or module is referred to as being "on," "connected to," or "coupled to" another device, unit, or module, it may be directly connected to or coupled to or communicate with other devices, units, or modules, or there may be intermediate devices, units, or modules present, unless the context explicitly indicates otherwise. For example, the term "and / or" as used herein includes any one and all combinations of one or more of the relevant listed items.
[0023] The terminology used in this application is for the purpose of describing specific embodiments only and is not intended to limit the scope of this application. As shown in the specification and claims of this application, unless the context clearly indicates otherwise, words such as "a," "an," "an," and / or "the" do not specifically refer to the singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate that explicitly identified features, integrals, steps, operations, elements, and / or components are included, and such expressions do not constitute an exclusive list, and other features, integrals, steps, operations, elements, and / or components may also be included.
[0024] Referring to the following description and accompanying drawings, these and other features and characteristics, operating methods, functions of related structural elements, combinations of parts, and economics of manufacture of this application can be better understood, wherein the description and drawings form part of the specification. However, it is clearly understood that the drawings are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. It is understood that the drawings are not drawn to scale.
[0025] Various structural diagrams are used in this application to illustrate various variations of the embodiments according to this application. It should be understood that the preceding or following structures are not intended to limit this application. The scope of protection of this application is determined by the claims.
[0026] As described in the background section, materials management is the core of supply chain operations, and its management efficiency directly determines the stability of the supply chain and the operational benefits of the enterprise. In actual manufacturing production scenarios, material shortages are a frequent pain point in supply chain management. Traditional material shortage prediction models integrate multi-source data such as production plans, inventory, and historical material requirements. After basic preprocessing such as missing value imputation and outlier removal, they construct a set of basic time and statistical features. Then, they are trained using single or basic combined machine learning models, ultimately outputting a qualitative prediction result of "whether there is a material shortage" and directly feeding it back to the procurement or inventory management module to guide stock preparation decisions. A typical process is as follows: Figure 1 As shown.
[0027] However, at the data integration level, the existing solution only achieves basic aggregation of multi-source data and does not design a dynamic parsing and mapping mechanism for the hierarchical relationship between production plans and BOM tables. This results in weak logical connections between data and incomplete material demand chains, which affects the accuracy of the basic forecast data and makes it impossible to trace the cause of shortages. At the forecasting capability level, it adopts a general feature set and a single or basic combination model, without building a specialized feature system covering dimensions such as material demand cycle and change trend. Moreover, the model is not well adapted to the unbalanced categories and long-tail distribution characteristics of material demand data. At the same time, it lacks a forecasting deviation correction and material shortage quantity quantification forecasting mechanism, resulting in limited forecasting accuracy in complex production scenarios and difficulty in supporting accurate procurement batch and inventory allocation decisions.
[0028] To address the aforementioned shortcomings, this application proposes a material shortage prediction method based on cascaded machine learning. The core inventive concept is as follows: First, by dividing production batches using a dual dimension of "factory ID-date" and dynamically matching work order BOMs or manufacturing BOMs to parse material demand levels, a complete and traceable prediction data source is constructed. Second, a four-dimensional feature set encompassing lag characteristics, rolling statistical characteristics, trend characteristics, and temporal semantic characteristics is designed, enabling the model to learn material demand patterns across scenarios. Based on this, a cascaded classification model architecture is used to achieve qualitative prediction of "whether there is a material shortage," and based on the routing table generated during training, the samples to be predicted are routed to the optimal-level model to complete the identification of material shortage events. Subsequently, for samples predicted to be in short supply, a historical extreme value constraint pruning and data binning strategy are independently introduced, and a regression model is used to achieve accurate quantitative prediction of the shortage quantity, thereby reducing prediction errors and providing accurate data support for inventory management. The overall technical process of the material shortage prediction method is as follows: Figure 2 As shown, its cascaded model training framework is as follows: Figure 3 As shown.
[0029] The following implementation method will be based on the above technical solution and will be described in detail in three parts: The first part focuses on the training method of the cascaded material shortage prediction classification model, including the construction of the prediction data source, four-dimensional feature engineering, the training process of the cascaded classification model, and the establishment of the routing table; The second part describes the training method of the material shortage quantity regression prediction model, including the acquisition of training data, the pruning of abnormal data based on historical extreme values, the binning of data according to the shortage quantity range, and the training of the regression model based on the binned data; The third part details the material shortage prediction method based on the cascaded model, covering the routing mechanism of the sample to be predicted, the collaborative prediction process of the cascaded classification model, and the independent regression prediction and optimization of the shortage quantity.
[0030] Figure 4 This is a flowchart illustrating a training method for a cascaded material shortage prediction classification model according to some embodiments of this application. Figure 4 As shown, the method specifically includes the following steps: S410 dynamically matches the hierarchical parsing path of the bill of materials table according to the production plan, and integrates production plan data, bill of materials hierarchical structure data, inventory data and historical material shortage data to form a training data source.
[0031] This application addresses the problems of scattered, poorly correlated, and insufficiently traceable data sources in existing material shortage classification and prediction technologies by proposing the following solution: First, production batches are divided based on the production plan, using both factory and date as dual dimensions. Then, for each material record in the production plan, it is determined whether it is associated with a work order number: if a work order number exists, it is matched against the work order's Bill of Materials (BOM); if no work order number exists, it is matched against the manufacturing BOM, thus achieving dynamic parsing of material requirements. Subsequently, multi-source information, including production plan data, BOM hierarchical structure data, inventory data, and historical shortage data, is integrated. Through data cleaning operations such as missing value imputation and outlier removal, and through association mapping based on work order numbers and material codes, a complete, accurate, and highly traceable training data source is ultimately formed, providing a solid data foundation for the subsequent training of the material shortage classification and prediction model. Specifically: First, based on the production plan, production batches are divided using "Factory ID-Date" as a two-dimensional identifier (e.g., "Factory A-20250101" is considered an independent batch). Then, for each batch's material records, it is determined whether they are associated with a work order number: if a work order number exists (e.g., "WO202501001"), the work order's Bill of Materials (BOM) is matched to parse the single-level demand relationship of the materials; if no work order number is associated, the manufacturing BOM is matched to parse the multi-level structure of the materials.
[0032] Subsequently, the following three core data sources were integrated: 1. Production planning data, including batches, planned production dates, and planned output; 2. BOM hierarchical structure data, including material codes, parent-child relationships, and usage ratios; 3. Inventory data, including real-time inventory quantity, safety stock threshold, and inventory turnover rate.
[0033] After data integration is complete, perform data cleaning and association mapping: Cleaning procedure: Missing values are filled in (missing inventory quantities are filled with the average of the past 3 days, and missing BOM usage is filled with the standard process value), and extreme outliers in inventory quantities and material shortage quantities are removed using the 3σ criterion.
[0034] Association mapping: Using "work order number + material code" as a composite primary key, relationships are established between multi-source data, ultimately generating an integrated dataset containing 12 core fields, including factory ID, material ID, date, work order number, planned output, inventory quantity, and historical shortage quantity. This design ensures that each piece of data can be traced back to its corresponding specific production batch and BOM level.
[0035] S420, construct a four-dimensional feature set based on the training data source. The four-dimensional feature set includes multi-order lag features, rolling statistical features, trend features, and temporal semantic features.
[0036] Based on the integrated dataset constructed using S410, this application utilizes feature engineering to build a four-dimensional feature set designed to comprehensively characterize the features of material shortage classification. This feature set comprehensively portrays material demand patterns from four dimensions: temporal lag, statistical volatility, trend of change, and temporal semantics, to cover different production scenarios. This allows the prediction model to learn common patterns across scenarios, thereby effectively improving its generalization ability in shortage classification tasks. The four dimensions specifically include: Multi-order lag characteristics: The lag order is determined based on the material demand cycle to capture the periodicity and inertia of demand; Rolling statistical characteristics: The sliding window method is used to calculate historical indicators within the window to reflect recent fluctuations and levels of demand; Trend characteristics: Extract the direction and rate of change of the material shortage quantity through differential operation; Time semantic features: Extract date and historical statistical semantic information related to the business cycle.
[0037] In some embodiments of this application, the generation process of specific features in the four-dimensional feature set is as follows: Lag characteristics: This method extracts the historical material shortage quantity at a specific point in time. The multi-order lag characteristic is determined based on the material demand cycle (which can be set manually; in the application scenario of this invention, it is set to 30 days by default). For each (plant, material) combination, this method generates the material shortage quantity lag characteristic for the past 1 to 7 days. Specifically, this involves extracting the historical material shortage quantity lag characteristics for 1 day, 2 days, 3 days, 7 days, and 14 days.
[0038] Rolling statistical characteristics: A sliding window method (window size of 7 days) is used to count the historical maximum and minimum values within the window. In the extended implementation, based on sliding windows of 3 days, 7 days, and 14 days, the mean, standard deviation, maximum, and minimum of the historical material shortage quantity within the window are calculated respectively.
[0039] Trend characteristics: Extract the direction and rate of change in the amount of material shortage using differential operations. Calculate the material shortage trend difference over 3 days, 7 days, and 14 days.
[0040] Time characteristics: Extract date semantic information related to the business cycle. Time semantic features include production schedules, seasonal factors, etc. In specific implementation, extract the day of the week, the date of the current month, the week number of the current year, whether it is a weekend, and whether it is the beginning or end of the month.
[0041] Historical statistical characteristics: Grouped by "Plant ID-Material ID", this feature depicts the long-term material shortage behavior from a global perspective, including the mean, standard deviation, maximum value, and number of data records of historical material shortages.
[0042] By filtering the above features, the feature matrix X for model input is finally formed. At the same time, "whether there is a shortage of materials" is used as a binary classification label to form a label vector y, which together constitute the training samples of the model.
[0043] S430, Based on the four-dimensional feature set, a cascaded material shortage prediction classification model and a corresponding routing table are constructed through a multi-level cascaded training method, including: training the first-level model using the full data of the four-dimensional feature set, recording the data features of the correct samples in the classification prediction of this level model to form a mapping relationship, and obtaining the samples with prediction errors. The prediction error samples generated by the previous level model are used as training data for the next level model. This process is iterated until the training of all levels of models is completed. During the training of each level model, the data features of the correct samples in the classification prediction of this level model are recorded to update the mapping relationship. Based on the finally determined mapping relationship, a routing table is generated to route the samples to be predicted to the classification model of a specific level.
[0044] Based on the four-dimensional feature set constructed using S420, this application adopts a hierarchical and adaptive ladder-style prediction model architecture (i.e., a multi-level cascaded structure). Through a training strategy of "identifying prediction capability domains, constructing residual sample sets, progressive correction, and sample routing," a cascaded material shortage prediction classification model and its corresponding routing table are constructed. The core of this method lies in organizing the model training process into a multi-level (two or more levels) cascaded structure, aiming to allow different levels of models to adaptively learn and adapt to data subsets with different feature distributions, thereby achieving more accurate classification predictions within their preferred feature domains. The first-level model is trained on the full training set, identifies the first prediction capability domain, and constructs an initial mapping table; samples from this domain are removed from the full training set to construct the first residual sample set; subsequent level models are trained based on the residual sample set of the previous level, identify new prediction capability domains, and update the mapping table. Finally, based on this mapping table, the sample to be predicted is routed to the uniquely corresponding best-fitting model for a binary classification prediction of "whether there is a material shortage."
[0045] This application will provide a detailed description of its technical solution through a preferred three-level cascaded embodiment. It should be understood that this specific embodiment (including the three-level cascade setup and the specific model selections for LightGBM, XGBoost, and CatBoost) is merely for illustrating the core principles of this application and is not intended to limit the scope of protection of this application. The core of this application lies in the described multi-level cascaded training process and sample routing mechanism. Any changes or equivalent substitutions made to the number of cascaded levels or the specific model type used in each level, as long as this core mechanism is adopted, should be included within the scope of protection of this application.
[0046] In a preferred embodiment of this application, the cascaded material shortage prediction classification model employs a cascaded model framework containing a maximum of three levels. This framework utilizes three gradient boosting frameworks: LightGBM, XGBoost, and CatBoost. The training process within this framework is as follows: Training data preparation: Considering the temporal characteristics of material shortage data, the training set and validation set are divided according to date. To address the class imbalance problem in the training set, random oversampling is performed on the minority class (shortage samples) to make the sample ratio of the training set closer to 1:1 after oversampling.
[0047] Level 3 model training: Level 1: Lightweight Gradient Boosting Machine (LightGBM) is used to train on the full dataset to learn common features of material demand and obtain the validation set of prediction error samples; Core task: To learn the common patterns of shortages in multiple factories and materials, and to output preliminary prediction results and error samples.
[0048] Model parameters: objective function is binary classification, evaluation metric is AUC, learning rate is 0.05316, feature sampling rate is 0.7284, sample sampling rate is 0.7940, maximum depth is 11, minimum number of subsamples is 7, and number of training epochs is 3000. Training and Prediction: Input the oversampled training set into the model for training, evaluate the performance using the validation set, and output the predicted probability and predicted label of the validation set; Error sample screening: Compare the predicted label with the real label. If the predicted label is consistent with the real label, record the data characteristics of the correctly predicted samples. Extract and summarize the data characteristic patterns from multiple dimensions such as material characteristics (general / specialized), production batch attributes (regular / peak season / holiday), material shortage degree (low / medium / high), and historical data completeness (number of historical records) to form the "Sample Feature-Model Level Mapping Table" (hereinafter referred to as the mapping table). At the same time, filter out the samples with incorrect predictions.
[0049] The second stage involves constructing a targeted training set based on erroneous samples to train the Extreme Gradient Boosting Machine (XGBoost) and correct prediction bias. Construction of the second-level correction training set: Triggering condition: Level 1 prediction error rate exceeds 5% Three types of samples are merged to ensure data representativeness: Level 1 error samples (accounting for 50% of the Level 2 corrected dataset), randomly selected samples from Level 1 correct samples (accounting for 30% of the Level 2 corrected dataset), and randomly selected samples from the original training set (accounting for 20% of the Level 2 corrected dataset); these are then divided into Level 2 corrected training set and Level 2 corrected test set in an 8:2 ratio.
[0050] The objective function is binary logistic regression, the evaluation metric is AUC, the learning rate is 0.05, the maximum depth is 6, the sample sampling rate is 0.8, the feature sampling rate is 0.8, and the number of training epochs is 2000 (using an early stopping strategy with an early stopping threshold of 200 epochs). The class distribution in the training set is corrected through parameter adaptation, calculated as "(total number of corrected training subset samples - number of missing samples) / number of missing samples", to ensure the model's fit to the minority class of missing samples.
[0051] The corrected training subset is input into the XGBoost model for training. After training, the predicted labels are compared with the true labels. If the predicted labels match the true labels, the data features of these correctly predicted samples are recorded, similar to the first stage. If the mapping table conflicts with the first stage, the mapping table from the first stage is used first. In addition, samples with incorrect predictions need to be filtered out.
[0052] The third stage uses a categorical feature boosting machine (CatBoost) to fuse and judge the binary classification prediction results of the first two stages, correct the prediction bias, and finally output a mapping table.
[0053] Triggering condition: Secondary prediction error rate exceeds 5% The construction method for this data level is the same as that for the second level, namely, integrating the three types of samples from the previous level to ensure data representativeness.
[0054] Parameter settings for adapting to category features: objective function is Logloss (logistic regression loss), evaluation metric is AUC, learning rate is 0.05, maximum depth is 8, and training epochs are 2000 (early stopping threshold is 200 epochs). Train the CatBoost model using the dataset described above. After training, perform the same operation as for the secondary prediction, and in case of conflict, use the mapping table of the secondary prediction. It should be noted that the above cascaded training process is a dynamic process that can be terminated early. Its termination conditions follow these rules: Normal termination: The process terminates when the system has successfully completed the training of all three levels (LightGBM, XGBoost, CatBoost) of the model in sequence.
[0055] Early termination: After training any level of the model, if the prediction error rate of the model on the validation set is not higher than a preset threshold (e.g., 5%), it is determined that the model has reached the required accuracy, and the cascade training process will be terminated early at this point, without the need to continue training subsequent levels of the model.
[0056] The design that allows for "early termination" ensures training efficiency.
[0057] Through the three-level training described above, the mapping relationship from sample features to the optimal model level is finally determined. Based on this mapping relationship, a routing table is generated to route samples to be predicted to classification models at specific levels.
[0058] It should be noted that the routing mechanism in this application does not generate a static sample feature table. Its core lies in the following: During the training phase, clustering is used to generate a set of cluster centers for the correctly predicted samples of each model level, and the optimal model level corresponding to each cluster center is recorded, forming a "cluster center-level mapping table"; during the prediction phase, the optimal model level to which the sample to be predicted should be routed is dynamically determined by calculating the distance between the sample to be predicted and each cluster center. Therefore, the "cluster center-level mapping table" is the core carrier for achieving efficient and dynamic routing.
[0059] Cluster core-level mapping table generation This application establishes a routing table through clustering and sample partitioning to achieve accurate routing, specifically including: Clustering: The set of samples S that are correctly predicted at each stage of the cascaded model. + Perform one K-Means clustering operation to obtain a finite number of static cluster centers. Specifically: First, the sample space is divided based on the core business attributes to ensure that subsequent clustering and matching are performed within the homogeneous sample range, avoiding cross-domain samples from interfering with routing accuracy. Specific partitioning rules: Combining the core attributes (factory, material type) in the feature vector, the overall sample is divided into multiple independent sample spaces (e.g., "Factory A - Core Materials", "Factory B - General Materials", etc.); the sample to be predicted must first be assigned to the corresponding sample space, and then subsequent clustering and matching operations are performed within that space.
[0060] Within each partitioned sample space, the set S of correctly predicted samples for each stage of the cascaded model is determined. + Based on its 6-dimensional core feature vector (in this preferred embodiment, the 6-dimensional core feature vector includes factory ID, material type, historical average shortage quantity, inventory turnover rate, shortage quantity with a 1-day lag, and recent shortage trend difference), K-Means clustering is performed with a fixed number of clusters k=3 to obtain the cluster center set C={c1,c2,c3} for each sample space.
[0061] Establishing a mapping relationship: The obtained cluster centers are mapped one-to-one with the levels of the cascaded classification model, forming a cluster center-level mapping table. This cluster center-level mapping table constitutes the routing table used for prediction. Specifically: Calculate S + The Euclidean distance from each sample to the cluster center is used to divide the samples into the nearest clusters in one go, forming a "sample group-cluster" correspondence. The division formula is as follows: G i ={x|x∈S + ∧i=argmin j ‖φ(x)-c j ||2(i=1,2,3), Where φ(x) is the feature vector of sample x (containing core attributes such as factory and materials); G i Let i represent the i-th sample group (i.e., all samples belonging to the i-th cluster), where i is determined by the cluster index that minimizes the Euclidean distance from the sample to the cluster center.
[0062] Figure 5 This application describes a training method for a material shortage quantity regression prediction model, as shown in some embodiments. The regression prediction model is used to predict the quantity of material shortages identified by the cascaded classification model described in s410-s430. Figure 5 As shown, the method includes: S510, acquire training data, which includes historical bill of materials data, inventory data, and historical shortage data.
[0063] S520, based on the historical material shortage data, determine the extreme range of material shortage quantity for each material, and prune abnormal data in the training data that exceed the extreme range.
[0064] S530 divides the cut data into intervals based on the amount of missing material.
[0065] S540, Use the interval-divided data to train a regression model so that the regression model can learn specifically for data in different intervals of material shortage.
[0066] To address the issue of significant prediction errors in material shortage quantities, some embodiments of this application provide a training method for a material shortage quantity regression prediction model. First, multi-source information, including historical Bill of Materials (BOM) data, inventory data, and historical shortage data, is acquired to form initial training data. Based on this, to reduce prediction errors, a historical extreme value constraint pruning and data binning strategy is introduced: the extreme value range of shortage quantities for each material is determined based on the obtained historical shortage data, and abnormal samples exceeding this range in the training data are pruned; then, the pruned data is binned according to shortage quantity intervals. Finally, the binning parameters are optimized through fuzzy model parameter tuning, specifically by determining the optimal bin length (candidate bin lengths increase logarithmically) through a logarithmically increasing grid search. Specialized training is then performed on shortage data for different quantity intervals, thereby improving the prediction accuracy of the regression model (such as LightGBM) and effectively reducing prediction errors.
[0067] During training, the model parameters are: The objective function is L1 loss (MAE), the evaluation metric is MAE, the learning rate is 0.05, the number of leaves is 31, the number of training epochs is 1000 (early stopping threshold is 100 epochs); the feature sampling rate is 0.8, the sample sampling rate is 0.8, the sampling frequency is 5, and log output is turned off. The prediction results during training are constrained to the range of the minimum / maximum material shortage in the material history.
[0068] Figure 6 This is a material shortage prediction method based on a cascaded model, as shown in some embodiments of this application. For example... Figure 6 As shown, the method includes: S610: Obtain production plan data to be predicted.
[0069] S620, using the cascaded material shortage prediction classification model and routing table trained by the methods described in s410-s430, classify and predict whether the production plan data is in short supply, and obtain the first prediction result.
[0070] Specifically, when the production plan data to be predicted (sample x*) enters the system, two preliminary matching steps are performed first: 1. Based on core attributes (factory, material type), assign the samples to be predicted to the corresponding sample space; 2. Extract the 6-dimensional feature vector v (i.e., φ(x*)) that is isomorphic to the training phase.
[0071] Perform cluster matching within the corresponding sample space: Calculate the feature vector φ(x*) and the multiple cluster centers c generated during the training phase. j The Euclidean distance between them is ||φ(x*)-c j ‖2. Find the cluster center c that minimizes the distance, thus completing the mapping from sample to cluster. The mapping formula is: g i =argmin j ‖φ(x*)-c j ‖2(i=1,2,3).
[0072] Read the single model index L of the row record containing c in the cluster core-level mapping table. j The samples to be predicted are routed to the corresponding cascaded model level L. j The level classification model is used to output a binary classification prediction result indicating whether the material is in short supply.
[0073] S630, if the first prediction result indicates a material shortage, then the material shortage quantity regression prediction model trained by the method described in s510-s540 is further used to perform a regression prediction of the material shortage quantity on the production plan data to obtain a second prediction result.
[0074] One embodiment of this application verifies the effectiveness of the material shortage prediction method based on a cascaded machine learning model proposed in this application in improving prediction accuracy on real manufacturing enterprise production data through performance comparison experiments. Specifically, its performance is evaluated in terms of the accuracy of material shortage classification prediction and the average error of material shortage quantity regression prediction.
[0075] Experimental environment Software environment: Python 3.9, machine learning libraries LightGBM 3.3.5, XGBoost 1.7.6, CatBoost 1.2, data processing libraries Pandas 1.5.3, NumPy 1.24.3.
[0076] Experimental data Data source: Actual production and operation data of a manufacturing company from September 2025 to October 2025; Data types: covering production planning data, manufacturing BOM data, real-time inventory data, historical material shortage data, and supplier delivery data; Data partitioning: The data is divided into training and test sets in a 7:3 ratio. Comparison method (baseline method): Classification task baseline: A single LightGBM model is used for binary classification training and prediction based on the same feature set to determine whether there is a shortage of materials.
[0077] Regression task baseline: Use a regression model (such as the LightGBM regressor) that does not introduce historical extreme value constraints for pruning and data binning strategies to predict the amount of material shortage.
[0078] Verification method: Classification task: Prediction is performed using the three-level cascaded classification model (LightGBM, XGBoost, CatBoost) and routing table described in s410-s430.
[0079] Regression task: The regression model described in s510-s540, optimized by historical extreme value pruning and data binning strategies, is used for prediction.
[0080] Experimental results: Comparison of classification prediction accuracy: The prediction accuracy of the single LightGBM model (baseline) is 91.08%.
[0081] The final prediction accuracy of the three-level cascaded strategy in this application reaches 97.62%.
[0082] The accuracy rate improved by 6.54 percentage points.
[0083] Comparison of regression prediction errors: The mean absolute error of the regression model (baseline) before optimization was 184.3213.
[0084] After adopting the optimization strategy of this application, the mean absolute error of the regression model was reduced to 123.9098.
[0085] The prediction error was improved by 32.78%.
[0086] Experimental conclusions In classification forecasting, the cascaded model significantly improves the ability to identify critical material shortage events through step-by-step correction, raising the accuracy to 97.62%. In regression forecasting, the average forecasting error is reduced by 32.78% through the synergistic optimization of historical extreme value constraints and data binning. Experimental results show that the cascaded material shortage forecasting method provided in this application can systematically improve forecasting accuracy, providing a more reliable quantitative basis for inventory and procurement decisions in supply chain management.
[0087] In summary, the training methods for the cascaded material shortage prediction classification model, the material shortage quantity regression prediction model, and the material shortage prediction method based on the cascaded model provided in the embodiments of this application, firstly, achieve deep association and integration of multi-source data by dynamically matching the hierarchical parsing paths of the production plan and the bill of materials (BOM) table, thus constructing a complete and traceable high-quality data foundation and fundamentally improving the input conditions for prediction; secondly, by constructing a four-dimensional feature set covering multi-dimensional patterns, the model can deeply learn the inherent patterns of material demand cycles, trends, and business semantics, significantly enhancing the model's representation and generalization capabilities; on this basis, by adopting a multi-level cascaded model architecture and a targeted training strategy based on error samples, the model system can accurately adapt to the class imbalance and long-tail distribution characteristics of material data, thereby significantly improving the ability to capture key material shortage events and the overall prediction accuracy; simultaneously, by introducing a collaborative strategy combining historical extreme value constraint pruning and data binning, the material shortage quantity regression prediction is transformed into a stable classification task, effectively reducing the error in quantity prediction. The deep integration of the above-mentioned technical features constitutes a complete solution from data foundation, feature engineering, model learning to result output, which systematically overcomes the shortcomings of existing technologies and ultimately achieves a substantial leap in the accuracy of material shortage prediction in qualitative identification and quantitative assessment.
[0088] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the devices and modules described above can be referred to the corresponding descriptions in the foregoing device embodiments, and will not be repeated here.
[0089] Although the subject matter described herein is provided in the general context of execution on a computer system in conjunction with an operating system and applications, those skilled in the art will recognize that other implementations can also be executed in conjunction with other types of program modules. Generally, program modules include routines, programs, components, data structures, and other types of structures that perform specific tasks or implement specific abstract data types. Those skilled in the art will understand that the subject matter described herein can be practiced using other computer system configurations, including handheld devices, multiprocessor systems, microprocessor-based or programmable consumer electronics, minicomputers, mainframes, etc., and can also be used in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules may reside on both local and remote memory storage devices.
[0090] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0091] It should be understood that the specific embodiments described above are merely illustrative or explanatory of the principles of this application and do not constitute a limitation thereof. Therefore, any modifications, equivalent substitutions, improvements, etc., made without departing from the spirit and scope of this application should be included within the protection scope of this application. Furthermore, the appended claims are intended to cover all variations and modifications falling within the scope and boundaries of the appended claims, or equivalent forms of such scope and boundaries.
Claims
1. A training method for a cascaded material shortage prediction classification model, characterized in that, include: Based on the production plan, the hierarchical parsing path of the bill of materials table is dynamically matched, and production plan data, bill of materials hierarchical structure data, inventory data and historical material shortage data are integrated to form a training data source; A four-dimensional feature set is constructed based on the training data source. The four-dimensional feature set includes multi-order lag features, rolling statistical features, change trend features, and temporal semantic features. Based on the four-dimensional feature set, a cascaded material shortage prediction classification model and corresponding routing table are constructed through a multi-level cascaded training method. This includes: training the first-level model using the full data of the four-dimensional feature set; recording the data features of the correct samples in the classification prediction of this level model to form a mapping relationship; obtaining the samples with incorrect predictions; using the incorrectly predicted samples generated by the previous level model as training data for the next level model; iterating this process until all levels of models are trained; during the training of each level model, recording the data features of the correct samples in the classification prediction of this level model to update the mapping relationship; and generating a routing table based on the finally determined mapping relationship to route the samples to be predicted to the classification model at a specific level.
2. The method according to claim 1, characterized in that: The cascaded material shortage prediction classification model is a cascaded classification model framework that contains up to three levels. The framework includes models that, in order, employ the LightGBM framework, the XGBoost framework, and the CatBoost framework. The training process of the model satisfies the following conditions: If the prediction error rate of the current level model on the validation set exceeds the first threshold, then continue training the next level model; The cascaded training process terminates when any of the following conditions are met: Successfully trained to the third-level model within the framework; The prediction error rate of the current level model on the validation set does not exceed the second threshold.
3. The method according to claim 1, characterized in that, The hierarchical parsing path for dynamically matching the bill of materials table according to the production plan includes: Production batches are categorized using both factory identification and date. For each material in a production batch, determine whether it is associated with a work order number; If associated with a work order number, the work order bill of materials table is matched to parse the single-level demand relationship of the materials; If no work order number is associated, the manufacturing bill of materials table is matched to resolve the multi-level structure relationship of the materials.
4. The method according to claim 1, characterized in that: The lag order of the multi-order lag features in the four-dimensional feature set is determined by analyzing the time series autocorrelation of historical material consumption data; and The rolling statistical features are calculated using the sliding window method, wherein the sliding window size is 7 days and the step size is 1 day, and the calculated statistical indicators include one or more of the mean, standard deviation, maximum value and minimum value.
5. The method according to claim 1, characterized in that: The routing table is a sample feature-model level mapping table, used to record the correspondence between different data features and the appropriate prediction model level, so that the sample to be predicted can be routed to the most suitable single-level model according to its features during prediction.
6. The method according to claim 1, characterized in that, The process of generating a routing table for prediction based on the finalized mapping relationship includes: For each level of the model, the set of samples S that are correctly predicted + Performing K-Means clustering yields k cluster centers c1, c2, ..., c k Where k is the preset number of clusters; Based on the principle of minimizing Euclidean distance, set S + Each sample in the sample group is assigned to a corresponding cluster center, forming a sample group partition, wherein the sample group G i The division is defined by the following formula: G i ={x|x∈S + ∧i=argmin j ‖φ(x)-c j ‖2} Where φ(x) is the feature vector of sample x, ‖·‖2 represents the Euclidean distance, and G i Represents the i-th sample group; Establish a mapping relationship between each cluster core and its corresponding cascaded model level, thereby forming a sample feature-model level mapping relationship as a routing table.
7. The method according to claim 1, characterized in that, The step of using the prediction error samples generated by the previous stage model as training data for the next stage model includes: Based on the predicted error samples, and by fusing other samples from the original training set, a targeted training set is constructed. The fused samples include the predicted error samples, correctly predicted samples randomly drawn from the original training set, and samples randomly drawn from the original training set, with a ratio of 5:3:
2. The next-level model is trained based on the targeted training set.
8. A training method for a material shortage quantity regression prediction model, wherein the regression prediction model is used to predict the quantity of material shortage scenarios identified by the cascaded classification model of claim 1, characterized in that, include: Acquire training data, which includes historical bill of materials data, inventory data, and historical shortage data; Based on the historical material shortage data, the extreme range of material shortage quantity for each material is determined, and abnormal data in the training data that exceeds the extreme range is pruned. Divide the cut data into intervals based on the amount of missing material; The regression model is trained using the data after interval division, so that the regression model can learn in a targeted manner for data of different shortage quantity intervals.
9. A material shortage prediction method based on a cascaded model, characterized in that, include: Obtain the production plan data to be predicted; Using the cascaded material shortage prediction classification model and routing table trained by the method described in claim 1, the production plan data is classified and predicted to determine whether there is a material shortage, and a first prediction result is obtained. If the first prediction result indicates a material shortage, then the material shortage quantity regression prediction model trained by the method described in claim 8 is further used to perform a regression prediction of the material shortage quantity on the production plan data to obtain a second prediction result.
10. The method according to claim 9, characterized in that, Using a cascaded material shortage prediction classification model and routing table, the production plan data is classified and predicted to indicate whether there is a material shortage, including: Based on the production plan data, extract feature vectors that are consistent with the feature types used when training the cascaded material shortage prediction classification model of claim 1; Calculate the matching degree between the feature vector and the multiple cluster centers generated by clustering during the training phase; According to the routing table and based on the matching degree, the feature vector is routed to the corresponding specific level classification model in the cascaded material shortage prediction classification model; The feature vector is processed using a specific level classification model to which the routing is applied, and a binary classification prediction result is outputting whether the material is in short supply.