Injection molding process fault diagnosis model training method and system based on large language model and fault diagnosis method
The injection molding process fault diagnosis model constructed through large language models and specific optimization strategies solves the problems of high diagnostic accuracy and cost in the existing technology, and realizes efficient and low-cost intelligent injection molding process fault diagnosis.
Patent Information
- Application Number
- CN202510478472.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-08-01
AI Technical Summary
The existing injection molding process fault diagnosis methods have decreased diagnostic accuracy in the absence of noise data and data, rely on field experts' experience, high maintenance and use costs, and high calculation overhead.
The injection molding process fault diagnosis method based on large language models is adopted, and textual data processing, quantitative configuration and layered freezing strategies are combined with low-rank adaptation, and only the key parameters of the high-level Transformer module are fine-tuned and optimized to build an efficient and intelligent fault diagnosis model.
It significantly reduces the computing resource requirements for diagnostic model training and deployment, reduces the cost of on-site deployment, avoids frequent manual intervention and model retraining, and realizes efficient and low-cost intelligent diagnosis.
Smart Images

Figure CN120408032A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of industrial intelligent diagnosis, and more specifically, relates to a method and system for training an injection molding process fault diagnosis model based on a large language model, as well as a fault diagnosis method. Background Art
[0002] The injection molding process is a technology widely used in modern manufacturing, mainly for producing various plastic parts. This process includes multiple key steps, such as heating and plasticizing, injection, holding pressure, cooling, and demolding. Since the injection molding process involves the fine combination of various process parameters (such as injection pressure, mold temperature, cooling time, injection speed, etc.), these parameters must be precisely controlled. Otherwise, it may lead to product defects, such as warping, bubbles, sink marks, and burns. These defects not only affect the quality of the product but may also cause other problems, such as increasing production costs and extending the manufacturing cycle. For example, in the automotive manufacturing industry, the injection molding process is commonly used to produce large plastic parts such as instrument panels and bumpers. The quality of these parts not only directly affects the overall appearance of the vehicle but may also have an impact on the structural strength. If the injection pressure is set improperly, it may lead to insufficient filling inside the part, resulting in problems such as bubbles and internal voids. In the consumer electronics field, such as the production of mobile phone casings or laptop computer bodies, minor adjustments to the injection molding process parameters will also significantly affect the appearance and durability of the product. For example, too short cooling time may cause obvious flow marks on the surface, while too long cooling time may lead to reduced production efficiency. In addition, the medical industry also has strict requirements for the injection molding process, such as the production of medical devices such as disposable syringes and infusion connectors. These products must meet strict dimensional accuracy and hygiene standards. If the mold temperature is not controlled properly, it may cause the product to warp or generate uncontrollable internal stresses, thereby affecting the performance and safety of the product. Therefore, the precise control of the injection molding process is crucial in various application fields.
[0003] Existing methods mainly include diagnostic solutions based on artificial rules and traditional machine learning, but these solutions usually perform poorly in the presence of noisy data and data missing, and the diagnostic accuracy drops significantly. In addition, traditional methods rely heavily on the experience of domain experts, requiring manual updating of the rule base or re-extraction of features continuously, resulting in high diagnostic costs. Especially when the equipment is replaced or the working conditions change, it is difficult for the model to achieve rapid and efficient adaptive learning, further increasing the maintenance and use costs. Therefore, there is an urgent need to propose a new type of efficient and intelligent injection molding process fault diagnosis technology.
[0004] The invention patent with the publication number CN116796827A in the prior art proposes a method and system for lightweighting the edge - end fault diagnosis model of distributed wind turbines. A teacher network is used to perform knowledge distillation in each iteration cycle to generate distilled knowledge; a student network is used to update the sparse pruning algorithm based on the distilled knowledge in each iteration cycle, prune the edge - end fault diagnosis model of distributed wind turbines, and generate the teacher network for the next iteration cycle; a dean network is used to calculate the distillability and sparsity of the student network, adjust the intensity of knowledge distillation according to the distillability, and adjust the sparse pruning algorithm according to the sparsity. This method has a complex training and iteration process and a large computational overhead. Summary of the Invention
[0005] In order to overcome the problems of high maintenance and use costs and large computational overhead of intelligent diagnosis methods in the prior art, the present invention provides a method for training an injection molding process fault diagnosis model based on a large - language model, a system, and a fault diagnosis method.
[0006] The primary object of the present invention is to solve the above - mentioned technical problems, and the technical solution of the present invention is as follows:
[0007] The first aspect of the present invention provides a method for training an injection molding process fault diagnosis model based on a large - language model, including the following steps:
[0008] Collect the injection molding machine process parameters when a fault occurs, clean the injection molding machine process parameters to obtain a cleaned data set;
[0009] Perform natural - language conversion on the data in the data set to obtain a text description containing fault semantics; combine the text description with its corresponding fault label to construct a text - based data set for the injection molding fault diagnosis task, and divide it into a training set and a validation set according to a preset ratio.
[0010] Utilize the sample dimension of the text - based data set and the number of predicted target fault labels, and in combination with the parameter structure of the pre - trained large - language model, configure a diagnostic model structure with fine - tuning ability using a quantization method.
[0011] Start training. Input the text - based data training set into the diagnostic model to extract semantic features and output intermediate feature representations. Perform feature transformation processing on the intermediate feature representations to obtain high - order feature vectors for fault prediction.
[0012] Input the high - order feature vectors into the classification head to output the predicted probability distribution of the fault type. Use the loss function between the predicted probability distribution and the true label to perform backpropagation and gradient optimization on the model parameters, and use low - rank adaptation combined with a hierarchical freezing strategy to fine - tune the model parameters. Repeat the above training steps until the performance index on the validation set reaches a preset threshold, and output the final diagnostic model.
[0013] Further, the process parameters obtained during a failure include at least one or more of the following: melt temperature, mold temperature, peak injection pressure, peak back pressure, injection time, filling time, holding pressure time, cycle time, peak clamping force, screw position, injection volume, barrel temperature, injection speed, mold closing force, and peak torque. The detected failures include: bubbles, short shots, surface defects, warping, shrinkage, burns, flash, surface spots, color difference, and mucosal adhesion.
[0014] Further, the method for collecting the process parameters of the injection molding machine during a failure is to collect them using a PLC or SCADA system.
[0015] Further, the cleaning process includes at least one or more of the following: missing value processing, outlier processing, and duplicate data processing;
[0016] The method for filling missing values is as follows: for a small number of missing values, fill them with the mean, median, or mode; for parameters with a large number of missing values, delete the column or row of data; if missing values are inevitable in some cases, perform interpolation filling using the historical mean or median of each process parameter.
[0017] The method for processing outliers is as follows: use box plots or the standard deviation method to detect outliers, identify data points that deviate significantly from the normal range, and delete the outliers or fill them with the mean or median.
[0018] The method for processing duplicate data is as follows: use sample hash value matching to identify and delete duplicate samples.
[0019] Further, the pre-trained large language model selects the open-source pre-trained large language model LLaMA 3.2 or chatglm4 as the base model.
[0020] Further, the quantization method is the 4-bit normal floating-point quantization method. The method for configuring the diagnostic model using the quantization method includes the following steps:
[0021] Before loading the model, set the 4-bit normal floating-point quantization related parameters through a configuration file or code parameters;
[0022] Use the model loading tool, combined with the configuration, to load the pre-trained model and convert the model weights from the original precision to 4-bit integer representation using 4-bit normal floating-point quantization.
[0023] Further, the method for fine-tuning the model parameters using low-rank adaptation combined with a hierarchical freezing strategy is as follows:
[0024] During the configuration process of the diagnostic model structure, the parameters of the underlying Transformer module of the large language model are frozen using a hierarchical freezing strategy, the parameters of the high-level Transformer module of the model are unfrozen, and the low-rank adaptation method is further applied to the Query and Value matrices of the unfrozen high-level Transformer module. The original weight matrix W is structurally reconstructed using low-rank matrices A and B to obtain the reconstructed weight matrix W′. The reconstruction expression is as follows:
[0025] W′ = W + BA
[0026] During the training process, only the low-rank matrix parameters A, B and the classification head parameters in the high-level Transformer module are optimized.
[0027] Furthermore, to adapt to fault diagnosis under more working conditions, before training the model, multiple text-based datasets from different working conditions are fused, and the model is trained using the transfer learning method, which specifically includes the following steps:
[0028] Using a general natural language prompt template that includes working condition information, injection molding process parameter feature descriptions, and fault type labels, the injection molding process parameters from different working conditions are uniformly texturized to obtain a multi-condition texturized dataset;
[0029] The multi-condition texturized dataset is balanced to obtain a source domain dataset and a target domain dataset with balanced working condition distributions;
[0030] Using the sample dimension of the multi-condition texturized dataset and the number of target fault categories, combined with the parameter structure of the pre-trained large language model, a diagnostic model structure with an adaptation layer is constructed using the quantization method;
[0031] Start training. Input the source domain dataset into the diagnostic model structure, output and extract the high-order semantic features of the source domain data; input the target domain dataset into the diagnostic model structure in the same way, output the high-order semantic features of the target domain data, and share the high-order semantic features of the source domain data and the high-order semantic features of the target domain data to obtain a semantic feature representation that fuses multi-condition knowledge;
[0032] Using the original parameters of the pre-trained basic model, combined with the parameters obtained after training with the source domain data, determine the initial values of the target model parameters;
[0033] Input the semantic feature representation that fuses multi - working - condition knowledge into the adaptation layer and classification head, output the predicted probability distribution of the fault type, and perform backpropagation and gradient optimization on the model parameters according to the loss function between the predicted probability distribution and the true label. Use low - rank adaptation combined with the hierarchical freezing strategy to fine - tune the parameters of the adaptation layer and classification head. Repeat the above training process until the performance index of the validation set of the target - domain data reaches the preset threshold, and output an injection - molding process fault diagnosis model with cross - working - condition generalization ability.
[0034] The second aspect of the present invention provides an injection - molding process fault diagnosis model training system based on a large - language model, including a memory and a processor. The memory includes a program for the injection - molding process fault diagnosis model training method based on a large - language model. When the program for the injection - molding process fault diagnosis model training method based on a large - language model is executed by the processor, it realizes the steps of an injection - molding process fault diagnosis model training method based on a large - language model.
[0035] The third aspect of the present invention provides an injection - molding process fault diagnosis method based on a large - language model. Use an injection - molding process fault diagnosis model training method based on a large - language model to train a fault diagnosis model, and use the trained fault diagnosis model to diagnose process faults to obtain a fault diagnosis result.
[0036] Compared with the prior art, the beneficial effects of the technical solution of the present invention are as follows:
[0037] Through text - based data processing and quantization configuration technology, the present invention significantly reduces the computing resource requirements for the training and deployment of the diagnosis model, and remarkably reduces the on - site deployment cost. At the same time, by combining the hierarchical freezing strategy with low - rank adaptation measurement (LoRA), only the key parameters of the high - level Transformer module are fine - tuned and optimized, avoiding the defects of the traditional method that requires frequent manual intervention to update the rule base or retrain the model, and effectively reducing the model maintenance and usage costs. Thus, the present invention effectively overcomes the deficiencies of the prior art, is applicable to the high - efficiency, low - cost, and intelligent diagnosis requirements of industrial sites, and has obvious economic and social benefits. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] To make the objectives and technical solutions of the present invention clearer, the present invention provides the following drawings and explanations:
[0039] Figure 1 It is the flowchart of the method provided by the embodiment of the present invention;
[0040] Figure 2 It is the structure diagram of the large - language model provided by the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0041] To more clearly understand the above objects, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, without conflict, the embodiments of the present application and the features in the embodiments can be combined with each other.
[0042] In the following description, many specific details are set forth in order to fully understand the present invention. However, the present invention can also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited by the specific embodiments disclosed below.
[0043] Embodiment 1:
[0044] The present invention provides a method for training an injection molding process fault diagnosis model based on a large language model, as Figure 1 shown in a flowchart of a method for training an injection molding process fault diagnosis model based on a large language model. The specific steps are as follows:
[0045] S1: Collect the injection molding machine process parameters when a fault occurs, and clean the injection molding machine process parameters to obtain a cleaned data set.
[0046] More specifically, the process parameters obtained when a fault occurs include at least one or more of the following: melt temperature, mold temperature, peak injection pressure, peak back pressure, injection time, filling time, holding pressure time, cycle time, peak clamping force, screw position, injection volume, barrel temperature, injection speed, mold closing force, and peak torque. Their units and specific descriptions are shown in Table 1 below. The detected defect faults include: bubbles, short shots, surface defects, warping, shrinkage, burns, flash, surface spots, color difference, sticking, and their specific descriptions are shown in Table 2 below.
[0047] Table 1 3C%
[0048]
[0049] Table 2
[0050]
[0051]
[0052] The method for collecting the injection molding machine process parameters when a fault occurs is to collect using a PLC or SCADA system.
[0053] The cleaning process includes at least one or more of the following: missing value processing, outlier processing, and duplicate data processing. The purpose of data cleaning is to ensure data quality and improve the accuracy of subsequent analysis.
[0054] The missing value filling method is as follows: for a small number of missing values, use the mean, median or mode to fill; for parameters with a large number of missing values, delete the column or row data; if missing values are unavoidable in some cases, use the historical mean or median of each process parameter for interpolation filling;
[0055] The outlier processing method is: using a box plot or standard deviation method to detect outliers, identifying data points that are significantly deviated from the normal range, deleting outliers or filling them with mean or median;
[0056] The duplicate data processing method is: using sample hash value matching to identify and delete duplicate samples.
[0057] After data cleaning, the processed data is saved as a CSV file. Each column represents a feature (such as melt temperature, injection pressure, fault type, etc.). Each row represents a sample, including all process parameters and corresponding fault types for that sample.
[0058] S2: Perform natural language conversion on the data in the dataset to obtain a textual description containing the fault semantics. For example, during this injection molding process, the melt temperature was 280°C, the mold temperature was 80°C, the injection pressure peak was 120 bar, and the detected fault type was a bubble. This textual description is combined with its corresponding fault label to construct a textual dataset for the injection molding fault diagnosis task. This dataset is then divided into a training set and a validation set according to a preset ratio (in this example, the ratio is 9:1).
[0059] S3: Using the sample dimensions of the textual dataset and the number of predicted target fault labels, combined with the parameter structure of the pre-trained large language model, a diagnostic model with fine-tuning capabilities is configured using a quantization method. The preferred model structure is as follows: Figure 2 As shown in the figure, it consists of a basic model, a feature conversion module, a multi-head attention mechanism module and a classification head in series, and the input-output relationship between each module is clear.
[0060] The base model encodes the input text description and extracts high-level semantic features. The pre-trained DeepSeek-R1-Distill-Llama-8B model is preferred. This model contains a 32-layer Transformer encoder. During training, the first 26 layers of the Transformer encoder are frozen, and only the last 6 layers are fine-tuned. The base model takes the text description as input and outputs a high-level semantic feature vector.
[0061] The feature transformation module is connected after the base model and is used to perform dimensional transformation and feature fusion on the high-level semantic features to better adapt to subsequent classification tasks. The specific structure of this module includes a linear layer, a Layer Normalization (LayerNorm) layer, a GELU activation function, and a Dropout layer. Taking the high-level semantic feature vector output by the base model as input, it outputs the transformed feature vector.
[0062] The multi-head attention mechanism module is used to weight the transformed feature vector to highlight the important feature information for the fault diagnosis task. Taking the output of the feature transformation module as input, it outputs the weighted feature vector after the calculation of the multi-head self-attention mechanism.
[0063] The classifier is the final output module and is used to map the weighted feature vector to specific fault category labels. The classifier is preferably a linear mapping layer, and its output dimension is the number of fault categories. Taking the output features of the multi-head attention mechanism module as input, it outputs the probability distribution of the fault categories.
[0064] The serial relationship of the above modules is specifically as follows: The base model receives the text description as input and outputs the high-level semantic feature vector; the high-level semantic feature vector is input into the feature transformation module to output the transformed feature vector; then the transformed feature vector is input into the multi-head attention mechanism module to output the weighted feature vector; finally, the weighted feature vector is input into the classifier to output the probability distribution of the fault categories, completing the prediction of the injection molding process fault types.
[0065] More specifically, the pre-trained large language model selects the open-source pre-trained large language model LLaMA 3.2 or chatglm4 as the base model.
[0066] The quantization method is the 4-bit normal floating-point quantization method. The method of configuring the diagnostic model using the quantization method includes the following steps:
[0067] Before loading the model, set the 4-bit normal floating-point quantization related parameters through the configuration file or code parameters, including the quantization algorithm, whether to use double quantization, and the quantization range, and select according to the specific task and model characteristics;
[0068] Using the model loading tool, combined with the configuration, load the pre-trained model and use 4-bit normal floating-point quantization to convert the model weights from the original precision (such as 16-bit or 32-bit) to 4-bit integer representation to reduce the video memory and computing resources occupied during the model operation.
[0069] S4: Start training. Input the text-based data training set into the diagnostic model to extract semantic features, output intermediate feature representations, and perform feature transformation processing on the intermediate feature representations to obtain high-order feature vectors for fault prediction.
[0070] S5: Input the high-order feature vectors into the classification head, use the Softmax function to output the probability distribution of fault types, perform backpropagation and gradient optimization on the model parameters using the cross-entropy loss function between the predicted probability distribution and the true labels, and fine-tune the model parameters using low-rank adaptation (LoRA) combined with a hierarchical freezing strategy. Repeat the above training steps until the performance metrics on the validation set reach the preset threshold, and output the final diagnostic model.
[0071] In this embodiment, after the model is prepared, set the optimizer (AdamW), specify learning rates (such as 1e-4 and 1e-5) for the classification head and the base model respectively, and apply weight decay to prevent overfitting. At the same time, adopt a cosine annealing learning rate scheduler and set 10% warm-up steps to smooth the transition of the learning rate. Set an early stopping mechanism to terminate training early when the validation set accuracy no longer improves in several consecutive iterations. During the training process, print the training progress every 10 steps, calculate and record the performance metrics of the training set and the validation set after each iteration, and save the model state with the best performance. All training information and metrics are recorded in the specified log file to ensure the traceability of the training process and the reliability of the results.
[0072] More specifically, the method of fine-tuning the model parameters using low-rank adaptation combined with a hierarchical freezing strategy is as follows:
[0073] During the configuration process of the diagnostic model structure, use the hierarchical freezing strategy to freeze the parameters of the underlying Transformer modules of the large language model. These low-level modules are mainly responsible for extracting basic semantic and syntactic features and already have good generality in the pre-training stage. Freezing them can enable the model to focus on the adaptation adjustment of high-level modules to specific tasks during the fine-tuning process. By setting the requires_grad attribute of the corresponding layer parameters in the model to False, ensure that these parameters will not be updated during subsequent training.
[0074] Unfreeze the parameters of the high-level Transformer modules (such as the LayerNorm layer) of the model, and further apply the low-rank adaptation (LoRA) method to the Query and Value matrices of the unfrozen high-level Transformer modules. Use low-rank matrices A and B to perform structured reconstruction on the original weight matrix W to obtain the reconstructed weight matrix W′. The reconstruction expression is as follows:
[0075] W′ = W + BA
[0076] During the training process, while maintaining the original pre-trained weights, the model adapts to specific tasks by learning low-rank parameters, and only optimizes the low-rank matrix parameters A, B and the classification head parameters in the high-level Transformer module to reduce the computational resource consumption and parameter update amount during training.
[0077] For the small sample problem under cross-conditions, the text generation ability of the large language model can be utilized, combined with the existing fault samples and their corresponding process parameter information, to generate synthetic fault scenario data with semantic consistency and task relevance. To enhance the diversity and generalization ability of the synthetic data, the generated samples can be further perturbed, including: introducing random noise in the eigenvalues to simulate the errors in the actual measurement process; performing transformations such as scaling and translation on the eigenvalues to simulate the parameter fluctuations under different working conditions, so as to construct a more representative small sample training set and improve the robustness and adaptability of the model in the cross-condition environment.
[0078] To adapt to fault diagnosis under more working conditions, before training the model, multiple text-based data sets from different working conditions are fused, and the model is trained using transfer learning methods, specifically including the following steps:
[0079] Using a general natural language prompt template containing working condition information, injection molding process parameter feature descriptions and fault type labels, the injection molding process parameters from different working conditions are uniformly texturized to obtain a multi-condition texturized data set;
[0080] Specifically, various formats of prompt templates can be designed, such as fill-in-the-blank, multiple-choice, and judgment, to adapt to different fault diagnosis scenarios. For example:
[0081] Fill-in-the-blank: "During the injection molding process, if the temperature is XX °C, the pressure is XX MPa, and the speed is XX, the possible fault is ______."
[0082] Multiple-choice: "When the temperature is XX °C and the pressure is XX MPa, the most likely fault type is: A. Fault 1 B. Fault 2 C. Fault 3."
[0083] Judgment: "Under the condition that the temperature is XX °C and the pressure is XX MPa, is it possible to have Fault 1?"
[0084] During the active learning process, for samples without corresponding fault annotations, the model can be used to generate possible annotation suggestions to assist manual annotation, improving the annotation efficiency and data utilization rate. For example, the large language model can generate possible fault type suggestions based on the characteristics of the samples, and the annotators can refer to these suggestions for annotation, reducing the annotation workload.
[0085] Balance the multi - working - condition text - based dataset to obtain a source - domain dataset and a target - domain dataset with balanced working - condition distributions;
[0086] Using the sample dimension of the multi - working - condition text - based dataset and the number of target fault categories, combined with the parameter structure of the pre - trained large - language model, construct a diagnostic model structure with an adaptation layer using a quantization method;
[0087] Start training. Input the source - domain dataset into the diagnostic model structure, output and extract the high - order semantic features of the source - domain data; input the target - domain dataset into the diagnostic model structure in the same way, output the high - order semantic features of the target - domain data, and share the high - order semantic features of the source - domain data and the target - domain data to obtain a semantic feature representation integrating multi - working - condition knowledge;
[0088] Using the original parameters of the pre - trained base model and the parameters obtained after training with the source - domain data, determine the initial values of the target model parameters;
[0089] Input the semantic feature representation integrating multi - working - condition knowledge into the adaptation layer and the classification head, output the predicted probability distribution of the fault type, and perform backpropagation and gradient optimization on the model parameters according to the (cross - entropy) loss function between the predicted probability distribution and the true label. Use low - rank adaptation combined with a hierarchical freezing strategy to fine - tune the parameters of the adaptation layer and the classification head. Repeat the above training process until the performance metric of the validation set of the target - domain data reaches the preset threshold, and output an injection - molding process fault diagnosis model with cross - working - condition generalization ability.
[0090] The following factors are mainly considered when adding an adaptation layer during the transfer learning process:
[0091] Domain feature differences: The base model is usually pre - trained on a general large - scale dataset, and the features it extracts are general - domain knowledge. However, the target task (such as injection - molding fault diagnosis) may have specific - domain features. The adaptation layer can effectively adjust the feature expression so that the model can more accurately match the feature distribution of the target task.
[0092] Reduce training overhead: By adding a lightweight adaptation layer, only a small number of parameters need to be fine - tuned to effectively transfer the knowledge of the general model, avoiding retraining a large number of parameters of the base model and reducing the computational resource requirements and training costs.
[0093] Alleviate the catastrophic forgetting problem: The adaptation layer can adaptively learn domain - specific information on the premise of freezing most of the parameters of the base model, effectively preventing the original knowledge of the base model from being damaged due to excessive fine - tuning and ensuring the generalization ability of the model.
[0094] Improving model generalization: The adaptation layer structure is simple and flexible (such as fully connected layers, lightweight Transformers, etc.), which can quickly adapt to changes in multiple working conditions and devices, enhance the model's fast generalization ability for new environments and new tasks, and reduce the difficulty of cross-working condition migration.
[0095] Therefore, adding an adaptation layer is an effective strategy in transfer learning, which can economically and efficiently achieve the comprehensive improvement of knowledge transfer, feature adaptation, and model generalization performance.
[0096] The present invention significantly reduces the computational resource requirements for the training and deployment of diagnostic models through text data processing and quantization configuration technology, and remarkably reduces the on-site deployment cost. At the same time, by combining the hierarchical freezing strategy with low-rank adaptation measurement (LoRA), only the key parameters of the high-level Transformer module are fine-tuned and optimized, avoiding the defects of traditional methods that require frequent manual intervention to update the rule base or retrain the model, and effectively reducing the model maintenance and usage costs. Thus, the present invention effectively overcomes the deficiencies of the prior art, is applicable to the high-efficiency, low-cost, and intelligent diagnostic requirements of industrial sites, and has obvious economic and social benefits.
[0097] Embodiment 2:
[0098] This embodiment provides a training system for an injection molding process fault diagnosis model based on a large language model, including a memory and a processor. The memory includes a program for the training method of the injection molding process fault diagnosis model based on the large language model. When the program for the training method of the injection molding process fault diagnosis model based on the large language model is executed by the processor, it implements the steps of a training method for an injection molding process fault diagnosis model based on the large language model as described in Embodiment 1.
[0099] Embodiment 3:
[0100] This embodiment provides an injection molding process fault diagnosis method based on a large language model. The fault diagnosis model is trained using the training method for an injection molding process fault diagnosis model based on the large language model described in Embodiment 1, and the trained fault diagnosis model is used to diagnose process faults, and the fault diagnosis results.
[0101] The following Table 3 shows the results of various performance indicators after ten rounds of training on 1000 sample data in the injection molding field.
[0102] Table 3
[0103] Round Accuracy Precision Recall F1 Score 1 0.6976 0.5664 0.6976 0.6106 2 0.7526 0.8237 0.7526 0.7272 3 0.8935 0.8947 0.8935 0.8929 4 0.9003 0.9016 0.9003 0.8998 5 0.9072 0.908 0.9072 0.9068 6 0.9141 0.9151 0.9141 0.9139 7 0.9141 0.9152 0.9141 0.9137 8 0.9175 0.9185 0.9175 0.9173 9 0.9211 0.9213 0.9209 0.9207 10 0.9231 0.9215 0.9211 0.9221
[0104] It can be seen from the table that the various performance indicators show a stable and continuously optimized trend, indicating that the present invention has significant practicality and technical effectiveness, which are specifically manifested in the following aspects:
[0105] The accuracy rate has been significantly improved: gradually increasing from 0.6976 in the first round to 0.9231 in the tenth round, indicating that the model's ability to judge the overall samples is continuously enhancing, with good convergence and stability.
[0106] The precision and recall rate have increased evenly: the precision rate has increased from the initial 0.5664 to 0.9215, and the recall rate has increased from 0.6976 to 0.9211. The two finally tend to be consistent, indicating that the model can not only correctly identify faulty samples (high precision rate), but also has a strong ability to suppress missed detections (high recall rate), avoiding the problem of imbalance between false positives and false negatives.
[0107] The F1 value has been continuously improved and tends to saturate: the F1 value has increased from 0.6106 in the first round to 0.9221 in the tenth round, reflecting that the model can still maintain stable diagnostic performance under the condition of sample imbalance, weighing the comprehensive performance of precision rate and recall rate.
[0108] The number of training rounds matches well with the index stability: starting from the sixth round, the four indexes are basically stable, indicating that the model can quickly reach the optimal state in fewer rounds under the efficient parameter fine-tuning mechanism (such as LoRA, hierarchical freezing), verifying that the method of the present invention has the advantages of fast convergence and high training efficiency.
[0109] Support small sample scenarios: only 1000 injection molding samples can train a high-performance diagnostic model in a short time, fully demonstrating the application value of the present invention under the conditions of small samples, weak annotations or limited industrial field samples.
[0110] In summary, the present invention utilizes the semantic modeling ability of the large language model, combines key strategies such as text-based input expression, low-rank adaptation fine-tuning, and model quantization compression, and while maintaining the high performance of the model, achieves high training efficiency, low sample dependence and good engineering deployability, significantly superior to traditional methods, and is an efficient, intelligent and low-cost injection molding process fault diagnosis solution.
[0111] Obviously, the above embodiments of the present invention are only examples for clearly explaining the present invention, and are not limitations on the implementation manners of the present invention. For those of ordinary skill in the art, other different forms of changes or modifications can be made on the basis of the above description. It is not necessary and impossible to enumerate all the implementation manners here. Any modifications, equivalent replacements and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the claims of the present invention.
Claims
1. A training method for an injection molding process fault diagnosis model based on a large language model, characterized in that, Including the following steps: Collect the injection molding machine process parameters when a fault occurs, clean the injection molding machine process parameters, and obtain the cleaned dataset; Perform natural language conversion on the data in the dataset to obtain a text description containing fault semantics; combine the text description with its corresponding fault label to construct a text-based dataset for the injection molding fault diagnosis task, and divide it into a training set and a validation set according to a preset ratio; Utilize the sample dimension of the text-based dataset and the number of predicted target fault labels, combine with the parameter structure of the pre-trained large language model, and configure a diagnostic model with fine-tuning ability using a quantization method; Start training. Input the text-based data training set into the diagnostic model to extract semantic features and output intermediate feature representations. Perform feature transformation processing on the intermediate feature representations to obtain high-order feature vectors for fault prediction; Input the high-order feature vectors into the classification head to output the predicted probability distribution of the fault type. Use the loss function between the predicted probability distribution and the true label to perform backpropagation and gradient optimization on the model parameters. Use low-rank adaptation combined with a hierarchical freezing strategy to fine-tune the model parameters. Repeat the above training steps until the performance index on the validation set reaches the preset threshold, and output the final diagnostic model.
2. The training method of an injection molding process fault diagnosis model based on a large language model according to claim 1, wherein The process parameters obtained when a fault occurs include at least one or more of the following: melt temperature, mold temperature, peak injection pressure, peak back pressure, injection time, filling time, holding pressure time, cycle time, peak clamping force, screw position, injection volume, barrel temperature, injection speed, mold closing force, and peak torque. The detected faults include: bubbles, short shots, surface defects, warping, shrinkage, burns, flash, surface spots, color difference, and sticking.
3. A method for training an injection molding process fault diagnosis model based on a large language model according to claim 1, characterized in that, The method for collecting the injection molding machine process parameters when a fault occurs is to collect them using a PLC or SCADA system.
4. A training method for an injection molding process fault diagnosis model based on a large language model according to claim 1, characterized in that The cleaning process includes at least one or more of the following: missing value processing, outlier processing, and duplicate data processing; The method for filling missing values is as follows: for a small number of missing values, fill them with the mean, median, or mode; for parameters with a large number of missing values, delete the column or row of data; If missing values are inevitable in some cases, use the historical mean or median of each process parameter for interpolation filling; The method for outlier processing is as follows: use a box plot or standard deviation method to detect outliers, identify data points that deviate significantly from the normal range, and delete the outliers or fill them with the mean or median; The method for duplicate data processing is as follows: use sample hash value matching to identify and delete duplicate samples.
5. A training method for an injection molding process fault diagnosis model based on a large language model according to claim 1, characterized in that, The pre-trained large language model selects the open-source pre-trained large language model LLaMA3.2 or chatglm4 as the base model.
6. A training method for an injection molding process fault diagnosis model based on a large language model, characterized in that, The quantization method is the 4-bit normal floating-point quantization method. The method for configuring the diagnostic model using the quantization method includes the following steps: Before loading the model, set the 4-bit normal floating-point quantization related parameters through a configuration file or code parameters; Use the model loading tool, combined with the configuration, to load the pre-trained model and convert the model weights from the original precision to 4-bit integer representation using 4-bit normal floating-point quantization.
7. A training method for an injection molding process fault diagnosis model based on a large language model according to claim 1, characterized in that The method for fine-tuning model parameters by using low-rank adaptation combined with a hierarchical freezing strategy is as follows: During the configuration of the diagnostic model structure, the parameters of the underlying Transformer module of the large language model are frozen by using the hierarchical freezing strategy, the parameters of the high-level Transformer module of the model are unfrozen, and the low-rank adaptation method is further applied to the Query and Value matrices of the unfrozen high-level Transformer module. The original weight matrix W is structurally reconstructed by using low-rank matrices A and B to obtain the reconstructed weight matrix W′, and the reconstruction expression is as follows: W′ = W + BA During the training process, only the low-rank matrix parameters A, B and the classification head parameters in the high-level Transformer module are optimized.
8. A method for training an injection molding process fault diagnosis model based on a large language model according to claim 1, characterized in that, To adapt to fault diagnosis under more working conditions, before training the model, multiple text-based data sets from different working conditions are fused, and the model is trained by using the transfer learning method, which specifically includes the following steps: Using a general natural language prompt template containing working condition information, injection molding process parameter feature descriptions and fault type labels, the injection molding process parameters from different working conditions are uniformly texturized to obtain a multi-working condition texturized data set; The multi-working condition texturized data set is balanced to obtain a source domain data set and a target domain data set with balanced working condition distributions; Using the sample dimension of the multi-working condition texturized data set and the number of target fault categories, combined with the parameter structure of the pre-trained large language model, a diagnostic model structure with an adaptation layer is constructed by using the quantization method; Start training. Input the source domain data set into the diagnostic model structure, output and extract the high-order semantic features of the source domain data; input the target domain data set into the diagnostic model structure in the same way, output the high-order semantic features of the target domain data, and share the high-order semantic features of the source domain data and the high-order semantic features of the target domain data to obtain a semantic feature representation integrating multi-working condition knowledge; Using the original parameters of the pre-trained basic model and the parameters obtained after training with the source domain data, determine the initial values of the target model parameters; Input the semantic feature representation integrating multi-working condition knowledge into the adaptation layer and the classification head, output the predicted probability distribution of the fault type, and perform backpropagation and gradient optimization on the model parameters according to the loss function between the predicted probability distribution and the true label. Use the low-rank adaptation combined with the hierarchical freezing strategy to fine-tune the parameters of the adaptation layer and the classification head. Repeat the above training process until the performance index of the validation set of the target domain data reaches the preset threshold, and output an injection molding process fault diagnosis model with cross-working condition generalization ability.
9. An injection molding process fault diagnosis method based on a large language model, wherein the method uses the model trained by any one of claims 1-8 to diagnose injection molding process faults to obtain a fault diagnosis result.
10. A training system for an injection molding process fault diagnosis model based on a large language model, characterized in that, The system includes: a memory and a processor. The memory includes a program for a method of training an injection molding process fault diagnosis model based on a large language model. When the program for the method of training an injection molding process fault diagnosis model based on a large language model is executed by the processor, the steps of a method of training an injection molding process fault diagnosis model based on a large language model as described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Lightweight method and system for distributed wind turbine generator side end fault diagnosis model
CN116796827A
Cited By
Meter fault detection method and system
CN120804899A
Low-rank fine-tuning transformer fault diagnosis method based on adaptive attention guidance
CN120873758A
Transformer fault diagnosis method based on low-rank fine-tuning of adaptive attention guidance
CN120873758B
Vertical field-oriented model training method, electronic equipment, storage medium and program product
CN121094031A
Injection mold pressure monitoring processing method and system
CN121234023A