Product defect positioning model construction method, product defect positioning method and computer readable storage medium

The method addresses inefficiencies in traditional defect location by using BERT-wwm and linear discriminant analysis to construct a hierarchical classifier for automated defect location, enhancing accuracy and speed in software defect identification.

CN119226154APending Publication Date: 2024-12-31FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411229534.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

Traditional defect location methods in software development are subjective, inefficient, prone to errors, and lack automation, especially when dealing with mixed modal data containing both textual and digital descriptions, leading to inconsistent and inaccurate defect identification.

Method used

A method involving feature extraction from product defect descriptions and log data using BERT-wwm for semantic features, hierarchical classification, and linear discriminant analysis to construct a product defect location model, enhancing and reducing feature dimensions, and employing a hierarchical classifier for automated defect location.

Benefits of technology

Improves defect classification accuracy, enhances discriminative ability, and increases processing speed, making the model versatile for diverse data sources and complex environments, thus improving overall defect location efficiency and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226154A_ABST
    Figure CN119226154A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of defect positioning and machine learning, in particular to a product defect positioning model construction method, a product defect positioning method and a computer readable storage medium, and the product defect positioning model construction method comprises the following steps: carrying out feature extraction on product defect description to obtain a first quantitative feature; performing feature extraction on the product positioning conclusion after hierarchical classification to obtain a second quantitative feature; constructing a training data set according to the first quantitative features and the second quantitative features; and training a hierarchical classifier based on the training data set to obtain a product defect positioning model. According to the method, through deep mining of the mixed modal data, the feature quality of the input data is improved, it is ensured that important information is not ignored, hierarchical feature learning of the LDA technology is combined, defect classification and positioning features with higher discrimination are obtained, and the accuracy of defect positioning is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of defect location and machine learning, and in particular to a product defect location model construction method, a product defect location method and a computer-readable storage medium. Background Art

[0002] In the process of software development and testing, defect location is crucial. Traditional defect location mainly relies on manual work, which has many problems, such as strong subjectivity, inconsistency and limited efficiency improvement. With the development of artificial intelligence, especially the continuous advancement of machine learning and natural language processing technology, defect location can also benefit from the application of these technologies, thus greatly changing the way and efficiency of defect location. Summary of the invention

[0003] The present disclosure aims to solve at least one of the technical problems in the above-mentioned technologies to a certain extent, and proposes a method for constructing a product defect location model, including:

[0004] Extracting features from the product defect description to obtain a first quantitative feature; the first quantitative feature includes: a product defect description quantitative feature and a log record quantitative feature based on digital decoupling; the product defect description quantitative feature is a text and digital integrated coding feature;

[0005] Extracting features from the hierarchically classified product positioning conclusions to obtain second quantitative features; the second quantitative features include: positioning conclusion hierarchical quantitative features;

[0006] Constructing a training data set according to the first quantitative feature and the second quantitative feature;

[0007] A hierarchical classifier is trained based on the training data set to obtain a product defect location model.

[0008] Furthermore, feature extraction is performed on the product defect description, including: using a high-level encoder of a BERT-wwm model to vectorize and output high-level semantic features of the product defect description.

[0009] Furthermore, extracting features from the product defect description also includes: extracting quantitative features from log data corresponding to the product defect description, including:

[0010] Performing data quantification and structural processing on the log data;

[0011] Perform feature extraction on the processed log data and construct data feature vectors;

[0012] The data feature vector is used as a quantitative feature of the log data.

[0013] Furthermore, feature extraction is performed on the product positioning conclusion after hierarchical classification, including:

[0014] Classify the product positioning conclusions in a hierarchical manner;

[0015] Construct label vectors for each classification level based on one-hot encoding;

[0016] The obtained label vector set is used as the quantitative feature of the product positioning conclusion.

[0017] Furthermore, constructing a training data set according to the first quantitative feature and the second quantitative feature includes: concatenating the label vector and a feature vector of the product defect description.

[0018] Furthermore, constructing a training data set according to the first quantitative feature and the second quantitative feature also includes: enhancing and reducing the dimension of the quantitative feature based on linear discriminant analysis.

[0019] Furthermore, the quantitative features are enhanced and reduced in dimension based on linear discriminant analysis, including:

[0020] Concatenating the label vector with a feature vector of a product defect description;

[0021] Construct the projection matrix corresponding to each layer of the concatenated feature vectors according to the linear discriminant analysis;

