Small sample defect detection method and device based on fuzzy reasoning system based on knowledge transfer

Through a fuzzy inference system based on knowledge transfer, the small sample industrial defect detection method solves the problem of small sample size and unexplainable model, and achieves high-precision and interpretable defect detection.

CN114418125BActive Publication Date: 2025-04-04UNIV OF SCI & TECH BEIJING
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210177982.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-24
Publication Date
2025-04-04
Estimated Expiration
2042-02-24

AI Technical Summary

Technical Problem

In industrial defect detection, when the number of samples is very small (within ten), it is difficult to train a model with high detection accuracy, and most of the models trained by existing methods are black boxes, which is difficult to meet the interpretability needs of the detection model.

Method used

A fuzzy inference system based on knowledge transfer is adopted and a small sample defect detection method. The method includes obtaining the sample to be detected, extracting defect features through the feature extraction model, and inputting it into the fuzzy logic system detection model to perform defect detection. The system uses deep learning and transfer knowledge to build a specific defect feature extraction model and a fuzzy logic system to realize knowledge transfer and fuzzy reasoning.

Benefits of technology

It can accurately detect industrial defects under small sample conditions, provide interpretable detection results, and meet the knowledge and comprehensibility requirements of the detection model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114418125B_ABST
    Figure CN114418125B_ABST
Patent Text Reader

Abstract

The present invention discloses a small sample defect detection method and device of a fuzzy reasoning system based on knowledge transfer, and relates to the technical field of defect detection. It includes: obtaining multiple samples to be detected; inputting the multiple samples to be detected into a constructed feature extraction model to obtain the defect features of the samples; wherein the feature extraction model includes multiple specific defect feature extraction models; the defect features of the samples include multiple defect types; inputting the defect features of the samples into a constructed fuzzy logic system detection model to obtain the defect detection results of the samples; the defect detection results of the samples are whether the defects of the samples are target defects. The present invention can accurately extract defect features, construct a knowledge transfer model to detect defects of small samples, and proposes a fuzzy reasoning system for knowledge transfer. By transferring knowledge to construct various parts of the fuzzy logic system, knowledge transfer is realized in a fuzzy reasoning manner, thereby realizing industrial defect detection under small sample conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of industrial defect detection, and in particular to a small sample defect detection method and device of a fuzzy reasoning system based on knowledge transfer. Background Art

[0002] With the continuous development of artificial intelligence technology, machine learning methods have been widely used in the field of industrial defect detection. Machine learning methods have the characteristics of weak dependence on domain knowledge, strong robustness, and high detection accuracy. They are an emerging and rapidly developing defect detection method. However, in practical applications, the problem of small number of training samples seriously hinders the use of machine learning methods. The small sample problem refers to the fact that in the actual detection model training process, the number of defect samples that can be obtained is very limited, and it is difficult to use a small number of defect samples to train an effective defect detection model. Therefore, in the process of using data-driven and machine learning methods to detect industrial defects, it is crucial to solve the problem of small samples.

[0003] In solving the problem of small sample defect detection, commonly used methods include virtual sample-based detection methods, feature mapping-based detection methods, and knowledge model-based detection methods. Virtual sample-based methods directly process small samples and use generative models or statistical methods to generalize and generate a large number of virtual samples; the main idea of ​​feature mapping-based methods is to map the original data into a unique feature space, and use metric learning and other methods in this space to deal with the problem of small samples; and knowledge-based methods use domain knowledge as auxiliary information to deal with the problem of small samples.

[0004] However, although these methods have made some progress in dealing with small sample problems, there are still some problems that restrict defect detection under small sample conditions: in actual industrial defect detection, if the number of collected samples is extremely small (less than ten), then even using the above-mentioned small sample processing method, it is difficult to train a model with high detection accuracy, which seriously affects normal defect detection; in practical applications, there is an extreme need for a detection model whose detection logic is knowable and understandable to others, but most of the models trained by existing methods are black box, which is difficult to meet the need for interpretable detection models. Summary of the invention

[0005] The present invention aims at the problem that in the existing technology, in actual industrial defect detection, if the number of collected samples is extremely small (within ten), it is difficult to train a model with high detection accuracy, which seriously affects normal defect detection; in practical applications, a detection model with known detection logic and understandable to others is extremely needed, but the models trained by the existing methods are mostly black box, which is difficult to meet the need for the detection model to be explainable, and the present invention is proposed.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] On the one hand, the present invention provides a small sample defect detection method of a fuzzy reasoning system based on knowledge transfer, which is implemented by an electronic device and includes:

[0008] S1. Obtain multiple samples to be tested.

[0009] S2. Input multiple samples to be tested into the constructed feature extraction model to obtain defect features of the samples; wherein the feature extraction model includes multiple specific defect feature extraction models; and the defect features of the samples include multiple defect types.

[0010] S3. Input the defect characteristics of the sample into the constructed fuzzy logic system detection model to obtain the defect detection result of the sample; the defect detection result of the sample is whether the defect of the sample is a target defect.

[0011] Optionally, the construction process of each specific defect feature extraction model of the multiple specific defect feature extraction models in S2 includes:

[0012] S21. Build a basic model for extracting specific defect features based on the domain knowledge of defect detection and deep learning models.

[0013] S22. Based on the domain knowledge of defect detection, select training data used to train a basic model for extracting specific defect features.

[0014] S23. According to the specific defect feature extraction basic model and the training data, a constructed specific defect feature extraction model is obtained.

[0015] Optionally, the specific defect feature extraction basic model in S21 is as shown in the following formula (1):

[0016]

[0017] Among them, a is the defect characteristic of the sample; a i is a specific defect feature of any sample among the defect features of the samples; is the specific defect feature extracted; It is the basic model for extracting specific defect features.

[0018] Optionally, the training data used for training the specific defect feature extraction basic model in S22 includes specific defect feature a i Opposing data With specific defect characteristics a i Data with similarities And other feature data in feature recognition transfer knowledge

[0019] Among them, the specific defect feature a i The opposite data is the data that does not contain the specific defect feature a i training data.

