A method for analyzing the causes of nuclear power quality defects
Through the particle swarm-chi-square test-random forest method, combined with natural language processing and genetic algorithm, the problems of low efficiency and low accuracy of nuclear power defects are solved, and efficient and accurate analysis of the causes of nuclear power quality defects is achieved.
Patent Information
- Application Number
- CN202210665278.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-13
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2042-06-13
AI Technical Summary
The existing nuclear power defect cause analysis methods are inefficient and low-precision, and cannot effectively process messy and redundant nuclear power text data.
The dendrogram method for the analysis of nuclear power quality defects based on particle swarm-chi-square test-random forest was adopted, and text keywords were extracted through natural language processing technology, feature selection of chi-square tests, random forest model training, and genetic algorithms were used to optimize model parameters.
The efficiency and accuracy of the analysis of the causes of nuclear power defects is improved, and the causes of nuclear power quality defects can be quickly and accurately analyzed, and accurate propagation path maps and importance histograms are generated.
Smart Images

Figure CN114969267B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a data-driven defect cause analysis, and in particular to a nuclear power quality defect cause analysis tree diagram method based on particle swarm-chi-square test-random forest. Background Art
[0002] During the nuclear power production process, both equipment and operating techniques will affect the normal operation of the nuclear power plant. Improper handling may cause defects in the unit equipment, such as pump leakage, orifice plate breakage, lifting detachment, etc. These defects may pose safety hazards to nuclear power production.
[0003] Most existing technologies use manual defect cause analysis for messy and redundant nuclear power text data, using NCR report forms and other forms to analyze nuclear power quality defects and causes and feedback experience. However, this method is not only inefficient, but also has low accuracy in analysis results. Summary of the invention
[0004] The purpose of the present invention is to provide a method for analyzing the causes of nuclear power quality defects, so as to solve the problem of low efficiency and low precision of the existing methods for analyzing the causes of nuclear power defects.
[0005] In order to achieve the above object, the present invention provides a method for analyzing the causes of nuclear power quality defects, comprising:
[0006] S1: Use natural language processing technology to extract text keywords from nuclear power defect event data to form standardized defect targets and standardized defect causes;
[0007] S2: Take each standardized defect target as a target and each standardized defect cause as a feature. Use the chi-square test feature extraction technology to calculate the chi-square value between the feature and the target to measure their correlation. Select the first k features with high correlation among all features. k is the number of chi-square test feature selections.
[0008] S3: Take all the selected features as input and use the random forest algorithm to train a random forest model containing multiple decision trees;
[0009] S4: Use an intelligent optimization algorithm to find the optimal chi-square test feature selection number k and the hyperparameters of the random forest. The optimization goal is to make the random forest model obtained in step S2 and step S3 more accurate, thereby obtaining a chi-square test-random forest scheduling model.
[0010] Preferably, the step S1 comprises:
[0011] S11: Obtain the correspondence between the defect event description and the defect cause description from the nuclear power defect event data;
[0012] S12: performing natural language processing on the defect event description and the defect cause description to obtain standardized defect targets and standardized defect causes corresponding to each other;
[0013] S12 includes:
[0014] S121: obtaining a nuclear power knowledge base of a provider of a historical defect text library, and constructing a nuclear power text dictionary using the nuclear power knowledge base;
[0015] S122: inputting all character feature vectors of the nuclear power text dictionary into the algorithm framework of the natural language processing model to train the natural language processing model;
[0016] S123: Input the defect event description and defect cause description into the trained natural language processing model to obtain corresponding standardized defect targets and standardized defect causes.
[0017] Preferably, the algorithm framework of the natural language processing model adopts the Bert-LSTM-CRF model framework.
[0018] Preferably, step S2 comprises:
[0019] S21: Perform data cleaning on the standardized defect targets and standardized defect causes, and use the cleaned standardized defect targets and standardized defect causes as targets and features respectively;
[0020] S22: Perform feature engineering processing of the chi-square test on the target and the feature to obtain the chi-square value of each feature, and select k features with the largest chi-square value.
[0021] Preferably, the step S3 comprises:
[0022] S31: Through the bootstrap sampling method, random samples are drawn with replacement to form multiple data subsets;
[0023] S32: using each data subset to train a decision tree, thereby forming a random forest with multiple decision trees;
[0024] S33: Using the multiple decision trees and majority voting strategy to determine the standardized defect target to which the sample belongs, and determining the accuracy of the random forest model.
[0025] Preferably, the intelligent optimization algorithm adopts a genetic algorithm among heuristic algorithms, and the hyperparameters of the random forest include the number n of decision trees and the maximum depth d of each decision tree.
[0026] Preferably, step S4 comprises:
[0027] S41: Take each set of random forest hyperparameters and chi-square test feature selection number k as a chromosome, set the encoding rules for converting it to the genetic space, and then create the initial population data as the population of the current round through random initialization;
[0028] S42: Calculate the fitness function value of each individual in the population of the current round by repeating steps S2 and S3, wherein the fitness function takes the accuracy of the random forest model as the target function;
[0029] S43: performing a selection operation according to the calculated fitness function value to obtain selected individuals; then performing a crossover operation and a mutation operation on all selected individuals to obtain mutated individuals;
[0030] S44: Calculate the fitness function values of all mutated individuals;
[0031] S45: merge all selected individuals and all mutated individuals into a merged population, and probabilistically select individuals from them according to the fitness function value to obtain the next round population as the new current round population;
[0032] S46: Determine whether the current round reaches the maximum number of iterations. If so, execute step S47, otherwise return to step S42;
[0033] S47: Select the individual with the largest fitness function value in the current round of population as the optimal chi-square test feature selection number k and the hyperparameter of the random forest, and obtain the chi-square test-random forest scheduling model accordingly by repeating steps S2 and S3.
[0034] Preferably, the method for analyzing the causes of nuclear power quality defects further includes step S5: corresponding to the decision tree with the highest accuracy in the chi-square test-random forest scheduling model, obtaining a corresponding visualized propagation path diagram.
[0035] Preferably, the method for analyzing the causes of nuclear power quality defects is characterized by further comprising step S5': using the GBDT algorithm to evaluate the importance of multiple standardized defect causes in the chi-square test-random forest scheduling model, and sorting the standardized defect causes.
[0036] Preferably, the step S5' comprises:
[0037] S51': Using the GBDT algorithm, in the process of training the decision tree of the chi-square test-random forest scheduling model, the total number of feature splits, total information gain, and average information gain are recorded;
[0038] S52': By formula Calculate the importance of the jth standardized defect cause in a single decision tree Where j is the ordinal number of the standardized defect cause, L is the number of leaf nodes in the decision tree, t is the ordinal number of the non-leaf node, and v t is the normalized defect cause associated with non-leaf node t, is the reduction in square loss of non-leaf node t after splitting, 1(v t =j) refers to a function whose expression is 1 when the feature associated with the non-leaf node t is equal to the standardized defect cause j, and T represents a decision tree;
[0039] S53': By formula Calculate the global importance of the jth standardized defect cause on all decision trees; where, is the importance of the jth standardized defect cause in the mth decision tree, M is the total number of decision trees, and m is the ordinal number of the decision tree;
[0040] S54': rank the importance of each standardized defect cause, and form an importance bar chart of the standardized defect causes.
[0041] The method for analyzing the causes of nuclear power quality defects of the present invention extracts text keywords through natural language processing technologies such as Bert and LSTM to form standardized defects and defect causes, thereby solving the problem of standardization of messy and redundant nuclear power text data. On the other hand, the present invention selects redundant defect causes through feature selection of chi-square test before modeling the random forest model, and uses genetic algorithm to optimize model parameters to improve the accuracy of the random forest model of defect causes.
[0042] In addition, the present invention generates an accurate propagation path diagram of the defect cause and a defect cause importance histogram through a random forest model, which can provide a comprehensive, fast and accurate analysis of the defect cause. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flow chart of the method for analyzing the causes of nuclear power quality defects of the present invention.
[0044] Figure 2A and Figure 2B is the accuracy convergence diagram after 30 generations of optimization by genetic algorithm, where Figure 2A For a scatter plot, Figure 2B For a line chart.
[0045] Figure 3 Visual propagation path diagram for the random forest model.
[0046] Figure 4 A bar chart showing the importance of normalized defect causes. DETAILED DESCRIPTION
[0047] The method of the present invention is described in detail below with reference to the accompanying drawings and specific implementation examples.
[0048] The present invention provides a method for analyzing the causes of nuclear power quality defects, which is based on genetic algorithm-chi-square test-random forest, and is used to solve the problems of low efficiency and low precision of the existing nuclear power defect cause analysis NCR report, realize the standardization of nuclear power text data, and form standardized defects and defect causes. The following is combined with a specific example of nuclear power equipment defects to illustrate the specific implementation process of the present invention, as well as its superiority over the traditional defect cause analysis method. Figure 1 As shown in the figure, the method for analyzing the causes of nuclear power quality defects specifically includes the following steps:
[0049] Step S0: Collecting nuclear power defect event data during the entire life cycle (EPCS) of nuclear power;
[0050] The collection of nuclear power defect event data is mainly carried out by collecting existing NCR reports. NCR reports are a textual method for engineers to record non-conformities of nuclear power. Nuclear power defect event data refers to events in non-conformities recorded in NCR reports throughout the life cycle of nuclear power.
[0051] In this embodiment, the application object collected is the nuclear power quality defect data provided by China General Nuclear Power Corporation, which includes the defect event data report of the nuclear power life cycle (EPCS) stage, especially the nuclear power defect event data in the NCR report (i.e., non-conformity report). The entire NCR report contains detailed description information such as unit information, primary stage information, secondary stage information, event information, and cause information, among which the event information and cause information are the data required by the present invention.
[0052] In addition, considering that the historical defect text library of nuclear power is the text of all defects in the history of nuclear power, not just nuclear power defect event data, the historical defect text library of nuclear power includes NCR reports, and then includes nuclear power defect event data, so nuclear power defect event data can also be directly obtained from the historical defect text library.
[0053] The related text library does not involve nuclear power defect texts, but some texts in other fields. For example, some cross-enterprise supplier responsibility chain information cannot be found in the nuclear power defect text library. The related text library is parallel to the nuclear power historical defect text library.
[0054] In other embodiments, the step of collecting nuclear power defect event data is omitted, as long as step S1 can obtain the nuclear power defect event data.
[0055] Step S1: Use natural language processing technology to extract text keywords from nuclear power defect event data to form standardized defect targets and standardized defect causes; because the input is a text report, a text report is a description of a defect and a defect cause that corresponds to each other. In this way, the conversion from defect cause to feature (i.e., standardized defect cause) is completed.
[0056] In step S1, the natural language processing technology includes at least one of Bert, LSTM and the like technologies.
[0057] Step S1 includes:
[0058] Step S11: Obtaining the correspondence between the defect event description and the defect cause description from the nuclear power defect event data;
[0059] The defect event description and defect cause description are used as one of the input parameters of the natural language processing model.
[0060] In this embodiment, the defect event description and the defect cause description are the event information and cause information reported by the NCR, respectively.
[0061] Step S12: Perform natural language processing operations on the defect event description and the defect cause description to obtain standardized defect targets and standardized defect causes corresponding to each other.
[0062] The standardized defect targets and standardized defect causes obtained here are the key defect targets and key defect causes. At this time, since the defect event description and defect cause description come from the historical defect text library, a text report is a description of a defect and a defect cause that correspond to each other, so the corresponding relationship between the standardized defect targets and the standardized defect causes can be obtained.
[0063] The step S12 specifically includes:
[0064] Step S121: obtaining a nuclear power knowledge base of a provider of a historical defect text library, and constructing a nuclear power text dictionary using the nuclear power knowledge base; the nuclear power text dictionary is used as another input parameter of a natural language processing model;
[0065] In this embodiment, the provider of the NCR report is China General Nuclear Power Corporation. Using the nuclear power knowledge base to construct a nuclear power text dictionary includes: traversing the nuclear power knowledge base, traversing each word, marking each word with a sequence number to obtain a character feature vector of each word, thereby obtaining a nuclear power text dictionary. The nuclear power text dictionary is usually in json format. The character feature vector of each word is obtained by exhaustively enumerating the nuclear power text and adding a sequence number to each word. The character feature vector of each word is similar to {Nuclear: 1}, {Electric: 2}, and so on.
[0066] Step S122: Input all character feature vectors in the nuclear power text dictionary into the algorithm framework of the natural language processing model to train the natural language processing model.
[0067] In this embodiment, the algorithm framework of the natural language processing model adopts the Bert-LSTM-CRF model framework. The Bert-LSTM-CRF model framework is a typical algorithm framework of the natural language processing model.
[0068] As described above, the character feature vector of each character in the nuclear power text dictionary is similar to {nuclear: 1}, {electricity: 2}, etc. Thus, during the training process, through the characteristics of bert and MasterL itself, the nuclear power text dictionary is converted into feature vectors. The character feature vectors of the nuclear power text dictionary are used to convert the semantic information of the text into feature information recognizable by the computer and are one of the input parameters.
[0069] Step S123: Input the defect event description and the defect cause description into the trained natural language processing model to obtain the corresponding standardized defect target and standardized defect cause.
[0070] That is to say, the input data of the natural language processing model is the defect event description and the defect cause description (i.e., event information and cause information) and the nuclear power text dictionary, and the output data is the standardized defect target and standardized defect cause (i.e., the feature vectors of the defect event description and the defect cause description). The standardized data is beneficial to be used as features and input into the algorithm. The feature vectors can be decoded through the nuclear power text dictionary to obtain the text forms of the standardized defect target and defect cause.
[0071] In each corresponding relationship between the standardized defect target and the standardized defect cause, the number of standardized defect targets is 1, and the number of standardized defect causes is multiple.
[0072] Step S2: Take each standardized defect target as a target and each standardized defect cause as a feature, and use the chi-square test feature extraction technique to calculate the chi-square value between the feature and the target to measure their correlation degree, so as to select a part (i.e., the first k) of the features with high correlation degree from all features; k is the chi-square test feature selection number and k is a positive integer;
[0073] The step S2 includes:
[0074] Step S21: Clean the data of the standardized defect target and the standardized defect cause. The standardized defect target and standardized defect cause after data cleaning are used as the target and feature respectively;
[0075] Data cleaning includes but is not limited to missing value processing and outlier processing. Missing value processing and outlier processing refer to directly deleting missing values and outliers.
[0076] Step S22: Perform feature engineering processing of the chi-square test on the target and the feature to obtain the chi-square value of each feature; perform feature selection on the standardized defect causes, that is, select the k features with the largest chi-square values (that is, the first k important features).
[0077] The selected features are used as input to the random forest model below.
[0078] In step S22, the specific steps of feature engineering processing for performing chi-square test on the target and the feature are as follows:
[0079] Step S221: Chi-square analysis first assumes that the two variables, target and feature, are independent of each other. Under the condition that this assumption is established, the actual frequency and theoretical frequency of each grid in the variable contingency table are obtained;
[0080] The actual frequency is the number of defects caused by this defect cause, and the theoretical frequency is calculated by multiplying the actual frequency by the probability (the probability of the defect occurring).
[0081] Step S222: Then calculate the actual frequencies of the two variables, target and feature, and compare the difference between the actual frequency and the theoretical frequency in each grid in the variable contingency table by calculating the chi-square value of each feature and all targets. The larger the difference, the greater the difference, the greater the gap between the actual and the hypothesis, and the smaller the difference, the smaller the gap between the actual and the hypothesis;
[0082] Step S223: The difference (i.e., the chi-square value of each feature) is expressed as the chi-square test result; that is, if the chi-square test result is not obvious, the original hypothesis is not established, and the target and feature variables are independent of each other; if the chi-square test result is significant, the original hypothesis is established, and the target and feature variables are correlated.
[0083] That is, the chi-square value X of each feature is calculated by the following formula (1): 2 :
[0084]
[0085] Among them, X 2 is the chi-square value of the characteristic, o is the actual frequency, and e is the theoretical frequency.
[0086] The chi-square value X of the feature 2 The larger it is, the more relevant the feature is to the target, i.e., the defect cause is more important to the defect.
[0087] In addition, the step S2 may further include a step S23: numericalizing and one-hot encoding defect labels of all targets and selected features respectively.
[0088] Defect label digitization is to represent the standardized defect target with a numerical value (0, 1, 2...n) for easy program recognition. One-hot encoding is to represent each standardized defect cause as a binary vector.
[0089] Step S3: taking all the selected features as input, and using the random forest algorithm to train a random forest model containing multiple decision trees;
[0090] In machine learning, a random forest model is a classifier that contains multiple decision trees, and its output category is determined by the mode of the categories output by individual decision trees.
[0091] In step S3, all selected features are one-hot encoded features.
[0092] The step S3 comprises:
[0093] Step S31: randomly select samples with replacement through the bootstrap sampling method to form multiple data subsets;
[0094] Each data subset includes multiple samples extracted at the same time.
[0095] Step S32: using each data subset to train a decision tree, thereby forming a random forest with multiple decision trees;
[0096] Among them, during training, features are randomly extracted for node splitting until they can no longer be split, thereby establishing multiple decision trees; randomly extracting features for node splitting means finding the best feature among multiple randomly extracted features and applying it to the node for node splitting.
[0097] Step S33: using the multiple decision trees and majority voting strategy to identify the standardized defect target to which the sample belongs, and determining the accuracy of the random forest model.
[0098] The samples here are the same as the samples randomly selected in step S31, both of which are single defect causes and defect targets.
[0099] Step S4: Use an intelligent optimization algorithm to find the optimal chi-square test feature selection number k and the hyperparameters of the random forest. The optimization goal is to make the random forest model obtained in steps S2 and S3 more accurate, thereby obtaining a chi-square test-random forest scheduling model.
[0100] The hyperparameters of the random forest and the number of chi-square test feature selections k should all be in the best state. To achieve the above purpose, the present invention adopts an intelligent optimization algorithm to optimize the model and the features selected by the chi-square test. Specifically, the intelligent optimization algorithm adopts a genetic algorithm in the heuristic algorithm to optimize the hyperparameters of the random forest and the number of chi-square test feature selections k, and automatically finds the local optimal point, thereby optimizing the random forest model and the features selected by the chi-square test, thereby making the decision tree in the random forest model more accurate and making the visualization propagation path of the cause of the defect more accurate.
[0101] Among them, the hyperparameters of the random forest may include the number of decision trees n, the maximum depth d of each decision tree, the number of features randomly extracted when finding the best split point, and other parameters.
[0102] In this embodiment, the optimized parameters include at least three parameters: the chi-square test feature selection number k, the number of decision trees n, and the maximum depth d of each decision tree. That is, the optimized hyperparameters of the random forest include the number of decision trees n and the maximum depth d of each decision tree.
[0103] Further, step S4 includes:
[0104] Step S41: taking each set of random forest hyperparameters and chi-square test feature selection number k as a chromosome, setting the encoding rules for converting it to the genetic space, and then creating initial population data as the population of the current round through random initialization;
[0105] Specifically, by setting the encoding rules for converting the hyperparameters of random forest and the chi-square test feature selection number k into binary genotypes, the hyperparameters of random forest and the chi-square test feature selection number k are represented as chromosomes or individuals in the genetic space, that is, converted to the genetic space.
[0106] The specific way to convert the hyperparameters of random forest and the chi-square test feature selection number k into binary genotypes is as follows: Because the chi-square test feature selection number k and the hyperparameters of random forest are specific decimal values, the encoding is to be converted into binary (01). For example, when the encoding result of the binary genotype is 000100100100, assuming that the basic coefficient of a chromosome in the encoding rule is set to 0.1, the left 4 bits represent the value of k as 1×0.1, the middle four bits represent the value of the second parameter as 2×0.1, and the right four bits represent the value of the third parameter as 4×0.1.
[0107] The initial population data is the initial population of the starting search point. The initial population data is random and does not affect the final convergence result.
[0108] Random initialization refers to randomly setting a binary value for the encoding results of the binary genotypes of the hyperparameters of the random forest and the chi-square test characteristics of these parameters.
[0109] Step S42: Calculate the fitness function value of each individual in the population of the current round by repeating steps S2 and S3;
[0110] Among them, the fitness function takes the accuracy of the random forest model as the objective function, and calculates the fitness function value of each chromosome (including hyperparameters and k values) in each round of population. In the genetic algorithm, the size of individual fitness is used to evaluate the quality of each individual, thereby determining the size of its genetic opportunity.
[0111] Step S43: performing a selection operation according to the calculated fitness function value to obtain selected individuals; then performing a crossover operation and a mutation operation on all selected individuals to obtain mutated individuals;
[0112] Selection operation refers to applying the selection operator to the population of the current round. The purpose of selection is to directly pass on the optimized individuals to the next generation or to generate new individuals through pairing and crossover and then pass on to the next generation. The selection operation is based on the fitness evaluation of individuals in the population of the current round.
[0113] The selection operation adopts the roulette wheel selection method, which calculates the probability of each individual appearing in the offspring based on the individual's fitness function value, and randomly selects individuals to form the offspring population according to this probability.
[0114] The crossover operation refers to setting the crossover probability, and each individual randomly selects another individual to perform the crossover operation with the crossover probability.
[0115] Mutation operation refers to the operation of mutation of each individual according to the mutation probability. Among them, the mutation is random, and the mutation probability is generally set to 0.1, that is, how many bits in the chromosome * 0.1 will mutate. The mutation operation is to change 0 to 1, or 1 to 0.
[0116] Step S44: Calculate the fitness function values of all mutated individuals obtained in step S43;
[0117] Step S45: All selected individuals and all mutated individuals obtained in step S43 are combined into a combined population, and individuals are probabilistically selected from them according to the fitness function value to obtain the next round of population as the new current round of population.
[0118] In step S45, individuals are probabilistically selected according to the fitness function value using a roulette wheel selection strategy, and the specific process is as follows:
[0119] Step S451: superimpose the fitness function values of all individuals in the combined population to obtain a total fitness function value;
[0120] Step S452: The fitness function value of each individual is divided by the total fitness function value to obtain the probability of the individual being selected.
[0121] Step S453: Calculate the cumulative probability of the individual according to the probability of the individual being selected to construct a roulette wheel;
[0122] Step S454: Generate a random number in the interval [0,1]. If the random number is less than or equal to the cumulative probability of an individual and greater than the cumulative probability of the previous individual, select the individual to enter the offspring population.
[0123] Step S455: Repeat step S454 until the population size is met.
[0124] Step S46: Determine whether the current round reaches the maximum number of iterations. If so, stop the iteration and execute step S47; otherwise, return to step S42;
[0125] Step S47: Select the individual with the largest fitness function value in the current round of population as the optimal chi-square test feature selection number k and the hyperparameter of the random forest, and obtain the chi-square test-random forest scheduling model accordingly by repeating steps S2 and S3.
[0126] In addition, step S5 is also included: corresponding to the decision tree with the highest accuracy in the chi-square test-random forest scheduling model, a corresponding visualized propagation path diagram (i.e., the propagation path of the defect-cause) is obtained.
[0127] In this embodiment, the number of the visualized propagation path graphs is 1, and a corresponding visualized propagation path graph is obtained by selecting a decision tree with the highest accuracy from the chi-square test-random forest scheduling model for visualization, and the visualized propagation path graph shows the correlation between the standardized defect target and the standardized defect cause in the decision tree with the highest accuracy in the chi-square test-random forest scheduling model. Thus, the cause analysis of each defect is realized.
[0128] In addition, in order to achieve the purpose of analyzing the importance of defect causes, the present invention also provides a GBDT defect cause importance ranking visualization bar chart method, that is, it also includes step S5': using the GBDT algorithm to evaluate the importance of multiple standardized defect causes in the chi-square test-random forest scheduling model, and rank the standardized defect causes. Thus, the importance of each defect cause is displayed.
[0129] It should be noted that because GBDT analyzes the full amount of data, without feature selection, it can show the importance of all defect causes. Therefore, when using the GBDT algorithm, step S5' uses the data output from step S1, that is, the standardized data after natural language processing.
[0130] The GBDT algorithm is a gradient boosting tree algorithm that can evaluate the importance of each feature in the random forest model.
[0131] The step S5' comprises:
[0132] Step S51': Using the GBDT algorithm, in the process of training the decision tree of the chi-square test-random forest scheduling model, the total number of feature splits, the total information gain, and the average information gain are recorded; these parameters are evaluation indicators used to measure the importance of features.
[0133] It should be noted that if a feature (i.e., the standardized defect cause) is split more times, the importance of this feature is stronger. The importance contribution of each feature on each tree is calculated and then simply averaged.
[0134] Step S52': Calculate the importance of the jth standardized defect cause in a single decision tree using formula (2)
[0135]
[0136] Where j is the ordinal number of the standardized defect cause, L is the number of leaf nodes in the decision tree, t is the ordinal number of the non-leaf node, and v t is the normalized defect cause associated with non-leaf node t, is the reduction in square loss of non-leaf node t after splitting, 1(v t =j) refers to a function whose expression is 1 when the feature associated with the non-leaf node t is equal to the standardized defect cause j, and T represents a decision tree.
[0137] Step S53': Calculate the global importance of the jth standardized defect cause on all decision trees by formula (3);
[0138]
[0139] in, is the importance of the jth standardized defect cause in the mth decision tree, M is the total number of decision trees, and m is the ordinal number of the decision tree.
[0140] Step S54 ′: sort the importance of each standardized defect cause and form a bar graph of the importance of the standardized defect causes, thereby realizing visualization of the bar graph of the importance of the defect causes.
[0141] Experimental Results
[0142] In the experimental results of the present invention, according to step S2, the chi-square value of each defect cause to the defect is calculated, the defect causes are sorted, and the defect causes such as management defects, human errors, failures, temporary, failures, and deficiencies that have a high correlation with the defects are obtained as features.
[0143] Table 1 shows a specific experimental result of standardized defect targets and standardized defect causes extracted by natural language processing technology. Among them, the standardized defect targets are located in the 1st and 2nd columns in Table 1, NAN represents missing values, and the standardized defect causes are fields in other columns except the 1st and 2nd columns in Table 1. As shown in Table 1, in each corresponding relationship between standardized defect targets and standardized defect causes, the number of standardized defect targets is 1, and the number of standardized defect causes is multiple.
[0144] Table 1 Standardized defect targets and standardized defect causes after extraction
[0145] Device Object Phenomenon Cause classification Orifice Plate fracture Design Error No match Human error Not found Not clear stone NAN Design Error destroy Cancel Renovation Demolition insurance conflict Influence consider switch NAN Design Error Invalidation insufficient Lack Fan Reversal Design Error insufficient Revise violation Fault Not strict fail Reverse connection cable damage Management flaws Installation Issues Human error Not found Not implemented Bracket rust other Designing for safety change Influence Hoisting NAN Human error No match consider Installation Issues Lack Pit NAN Management flaws Hysteresis power supply Power outage Management flaws Power failure Unstable Invalidation Fault temporary Flange NAN NAN NAN dynamo NAN Management flaws Sundries Safety Adjustment temporary schedule Influence cable Power outage Management flaws Human error Consider Hoisting Shedding Management flaws insufficient Safety negligence valve NAN other change Through-pieces NAN Program defects Construction technology out of control dynamo NAN Management flaws Adjustment schedule Hysteresis temporary Lack
[0146] The final chi-square test-random forest scheduling model is the random forest model corresponding to the optimal parameters after genetic algorithm optimization, and the corresponding visual propagation path diagram is the decision tree with the highest accuracy of the chi-square test-random forest scheduling model. After the formation of the visual propagation path diagram optimized by the intelligent optimization algorithm, the recognition accuracy of defects is improved from 96% to 99.2%. The recognition accuracy is the classification accuracy of the model, and the formula for recognition accuracy is the correct category of data in the test set / the total number of categories in the test set.
[0147] Figure 2A and Figure 2B This is the accuracy convergence diagram after 30 generations of optimization using the genetic algorithm. Figure 2A and Figure 2B The horizontal axis is the number of iterations. Figure 2A The vertical axis is the accuracy of the random forest model (i.e., the fitness function value). Figure 2B The vertical axis is the accuracy of the optimal random forest model. Figure 2A It is a scatter plot, in which the points are the distribution of the fitness function values of the random forest model of each chromosome in each iteration of the genetic algorithm. Figure 2B is the corresponding line chart.
[0148] Output the random forest visualization tree diagram and select the decision tree with the highest accuracy as the visualization propagation path diagram. Figure 3 The visual propagation path diagram of the random forest model is shown, that is, the visualization result of the optimal decision tree in the random forest model. Figure 3 The path from the root node to each leaf node in the decision tree is shown. All non-leaf nodes are defect causes, and leaf nodes are defects. In this way, it is clear from the path which defects are associated with which causes.
[0149] Use the standardized defect data to build the GBDT model, analyze and sort all defect causes by importance, obtain all defect causes, and visualize the importance bar chart. Figure 4 A bar chart of the importance of standardized defect causes is displayed. The importance of each standardized defect cause can be known by searching for the corresponding standardized defect cause through the letter code.
[0150] It can be seen from the above figures that the present invention is more accurate and efficient than the NCR report defect cause analysis. The method for defect cause analysis of quality defect events in the entire life cycle of a nuclear power plant in the embodiment of the present invention can timely determine the process of defect formation and intuitively reflect the importance of the defect cause, so that relevant measures can be taken more targeted to improve the efficiency of experience feedback work in nuclear power plants.
[0151] The above is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. The above embodiments of the present invention can also be modified in various ways. All simple, equivalent changes and modifications made according to the claims and the description of the present invention fall within the scope of protection of the claims of the present invention. The contents not described in detail in the present invention are all conventional technical contents.
Claims
1. A method for analyzing the causes of nuclear power quality defects, characterized in that: include: Step S1: extracting text keywords from nuclear power defect event data using natural language processing technology to form standardized defect targets and standardized defect causes; Step S2: Take each standardized defect target as a target and each standardized defect cause as a feature. Use the chi-square test feature extraction technology to calculate the chi-square value of the feature and the target to measure their correlation. Select the first k features with high correlation from all features. k is the number of chi-square test feature selections. In this way, redundant defect causes can be screened out through the feature selection of the chi-square test before the random forest model is built. Step S3: taking all selected features as input, and using the random forest algorithm to train a random forest model containing multiple decision trees; Step S4: Use an intelligent optimization algorithm to find the optimal chi-square test feature selection number k and the hyperparameters of the random forest. The intelligent optimization algorithm adopts a genetic algorithm in the heuristic algorithm. The hyperparameters of the random forest include the number of decision trees n and the maximum depth d of each decision tree. The optimization goal is to make the random forest model obtained in step S2 and step S3 have a high accuracy rate, thereby obtaining a chi-square test-random forest scheduling model. The model parameters are optimized by a genetic algorithm to improve the accuracy of the random forest model of the cause of the defect.
2. The method for analyzing the causes of nuclear power quality defects according to claim 1, characterized in that: The step S1 comprises: Step S11: Obtaining the correspondence between the defect event description and the defect cause description from the nuclear power defect event data; Step S12: performing natural language processing on the defect event description and the defect cause description to obtain a standardized defect target and a standardized defect cause corresponding to each other; The step S12 comprises: Step S121: obtaining a nuclear power knowledge base of a provider of a historical defect text library, and constructing a nuclear power text dictionary using the nuclear power knowledge base; Step S122: inputting all character feature vectors in the nuclear power text dictionary into the algorithm framework of the natural language processing model to train the natural language processing model; Step S123: Input the defect event description and defect cause description into the trained natural language processing model to obtain corresponding standardized defect targets and standardized defect causes.
3. The method for analyzing the causes of nuclear power quality defects according to claim 2, characterized in that: The algorithm framework of the natural language processing model adopts the Bert-LSTM-CRF model framework.
4. The method for analyzing the causes of nuclear power quality defects according to claim 1, characterized in that: The step S2 comprises: Step S21: performing data cleaning on the standardized defect targets and the standardized defect causes, and using the cleaned standardized defect targets and the standardized defect causes as targets and features, respectively; Step S22: Perform feature engineering processing of the chi-square test on the target and the feature to obtain the chi-square value of each feature, and select k features with the largest chi-square value.
5. The method for analyzing the causes of nuclear power quality defects according to claim 1, characterized in that: The step S3 comprises: Step S31: randomly select samples with replacement through a self-service sampling method to form multiple data subsets; Step S32: using each data subset to train a decision tree, thereby forming a random forest with multiple decision trees; Step S33: using the multiple decision trees and majority voting strategy to identify the standardized defect target to which the sample belongs, and determining the accuracy of the random forest model.
6. The method for analyzing the causes of nuclear power quality defects according to claim 1, characterized in that: The step S4 comprises: Step S41: taking each set of random forest hyperparameters and chi-square test feature selection number k as a chromosome, setting the encoding rules for converting it to the genetic space, and then creating initial population data as the population of the current round through random initialization; Step S42: Calculate the fitness function value of each individual in the population of the current round by repeating steps S2 and S3, wherein the fitness function takes the accuracy of the random forest model as the target function; Step S43: performing a selection operation according to the calculated fitness function value to obtain selected individuals; then performing a crossover operation and a mutation operation on all selected individuals to obtain mutated individuals; Step S44: Calculate the fitness function values of all mutated individuals; Step S45: merge all selected individuals and all mutated individuals into a merged population, and probabilistically select individuals from them according to the fitness function value to obtain the next round population as the new current round population; Step S46: Determine whether the current round reaches the maximum number of iterations. If so, execute step S47, otherwise return to step S42; Step S47: Select the individual with the largest fitness function value in the current round of population as the optimal chi-square test feature selection number k and the hyperparameter of the random forest, and obtain the chi-square test-random forest scheduling model accordingly by repeating steps S2 and S3.
7. The method for analyzing the causes of nuclear power quality defects according to claim 1, characterized in that: The step S5 is also included: corresponding to the decision tree with the highest accuracy in the chi-square test-random forest scheduling model, a corresponding visual propagation path diagram is obtained.
8. The method for analyzing the causes of nuclear power quality defects according to claim 1, characterized in that: The method also includes step S5': using the GBDT algorithm to evaluate the importance of multiple standardized defect causes in the chi-square test-random forest scheduling model, and to sort the standardized defect causes.
9. The method for analyzing the causes of nuclear power quality defects according to claim 8, characterized in that: The step S5' comprises: Step S51': using the GBDT algorithm, in the process of training the decision tree of the chi-square test-random forest scheduling model, the total number of feature splits, the total information gain, and the average information gain are recorded; Step S52': By formula Calculate the importance of the jth standardized defect cause in a single decision tree Where j is the ordinal number of the standardized defect cause, L is the number of leaf nodes in the decision tree, t is the ordinal number of the non-leaf node, and v t is the normalized defect cause associated with non-leaf node t, is the reduction in square loss of non-leaf node t after splitting, 1(v t =j) refers to a function whose expression is 1 when the feature associated with the non-leaf node t is equal to the standardized defect cause j, and T represents a decision tree; Step S53': By formula Calculate the global importance of the jth standardized defect cause on all decision trees; where, is the importance of the jth standardized defect cause in the mth decision tree, M is the total number of decision trees, and m is the ordinal number of the decision tree; Step S54 ′: sorting each standardized defect cause by importance, and forming an importance bar graph of the standardized defect causes.
Citation Information
Patent Citations
A solder paste printing performance influence factor analysis method based on SMT big data
CN109597968A
Software defect prediction method based on genetic algorithm and random forest
CN109977028A