[0022] The projection matrix is ​​used to enhance and reduce the dimension of the corresponding layers of the concatenated feature vectors.

[0023] Furthermore, a hierarchical classifier is trained based on the training data set to obtain a product defect location model, including:

[0024] Constructing a first-level classifier group including several classifiers;

[0025] Inputting the training data set into the first-level classifier group, training the first-level classifier group, and obtaining a plurality of first-level classification results;

[0026] Construct a second-level classifier group equal to the number of first-level classification results;

[0027] Using each first classification result as a guide, training a second-level classifier group corresponding to the first classification result in turn to obtain a plurality of second-level classification results;

[0028] Repeat the above method to construct a product defect location model with multiple levels and each level containing several classifier groups; the number of levels of the product defect location model is equal to the number of levels of the product location conclusion; the number of classifiers contained in each classifier group in the product defect location model is the same and is positively correlated with the size of the training data set.

[0029] The present disclosure also proposes a product defect location method, comprising: using a product defect location model constructed based on the above-mentioned product defect location model construction method to locate product defects.

[0030] The present disclosure also proposes a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed by a processor, it is at least used to implement the above-mentioned product defect location method.

[0031] Compared with the prior art, the beneficial effects of the present invention are:

[0032] The present disclosure improves the feature quality of input data through deep mining of mixed modal data, ensures that important information is not ignored, and combines hierarchical feature learning of LDA technology to obtain more discriminative defect classification and positioning features, significantly improving the accuracy of defect positioning. In addition, the solution provided in the present disclosure can effectively enhance the discriminative ability of the model through the hierarchical feature learning method, so that the model can still maintain high-performance classification and positioning capabilities in complex data environments. The model provided can handle diversified data including text and numbers, adapt to different types of data sources, and improve the versatility and application scope of the model. Moreover, the automated auxiliary positioning model can greatly improve the processing speed of defect positioning, can quickly process large amounts of data, significantly improve work efficiency, and further improve the overall quality of the product.

[0033] Other features and advantages of the present disclosure will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures particularly pointed out in the written description and the drawings. The technical solution of the present disclosure is further described below through drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. In the accompanying drawings:

[0035] Figure 1 A schematic diagram of a method for constructing a product defect location model given in an embodiment;

[0036] Figure 2 A schematic diagram of a BERT-wwm model provided in an embodiment;

[0037] Figure 3 A schematic diagram of the log data quantization result given in the embodiment;

[0038] Figure 4A schematic diagram of a hierarchical classification framework for product positioning conclusions given in an embodiment;

[0039] Figure 5 A schematic diagram of the quantification results of the product positioning conclusion characteristics given in the embodiment;

[0040] Figure 6 A schematic diagram of a two-classification task of the linear discriminant method given in the embodiment;

[0041] Figure 7 A schematic diagram of the process of extracting the quantitative features of product defect description, log data quantification and product positioning conclusion given in the embodiment;

[0042] Figure 8 A schematic diagram of a hybrid modal feature enhancement process provided in an embodiment;

[0043] Fig. 9 A schematic diagram of a hierarchical classifier training process provided in an embodiment;

[0044] Fig.10 A schematic diagram of an electronic device provided for an embodiment;

[0045] Fig.11 A schematic diagram of a computer-readable storage medium is provided for an embodiment. DETAILED DESCRIPTION

[0046] The problems of traditional product defect location methods are mainly concentrated in the following three aspects: 1. Subjectivity and inconsistency: Manual defect location is intuitive and simple but highly subjective. Different developers or testers may have different judgments, resulting in inconsistent location results; 2. Low efficiency and prone to errors: Manual location is relatively slow, especially in large-scale software projects, which requires a lot of time and effort to locate defects. At the same time, since manual location is susceptible to negligence and misjudgment, omissions or incorrect location may occur; 3. Lack of automation and data analysis: Traditional defect location usually lacks the support of automated tools and data analysis technology, and cannot quickly analyze a large amount of defect-related data and logs. The existing product defects and location conclusions that are composed of textual qualitative descriptions and digital quantitative descriptions simply use natural language processing technology for feature encoding, which may cause the importance of digital data to be ignored or obliterated, affecting the accuracy of defect location.