[0020] With specific defect characteristics a i The data with similarities do not belong to the specific defect feature a i , but with specific defect characteristics a i Similar training data.

[0021] Other feature data in the feature recognition transfer knowledge are the data in the transfer knowledge that are related to the specific defect feature a i Training data for specific defect characteristics are juxtaposed.

[0022] Optionally, the specific defect feature extraction model in S23 is as shown in the following formula (2):

[0023]

[0024] in, It is a feature recognition training network; It is the basic model for extracting specific defect features; The specific defect characteristic is a i training data; K d is the domain knowledge model for sample classification, and D is all the training data; K s It is a domain knowledge model of feature-similar classes; K t It is a transfer knowledge recognition model.

[0025] Optionally, the construction process of the fuzzy logic system detection model in S3 includes: constructing a model input, constructing a semantic variable L i , construct membership functions of semantic variables, define semantic variables using biterms, and construct new terms T i (d) And fit the new membership function and define the rule R.

[0026] Among them, constructing the model input includes: converting the defect characteristics of the sample into the input of the fuzzy logic system detection model, as shown in the following formula (3):

[0027]

[0028] in, Is a specific defect feature a i The eigenvector of is the basic model for extracting specific defect features; m is the preset vector dimension.

[0029] Construct semantic variable L i Includes: specific defect features a i Convert to semantic variable L i ; Each semantic variable consists of multiple terms, as shown in the following formula (4):

[0030]

[0031] Among them, T i P is the Pth term constructed.

[0032] Constructing the membership function of the semantic variable includes: establishing a membership function for each semantic variable, and the membership function of the t-th term of the i-th semantic variable is shown in the following formula (5):

[0033]

[0034] in, is the membership function of the constructed t-th term; T i t is the tth term constructed.

[0035] Semantic variables are defined using biterms, where the biterms include positive terms and negative terms, as shown in the following formula (6):

[0036] v={v (p) ,v (n)},L i ={T i (p) ,T i (n)} (6)

[0037] Among them, v (p) is the probability that the sample belongs to the target defect feature; v (n) is the probability that the sample falls outside the target defect type; T i (p) is the positive term of the i-th semantic variable, indicating that it meets the target defect characteristics; T i (n) is the negative term of the i-th semantic variable, indicating that it does not meet the target defect characteristics.

[0038] Optionally, constructing new terms and fitting new membership functions includes:

[0039] Calculate the mean and standard deviation of the target defect as shown in formula (7):

[0040]

[0041] Where N is the total amount of training data; η (d) is the calculated mean; η (d) is the calculated standard deviation.

[0042] According to the mean and standard deviation of the target defect, the membership function of the triangle is constructed. The membership function of the triangle is a new membership function. The constructed new term is defined as T i (d) .

[0043] According to the new terms and new membership functions, a new term structure is formed, as shown in the following formula (8):

[0044] L i ={T i (p) ,T i (n) ,T i (d)} (8)

[0045] Among them, T i (p) is the positive term of the i-th semantic variable, indicating that it meets the target defect characteristics; T i (n) is the negative term of the i-th semantic variable, indicating that it does not meet the target defect characteristics.

[0046] Optionally, defining rule R includes: according to the new term T i (d) , define rule R; rule R includes positive rule R p and negative rule R n .

[0047] The positive rule indicates that if all required defect features of a sample fall into the new term of the target defect type, then the sample belongs to the target defect type, as shown in the following formula (9):

[0048]

[0049] Where k is the number of semantic variables; is the positive term of the fuzzy output, indicating that the sample belongs to the target defect type.

[0050] The negative rule indicates that if any required defect feature of a sample falls outside the new term of its target defect type, the sample does not belong to the target defect type, as shown in the following formula (10):

[0051]

[0052] in, is the negative term of the fuzzy output, indicating that the sample does not belong to the target defect type.

[0053] Optionally, in S3, the defect characteristics of the sample are input into the constructed fuzzy logic system detection model to obtain the defect detection result of the sample, including:

[0054] S31, input the defect features of the sample into the constructed fuzzy logic system detection model, and the membership function in the fuzzy logic system detection model processes the feature vectors of each specific defect feature input to obtain the corresponding ignition level, as shown in the following formula (11):

[0055]

[0056] Among them, Fl r is the firing level of the rth rule, r∈R(R p ,R n ), R p is a positive rule and R n It is a negative rule; It represents the membership function of the i-th eigenvector corresponding to the r-th rule; ∧ is the minimum t-norm operator.

[0057] S32, use ignition level Fl r Calculate with the new membership function of the fuzzy logic system to obtain the fuzzy output, as shown in the following formula (12):

[0058]

[0059] Among them, μ c (y) is the new membership function; is the calculated fuzzy output.

[0060] S33, integrating the fuzzy outputs calculated by each rule, as shown in the following formula (13):

[0061]

[0062] in, is the fuzzy output after integration; is the maximum operator; M is the number of rules.

[0063] S34, defuzzify the integrated fuzzy output to obtain the probability p that the sample defect is the target defect, as shown in the following formula (14):

[0064]

[0065] S35. If the value of p is greater than 0.5, then it is determined that the detected sample is a target defect; if the value of p is less than or equal to 0.5, then it is determined that the detected sample is not a target defect.

[0066] On the other hand, the present invention provides a small sample defect detection device for a fuzzy inference system based on knowledge transfer, which is used to implement a small sample defect detection method for a fuzzy inference system based on knowledge transfer, and the device includes:

[0067] The acquisition module is used to acquire multiple samples to be detected.

[0068] The feature extraction module is used to input the multiple samples to be detected into the constructed feature extraction model to obtain the defect features of the samples; wherein the feature extraction model includes multiple specific defect feature extraction models; the defect features of the samples include multiple defect types.

[0069] The output module is used to input the defect characteristics of the sample into the constructed fuzzy logic system detection model to obtain the defect detection result of the sample; the defect detection result of the sample is whether the defect of the sample is a target defect.

[0070] Optionally, the feature extraction module is further used to:

