CN113724197B - Thread screwing property judging method based on meta-learning - Google Patents

Thread screwing property judging method based on meta-learning Download PDF

Info

Publication number
CN113724197B
CN113724197B CN202110847674.5A CN202110847674A CN113724197B CN 113724197 B CN113724197 B CN 113724197B CN 202110847674 A CN202110847674 A CN 202110847674A CN 113724197 B CN113724197 B CN 113724197B
Authority
CN
China
Prior art keywords
data set
model
training
thread
meta
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110847674.5A
Other languages
Chinese (zh)
Other versions
CN113724197A (en
Inventor
涂中
陈盛
徐国政
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University of Posts and Telecommunications
Original Assignee
Nanjing University of Posts and Telecommunications
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing University of Posts and Telecommunications filed Critical Nanjing University of Posts and Telecommunications
Priority to CN202110847674.5A priority Critical patent/CN113724197B/en
Publication of CN113724197A publication Critical patent/CN113724197A/en
Application granted granted Critical
Publication of CN113724197B publication Critical patent/CN113724197B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B21/00Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant
    • G01B21/10Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant for measuring diameters
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B21/00Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant
    • G01B21/16Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant for measuring distance of clearance between spaced objects
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B21/00Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant
    • G01B21/22Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant for measuring angles or tapers; for testing the alignment of axes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component

Abstract

The invention discloses a thread screwing property judging method based on meta learning. The method comprises the following steps: s1: collecting thread parameter information to prepare an original data set; labeling the original data set; obtaining an unbalanced thread parameter data set; s2: carrying out balancing treatment on the unbalanced thread parameter data set to obtain a detection data set; normalizing the detection data set; s3, dividing the normalized detection data set into a pre-training data set and a fine tuning data set; s4: constructing an artificial neural network model, taking a pre-training data set as the input of the model, and adopting a MAML (maximum likelihood markup language) element learning algorithm to perform thread screwing characteristic pre-training to obtain a pre-trained element model Meta and initialization parameters; s5: inputting the fine adjustment data set into the Meta-model Meta for fine adjustment training of the screw thread screwing characteristic to obtain a screw thread screwing judgment model M fine‑tune . The invention can obtain an accurate model through a small sample data set, improves the accuracy, the high efficiency and the generalization of the detection of the screw thread screwing propertyReliability and reliability.

Description

Thread screwing property judging method based on meta-learning
Technical Field
The invention relates to the technical field of thread detection and meta-learning, and particularly provides a thread screwing performance judging method based on meta-learning.
Background
With the continuous progress of society, social economy is rapidly developed, various technologies are continuously developed, and requirements are higher and higher. Thread detection is a complex technology, and with the continuous development of technology, the requirements of people on thread detection are higher and higher, and the requirements on the quality of threads are also higher and higher, so that after the threads are finished, the detection on the quality of the threads becomes a necessary and critical step. In the prior art, the detection of the thread factory products is mainly finished by manpower, the efficiency is low, the cost is high, and errors can occur in the detected standards, so that the quality of threads is uneven.
The existing method for training the model by utilizing the image recognition technology uses a large number of training data sets to train the model by using an image fitting method, has a general effect, and has a non-ideal effect on a small sample data set.
According to the search, the Chinese patent publication No. CN109919941A is in favor of 2019, 6 and 21, and discloses a method, a device, a system, computer equipment and a storage medium for detecting internal thread defects, wherein an internal thread image of a target object sent by an image acquisition module is firstly acquired, and the internal thread image is an image which is acquired by the image acquisition module through a prism component and the image acquisition component and comprises complete internal thread information of the target object, so that the efficiency and the precision of internal thread image acquisition can be ensured; further, the internal thread image is identified through a preset defect detection model, and defect detection information of the target object is obtained. The efficiency and the accuracy of defect identification in the internal thread image are ensured. However, the fitting accuracy is low, and the data processing amount is large. A judgment method with higher precision and more precision needs to be designed; the method has ideal judging effect on the small sample data set.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a thread screwing performance judging method based on meta-learning, which can solve the problems of low thread screwing performance detection speed, low accuracy and incapability of guaranteeing the detection effect, and also solves the problem of non-ideal detection effect on a small sample data set in the prior art.
In order to achieve the above purpose, the present invention provides the following technical solutions:
the thread screwing performance judging method based on meta learning specifically comprises the following steps:
s1, collecting thread parameter information including thread pitch diameter, thread angle, thread pitch, major diameter, minor diameter and the like, and taking the information as a sampleAnd making the original CSV data set; by analyzing the original data set, marking the original data according to the national standard GB/T197-2003 thread tolerance, marking the qualification meeting the tolerance zone standard as 1, and marking the disqualification as 0;
s2, carrying out data processing and feature processing, carrying out balancing processing on the unbalanced thread parameter data set, and carrying out balancing processing on the unbalanced thread parameter data set by using a C-K-SMOTE algorithm to obtain a detection data set; normalizing each sample in the detection dataset;
s3, dividing the detection data set after normalization in the step S2 into a fine adjustment data set and a pre-training data set according to a data quality standard;
s4, constructing an artificial neural network model M with forward and backward bi-directional propagation, using a pre-training data set as the input of the model, and adopting a MAML element learning algorithm to obtain a pre-trained element model Meta and initialization parameters;
s5, taking a training set in the fine adjustment data set as the input of the model Meta, and performing fine adjustment training on the thread screwing judgment model to obtain a trained thread screwing judgment model M fine-tune
S6, taking a test set in the fine tuning data set as a model M fine-tune The accuracy of the thread screwing judgment model is obtained.
Preferably, in step S1, the data in the dataset is recorded as (n is the number of thread parameter samples) }.
Preferably, in step S2, the C-K-SMOTE algorithm may convert the unbalanced thread parameter data set into a balanced data set; the method comprises the following specific steps:
s21: coarse clustering is carried out on unqualified types of screw thread screwing property in the unbalanced data set by using a Canopy algorithm, so that a plurality of coarse clusters are obtained;
s22: setting a K-means algorithm to preset a cluster number K according to the number of the coarse clusters, and clustering again to obtain accurate clusters;
s23: based on the plurality of accurate clusters with unqualified screw thread screwing performance obtained in the step S22, a SMOTE oversampling algorithm is applied, and a modified random interpolation formula is adopted to obtain a new synthesized screw thread screwing performance unqualified sample, so that the number of unqualified minority classes in the screw thread parameter sample is increased, and the screw thread parameter data set is balanced.
Wherein the modified random interpolation formula is:
P j =P i +rand(0,1)(u t -P i ) (1)
wherein: p (P) i (i=1, 2., n) is a thread-on failure class sample, n is the total number of thread-on failure class samples; u (u) t (t=1, 2,., k) is the exact cluster center of the screw-thread failure sample, k represents the cluster number thereof; p (P) j (j=1, 2,., m) is a composite new thread-set failure sample, m is the total number of new composite thread-set failures; rand (0, 1) is a random number in the (0, 1) interval.
Preferably, in step S2, the preprocessing of the data set is performed to optimize the thread parameters after the processing of the data set, unified measure the data set, and perform normalization to improve the accuracy and convergence speed of the model. The Z-Score method is applied, and the formula is as follows:
P=(P 0 -μ)/σ (2)
wherein P is 0 = (pitch, tooth angle, pitch, major diameter, minor diameter, thread lead angle), P is the thread parameter dataset feature normalization vector, μ is the thread parameter dataset feature mean vector, σ is the thread parameter dataset feature standard deviation vector.
Preferably, in step S3, the step of formulating the data quality standard (i.e., a priori knowledge) includes: measuring the same thread 10 times by using different instruments to obtain 10 data, taking the data as uncertainty mu according to the standard deviation sigma corresponding to the Bessel formula, and dividing the data into high-quality data and general data according to the uncertainty; the data set is divided into a fine tuning data set and a pre-training data set according to the proportion of 1:3, wherein the fine tuning data set is all high-quality data, and the time and the accuracy of fine tuning model training are improved.
Preferably, in step S4, the structure of the model M is as follows: a 3-layer neural network, wherein the input layer comprises 6 neurons to accept the input of 6 characteristics of each sample, the 1-layer hidden layer comprises 4 neurons, so that the model can fully receive the characteristics of the samples, the integrity of sample information is maintained, the generalization capability of the model is enhanced, the output layer is 1 neuron, and finally the neural network output is connected with an activation function; the neural network is a fully connected artificial neural network.
The model M is trained by adopting MAML (Model Agnostic Meta Learning) algorithm in meta learning to train the initialization parameters of the artificial neural network.
Specifically, in step S4, the specific process of pre-training the thread screwing characteristic by using the pre-training data set as the input of the model M is as follows:
s401, extracting a thread parameter sample from a pre-training data set to be divided into a pre-training judging task set of different tasks, namely a thread parameter training set A, a thread training set B, a thread training set C and a thread training set D, wherein the task sets are small sample data sets; the data size is 50; each task set is divided into a support data set and a query data set:
s402, copying the original artificial neural network model M, and adopting a random initialization methodInitializing model parameters θ 0 Then training the artificial neural network model M, and using a thread training set A in a first training stage; initialization θ of model-based parameters 0 Calculating a loss function of the artificial neural network model M on the support data set of the task A, and optimizing an initialization parameter theta of the model M by adopting a random gradient descent method 0 Obtain unique model parameter theta on task A A Then, training the task B by adopting a training method the same as that of the task A to obtain a unique model parameter theta on the task B B The method comprises the steps of carrying out a first treatment on the surface of the And then, for the task C, the task D and the like, the training method is adopted in sequence to finally obtain the specific model parameters theta on each different task i . Parameter θ i The update formula is as follows:
θ i =θ 0 -αΔ i (3)
wherein: θ 0 Initializing parameters delta for thread screwing judging model i (i=a, B, C, D., N) is a random gradient on each task, N is the number of tasks, and D is the initial learning rate.
S403, model parameter θ unique to task A A Taking the query data set in the task A as an input model parameter theta A In the model of (2), a corresponding loss function is obtained AA ) Then, the same processing mode as the task A is adopted for other tasks to obtain a corresponding loss function I ii ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein the loss function uses a cross entropy loss function, wherein the formula is as follows:
l ii )=y i logf θ (P i )+(1-y i )log(1-f θ (P i )) (4)
wherein: y is i A thread sample label is represented, the thread screwing performance is qualified as 1, and the disqualification is 0; f (f) θ (P i ) And the probability that the sample is qualified in the screw thread screwing property is predicted through an artificial neural network model is represented.
S404, performing a second gradient update on the original artificial neural network model, and obtaining the loss on each task of the batchLoss function l ii ) The addition results in a sum of loss functions, the formula is as follows:
wherein: l (θ) is the sum of loss functions obtained by all N thread screwing performance judging tasks, L ii ) A loss function of the task is determined for each thread turn-up.
S405, updating the initialization parameters of the original model, wherein the initialization parameters are updated by random gradient descent through the loss function and L (theta) of the batch obtained in the last step, and the formula is as follows:
wherein: θ M The model parameters of the Meta model Meta are judged for the screw thread screwing performance, and beta is the Meta learning rate.
Wherein the number of tasks is multiple, not necessarily only four tasks; multiple batch loop iterations are also possible.
Preferably, in step S5, the fine data set is input with an initialization parameter θ M The model Meta is subjected to fine tuning training, wherein the model Meta does not need to randomly initialize parameters any more, but utilizes the trained model initialization parameters theta M The method comprises the steps of carrying out a first treatment on the surface of the Extracting a plurality of tasks from the fine tuning data set, dividing each task into a support data set and a query data set, and initializing parameter theta of a Meta model by using the support data set of the tasks M And performing fine tuning training, wherein the training process is the same as the model pre-training process. Finally, a thread screwing judgment model M is obtained fine-tune
The process of fine tuning the model does not need a second gradient update, but directly updates the model parameters by using the result of the first gradient calculation.
Preferably, in step S6, the query data set in the task extracted from the fine adjustment data set is inputInto model M fine-tune In the method, a prediction result obtained through the model is compared with an actual result to obtain a classification effect of the final model
Compared with the prior art, the invention has the beneficial effects that:
(1) According to the invention, a more accurate thread screwing property judging model can be obtained through the accurate thread parameter data set, and compared with the existing image fitting method, the method is simpler, more convenient and more accurate, the quality problem of thread screwing property can be more efficiently checked, and the quality of thread screwing property is further ensured.
(2) The invention uses the MAML method, belongs to small sample learning, can obtain an accurate model by taking a small amount of data as a small sample data set, and improves the rapidity, the high efficiency and the generalization and the reliability of the screw thread screwing detection.
(3) The invention has the advantages of no need of increasing detection cost, high detection efficiency and good popularization and application value.
Drawings
FIG. 1 is a flow chart of a thread closure determination method based on meta-learning according to the present invention;
FIG. 2 is a schematic diagram of training a thread closure judgment model according to the present invention;
FIG. 3 is a flow chart of the thread parameter dataset balancing of the present invention;
Detailed Description
The following description of the embodiments of the present invention will be made in detail and with reference to the accompanying drawings, wherein it is apparent that the embodiments described are only some, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
Examples
In the embodiment, 15 threads of national standard coarse-tooth screws M2.0, M3.0, M4.0, M5.0, M6.0, M7.0, M8.0, M9.0 and M10 are adopted, wherein 14 threads are qualified in screwing performance, 1 thread is unqualified in screwing performance, and thread parameters are measured on two thread measuring instruments.
As shown in fig. 1, the thread screwing performance judging method based on meta learning specifically includes the following steps:
s1, collecting a training data set and a fine adjustment data set, wherein the 6 thread parameter characteristics are used as one sample by collecting 6 characteristic parameters of different thread parameters such as pitch diameter, thread pitch, major diameter, minor diameter, thread angle and thread lead angle, the different types are classified into different types according to the different thread parameter characteristics and thread specifications, the pre-training data set comprises 10 types, the fine adjustment data set comprises 5 types, and each type comprises 10 samples; and preparing each type of data into a CSV file, firstly marking a sample with qualified screw thread screwing performance as 1 according to the national standard GB/T197-2003 screw thread tolerance on the data collected for the first time, and marking a sample with unqualified screw thread screwing performance as 0 on the contrary.
S2, as the marked data set belongs to an unbalanced data set, the unbalanced thread parameter data set can be converted into a balanced data set by using a C-K-SMOTE algorithm as shown in FIG. 3; (1) Coarse clustering is carried out on unqualified types of screw thread screwing property in the unbalanced data set by using a Canopy algorithm, so that 3 coarse clusters are obtained; (2) Setting the number of the K-means algorithm preset cluster clusters to be 3 according to the number of the coarse clusters, and clustering again to obtain accurate clusters; (3) Based on the 3 accurate clusters with unqualified screw thread screwing performance obtained in the step (2), a SMOTE oversampling algorithm is applied, a new synthesized screw thread screwing performance unqualified sample can be obtained by adopting a modified random interpolation formula, the number of unqualified minority classes in the screw thread parameter sample is increased, and the screw thread parameter data set is balanced. Wherein the modified random interpolation formula is:
P j =P i +rand(0,1)(u t -P i )
wherein: p (P) i (i=1, 2.,. 10) a screw-on failure class sample, 10 a screw-on failure class sample total; u (u) t (t=1, 2,.. 10) is a thread-screwing failed sample precision cluster core; p (P) j (j=1, 2,.. 10) is a composite new thread-on failure sample; rand (0, 1) is a random number in the (0, 1) interval.
Normalizing the pretreatment of the data set, and uniformly measuring the thread parameters of different specifications. Normalizing the data set to enable the data set to be rapidly recognized and calculated by a machine, and applying a Z-Score method, wherein the formula is as follows:
P=(P 0 -μ)/σ
wherein: p (P) 0 = (pitch, tooth angle, pitch, major diameter, minor diameter, thread lead angle), P is the thread parameter dataset feature normalization vector, μ is the thread parameter dataset feature mean vector, σ is the thread parameter dataset feature standard deviation vector.
S3, measuring the same thread on the same machine 10 times according to measurement on a thread measuring instrument to obtain 10 data, taking the data as uncertainty mu according to the standard deviation sigma corresponding to the Bessel formula, and dividing the data into high-quality data and general data according to the uncertainty; the data set is divided into a fine tuning data set and a pre-training data set according to the proportion of 1:3, wherein the fine tuning data set is all high-quality data, (namely, the data set is divided into the fine tuning data set and the pre-training data set according to priori knowledge), so that the time and the model accuracy of fine tuning model training can be improved.
S4, firstly, constructing an artificial neural network model M with forward and backward bidirectional propagation, wherein the model adopts a neural network of 3 layers, an input layer comprises 6 neurons to accept the input of 6 characteristics of each sample, a 1-layer hidden layer comprises 4 neurons, an output layer comprises 1 neuron, and a sigmoid activation function is connected behind the output layer to serve as the final output; the specific process of pre-training the thread-screwing feature using the pre-training dataset as input to the model M is as shown in fig. 2: in the figure, phi is the initial parameter of the network model, n is meta tran bach size, task-learn is trained k times, alpha is the task-learner learning rate, and beta is the meta-leamer learning rate.
S401, dividing the pre-training data set into different task pre-training judging task sets, namely a thread training set A, a thread training set B, a thread training set C, a thread training set D and other task sets according to different thread parameters to form a batch, wherein the batch size is 40; each pre-training judgment task set is divided into a support data set and a query data set.
S402, copying an original artificial neural network model M, and initializing model parameters theta by adopting a random initialization method 0 Then starting training the artificial neural network model M, and using a thread training set A in a first training stage; initialization θ of model-based parameters 0 Calculating a loss function of the artificial neural network model M on a support data set of the thread training set A, and optimizing an initialization parameter theta of the model M by adopting a random gradient descent method A Obtain unique model parameters theta on the thread training set A A Then, for the thread training set B, a training method identical to the thread training set A is adopted to obtain unique model parameters theta on the thread training set B B The method comprises the steps of carrying out a first treatment on the surface of the And then, sequentially adopting the training method for the thread training set C, the thread training set D and the like to finally obtain the specific model parameters theta on each different thread training set i . Parameter θ i The update formula is as follows:
θ i =θ 0 -αΔ i
wherein: θ 0 Initializing parameters delta for thread screwing judging model i (i=ugly, B, C, D.,. Epsilon.) is a random gradient on each task, n=40 is the number of tasks, and the initial learning rate α is 1e-3.
S403, model parameters theta unique to the thread training set A A Taking a query data set in the thread training set A as an input model parameter theta A In the model of (2), a corresponding loss function is obtained AA ) Then, the same processing mode as the thread training set A is adopted for other tasks to obtain a corresponding loss function l ii ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein the loss function uses a cross entropy loss function, wherein the formula is as follows:
l ii )=y i logf θ (P i )+(1-y i )log(1-f θ (P i ))
wherein: y is i A thread sample label is represented, the thread screwing performance is qualified as 1, and the disqualification is 0; i=0, 1, 2..40 is the number of tasks, f θ (P i ) Representing the sampleThe probability of qualified screw thread screwing property is predicted through an artificial neural network model.
S404, performing a second gradient update on the original artificial neural network model, and determining the obtained loss function l on each pre-training judgment task set of the batch ii ) The addition results in a sum of loss functions, the formula is as follows:
wherein: l (θ) is the sum of loss functions obtained by all 40 thread-closure judging tasks, L ii ) A loss function of the task is determined for each thread turn-up.
S405, updating the initialization parameters of the original model, wherein the initialization parameters are updated by random gradient descent through the loss function and L (theta) of the batch obtained in the last step, and the formula is as follows:
wherein: θ M The Meta learning rate β is 0.001, which is a model parameter of the Meta model Meta.
The training process in the step S4 is a loop iteration process, and 10000 loops are set as conditions for loop termination, wherein the initialization parameters of the artificial neural network in each loop are Meta model parameters theta obtained in the previous loop M
S5, inputting the fine tuning data set into an initialization parameter theta according to the Meta model Meta obtained in the last step M The model Meta carries out fine tuning training, wherein the model Meta does not need to randomly initialize parameters any more, but utilizes the trained model initialization parameters; extracting a plurality of tasks from the fine tuning data set, dividing each task into a support data set and a query data set, and initializing parameter theta of a Meta model by using the support data set of the tasks M Fine-tuning training, trainingThe process is the same as the model pre-training process. Finally, a thread screwing judgment model M is obtained fine-tune
S6, inputting a query data set in the task extracted from the fine tuning data set into the model M fine-tune And (3) comparing the predicted result obtained by the model with the actual result to obtain the classification accuracy of the final model.
S7, inputting the screw thread parameter information to be measured into a model M fine-tune In (3), the screw thread screwing performance is judged.
According to the embodiment, a more accurate thread screwing judgment model can be obtained through the accurate thread parameter data set, and the method is more accurate than the existing image fitting method. The method solves the problems of low speed and low accuracy of the existing thread screwing detection method, and realizes a fast and efficient thread detection method.
The foregoing is merely a preferred embodiment of the present invention, and it should be noted that modifications and variations could be made by those skilled in the art without departing from the technical principles of the present invention, and such modifications and variations should also be regarded as being within the scope of the invention.
In the description of the present specification, reference to the terms "one embodiment," "certain embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced with equivalents; these modifications or substitutions do not depart from the essence of the corresponding technical solutions from the technical solutions of the present embodiment.