[0047] The present disclosure is committed to deeply mining this type of mixed modal data to improve the feature quality of the input data and give full play to the capabilities of the natural language processing model. At the same time, the Linear Discriminant Analysis (LDA) technology is used in combination with classification subtasks to perform hierarchical feature learning, aiming to obtain more discriminative defect classification and location features. Furthermore, the present disclosure combines machine learning algorithms with the above-mentioned mixed modal data as training samples to obtain a hierarchical product defect location classifier model, which can realize automatic auxiliary location of product defects.

[0048] The present disclosure is described below in conjunction with the accompanying drawings. The preferred embodiments described herein are only used to illustrate and explain the present disclosure and are not used to limit the present disclosure.

[0049] Figure 1 The method for constructing a product defect location model provided in the present disclosure includes:

[0050] Extracting features from the product defect description to obtain a first quantitative feature; the first quantitative feature includes: a product defect description quantitative feature and a log record quantitative feature based on digital decoupling; the product defect description quantitative feature is a text and digital integrated coding feature;

[0051] Extracting features from the hierarchically classified product positioning conclusions to obtain second quantitative features; the second quantitative features include: positioning conclusion hierarchical quantitative features;

[0052] Constructing a training data set according to the first quantitative feature and the second quantitative feature;

[0053] A hierarchical classifier is trained based on the training data set to obtain a product defect location model.

[0054] According to some embodiments of the present disclosure, the above method mainly includes three steps: quantitative feature extraction, mixed modal feature enhancement and hierarchical classifier training. Among them, quantitative feature extraction includes three parts: product defect description quantification (integrated coding features of text and numbers), log record quantification based on digital decoupling (digital features) and positioning conclusion hierarchical quantification; the mixed modal feature enhancement step includes three parts: integrated feature enhancement of text and numbers, digital feature enhancement and mixed modal feature concatenation; hierarchical classifier training includes: model selection, hierarchical classification design and hierarchical classifier training.

[0055] Furthermore, extracting quantitative features of the product defect description includes: extracting features of the product defect description, including: using a high-level encoder of a BERT-wwm model to vectorize and output high-level semantic features of the product defect description.

[0056] According to some embodiments of the present disclosure, quantitative feature extraction of product defect descriptions includes: feature encoding the defect descriptions (including log data) based on natural language processing.

[0057] This disclosure uses the BERT-wwm (WholeWordMasking) pre-trained model. Compared with the ordinary BERT model, this model can better preserve the integrity of Chinese semantics through the whole word masking strategy, and the quantitative features obtained are more comprehensive and accurate. The other structures are the same as the BERT model. Figure 2 As shown in the figure, the BERT-wwm model is composed of multiple layers of Transformer encoders stacked together. Taking the BERT-wwm model with 12 Transformer encoder layers as an example (each layer has 768 units), the roles of different layers in text feature extraction are as follows:

[0058] Embedding layer: including word embedding, position embedding and segment embedding, converting text into vector representation; low-level encoder (1-4 layers): mainly captures local lexical features and short-distance semantic relations; middle-level encoder (5-8 layers): integrates long-distance dependencies at the sentence level and constructs global semantic representation; high-level encoder (9-12 layers): extracts abstract semantic features and provides rich semantic information for downstream tasks; output layer: uses the output of [CLS] tags for downstream tasks such as text classification, question answering, etc.

[0059] In this embodiment, in combination with the characteristics of the current multi-classification task, taking into account both high-level semantics and detailed features, and avoiding the introduction of too much noise, high-level features are selected, such as Figure 2 As shown, take the output vectors of the 9th to 12th layers (respectively E 9 、E 10 、E 11 、E 12 Represents) as the extracted features of the input text, and the output vector dimension of each layer is 768.

[0060] Furthermore, extracting features from the product defect description also includes: extracting quantitative features from log data corresponding to the product defect description, including:

[0061] Quantify and structure log data;

[0062] Perform feature extraction on the processed log data and construct data feature vectors;

[0063] The data feature vector is used as the quantitative feature of the log data.

[0064] According to some embodiments of the present disclosure, the process of extracting quantitative features from product defect descriptions also includes decoupling the log data in the defect description and converting it into a structured format. Figure 3As shown in the figure, the log data in the defect description includes timestamp, routing table entry, destination IP address, next hop IP address, routing table update event and other information. These data are quantified and input into the classifier as independent features. The implementation process is as follows:

[0065] 1. Quantitative Representation of Log Data

[0066] (1) Timestamp: Converted to the unified Unix timestamp, represented by t.