[0071] S21. Build a basic model for extracting specific defect features based on the domain knowledge of defect detection and the deep learning model;

[0072] S22. Selecting training data used for training a basic model for extracting specific defect features based on domain knowledge of defect detection;

[0073] S23. According to the specific defect feature extraction basic model and the training data, a constructed specific defect feature extraction model is obtained.

[0074] Optionally, a specific defect feature extraction basic model is shown in the following formula (1):

[0075]

[0076] Among them, a is the defect characteristic of the sample; a i is a specific defect feature of any sample among the defect features of the samples; is the specific defect feature extracted; It is the basic model for extracting specific defect features.

[0077] Optionally, the training data used to train the specific defect feature extraction basic model includes the specific defect feature a i Opposing data With specific defect characteristics a i Data with similarities And other feature data in feature recognition transfer knowledge

[0078] Among them, the specific defect feature a iThe opposite data is the data that does not contain the specific defect feature a i training data;

[0079] With specific defect characteristics a i The data with similarities do not belong to the specific defect feature a i , but with specific defect characteristics a i Similar training data;

[0080] Other feature data in the feature recognition transfer knowledge are the data in the transfer knowledge that are related to the specific defect feature a i Training data for specific defect characteristics are juxtaposed.

[0081] Optionally, a specific defect feature extraction model is shown in the following formula (2):

[0082]

[0083] in, It is a feature recognition training network; It is the basic model for extracting specific defect features; The specific defect characteristic is a i training data; K d is the domain knowledge model for sample classification, and D is all the training data; K s It is a domain knowledge model of feature-similar classes; K t It is a transfer knowledge recognition model.

[0084] Optionally, the output module is further configured to:

[0085] Construct model input and construct semantic variable L i , construct membership functions of semantic variables, define semantic variables using biterms, and construct new terms T i (d) And fit the new membership function and define the rule R;

[0086] Among them, constructing the model input includes: converting the defect characteristics of the sample into the input of the fuzzy logic system detection model, as shown in the following formula (3):

[0087]

[0088] in, Is a specific defect feature a i The eigenvector of is the basic model for extracting specific defect features; m is the preset vector dimension;

[0089] Construct semantic variable Li Includes: specific defect features a i Convert to semantic variable L i ; Each semantic variable consists of multiple terms, as shown in the following formula (4):

[0090]

[0091] in, is the Pth term constructed;

[0092] Constructing the membership function of the semantic variable includes: establishing a membership function for each semantic variable, and the membership function of the t-th term of the i-th semantic variable is shown in the following formula (5):

[0093]

[0094] in, is the membership function of the constructed t-th term; T i t is the tth term constructed;

[0095] Semantic variables are defined using biterms, where the biterms include positive terms and negative terms, as shown in the following formula (6):

[0096]

[0097] Among them, v (p) is the probability that the sample belongs to the target defect feature; v (n) is the probability that the sample falls outside the target defect type; T i (p) is the positive term of the i-th semantic variable, indicating that it meets the target defect characteristics; T i (n) is the negative term of the i-th semantic variable, indicating that it does not meet the target defect characteristics.

[0098] Optionally, the output module is further configured to:

[0099] Calculate the mean and standard deviation of the target defect as shown in formula (7):

[0100]

[0101] Where N is the total amount of training data; η (d) is the calculated mean; η (d) is the calculated standard deviation;

[0102] According to the mean and standard deviation of the target defect, the membership function of the triangle is constructed. The membership function of the triangle is a new membership function. The constructed new term is defined as T i(d) ;

[0103] According to the new terms and new membership functions, a new term structure is formed, as shown in the following formula (8):

[0104] L i ={T i (p) ,T i (n) ,T i (d)} (8)

[0105] Among them, T i (p) is the positive term of the i-th semantic variable, indicating that it meets the target defect characteristics; T i (n) is the negative term of the i-th semantic variable, indicating that it does not meet the target defect characteristics.

[0106] Optionally, defining rule R includes: according to the new term T i (d) , define rule R; rule R includes positive rule R p and negative rule R n ;

[0107] The positive rule indicates that if all required defect features of a sample fall into the new term of the target defect type, then the sample belongs to the target defect type, as shown in the following formula (9):

[0108]

[0109] Where k is the number of semantic variables; is the positive term of the fuzzy output, indicating that the sample belongs to the target defect type.

[0110] The negative rule indicates that if any required defect feature of a sample falls outside the new term of its target defect type, the sample does not belong to the target defect type, as shown in the following formula (10):

[0111]

[0112] in, is the negative term of the fuzzy output, indicating that the sample does not belong to the target defect type.

[0113] Optionally, the output module is further configured to:

[0114] S31, input the defect features of the sample into the constructed fuzzy logic system detection model, and the membership function in the fuzzy logic system detection model processes the feature vectors of each specific defect feature input to obtain the corresponding ignition level, as shown in the following formula (11):

[0115]

[0116] Among them, Fl r is the firing level of the rth rule, r∈R(R p ,R n ), R p is a positive rule and R n It is a negative rule; represents the membership function of the i-th eigenvector corresponding to the r-th rule; ∧ is the minimum t-norm operator;

[0117] S32, use ignition level Fl r Calculate with the new membership function of the fuzzy logic system to obtain the fuzzy output, as shown in the following formula (12):

[0118]

[0119] Among them, μ c (y) is the new membership function; is the calculated fuzzy output;

[0120] S33, integrating the fuzzy outputs calculated by each rule, as shown in the following formula (13):

[0121]

[0122] in, is the fuzzy output after integration; is the maximum operator; M is the number of rules;

[0123] S34, defuzzify the integrated fuzzy output to obtain the probability p that the sample defect is the target defect, as shown in the following formula (14):

[0124]

[0125] S35. If the value of p is greater than 0.5, then it is determined that the detected sample is a target defect; if the value of p is less than or equal to 0.5, then it is determined that the detected sample is not a target defect.

[0126] On the one hand, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the above-mentioned fuzzy reasoning system small sample defect detection method based on knowledge transfer.

[0127] On the one hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the above-mentioned small sample defect detection method of a fuzzy reasoning system based on knowledge transfer.

[0128] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0129] In the above scheme, first, a specific defect feature extraction model is constructed based on the domain knowledge of defect detection. The defect-specific feature extraction model is trained by building a classification model based on the feature data related to the deep learning network and the transfer knowledge, so that accurate defect features can be extracted. Then, a knowledge transfer model is constructed to detect defects in small samples, and a fuzzy reasoning system for knowledge transfer is proposed. By transferring knowledge to construct various parts of the fuzzy logic system, knowledge transfer is realized by fuzzy reasoning, thereby realizing industrial defect detection under small sample conditions.

[0130] The use of knowledge-based feature extractors can accurately extract the features of samples, and defect detection based on knowledge transfer is more accurate. Fuzzy logic ensures high-precision modeling of knowledge modeling. The "positive and negative rules" are easy to set and adjust, ensuring the flexibility of knowledge application. Features that cannot be obtained can be extracted from synthetic samples with high uncertainty. BRIEF DESCRIPTION OF THE DRAWINGS

[0131] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0132] Figure 1 It is a flowchart of a small sample defect detection method of a fuzzy reasoning system based on knowledge transfer provided by an embodiment of the present invention;

[0133] Figure 2 It is a flowchart of a small sample defect detection method of a fuzzy reasoning system based on knowledge transfer provided by an embodiment of the present invention;

[0134] Figure 3 It is a block diagram of a small sample defect detection device of a fuzzy reasoning system based on knowledge transfer provided by an embodiment of the present invention;

[0135] Figure 4 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0136] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0137] like Figure 1 As shown, an embodiment of the present invention provides a small sample defect detection method of a fuzzy reasoning system based on knowledge transfer, which can be implemented by an electronic device. Figure 1 The flowchart of the small sample defect detection method of the fuzzy reasoning system based on knowledge transfer is shown. The processing flow of the method may include the following steps:

[0138] S1. Obtain multiple samples to be tested.

[0139] In a feasible implementation manner, the present invention is illustrated by taking industrial pipeline weld defect detection as an example. Among the existing pipeline defect samples, the more common defect types are circular defect samples and strip defect samples, but the less common are strip-circle defect samples. The present invention can construct a strip-circle defect recognition model based on the circular defect samples and the strip defect samples to detect the strip-circle defects.

[0140] The multiple industrial pipeline weld samples to be inspected obtained by the present invention may include defective pipeline weld samples and non-defective pipeline weld samples. The defective pipeline weld samples may include defect types such as circular defects, strip defects, and strip-circle defects, etc.; they may also include incomplete penetration defect types, etc.

[0141] S2. Input multiple samples to be tested into the constructed feature extraction model to obtain defect features of the samples; wherein the feature extraction model includes multiple specific defect feature extraction models; and the defect features of the samples include multiple defect types.

[0142] In a feasible implementation, Figure 2 As shown, the samples to be detected with multiple defect types are input into the constructed feature extraction model. First, the classifier in the feature extraction model classifies the samples to be detected, and then the required specific defect features are input into the corresponding specific defect feature extraction model to obtain the specific defect features.

[0143] For example, the classifier may classify the samples to be tested, input the defect samples of the circular defect category into the circular defect feature extraction model, and extract the circular defect features. The defect samples of the strip defect category may be input into the strip defect feature extraction model, and extract the strip defect features.

[0144] Optionally, the construction process of each specific defect feature extraction model of the multiple specific defect feature extraction models in S2 includes:

[0145] S21. Build a basic model for extracting specific defect features based on the domain knowledge of defect detection and deep learning models.

[0146] In a feasible implementation, the domain knowledge of defect detection is used to construct a feature extractor based on a deep learning model. a , thereby obtaining the accurate characteristics of the defects.

[0147] Optionally, the specific defect feature extraction basic model in S21 is as shown in the following formula (1):

[0148]

[0149] Among them, a is the defect characteristic of the sample; a i is a specific defect feature of any sample among the defect features of the samples; is the specific defect feature extracted; It is the basic model for extracting specific defect features.

[0150] In a feasible implementation, based on domain knowledge, a deep model is used to construct an extraction model for a feature of a specific defect, which is used to extract a specific feature information of the defect. First, a basic model for feature extraction is built.

[0151] For example, a is the defect feature of the sample, including a1 circular defect feature and a2 strip defect feature.

[0152] The ResNet (Residual Network) deep model can be selected to build a basic model for circular defect feature extraction and a basic model for strip defect feature extraction.

[0153] S22. Based on the domain knowledge of defect detection, select training data used to train a basic model for extracting specific defect features.

[0154] Optionally, the training data used for training the specific defect feature extraction basic model in S22 includes specific defect feature a i Opposing data With specific defect characteristics a i Data with similarities And other feature data in feature recognition transfer knowledge

[0155] Among them, the specific defect feature a i The opposite data is the data that does not contain the specific defect feature a i training data.

[0156] Take the bar feature as an example. Represents all samples of non-bar defects in all data samples.

[0157] With specific defect characteristics a i The data with similarities do not belong to the specific defect feature a i , but with specific defect characteristics a i Similar training data.

[0158] Take the bar feature as an example. It means that among all the samples, there are features similar to the bar features, such as the "lack of penetration" defect, which also has the shape of a bar, but they are two different defects from the bar defect.

[0159] Other feature data in the feature recognition transfer knowledge are the data in the transfer knowledge that are related to the specific defect feature a i Training data for specific defect characteristics are juxtaposed.

[0160] Taking the bar feature as an example, if the transferred knowledge is: "If a defect has the tail feature of a bar defect and the head feature of a round defect, then this defect is a rare bar round defect", then the data It means that in this transfer knowledge, there are data samples with "circular features" that are parallel to "bar features".

[0161] S23. According to the specific defect feature extraction basic model and the training data, a constructed specific defect feature extraction model is obtained.

[0162] Optionally, the specific defect feature extraction model in S23 is as shown in the following formula (2):

[0163]

[0164] in, It is a feature recognition training network; It is the basic model for extracting specific defect features; The specific defect characteristic is a i training data; K d is the domain knowledge model for sample classification, and D is all the training data; K s It is a domain knowledge model of feature-similar classes; K t It is a transfer knowledge recognition model.

[0165] In a feasible implementation, L is a trained feature recognition model. While using a supervised learning method to train the recognition model L, the feature extraction model f a It will also be well trained, and the trained feature extraction model f aFor subsequent small sample defect detection. Since the final distinction is feature classification, The SVM (Support Vector Machine) classifier with lower complexity is selected as the recognition model.

[0166] S3. Input the defect characteristics of the sample into the constructed fuzzy logic system detection model to obtain the defect detection result of the sample; the defect detection result of the sample is whether the defect of the sample is a target defect.

[0167] Optionally, the construction process of the fuzzy logic system detection model in S3 includes: constructing a model input, constructing a semantic variable L i , construct membership functions of semantic variables, define semantic variables using biterms, and construct new terms T i (d) And fit the new membership function and define the rule R.

[0168] Among them, constructing the model input includes: converting the defect characteristics of the sample into the input of the fuzzy logic system detection model, as shown in the following formula (3):

[0169]

[0170] in, Is a specific defect feature a i The eigenvector of is the basic model for extracting specific defect features; m is the preset vector dimension.

[0171] For example, It is the feature vector of the extracted circular defect feature, or the feature vector of the strip defect feature.

[0172] Construct semantic variable L i Includes: specific defect features a i Convert to semantic variable L i ; Each semantic variable consists of multiple terms, as shown in the following formula (4):

[0173]

[0174] Among them, T i P is the Pth term constructed.

[0175] Constructing the membership function of the semantic variable includes: establishing a membership function for each semantic variable, and the membership function of the t-th term of the i-th semantic variable is shown in the following formula (5):

[0176]

[0177] in, is the membership function of the constructed t-th term; T i t is the tth term constructed.

[0178] In order to make the distinction of defect features more concise, the present invention uses two terms to define semantic variables, that is, to define "positive terms" and "negative terms", as shown in the following formula (6):

[0179]

[0180] Among them, v (p) is the probability that the sample belongs to the target defect feature; v (n) is the probability that the sample falls outside the target defect type; T i (p) is the positive term of the i-th semantic variable, indicating that it meets the target defect characteristics; T i (n) is the negative term of the i-th semantic variable, indicating that it does not meet the target defect characteristics.

[0181] Optionally, constructing new terms and fitting new membership functions includes:

[0182] 1. Calculate the mean and standard deviation of the target defect, as shown in formula (7):

[0183]

[0184] Where N is the total amount of training data; is the probability that the jth training data belongs to the target defect feature; η (d) is the calculated mean; η (d) is the calculated standard deviation.

[0185] For example, the target defect may be a bar defect.

[0186] 2. According to the mean and standard deviation of the target defect, the triangular membership function is constructed. The triangular membership function is a new membership function. The constructed new term is defined as T i (d) .

[0187] In a feasible implementation, the value of the vertex of the triangle membership function is set to η (d) , the two endpoints of the triangle are set to η (d) -3σ (d) and η (d) +3σ (d) , then the triangular function is the membership function of the new term, and the constructed new term is defined as T i (d) .

[0188] 3. Based on the new terms and new membership functions, a new term structure is formed, as shown in the following formula (8):

[0189] L i ={T i (p) ,T i (n) ,T i (d)} (8)

[0190] Among them, T i (p) is the positive term of the i-th semantic variable, indicating that it meets the target defect characteristics; T i (n) is the negative term of the i-th semantic variable, indicating that it does not meet the target defect characteristics.

[0191] In one feasible implementation, the new term T i (d) and its membership functions are integrated into the original fuzzy inference system to form a new terminology structure.

[0192] Optionally, defining rule R includes: according to the new term T i (d) , define rule R; rule R includes positive rule R p and negative rule R n .

[0193] The positive rule indicates that if all required defect features of a sample fall into the new term of the target defect type, then the sample belongs to the target defect type, as shown in the following formula (9):

[0194]

[0195] Where k is the number of semantic variables; is the positive term of the fuzzy output, indicating that the sample belongs to the target defect type.

[0196] The negative rule indicates that if any required defect feature of a sample falls outside the new term of its target defect type, the sample does not belong to the target defect type, as shown in the following formula (10):

[0197]

[0198] in, is the negative term of the fuzzy output, indicating that the sample does not belong to the target defect type.

[0199] Optionally, in S3, the defect characteristics of the sample are input into the constructed fuzzy logic system detection model to obtain the defect detection result of the sample, including:

[0200] S31, input the defect features of the sample into the constructed fuzzy logic system detection model, and the membership function in the fuzzy logic system detection model processes the feature vectors of each specific defect feature input to obtain the corresponding ignition level, as shown in the following formula (11):

[0201]

[0202] Among them, Fl r is the firing level of the rth rule, r∈R(R p ,R n ), R p is a positive rule and R n It is a negative rule; It represents the membership function of the i-th eigenvector corresponding to the r-th rule; ∧ is the minimum t-norm operator.

[0203] S32, use ignition level Fl r Calculate with the new membership function of the fuzzy logic system to obtain the fuzzy output, as shown in the following formula (12):

[0204]

[0205] Among them, μ c (y) is the new membership function; is the calculated fuzzy output.

[0206] S33, integrating the fuzzy outputs calculated by each rule, as shown in the following formula (13):

[0207]

[0208] in, is the fuzzy output after integration; is the maximum operator; M is the number of rules.

[0209] S34, defuzzify the integrated fuzzy output to obtain the probability p that the sample defect is the target defect, as shown in the following formula (14):

[0210]

[0211] S35. If the value of p is greater than 0.5, then it is determined that the detected sample is a target defect; if the value of p is less than or equal to 0.5, then it is determined that the detected sample is not a target defect.

[0212] In an embodiment of the present invention, first, a model for extracting specific defect features is constructed based on the domain knowledge of defect detection, and the extraction model of defect-specific features is trained by building a classification model based on feature data related to a deep learning network and transfer knowledge, so that accurate defect features can be extracted; then, a knowledge transfer model is constructed to detect defects in small samples, and a fuzzy reasoning system for knowledge transfer is proposed. By transferring knowledge to construct various parts of a fuzzy logic system, knowledge transfer is achieved in a fuzzy reasoning manner, thereby achieving industrial defect detection under small sample conditions.

[0213] The use of knowledge-based feature extractors can accurately extract the features of samples, and defect detection based on knowledge transfer is more accurate. Fuzzy logic ensures high-precision modeling of knowledge modeling. The "positive and negative rules" are easy to set and adjust, ensuring the flexibility of knowledge application. Features that cannot be obtained can be extracted from synthetic samples with high uncertainty.

[0214] like Figure 3 As shown, an embodiment of the present invention provides a small sample defect detection device 300 of a fuzzy inference system with knowledge transfer, and the device 300 is applied to implement a small sample defect detection method of a fuzzy inference system with knowledge transfer, and the device 300 includes:

[0215] The acquisition module 310 is used to acquire a plurality of samples to be detected.

[0216] The feature extraction module 320 is used to input the multiple samples to be detected into the constructed feature extraction model to obtain the defect features of the samples; wherein the feature extraction model includes multiple specific defect feature extraction models; the defect features of the samples include multiple defect types.

[0217] The output module 330 is used to input the defect characteristics of the sample into the constructed fuzzy logic system detection model to obtain the defect detection result of the sample; the defect detection result of the sample is whether the defect of the sample is a target defect.

[0218] Optionally, the feature extraction module 320 is further used to:

[0219] S21. Build a basic model for extracting specific defect features based on the domain knowledge of defect detection and the deep learning model;

[0220] S22. Selecting training data used for training a basic model for extracting specific defect features based on domain knowledge of defect detection;

[0221] S23. According to the specific defect feature extraction basic model and the training data, a constructed specific defect feature extraction model is obtained.

[0222] Optionally, a specific defect feature extraction basic model is shown in the following formula (1):

[0223]

[0224] Among them, a is the defect characteristic of the sample; a i is a specific defect feature of any sample among the defect features of the samples; is the specific defect feature extracted; It is the basic model for extracting specific defect features.

[0225] Optionally, the training data used to train the specific defect feature extraction basic model includes the specific defect feature a i Opposing data With specific defect characteristics a i Data with similarities And other feature data in feature recognition transfer knowledge

[0226] Among them, the specific defect feature a i The opposite data is the data that does not contain the specific defect feature a i training data;

[0227] With specific defect characteristics a i The data with similarities do not belong to the specific defect feature a i , but with specific defect characteristics a i Similar training data;

[0228] Other feature data in the feature recognition transfer knowledge are the data in the transfer knowledge that are related to the specific defect feature a i Training data for specific defect characteristics are juxtaposed.

[0229] Optionally, a specific defect feature extraction model is shown in the following formula (2):

[0230]

[0231] in, It is a feature recognition training network; It is the basic model for extracting specific defect features; The specific defect characteristic is a i training data; K d is the domain knowledge model for sample classification, and D is all the training data; K s It is a domain knowledge model of feature-similar classes; K t It is a transfer knowledge recognition model.

[0232] Optionally, the output module 330 is further configured to:

[0233] Construct model input and construct semantic variable L i , construct membership functions of semantic variables, define semantic variables using biterms, and construct new terms T i (d) And fit the new membership function and define the rule R;

[0234] Among them, constructing the model input includes: converting the defect characteristics of the sample into the input of the fuzzy logic system detection model, as shown in the following formula (3):

[0235]

[0236] in, Is a specific defect feature a i The eigenvector of is the basic model for extracting specific defect features; m is the preset vector dimension;

[0237] Construct semantic variable L i Includes: specific defect features a i Convert to semantic variable L i ; Each semantic variable consists of multiple terms, as shown in the following formula (4):

[0238]

[0239] Among them, T i P is the Pth term constructed;

[0240] Constructing the membership function of the semantic variable includes: establishing a membership function for each semantic variable, and the membership function of the t-th term of the i-th semantic variable is shown in the following formula (5):

[0241]

[0242] in, is the membership function of the constructed t-th term; T i t is the tth term constructed;

[0243] Semantic variables are defined using biterms, where the biterms include positive terms and negative terms, as shown in the following formula (6):

[0244]

[0245] Among them, v (p) is the probability that the sample belongs to the target defect feature; v (n)is the probability that the sample falls outside the target defect type; T i (p) is the positive term of the i-th semantic variable, indicating that it meets the target defect characteristics; T i (n) is the negative term of the i-th semantic variable, indicating that it does not meet the target defect characteristics.

[0246] Optionally, the output module 330 is further configured to:

[0247] Calculate the mean and standard deviation of the target defect as shown in formula (7):

[0248]

[0249] Where N is the total amount of training data; η (d) is the calculated mean; η (d) is the calculated standard deviation;

[0250] According to the mean and standard deviation of the target defect, the membership function of the triangle is constructed. The membership function of the triangle is a new membership function. The constructed new term is defined as T i (d) ;

[0251] According to the new terms and new membership functions, a new term structure is formed, as shown in the following formula (8):

[0252] L i ={T i (p) ,T i (n) ,T i (d)} (8)

[0253] Among them, T i (p) is the positive term of the i-th semantic variable, indicating that it meets the target defect characteristics; T i (n) is the negative term of the i-th semantic variable, indicating that it does not meet the target defect characteristics.

[0254] Optionally, defining rule R includes: according to the new term T i (d) , define rule R; rule R includes positive rule R p and negative rule R n ;

[0255] The positive rule indicates that if all required defect features of a sample fall into the new term of the target defect type, then the sample belongs to the target defect type, as shown in the following formula (9):

[0256]

[0257] Where k is the number of semantic variables; is the positive term of the fuzzy output, indicating that the sample belongs to the target defect type.

[0258] The negative rule indicates that if any required defect feature of a sample falls outside the new term of its target defect type, the sample does not belong to the target defect type, as shown in the following formula (10):

[0259]

[0260] in, is the negative term of the fuzzy output, indicating that the sample does not belong to the target defect type.

[0261] Optionally, the output module 330 is further configured to:

[0262] S31, input the defect features of the sample into the constructed fuzzy logic system detection model, and the membership function in the fuzzy logic system detection model processes the feature vectors of each specific defect feature input to obtain the corresponding ignition level, as shown in the following formula (11):

[0263]

[0264] Among them, Fl r is the firing level of the rth rule, r∈R(R p ,R n ), R p is a positive rule and R n It is a negative rule; represents the membership function of the i-th eigenvector corresponding to the r-th rule; ∧ is the minimum t-norm operator;

[0265] S32, use ignition level Fl r Calculate with the new membership function of the fuzzy logic system to obtain the fuzzy output, as shown in the following formula (12):

[0266]

[0267] Among them, μ c (y) is the new membership function; is the calculated fuzzy output;

[0268] S33, integrating the fuzzy outputs calculated by each rule, as shown in the following formula (13):

[0269]

[0270] in, is the fuzzy output after integration; is the maximum operator; M is the number of rules;

[0271] S34, defuzzify the integrated fuzzy output to obtain the probability p that the sample defect is the target defect, as shown in the following formula (14):

[0272]

[0273] S35. If the value of p is greater than 0.5, then it is determined that the detected sample is a target defect; if the value of p is less than or equal to 0.5, then it is determined that the detected sample is not a target defect.

[0274] In an embodiment of the present invention, first, a model for extracting specific defect features is constructed based on the domain knowledge of defect detection, and the extraction model of defect-specific features is trained by building a classification model based on feature data related to a deep learning network and transfer knowledge, so that accurate defect features can be extracted; then, a knowledge transfer model is constructed to detect defects in small samples, and a fuzzy reasoning system for knowledge transfer is proposed. By transferring knowledge to construct various parts of a fuzzy logic system, knowledge transfer is achieved in a fuzzy reasoning manner, thereby achieving industrial defect detection under small sample conditions.

[0275] The use of knowledge-based feature extractors can accurately extract the features of samples, and defect detection based on knowledge transfer is more accurate. Fuzzy logic ensures high-precision modeling of knowledge modeling. The "positive and negative rules" are easy to set and adjust, ensuring the flexibility of knowledge application. Features that cannot be obtained can be extracted from synthetic samples with high uncertainty.

[0276] Figure 4 4 is a schematic diagram of the structure of an electronic device 400 provided in an embodiment of the present invention. The electronic device 400 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 401 and one or more memories 402, wherein the memory 402 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 401 to implement the following method:

[0277] S1. Obtain multiple samples to be tested.

[0278] S2. Input multiple samples to be tested into the constructed feature extraction model to obtain defect features of the samples; wherein the feature extraction model includes multiple specific defect feature extraction models; and the defect features of the samples include multiple defect types.

[0279] S3. Input the defect characteristics of the sample into the constructed fuzzy logic system detection model to obtain the defect detection result of the sample; the defect detection result of the sample is whether the defect of the sample is a target defect.

[0280] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions, which can be executed by a processor in a terminal to complete the fuzzy reasoning system small sample defect detection method with knowledge transfer. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0281] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0282] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A small sample defect detection method of fuzzy reasoning system based on knowledge transfer, characterized in that: The method comprises: S1. Acquire a plurality of samples to be tested; wherein the plurality of samples to be tested include: a plurality of industrial pipeline weld samples to be tested; S2. Input the plurality of samples to be tested into the constructed feature extraction model to obtain defect features of the samples; wherein the feature extraction model includes a plurality of specific defect feature extraction models; and the defect features of the samples include a plurality of defect types; S3, inputting the defect characteristics of the sample into the constructed fuzzy logic system detection model to obtain the defect detection result of the sample; the defect detection result of the sample includes: whether the defect of the industrial pipeline weld sample is a target defect; The construction process of the fuzzy logic system detection model in S3 includes: constructing model input, constructing semantic variables L i , construct membership functions of semantic variables, define semantic variables using biterms, and construct new terms T i (d) And fit the new membership function and define the rule R; The constructing model input includes: converting the defect characteristics of the sample into the input of the fuzzy logic system detection model, as shown in the following formula (1): in, Is a specific defect feature a i The eigenvector of is the basic model for extracting specific defect features; m is the preset vector dimension; The constructed semantic variable L i Includes: specific defect features a i Convert to semantic variable L i ; Each semantic variable consists of multiple terms, as shown in the following formula (2): in, is the Pth term constructed; The construction of the membership function of the semantic variable includes: establishing a membership function for each semantic variable, and the membership function of the t-th term of the i-th semantic variable is shown in the following formula (3): in, is the membership function of the constructed t-th term; T i t is the tth term constructed; The semantic variable is defined using a binary term, wherein the binary term includes a positive term and a negative term, as shown in the following formula (4): v={v (p) ,v (n) },L i ={T i (p) ,T i (n) } (4) Among them, v (p) is the probability that the sample belongs to the target defect feature; v (n) is the probability that the sample falls outside the target defect type; T i (p) is the positive term of the i-th semantic variable, indicating that it meets the target defect characteristics; T i (n) is the negative term of the i-th semantic variable, indicating that it does not meet the target defect characteristics.

2. The method according to claim 1, characterized in that The construction process of each specific defect feature extraction model of the multiple specific defect feature extraction models in S2 includes: S21. Build a basic model for extracting specific defect features based on the domain knowledge of defect detection and the deep learning model; S22. Selecting training data used for training the specific defect feature extraction basic model based on the domain knowledge of defect detection; S23, obtaining a constructed specific defect feature extraction model based on the specific defect feature extraction basic model and training data.

3. The method according to claim 2, characterized in that The specific defect feature extraction basic model in S21 is shown in the following formula (5): Among them, a is the defect characteristic of the sample; a i is a specific defect feature of any sample among the defect features of the samples; is the specific defect feature extracted; It is the basic model for extracting specific defect features.

4. The method according to claim 2, characterized in that: The training data used for training the specific defect feature extraction basic model in S22 includes specific defect feature a i Opposing data With specific defect characteristics a i Data with similarities And other feature data in feature recognition transfer knowledge Among them, the specific defect feature a i The opposite data is the data that does not contain the specific defect feature a i training data; The specific defect characteristics i The data with similarities do not belong to the specific defect feature a i , but with specific defect characteristics a i Similar training data; The other feature data in the feature recognition transfer knowledge is the data in the transfer knowledge that is related to the specific defect feature a. i Training data for specific defect characteristics are juxtaposed.

5. The method according to claim 2, characterized in that: The specific defect feature extraction model in S23 is shown in the following formula (6): in, It is a feature recognition training network; It is the basic model for extracting specific defect features; The specific defect characteristic is a i training data; K d is the domain knowledge model for sample classification, and D is all the training data; K s It is a domain knowledge model of feature-similar classes; K t It is a transfer knowledge recognition model.

6. The method according to claim 1, characterized in that The constructing of new terms and fitting of new membership functions include: Calculate the mean and standard deviation of the target defect as shown in the following formula (7): Where N is the total amount of training data; η (d) is the calculated mean; η (d) is the calculated standard deviation; According to the mean and standard deviation of the target defect, a triangular membership function is constructed, and the triangular membership function is a new membership function. The constructed new term is defined as T i (d) ; According to the new terms and new membership functions, a new term structure is formed, as shown in the following formula (8): L i ={T i (p) ,T i (n) ,T i (d) } (8) Among them, T i (p) is the positive term of the i-th semantic variable, indicating that it meets the target defect characteristics; T i (n) is the negative term of the i-th semantic variable, indicating that it does not meet the target defect characteristics.

7. The method according to claim 6, characterized in that The definition rule R includes: according to the new term T i (d) , define rule R; the rule R includes the regular rule R p and negative rule R n ; The positive rule indicates that if all required defect features of a sample fall into the new term of the target defect type, the sample belongs to the target defect type, as shown in the following formula (9): Where k is the number of semantic variables; is the positive term of the fuzzy output, indicating that the sample belongs to the target defect type; The negative rule indicates that if any required defect feature of a sample falls outside the new term of its target defect type, the sample does not belong to the target defect type, as shown in the following formula (10): in, is the negative term of the fuzzy output, indicating that the sample does not belong to the target defect type.

8. The method according to claim 1, characterized in that The step of inputting the defect features of the sample into the constructed fuzzy logic system detection model in S3 to obtain the defect detection results of the sample includes: S31, input the defect features of the sample into the constructed fuzzy logic system detection model, and the membership function in the fuzzy logic system detection model processes the feature vectors of each specific defect feature input to obtain the corresponding ignition level, as shown in the following formula (11): Among them, Fl r is the firing level of the rth rule, r∈R(R p ,R n ), R p is a positive rule and R n It is a negative rule; represents the membership function of the i-th eigenvector corresponding to the r-th rule; ^ is the minimum t-norm operator; S32, using the ignition level F1 r Calculate with the new membership function of the fuzzy logic system to obtain the fuzzy output, as shown in the following formula (12): Among them, μ c (y) is the new membership function; is the calculated fuzzy output; S33, integrating the fuzzy outputs calculated by each rule, as shown in the following formula (13): in, is the fuzzy output after integration; is the maximum operator; M is the number of rules; S34, defuzzify the integrated fuzzy output to obtain the probability p that the sample defect is the target defect, as shown in the following formula (14): S35. If the value of p is greater than 0.5, then it is determined that the detected sample is a target defect; if the value of p is less than or equal to 0.5, then it is determined that the detected sample is not a target defect.

9. A small sample defect detection device based on fuzzy reasoning system of knowledge transfer, characterized in that: The device comprises: An acquisition module is used to acquire a plurality of samples to be tested; wherein the plurality of samples to be tested include: a plurality of industrial pipeline weld samples to be tested; A feature extraction module, used to input the plurality of samples to be detected into a constructed feature extraction model to obtain defect features of the samples; wherein the feature extraction model includes a plurality of specific defect feature extraction models; the defect features of the samples include a plurality of defect types; The output module is used to input the defect characteristics of the sample into the constructed fuzzy logic system detection model to obtain the defect detection result of the sample; the defect detection result of the sample includes: whether the defect of the industrial pipeline weld sample is a target defect; The construction process of the fuzzy logic system detection model includes: constructing model input, constructing semantic variables L i , construct membership functions of semantic variables, define semantic variables using biterms, and construct new terms T i (d) And fit the new membership function and define the rule R; The constructing model input includes: converting the defect characteristics of the sample into the input of the fuzzy logic system detection model, as shown in the following formula (1): in, Is a specific defect feature a i The eigenvector of is the basic model for extracting specific defect features; m is the preset vector dimension; The constructed semantic variable L i Includes: specific defect features a i Convert to semantic variable L i ; Each semantic variable consists of multiple terms, as shown in the following formula (2): in, is the Pth term constructed; The construction of the membership function of the semantic variable includes: establishing a membership function for each semantic variable, and the membership function of the t-th term of the i-th semantic variable is shown in the following formula (3): in, is the membership function of the constructed t-th term; T i t is the tth term constructed; The semantic variable is defined using a binary term, wherein the binary term includes a positive term and a negative term, as shown in the following formula (4): v={v (p) ,v (n) },L i ={T i (p) ,T i (n) } (4) Among them, v (p) is the probability that the sample belongs to the target defect feature; v (n) is the probability that the sample falls outside the target defect type; T i (p) is the positive term of the i-th semantic variable, indicating that it meets the target defect characteristics; T i (n) is the negative term of the i-th semantic variable, indicating that it does not meet the target defect characteristics.

Citation Information

Patent Citations

  • Welding seam defect detection method, device, equipment and system

    CN108008006A