Claims (3)

1. The thread screwing performance judging method based on meta learning is characterized by comprising the following steps of:
s1, collecting a plurality of sets of thread parameter information, taking each set of thread parameter information as an original sample, and manufacturing a plurality of original samples into an original data set; analyzing the original data set, and marking the original data set according to the thread tolerance judgment standard; labeling a qualified original sample as 1, and labeling an unqualified original sample as 0 to obtain an unbalanced thread parameter data set; the thread parameter information comprises a pitch, a major diameter, a minor diameter, a tooth angle and a thread lead angle;
s2, carrying out balancing treatment on the unbalanced thread parameter data set in the step S1 to obtain a detection data set; normalizing each detection sample in the detection data set; the Z-Score method is used for normalizing the detection sample;
the specific steps of the balancing treatment of the unbalanced thread parameter data set comprise:
s21, performing coarse clustering on unqualified classes in the unbalanced data set by using a Canopy algorithm to obtain a plurality of coarse clusters;
s22, setting a preset cluster number K of a K-means algorithm according to the number of the coarse clusters in the step S21, and clustering again to obtain a plurality of accurate clusters;
s23, based on the plurality of accurate clusters obtained in the step S22, utilizing an SMOTE oversampling algorithm to obtain a balanced thread parameter data set;
s3, dividing the detection data set after normalization in the step S2 into a pre-training data set and a fine tuning data set according to a data quality standard;
the data quality standard making step comprises the following steps:
s31, measuring the same thread for a plurality of times by using different instruments to obtain thread parameter information and obtain initial data;
s32, obtaining a standard deviation sigma according to a Bessel formula, taking the standard deviation sigma as an uncertainty mu, and respectively marking initial data as high-quality data and general data according to the uncertainty mu;
s33, dividing the detection data set into a fine tuning data set and a pre-training data set according to a preset proportion, wherein the fine tuning data set is the high-quality data;
s4, constructing an artificial neural network model M with forward and backward bidirectional propagation, taking the pre-training data set in the step S3 as the input of the model M, and adopting a MAML element learning algorithm to perform thread screwing characteristic pre-training to obtain a pre-trained element model Meta and an initialization parameter theta M
The structure of model M is: a multi-layer, fully-connected artificial neural network, wherein the input layer comprises a plurality of neurons for receiving input of sample features; the hidden layer comprises a plurality of neurons and is used for keeping the integrity of sample information; the output layer is used for connecting the activation function;
the pre-training process includes:
s401, dividing the pre-training data set into N pre-training judging task sets, and dividing each pre-training judging task set into a support data set and a query data set:
s402, copying an artificial neural network model M, and obtaining initial model parameters theta by adopting a random initialization method 0 Training the artificial neural network model M, and in the first training stage, judging a task set by using each pre-training based on the initial model parameter theta 0 Calculating a loss function of the artificial neural network model M on a support data set of each pre-training judging task set, and optimizing initial model parameters theta of the model M by adopting a random gradient descent method 0 Obtaining a specific model parameter theta on the pre-training judging task set i i The method comprises the steps of carrying out a first treatment on the surface of the Parameter θ i The update formula is as follows:
θ i =θ 0 -αΔ i
wherein: θ 0 For judging initial model parameters of the model, delta, of screw thread screwing performance i For the random gradient of the pre-training judgment task set i, N is the random gradient of the pre-training judgment task setQuantity, α is the initial learning rate;
s403, judging specific model parameters theta of task set i for pre-training i Taking a query data set of the pre-training judging task set i as an input model parameter theta i In the meta model of (2), obtaining the loss function l of the pre-training judging task set i ii ) Wherein the loss function uses a cross entropy loss function, the formula is as follows:
l ii )=y i log f θ (P i )+(1-y i )log(1-f θ (P i ))
wherein: y is i A spiral sample label is represented, the pass is 1, and the fail is 0; f (f) θ (P i ) Representing the probability that the sample is qualified in the screw thread screwing property prediction through an artificial neural network model;
s404, performing a second gradient update on the original artificial neural network model, and determining the loss function l of the task set by N pre-training ii ) And adding to obtain a loss function sum, wherein the formula is as follows:
wherein: l (theta) is the sum of the loss functions of all N pre-training judging task sets, and L ii ) Judging a task set loss function for each pre-training;
s405, the loss function and L (θ) obtained in S404 are used for the initial model parameters θ 0 Random gradient descent is carried out to obtain an initialization parameter theta of the Meta-model Meta M The method comprises the steps of carrying out a first treatment on the surface of the The formula is as follows:
wherein: θ M The initialization parameter of the Meta model Meta is judged for the screw thread screwing performance, and beta is the Meta learning rate;
the pre-training process in the step S4 is a cyclic iteration process;the initial model parameters of the artificial neural network are the initialization parameters theta of the Meta model Meta obtained in the previous cycle M The method comprises the steps of carrying out a first treatment on the surface of the After the preset iteration times are reached, the cycle is terminated;
s5, inputting the fine tuning data set in the step S3 into the initialization parameter theta in the step S4 M In Meta model Meta of (1), performing fine adjustment training of thread screwing characteristic to obtain thread screwing judgment model M fine-tune
2. The thread screwing performance judging method based on meta learning according to claim 1, wherein the fine tuning training in step S5 specifically comprises the steps of: extracting a plurality of tasks from the fine tuning data set, dividing each extracted task into a fine tuning support data set and a fine tuning query data set, and utilizing the fine tuning support data set to initialize parameters theta of the Meta model M The pre-training process of step S4 is performed.
3. The meta-learning-based thread screwing property determination method according to claim 2, wherein the fine-tuning query data set is input to the model M fine-tune And (3) comparing the predicted result obtained by the model with the actual result to obtain the classification effect of the final model.
CN202110847674.5A 2021-07-26 2021-07-26 Thread screwing property judging method based on meta-learning Active CN113724197B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110847674.5A CN113724197B (en) 2021-07-26 2021-07-26 Thread screwing property judging method based on meta-learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110847674.5A CN113724197B (en) 2021-07-26 2021-07-26 Thread screwing property judging method based on meta-learning