[0067] (2) Routing table entries, destination IP address, next hop IP address:

[0068] They are represented as integers or category labels, denoted by R, dst_IP, and next_hop_IP respectively.

[0069] (3) Routing table update event: converted into a category label, for example, "add", "update", and "delete" are represented by 0, 1, and 2 respectively. Represented by event.

[0070] 2. Log data structuring

[0071] Assuming there are n log data, these data can be represented as a matrix X:

[0072]

[0073] Among them, x i =(t i ,R i ,dst_IP i ,next_hop_IP i ,event i ), which represents the vector of the i-th log data.

[0074] 3. Extracting features from log data

[0075] Assume there are h features, and the jth column c in matrix X j That is, a feature j is calculated for each column of data: (sequence length n, minimum value min(c j )、maximum valuemax(c j ), average value aver(c j ), standard deviation σ j ), where j∈{1,2,…,m}.

[0076] 4. Construct feature vector

[0077] Assuming that the log data has h columns (in this example, h = 5, corresponding to the five features of timestamp, routing table entry, destination IP address, next hop IP address, and routing table update event), the final feature vector The expression is: Its dimension is 5h.

[0078] Furthermore, feature extraction is performed on the product positioning conclusion after hierarchical classification, including:

[0079] Classify product positioning conclusions hierarchically;

[0080] Construct label vectors for each classification level based on one-hot encoding;

[0081] The obtained label vector set is used as the quantitative feature of the product positioning conclusion.

[0082] According to some embodiments of the present disclosure, by introducing a hierarchical defect classification architecture, an efficient, accurate and easily scalable solution is provided, which has significant innovation and practical value for the classification and diagnosis of complex product defects.

[0083] For multi-classification problems, as the number of categories increases, the classification task becomes more complex and the required training data scale also requires a larger scale. Through hierarchical classification, complex multi-classification tasks are decomposed into multiple simpler subtasks. Each subtask only needs to distinguish a small number of categories, making the model easier to learn and understand, thereby improving the accuracy and efficiency of classification.

[0084] The implementation process of the above solution includes: classifying product defects into categories C 1 (first level), which is then further broken down into subcategories and more specific components, forming (Second floor), (third layer), etc. Assume that there are k categories in the first layer, represented as Where p represents the category of the first level, p∈{1,2,…,k}. Each category of the first layer It can be further subdivided into mp subclasses, expressed as Where q represents the subclass of the second level, q∈{1,2,…,mp}. This hierarchical classification structure can be represented by a (p+q)-dimensional vector as like Figure 4 Each classification level and sub-class is represented by One-Hot Encoding, and the classification results are converted into a format suitable for machine learning model input, such as Figure 5 shown.

[0085] Furthermore, constructing a training data set according to the first quantitative feature and the second quantitative feature includes: concatenating the label vector and the feature vector of the product defect description.

[0086] According to some embodiments of the present disclosure, the first quantitative feature is divided into two types: text and digital integrated coding features and digital features. Before constructing the data set, the label vector is combined with the above two first quantitative features to construct a combined feature containing the label vector for classifier training, such as Figure 8 shown.

[0087] Furthermore, constructing a training data set according to the first quantitative feature and the second quantitative feature also includes: enhancing and reducing the dimension of the quantitative feature based on linear discriminant analysis.

[0088] According to some embodiments of the present disclosure, based on the empirical theory related to pattern recognition, directly using high-dimensional features will lead to insufficient generalization performance of the classification model, and the number of training samples must be more than ten times the feature dimension to ensure the generalization performance of the classification model. Considering that the current number of training samples is about thousands, the single-layer feature dimension of the hidden layer of the BERT model is 768, that is, only taking a single-layer feature dimension is already greater than the number of features that the current number of samples can support. Therefore, it is necessary to reduce the dimension of the features.

[0089] This paper introduces Linear Discriminant Analysis (LDA) to reduce and enhance the current high-dimensional features by using sample labels (i.e., positioning conclusions). By significantly reducing the feature dimensions, the model can still have good generalization performance under limited training samples.

[0090] Furthermore, the quantitative features are enhanced and reduced in dimension based on linear discriminant analysis, including:

[0091] Concatenate the label vector and the feature vector of the product defect description;

[0092] Construct the projection matrix corresponding to each layer of the concatenated feature vectors according to the linear discriminant analysis;

[0093] The projection matrix is ​​used to enhance and reduce the dimensionality of the corresponding layers of the concatenated feature vectors.

[0094] According to some embodiments of the present disclosure, the principle of reducing the dimension and enhancing the quantitative features corresponding to the product defect description and the quantitative features corresponding to the product positioning conclusion is as follows:

[0095] Linear discriminant analysis (LDA) is a statistical method for classification and dimensionality reduction, which can be used for the classification and dimensionality reduction of the above quantitative features:

[0096] 1. Classification: By finding a linear transformation that projects the data into a new space, the data of different categories are separated as much as possible in this space.

[0097] 2. Dimensionality reduction: Project high-dimensional data into a lower-dimensional space, retaining the maximum inter-class differences and reducing intra-class differences. The theoretical maximum dimension is (d-1), where d is the number of categories in the last layer, that is, the total number of categories.

[0098] 3. Objective function: Determine the optimal projection direction by maximizing the ratio of the inter-class scatter matrix to the intra-class scatter matrix. It can be expressed as: Here, W is the projection matrix, S B is the between-class scatter matrix, S W is the intra-class scatter matrix, and we look for the best projection surface, i.e., W, so that the objective function When solving W, select the eigenvector corresponding to the first (d-1) largest eigenvalue to form the projection matrix W, where d is the total number of categories.

[0099] like Figure 6 As shown in Figure 1, taking the binary classification task as an example, the optimal projection direction is found to maximize the distance between the two classes and make the distance within the class the most concentrated.

[0100] like Figure 7 As shown, using the linear discriminant analysis method, the processing process of the quantitative features corresponding to the product defect description and the quantitative features corresponding to the product positioning conclusion includes: integrated feature enhancement of text and numbers, digital feature enhancement and mixed modal feature concatenation.

[0101] 1. Integrated feature enhancement of text and numbers. The process includes feature representation, feature concatenation and feature enhancement. The implementation steps are as follows:

[0102] 1. Defect description integrated features, using E l represents the output vector of the selected encoder layer, l∈{9,10,11,12}. The dimension of each layer is 768.

[0103] 2. Locate the conclusion label, use Represents the label vector, and the number of categories in the last layer is the total number of categories, denoted by d.

[0104] 3. Concatenate the integrated features of each layer with the positioning conclusion label vector, and use express, l∈{9,10,11,12}. The dimension of each layer is (768+d).

[0105] 4. Output vector for each layer Use its corresponding LDA projection matrix W l Perform enhancement and dimensionality reduction: l∈{9,10,11,12}. E′ l The dimension of the enhanced dimension k is k, and the theoretical upper limit is k = d-1. Then the features after layered processing are concatenated. Its dimension is 4k=4(d-1).

[0106] Let's take an example to illustrate the above process. Assuming d = 10, the dimension after dimensionality reduction through linear discriminant analysis is k = (d-1) = 9.

[0107] 1. The integrated features of each layer of the selected encoder layer are:

[0108] E 9 =[0.1,0.2,0.3,…,0.768](768 dimensions)

[0109] E 10 =[0.4,0.5,0.6,…,0.768](768 dimensions)

[0110] E 11 =[0.7,0.8,0.9,…,0.768](768 dimensions)

[0111] E 12 =[1.0,1.1,1.2,…,0.768](768 dimensions)

[0112] 2. The label vector is:

[0113] 3. Concatenate the integrated features of each layer with the positioning conclusion label vector, and the dimension of each layer is 768+10=778

[0114] 4. According to the LDA algorithm, calculate the projection matrix W of each layer l , whose dimension is 778x(d-1)=778x9, and the concatenated feature vector of each layer Use the corresponding LDA projection matrix W l Perform enhancement and dimensionality reduction:

[0115]

[0116]

[0117] These enhanced features are then concatenated to obtain enhanced text and digital integration features. Its dimension is 4k=4x9=36.

[0118] After combining the original 768-dimensional feature vector with the category label, LDA is used to reduce the dimension and enhance it, and finally a 36-dimensional feature vector is obtained. This process not only reduces the feature dimension, but also enhances the discriminative ability of the feature.

[0119] 2. Digital Feature Enhancement

[0120] 1. Similarly, LDA (Linear Discriminant Analysis) is introduced to enhance the features using sample labels (i.e., positioning conclusions) to improve the classification ability of the features.

[0121] 2. Log feature vector for each sample Use its corresponding LDA projection matrix W log To enhance:

[0122] Its theoretical maximum dimension is d-1, where d is the number of categories in the last layer.

[0123] 3. Mixed modal feature concatenation

[0124] The text-digital integrated features and log features of each layer after dimensionality reduction and enhancement are concatenated as the input for subsequent hierarchical classifier training, expressed as: The process of mixed modality feature enhancement as the input of the classification trainer is as follows Figure 8 shown.

[0125] Furthermore, a product defect location model is constructed and trained based on the training data set, including:

[0126] Constructing a first-level classifier group including several classifiers;

[0127] Inputting the training data set into the first-level classifier group, training the first-level classifier group, and obtaining a number of first-level classification results;

[0128] Construct a second-level classifier group equal to the number of first-level classification results;

[0129] Using each first classification result as a guide, training a second-level classifier group corresponding to the first classification result in turn to obtain a plurality of second-level classification results;

[0130] Repeat the above method to construct a product defect localization model with multiple levels and each level containing several classifier groups; the number of levels of the product defect localization model is equal to the number of levels of the product positioning conclusion; the number of classifiers contained in each classifier group in the product defect localization model is the same and is positively correlated with the size of the training data set.

[0131] According to some embodiments of the present disclosure, the process of constructing a product defect location model includes: type selection and hierarchical classification design and hierarchical classifier training, and the implementation steps are as follows:

[0132] 1. Model selection and hierarchical classification design

[0133] The theoretical basis and practical effects of XGBoost have been widely recognized academically and it is an important tool in machine learning tasks. Therefore, this embodiment selects it as the multi-classification model.

[0134] The hierarchical positioning classifier model designed in the present invention gradually narrows the classification scope by layers, making each step of the classification task simpler and clearer, reducing the possibility of misclassification and improving the accuracy of classification.

[0135] 2. Hierarchical classifier training

[0136] (1) Training method design

[0137] In the present disclosure, the data conditions in the actual application scenarios are relatively complex, and there are uncertain factors such as high redundancy of training samples and strong noise. For example, duplicate bills of lading, some samples appear multiple times in the data set, resulting in data redundancy. The positioning conclusions are contradictory, and different positioning conclusions may be obtained for the same problem, which increases the noise of the data. The differences in the complexity of defects and the different complexity of different defects further increase the complexity of the data. These uncertain factors cause the classification model using a single learning rate and maximum classification depth to be prone to bias when processing such data, making it difficult to obtain stable and optimal classification results.

[0138] In order to balance the bias of various types of training data and different settings of classifiers, the present disclosure proposes a method for training M classifiers for each type of training data at each layer. The core idea of ​​this method is to establish a relationship between the number of classifiers M and the size of the training data set N, and the M classifiers correspond to different parameter (learning rate, maximum classification depth) settings.

[0139] When the training data samples are small, the pattern may be relatively simple and the classification difficulty is relatively small. In this case, a smaller M is set, and a classification result that meets the application requirements can be obtained using fewer classifiers. When the training data samples are large, the pattern may be more complex and the classification difficulty is relatively large. In this case, a larger M is set to obtain more classifiers to participate in the integrated classification, thereby improving the robustness and accuracy of the model.

[0140] In this embodiment, the number of classifiers M is set by raising the number of training samples N to the power of 1 / 2.2 and rounding down, that is, in, Represents the largest integer not greater than this number, that is, rounded down.

[0141] Combined with the actual business scenario of the present disclosure, the average number of bills of lading for a project is about 400-500, so the number of training classifiers is:

[0142]

[0143] (2) Integrated parameter setting design

[0144] a. Preset parameters

[0145] The problem to be solved in the present disclosure belongs to a multi-classification task, so the following model parameters are fixed: objective = multi:softprob, that is, the preset model is a multi-classification task, and the output category probability; num_class = k, that is, the preset number of categories, k>=3.

[0146] Adjust eta (learning rate) and max_depth (maximum depth), which are the two hyperparameters that have a greater impact on the model.

[0147] Learning rate eta: In XGBoost multi-classification tasks, the learning rate is a key hyperparameter that controls the step size of the weight update after each iteration during model training. The learning rate value range is [0.01, 0.3]. A large learning rate is suitable for fast convergence and simple problems, while a small learning rate is suitable for fine-tuning and high-noise data.

[0148] max_depth: In XGBoost multi-classification problems, max_depth is usually set between 3 and 10. With a high max_depth, the model can learn more complex patterns; with a low max_depth, the model's performance may be limited and it may be difficult to capture complex patterns.

[0149] At present, academia and industry also lack effective methods for adaptively setting such parameters. This paper proposes an adaptive multi-classifier integrated defect detection and positioning method, which integrates the setting of learning rate and maximum depth. Considering that max_depth (maximum depth) has a more direct and significant impact on the results, because it directly determines the complexity and expression ability of the model. Here, three fixed small, medium and large learning rates (0.01, 0.15, 0.3) are used to adjust the maximum depth of the model to set the parameters to obtain M integrated classifiers.

[0150] Generation of bM classifier models

[0151] As mentioned above, combined with the actual business scenario status of the present disclosure, M=15, when the learning rate is fixed at 3, M / 3=5 maximum depth values ​​are set, and the calculation process is as follows:

[0152] 1. max_depth step size: (10-3) / (M / 3-1)=(10-3) / (5-1)=1.75

[0153] The max_depth values ​​are: (3, 4.75, 6.5, 8.25, 10)

[0154] Considering that max_depth should be an integer, the fraction is rounded down to get max_depth = (3, 4, 6, 8, 10)

[0155] 2. Orthogonalizing the three fixed learning rates with max_depth yields M = 15 classifiers with the following parameter combinations:

[0156]

[0157] For example: C1 = (eta, max_depth) = (0.01, 3), and so on.

[0158] c. Generation of subsequent hierarchical classifier models

[0159] After the first layer of classifiers is trained, the number of training samples for each category in the second layer will change, still according to The number of classifiers to be trained for the current node is obtained by

[0160] (3) Model training

[0161] a. Basic model generation

[0162] Train M XGBoost models using the parameter combinations generated above. For the mth model, the parameters are θ m =(η m ,depth m ).

[0163] b. Data Representation

[0164] Enter the data Perform training and obtain M models: Model m That is, the parameter θ is used m The mth model obtained by training.

[0165] (1) For the first layer, assume that there are k categories in the first layer, expressed as Where p represents the category of the first level, p∈{1,…,p,…,k}. The input dataset can be represented as Train the first layer of classifiers for:

[0166] (2) For the second layer, assume that each category in the first layer It can be further divided into m p subclasses, represented by Where q represents the subclass of the second level, q∈{1,2,…,m p}.

[0167] c. Training steps

[0168] First, the classification results of the first layer Guide, the second layer classifier for each first layer category Train to get the second layer for the first layer category The trained classifier group The first level category Subclass of For classification. The input training sample set of the second layer is expressed as:

[0169] Enter the data Perform training and obtain M models: in, Represents the mth model, for the first layer category The trained classifier uses the parameters Training results in:

[0170] d. Expansion: If necessary, the hierarchy can be expanded by analogy. Each node needs to train a classifier group consisting of a set of M models, such as Fig. 9 shown.

[0171] The present disclosure also proposes a product defect location method, comprising: using a product defect location model constructed based on the above-mentioned product defect location model construction method to locate product defects.

[0172] According to some embodiments of the present disclosure, the product defect location model is used to locate the product defect, including:

[0173] 1. Data preparation

[0174] Assume that there are k categories in the first layer, represented as Where p represents the category of the first level, p∈{1,2,…,k}. Each category of the first layer It can be further divided into m p subclasses, represented by Where q represents the subclass of the second level, q∈{1,2,…,m p}.

[0175] 2. First-level prediction

[0176] For input X, use the first layer classifier group The M classifiers in are predicted separately. Assume that the probability vectors of each category in the first layer are obtained by training the mth model. Indicates that m∈{1,2,……,M}, k is the number of categories in the first layer, where P m,p Indicates that the mth model predicts that the input data belongs to the pth category The probability of the above process is expressed as follows:

[0177]

[0178] Ensemble discrimination: average the corresponding columns, that is, the input predicted by these M models belongs to the pth category The probability of averaging is used as the first layer classifier The probability vector of predicted belonging to each category is expressed as: in Indicates that it belongs to the pth category The probability of is obtained by averaging the probabilities of the corresponding categories of each model:

[0179] The category with the highest probability of discrimination is taken as the classification result of the first layer, and guides the classification of the second layer.

[0180] 3. Second level prediction

[0181] Assume that the first layer predicts that the input X belongs to the pth category in the first layer The probability is the largest, then the corresponding category is selected in the second layer The classifier group Make predictions.