Publications (2)

Publication Number Publication Date
CN113724197A CN113724197A (en) 2021-11-30
CN113724197B true CN113724197B (en) 2023-09-15

Family

ID=78674052

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110847674.5A Active CN113724197B (en) 2021-07-26 2021-07-26 Thread screwing property judging method based on meta-learning

Country Status (1)

Country Link
CN (1) CN113724197B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114461629A (en) * 2022-02-10 2022-05-10 电子科技大学 Temperature calibration method and device for aircraft engine and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110728656A (en) * 2019-09-06 2020-01-24 西安电子科技大学 Meta-learning-based no-reference image quality data processing method and intelligent terminal
CN111127429A (en) * 2019-12-24 2020-05-08 魏志康 Water conservancy system pipe thread defect detection method based on self-training deep neural network
CN112580521A (en) * 2020-12-22 2021-03-30 浙江工业大学 Multi-feature true and false video detection method based on MAML (maximum likelihood modeling language) meta-learning algorithm
CN112613556A (en) * 2020-09-01 2021-04-06 电子科技大学 Low-sample image emotion classification method based on meta-learning

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110163234B (en) * 2018-10-10 2023-04-18 腾讯科技(深圳)有限公司 Model training method and device and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110728656A (en) * 2019-09-06 2020-01-24 西安电子科技大学 Meta-learning-based no-reference image quality data processing method and intelligent terminal
CN111127429A (en) * 2019-12-24 2020-05-08 魏志康 Water conservancy system pipe thread defect detection method based on self-training deep neural network
CN112613556A (en) * 2020-09-01 2021-04-06 电子科技大学 Low-sample image emotion classification method based on meta-learning
CN112580521A (en) * 2020-12-22 2021-03-30 浙江工业大学 Multi-feature true and false video detection method based on MAML (maximum likelihood modeling language) meta-learning algorithm

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
面向无人机小样本目标识别的元学习方法研究;李宏男;吴立珍;牛轶峰;王菖;;无人系统技术(第06期);全文 *