[0182] Using Classifier Groups The M classifiers in predict respectively, and the probability vector is: in Indicates the use of a classifier group in the second layer The mth model in predicts that the input X belongs to Subclass of probability.

[0183] Ensemble discrimination: Similarly, the corresponding columns are averaged as the second layer The classifier group Prediction belongs to Subcategories of The probability of The category with the highest discriminant probability is taken as the classification result of the second layer.

[0184] 4. If necessary, you can continue to expand the levels by analogy.

[0185] like Fig.10 As shown, the present disclosure provides an electronic device 1000, which includes a memory 1002 and a processor 1001. The memory 1002 stores a computer program or instruction. When the computer program or instruction is executed by the processor 1001, it is at least used to implement the above-mentioned product defect location method.

[0186] like Fig.11 As shown, the present disclosure provides a computer-readable storage medium 1100, in which a computer program or instruction is stored. When the computer program or instruction is executed by a processor, it is at least used to implement the above-mentioned product defect location method.

[0187] The present disclosure also provides a computer program product, which is stored in a computer-readable storage medium. When the computer program product is executed by a processor, it is at least used to implement the above-mentioned product defect location method.

[0188] It is obvious that a person skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to include these modifications and variations.

Claims

1. A method for constructing a product defect location model, characterized in that: include: Extract features from the product defect description to obtain a first quantitative feature; The first quantitative feature includes: a product defect description quantitative feature and a log record quantitative feature based on digital decoupling; the product defect description quantitative feature is a text and digital integrated coding feature; Extracting features from the hierarchically classified product positioning conclusions to obtain second quantitative features; the second quantitative features include: positioning conclusion hierarchical quantitative features; Constructing a training data set according to the first quantitative feature and the second quantitative feature; A hierarchical classifier is trained based on the training data set to obtain a product defect location model.

2. The method according to claim 1, characterized in that Feature extraction is performed on the product defect description, including: using a high-level encoder of a BERT-wwm model to vectorize and output high-level semantic features of the product defect description.

3. The method according to claim 1, characterized in that Extracting features from the product defect description also includes: extracting quantitative features from log data corresponding to the product defect description, including: Performing data quantification and structural processing on the log data; Perform feature extraction on the processed log data and construct data feature vectors; The data feature vector is used as a quantitative feature of the log data.

4. The method according to claim 2 or 3, characterized in that Feature extraction is performed on the product positioning conclusion after hierarchical classification, including: Construct label vectors for each classification level based on one-hot encoding; The obtained label vector set is used as the quantitative feature of the product positioning conclusion.

5. The method according to claim 4, characterized in that Constructing a training data set according to the first quantitative feature and the second quantitative feature includes: concatenating the label vector and a feature vector of a product defect description.

6. The method according to claim 5, characterized in that Constructing a training data set according to the first quantitative feature and the second quantitative feature also includes: enhancing and reducing the dimension of the quantitative feature based on linear discriminant analysis.

7. The method according to claim 6, characterized in that Enhance and reduce the dimensionality of quantitative features based on linear discriminant analysis, including: Concatenating the label vector with a feature vector of a product defect description; Construct the projection matrix corresponding to each layer of the concatenated feature vectors according to the linear discriminant analysis; The projection matrix is ​​used to enhance and reduce the dimension of the corresponding layers of the concatenated feature vectors.

8. The method according to claim 7, characterized in that A hierarchical classifier is trained based on the training data set to obtain a product defect location model, including: Constructing a first-level classifier group including several classifiers; Inputting the training data set into the first-level classifier group, training the first-level classifier group, and obtaining a plurality of first-level classification results; Construct a second-level classifier group equal to the number of first-level classification results; Using each first classification result as a guide, training a second-level classifier group corresponding to the first classification result in turn to obtain a plurality of second-level classification results; Repeat the above method to construct a product defect location model with multiple levels and each level containing several classifier groups; the number of levels of the product defect location model is equal to the number of levels of the product location conclusion; the number of classifiers contained in each classifier group in the product defect location model is the same and is positively correlated with the size of the training data set.

9. A method for locating product defects, characterized in that: include: Product defect location is performed using a product defect location model constructed based on the product defect location model construction method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or instruction, and when the computer program or instruction is executed by the processor, it is used to implement at least the method of claim 9.

Citation Information

Cited By

  • Product defect positioning method and system based on large language model

    CN121278586A