Also Published As

Publication number Publication date
CN113724197A (en) 2021-11-30

Similar Documents

Publication Publication Date Title
CN111914644B (en) Dual-mode cooperation based weak supervision time sequence action positioning method and system
CN111860982A (en) Wind power plant short-term wind power prediction method based on VMD-FCM-GRU
CN112465040B (en) Software defect prediction method based on class unbalance learning algorithm
CN109993225B (en) Airspace complexity classification method and device based on unsupervised learning
CN107169117B (en) Hand-drawn human motion retrieval method based on automatic encoder and DTW
CN106529207B (en) A kind of prediction technique of the protein in conjunction with ribonucleic acid
CN109993236A (en) Few sample language of the Manchus matching process based on one-shot Siamese convolutional neural networks
CN111768000A (en) Industrial process data modeling method for online adaptive fine-tuning deep learning
CN113255573B (en) Pedestrian re-identification method based on mixed cluster center label learning and storage medium
CN113724197B (en) Thread screwing property judging method based on meta-learning
CN110533063A (en) A kind of cloud amount calculation method and device based on satellite image and GMDH neural network
CN113176998A (en) Cross-project software defect prediction method based on source selection
CN116227716A (en) Multi-factor energy demand prediction method and system based on Stacking
CN110717602A (en) Machine learning model robustness assessment method based on noise data
CN111178427A (en) Depth self-coding embedded clustering method based on Sliced-Wasserstein distance
CN113095229B (en) Self-adaptive pedestrian re-identification system and method for unsupervised domain
Ding et al. Few-shot classification with hypersphere modeling of prototypes
Hong et al. Gated multi-head attention pooling for weakly labelled audio tagging
US20230350913A1 (en) Mapping of unlabeled data onto a target schema via semantic type detection
CN111950652A (en) Semi-supervised learning data classification algorithm based on similarity
Wan et al. Software Defect Prediction Using Dictionary Learning.
Chang et al. Similarity metric-based metalearning network combining prior metatraining strategy for intelligent fault detection under small samples prerequisite
CN114757097B (en) Line fault diagnosis method and device
CN116343016A (en) Multi-angle sonar image target classification method based on lightweight convolution network
CN114610882A (en) Abnormal equipment code detection method and system based on electric power short text classification

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant