Space-constrained multi-source-domain generalization method for monitoring abrasion of cross-rotating-speed milling cutter
By adopting a multi-source domain generalization method across speed with space constraints in milling cutter wear monitoring, the spatial scale transformation and alignment of signal is used by STN network and spatial attention module, the problem of insufficient generalization in the existing technology is solved, and the problem of improved generalization is improved The performance and explanatory nature of the model at cross-rpm were found.
Patent Information
- Application Number
- CN202411415771.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2024-12-27
AI Technical Summary
The prior art lacks consideration for signal spatial scale changes at cross-rotation speeds in milling cutter wear monitoring, resulting in insufficient generalization and inability to effectively adapt to the characteristic spatial scale changes at different speeds.
The multi-source domain generalization method of cross-speed milling cutter wear monitoring is adopted with spatial constraints. Through a mechanism-guided spatial scale enhancement model, combined with the STN network and the spatial attention module, the spatial directional scaling transformation and adaptive translation alignment of the signal are realized, and the system can improve the spatial directional scaling transformation of the signal. The generalization ability of the model at cross-rpm.
Effectively reduce the data distribution differences of monitoring signals under different working conditions, improve the generalization and interpretability of the model at cross-rotation speed, and promote the application of deep learning methods in the field of tool wear monitoring.
Smart Images

Figure CN119188419A_ABST
Abstract
Description
[Technical field]
[0001] The invention relates to the technical field of milling tool wear monitoring, and in particular to a multi-source domain generalization method for cross-speed milling tool wear monitoring with spatial constraints. [Background technology]
[0002] Milling cutter is an important cutting tool and occupies an irreplaceable position in the field of mechanical processing. The wear state of milling cutter has a significant impact on product quality, production order and cost, so milling cutter wear state monitoring is an important research topic in the manufacturing industry. Currently, data-driven deep learning methods are widely studied in the field of milling cutter wear state monitoring due to their end-to-end convenience and adaptive nonlinear mapping capabilities.
[0003] During the machining process, changes in process resources and factors such as the type of milling cutter, the material of the workpiece, the machine tool, and the cutting amount will lead to differences in the data distribution of the monitoring signal. Conventional deep learning is based on the assumption of independent and identical distribution, that is, it is assumed that there is no difference in data distribution between the data used in the model training process and the data faced when the model is applied. Therefore, this type of method has insufficient generalization ability when facing the actual milling cutter wear monitoring task and is prone to failure. A single-source domain generalization method for milling cutter wear monitoring constrained by discontinuous characteristics in the publication number CN117620774A proposes a standard trend sample (S T ), as the theoretical benchmark of the monitoring signal, and the diversity of the signal is generated according to the benchmark, which increases the diversity of data distribution differences and effectively improves the generalization of deep learning in the field of milling cutter wear monitoring. At the same time, its mechanism data fusion method also provides ideas for the application of deep learning in related fields. For milling cutter wear monitoring, among the factors that affect the data distribution differences of its monitoring signal, the rotation speed will directly affect the distribution of the monitoring signal in space. For the same monitoring method, the sampling rate of the monitoring signal is constant. Therefore, when the rotation speed is high, the contact between the cutter teeth and the workpiece is more frequent in the same sampling period (the same signal sample), that is, the effective signal fragment is compressed and more dense; when the rotation speed is low, the effective signal fragment will be elongated and sparser. The above phenomenon reflects the change of the semantic structure of the monitoring signal in space; and the current deep learning technology represented by convolutional neural networks, although it has the characteristics of spatial translation invariance, does not have spatial scale invariance. Therefore, when facing the change of feature space scale caused by rotation speed change, its adaptability is poor.
[0004] In summary, the existing technology lacks consideration of the spatial scale changes of the signal under the cross-speed monitoring of the wear state of the milling cutter, and lacks an effective construction strategy for related methods, which makes it difficult to ensure the generalization of the related methods. Based on the milling cutter cutting mechanism, the distribution relationship of the signal at different speeds is studied, and used to guide the directional transformation of the signal spatial scale. The transformed signal is further adaptively aligned and enhanced through deep learning, which is of great significance to improve the generalization of the model across working conditions, especially across speeds, and promote the application of deep learning methods in the field of tool wear monitoring. [Summary of the invention]
[0005] The present invention aims to solve the shortcomings of deep learning in milling cutter wear monitoring, especially the problem that the spatial distribution of the signal is inconsistent when the tool speed changes, and the existing technology lacks the problem of insufficient spatial scale invariance. A spatially constrained multi-source domain generalization method for cross-speed milling cutter wear monitoring is proposed. The method first characterizes the spatial scale inconsistency of the monitoring signal at different speeds of the milling cutter, and implants the characterization results into the STN network (Spatial Transformer Network) to realize the spatial directional scaling transformation between signals; combined with the standard trend sample and spatial attention module in the single-source domain generalization method for milling cutter wear monitoring constrained by a non-continuous characteristic of the publication number CN117620774A, the spatial scale consistent signal after scaling transformation is adaptively translated, aligned and enhanced. Constraints. The designed model can realize adaptive scale transformation and alignment of the spatial distribution of signals across speeds, improve the ability to extract common features between multi-source domains, and enhance the generalization ability of the model across speeds.
[0006] To achieve the above purpose, the technical solution provided by the present invention is:
[0007] A spatially constrained multi-source domain generalization method for cross-speed milling cutter wear monitoring is characterized by comprising a domain generalization model based on mechanism-guided spatial scale enhancement; the domain generalization model based on mechanism-guided spatial scale enhancement comprises sequentially connected spatial transformation modules (M ST1 ), spatial attention module (M SA ), spatial translation module (M ST2 ), feature extraction module (M F ), classification module (M C ) and standard trend samples (S T ); the method comprises the following steps:
[0008] S1: Collect the spindle vibration signal S of the machine tool in different processing processes, the tool wear stage label and process parameters at the corresponding time; the process parameters include rotation speed, axial cutting depth, radial cutting depth and feed speed; pre-process the S to form samples; divide the samples into different source domains according to the different process parameters; obtain a data set containing multiple source domains K represents the number of source domains; the corresponding rotation speeds in the data set are at least two or more;
[0009] S2: Input the samples in the dataset described in S1 into M in batches according to the number of batches. ST1 , taking the source domain corresponding to any rotation speed as the reference domain R, spatially transforming all other source domains, and replacing and sampling the original samples; the M ST1 Contains a fixed 2D affine matrix A θ , grid generator, sampler; the process of the space transformation is as follows:
[0010] S21: Calculate the fixed two-dimensional affine matrix A θ :
[0011]
[0012] Where a is the scaling parameter, which is calculated as follows:
[0013]
[0014] Where N speed is the corresponding rotation speed; is the speed corresponding to the reference domain R; L is the length of the single-tooth sampling signal per rotation of the tool; L R is the signal length corresponding to a single tooth when the tool rotates one circle in the reference domain R;
[0015] S22: Create sampling grid:
[0016] A regular grid coordinate G of the same length as the sample is created by a grid generator; the G is an empty grid with an initial coordinate of [0, 1]; the coordinate values of the G and the coordinate values of the input sample are normalized to [-1, 1] to obtain a coordinate-normalized G and a coordinate-normalized sample;
[0017] S23: Point-by-point transformation:
[0018] The coordinate-normalized G and the coordinate-normalized sample are transformed point by point to obtain the filled G. The point-by-point transformation process is as follows:
[0019]
[0020] In the formula, xt i 、x s i are the coordinate values corresponding to the coordinate-normalized G and the coordinate-normalized sample respectively; the value interval of the subscript i is = [0, l];
[0021] S24: Sampler sampling:
[0022] The padded G and the coordinate normalized sample are sampled by a sampler; the sampled feature vector V is obtained. i ; After completing the sampling of all input samples, the transformed feature set is obtained The sampling method is as follows:
[0023]
[0024] Where U m is the amplitude of the coordinate-normalized sample at position m;
[0025] S3:M SA , M ST2 , M F , M C train:
[0026] S31: The above-mentioned After the samples in the sample are randomly shuffled, they are input into the M in batches according to the number of batches. SA ; Get the spatial attention weight w-att; combine w-att with The corresponding input samples are weighted to obtain the weighted feature x-att1;
[0027] S32: Input x-att1 to the M ST2 ; The M ST2 Except A θ Except for some parameters, the rest of the process is the same as M ST1 Consistent; the M ST2 Middle A θ The parameter t x It is obtained through adaptive learning of the positioning network; the structure of the positioning network is 3 groups of sequentially connected convolutional layers and pooling layers, and the kernel size of the first convolutional layer of the positioning network shall not be less than f z is the signal sampling frequency of the input sample, n is the number of teeth of the tool; the M ST2 The point-by-point transformation process is as follows:
[0028]
[0029] Get the feature x_st2 after adaptive translation transformation;
[0030] S33: x_st2 and S T Perform mean square error calculation to obtain the spatial scale consistency loss L mse ;
[0031] S34: Input x_st2 to M F , obtain the multi-source feature set x_fea, and calculate the global distribution alignment loss (L cor ) and local clustering loss (L tri );
[0032] S35: Input x_fea to M C , get the output classification probability;
[0033] S36: Perform cross entropy operation on the classification probability and the wear stage label corresponding to the input sample to obtain the source domain loss L ce ;
[0034] S37: Using L ce , after back propagation to M C 、M SA Optimize; use L ce +L cor +L tri , after back propagation to M F Optimize; use L ce +L mse , after back propagation to M ST2 Optimize
[0035] S38: After repeating S2 to S37 for a specified number of rounds, the trained M is obtained. SA _trained, M ST2 _trained, M F _trained, M C _trained;
[0036] S4: Preprocess the monitoring signal of the milling cutter wear process to be monitored under the target domain working condition, intercept it according to the length l, obtain the signal to be monitored, and input it into M in sequence. ST1 、M SA _trained, M ST2 _trained, M F _trained, M C _trained, outputs the tool wear status monitoring result; the rotation speed of the target domain working condition can be consistent with any rotation speed in the source domain.
[0037] Furthermore, the M SAThe structure is a sequentially connected average pooling layer (both the step size and the kernel size are k pool ), convolutional layer (kernel size is k, stride is 1), batch normalization layer, ReLU activation layer, element repetition layer (repetition multiple is k pool , the repeated dimension is the last dimension); the input and output channels of the convolutional layer are both 1; the M F is the WDCNN structure; the M C is a fully connected layer.
[0038] Furthermore, the preprocessing in S1 and S4 refers to first performing zero mean processing on the original signal; then performing Fourier low-pass filtering on the signal, and the cutoff frequency of the low-pass filtering is 10 times the tooth pass frequency under the working condition; then performing non-overlapping interception on the signal according to the length l and normalizing it to [-1,1]; the weighting in S32 refers to combining the weight w_att and the Multiply the elements of the corresponding samples at the same position in , and then add the product to the elements of the corresponding samples at the same position.
[0039] Furthermore, the spatial scale consistency loss (L mse ) is defined as follows:
[0040]
[0041] Where K is the number of source domains; is the number of samples in the kth source domain; is the feature of the kth source domain after adaptive translation transformation; S T is a standard trend sample, which is a vector {-1,…,1,0,…,0,…,-1,…,1,0,…,0}, which is composed of N sub-vectors {-1,…,1,0,…,0} of length l arranged in sequence; the sub-vector {-1,…,1,0,…,0} is periodically composed of a monotonically increasing vector {-1,…,1}(t1) from -1 to 1 and a continuous 0 vector {0,…,0}(t0); the sum of the lengths of t0 and t1 is L; the length of t1 Among them A p is the axial cutting depth (mm), β is the tool helix angle (°), D is the tool outer diameter (mm), π is the circumference, and n is the number of tool teeth;
[0042] The global distribution alignment loss (L cor ) is defined as follows:
[0043]
[0044] Where d is the dimension of the feature; is the Frobenius norm of the matrix; and They represent the covariance matrices of the i-th and j-th source domain features respectively. The covariance matrices are as follows:
[0045]
[0046] Where n s is the sample size; D s represents a feature set; Τ represents transpose; 1 represents a column vector whose elements are all equal to 1;
[0047] The local clustering loss (L tri ) is defined as follows:
[0048]
[0049] In the formula, f() represents the feature extraction module (M F ), and Represent the anchor samples and positive samples The distance and and negative samples The Euclidean distance of ; a is the edge threshold, and its value range is [0,1]; traverse the samples one by one in the batch, and the currently selected sample is Iterate through the rest of the batch, and The closest Euclidean distance is and The longest European distance is
[0050] The source domain loss L ce The definition is as follows:
[0051]
[0052] In the formula, K represents the number of source domains; Represents the number of samples in the kth source domain; and denote the true label and predicted label of the i-th sample in the k-th source domain respectively; L CE is the cross entropy loss, defined as follows:
[0053]
[0054] In the formula, and Represent the true label and the predicted label respectively; c represents different categories.
[0055] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention utilizes the discontinuous mechanism characteristics between the teeth and the workpiece during the milling process, and based on the function of STN spatial transformation, constructs a multi-parameter guided STN structure adaptation strategy, which is used to guide the spatial consistency transformation of source domain monitoring signals under different speeds, and at the same time utilizes spatial attention to enhance the features after the consistency transformation, so as to achieve effective constraints on common features between different source domains. At the same time, the proposed method can establish better spatial scale consistency constraints on source domain features and target domain features, so that the model can effectively reduce the data distribution differences of monitoring signals under different working conditions, and improve the generalization and interpretability of the model under variable working conditions, which is of great significance to promoting the application of deep learning methods in the field of tool wear monitoring under cross-speed conditions.
Brief Description of the Drawings
[0056] Figure 1 is a flow chart of the method of the present invention;
[0057] Figure 2 is a structural diagram of a fixed-scale spatial transformation module of the present invention;
[0058] Figure 3 Schematic diagram of the structure of the spatial attention module of the present invention;
[0059] Figure 4 is a schematic structural diagram of a spatial transformation module for adaptive translation of the present invention;
[0060] Figure 5 It is a statistical diagram of the identification accuracy of the wear state of the milling cutter under different working conditions in the implementation case of the present invention;
[0061] Figure 6 It is a schematic diagram of the change in spatial scale of the signal processed by each module during the process of spatial scale consistency between the source domain and the target domain in the implementation case of the present invention. [Specific implementation method]
[0062] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with embodiments and drawings. It should be understood that the exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in each embodiment of the present invention described below can be combined in any way as long as they do not conflict with each other.
[0063] See also Figure 1 to Figure 4 The present invention provides a multi-source domain generalization method for cross-speed milling cutter wear monitoring with spatial constraints, which mainly includes a domain generalization model based on mechanism-guided spatial scale enhancement; the domain generalization model based on mechanism-guided spatial scale enhancement includes sequentially connected spatial transformation modules (M ST1), spatial attention module (M SA ), spatial translation module (M ST2 ), feature extraction module (M F ), classification module (M C ) and standard trend samples (S T ); the method comprises the following steps:
[0064] S1: Collect the spindle vibration signal S of the machine tool in different processing processes, the tool wear stage label and process parameters at the corresponding time; the process parameters include rotation speed, axial cutting depth, radial cutting depth and feed speed; pre-process the S to form samples; divide the samples into different source domains according to the different process parameters; obtain a data set containing multiple source domains K represents the number of source domains; the corresponding rotation speeds in the data set are at least two or more;
[0065] S2: Input the samples in the dataset described in S1 into M in batches according to the number of batches. ST1 , taking the source domain corresponding to any rotation speed as the reference domain R (the role of the reference domain is to make other source domains or target domains with different spatial scales have a clear scaling standard), spatially transform all other source domains, and replace and sample the original samples; the M ST1 Contains a fixed 2D affine matrix A θ , grid generator, sampler; the process of the space transformation is as follows:
[0066] S21: Calculate the fixed two-dimensional affine matrix A θ :
[0067]
[0068] Where a is the scaling parameter, which is calculated as follows:
[0069]
[0070] Where N speed is the corresponding rotation speed; is the speed corresponding to the reference domain R; L is the length of the single-tooth sampling signal per rotation of the tool; L R is the signal length corresponding to a single tooth when the tool rotates one circle in the reference domain R;
[0071] S22: Create sampling grid:
[0072] A regular grid coordinate G of the same length as the sample is created by a grid generator; the G is an empty grid with an initial coordinate of [0, 1]; the coordinate values of the G and the coordinate values of the input sample are normalized to [-1, 1] to obtain a coordinate-normalized G and a coordinate-normalized sample;
[0073] S23: Point-by-point transformation:
[0074] The coordinate-normalized G and the coordinate-normalized sample are transformed point by point to obtain the filled G. The point-by-point transformation process is as follows:
[0075]
[0076] In the formula, x t i 、x s i are the coordinate values corresponding to the coordinate-normalized G and the coordinate-normalized sample respectively; the value interval of the subscript i is = [0, l];
[0077] S24: Sampler sampling:
[0078] The padded G and the coordinate normalized sample are sampled by a sampler; the sampled feature vector V is obtained. i ; After completing the sampling of all input samples, the transformed feature set is obtained The sampling method is as follows:
[0079]
[0080] Where U m is the amplitude of the coordinate-normalized sample at m; (V i is the amplitude of the output signal at each horizontal coordinate. Each sample is sampled in the same way, so each sample is transformed in the same way. It is worth noting that the horizontal coordinates of the input sample and the regular grid are both in the spatial range of [-1,1]. However, when performing the operation of formula (4), due to the existence of a in formula (5), may exceed [-1,1], so when When , the linear sampling kernel is used to calculate the output value; when , the output value is 0. )
[0081] S3:M SA , M ST2 , M F , M C train:
[0082] S31: The above-mentioned After the samples in the sample are randomly shuffled, they are input into the M in batches according to the number of batches. SA ; Get the spatial attention weight w-att; combine w-att with The corresponding input samples are weighted to obtain the weighted feature x-att1;
[0083] S32: Input x-att1 to the M ST2 ; The M ST2 Except A θ Except for some parameters, the rest of the process is the same as M ST1 Consistent; the M ST2 Middle A θ The parameter t x is obtained through adaptive learning of the positioning network; the structure of the positioning network is 3 groups of sequentially connected convolutional layers and pooling layers, and the kernel size of the first convolutional layer of the positioning network is equal to f z is the signal sampling frequency of the input sample, n is the number of teeth of the tool; the M ST2 The point-by-point transformation process is as follows:
[0084]
[0085] Get the feature x_st2 after adaptive translation transformation;
[0086] S33: x_st2 and S T Perform mean square error calculation to obtain the spatial scale consistency loss L mse ;
[0087] S34: Input x_st2 to M F , obtain the multi-source feature set x_fea, and calculate the global distribution alignment loss (L cor ) and local clustering loss (L tri );
[0088] S35: Input x_fea to M C , get the output classification probability;
[0089] S36: Perform cross entropy operation on the classification probability and the wear stage label corresponding to the input sample to obtain the source domain loss L ce ;
[0090] S37: Using L ce , after back propagation to M C 、M SA Optimize; use L ce +L cor +L tri , after back propagation to MF Optimize; use L ce +L mse , after back propagation to M ST2 Optimize
[0091] S38: After repeating S2 to S37 for a specified number of rounds, the trained M is obtained. SA _trained, M ST2 _trained, M F _trained, M C _trained;
[0092] S4: Preprocess the monitoring signal of the milling cutter wear process to be monitored under the target domain working condition, intercept it according to the length l, obtain the signal to be monitored, and input it into M in sequence. ST1 、M SA _trained, M ST2 _trained, M F _trained, M C _trained, outputs the tool wear status monitoring result; the rotation speed of the target domain working condition can be consistent with any rotation speed in the source domain.
[0093] Specifically, the M SA The structure is a sequentially connected average pooling layer (both the step size and the kernel size are k pool ), convolutional layer (kernel size is k, stride is 1), batch normalization layer, ReLU activation layer, element repetition layer (repetition multiple is k pool , the repeated dimension is the last dimension); the input and output channels of the convolutional layer are both 1; the M F is the WDCNN structure; the M C is a fully connected layer.
[0094] Specifically, the preprocessing in S1 and S4 refers to first performing zero mean processing on the original signal; then performing Fourier low-pass filtering on the signal, and the cutoff frequency of the low-pass filtering is 10 times the tooth pass frequency under the working condition; then performing non-overlapping interception on the signal according to the length l and normalizing it to [-1,1]; the weighting in S32 refers to adding the weight w_att and the Multiply the elements of the corresponding samples at the same position in , and then add the product to the elements of the corresponding samples at the same position.
[0095] Specifically, the spatial scale consistency loss (L mse ) is defined as follows:
[0096]
[0097] Where K is the number of source domains; is the number of samples in the kth source domain; is the feature of the kth source domain after adaptive translation transformation; S T is a standard trend sample, which is a vector {-1,…,1,0,…,0,…,-1,…,1,0,…,0}, which is composed of N sub-vectors {-1,…,1,0,…,0} of length l arranged in sequence; the sub-vector {-1,…,1,0,…,0} is periodically composed of a monotonically increasing vector {-1,…,1}(t1) from -1 to 1 and a continuous 0 vector {0,…,0}(t0); the sum of the lengths of t0 and t1 is L; the length of t1 Among them A p is the axial cutting depth (mm), β is the tool helix angle (°), D is the tool outer diameter (mm), π is the circumference, and n is the number of tool teeth;
[0098] The global distribution alignment loss (L cor ) is defined as follows:
[0099]
[0100] Where d is the dimension of the feature; is the Frobenius norm of the matrix; and They represent the covariance matrices of the i-th and j-th source domain features respectively. The covariance matrices are as follows:
[0101]
[0102] Where n s is the sample size; D s represents a feature set; Τ represents transpose; 1 represents a column vector whose elements are all equal to 1;
[0103] The local clustering loss (L tri ) is defined as follows:
[0104]
[0105] In the formula, f(·) represents the feature extraction module (M F ), and Represent the anchor samples and positive samples The distance and and negative samples The Euclidean distance of ; a is the edge threshold, the value is 1; traverse the samples one by one in the batch, the currently selected sample is Iterate through the rest of the batch, and The closest Euclidean distance is and The longest European distance is
[0106] The source domain loss L ce The definition is as follows:
[0107]
[0108] In the formula, K represents the number of source domains; Represents the number of samples in the kth source domain; and denote the true label and predicted label of the i-th sample in the k-th source domain respectively; L CE is the cross entropy loss, defined as follows:
[0109]
[0110] In the formula, and Represent the true label and the predicted label respectively; c represents different categories.
[0111] Working process of the present invention:
[0112] The present invention is a spatially constrained cross-speed milling cutter wear monitoring multi-source domain generalization method in the working process, combined with an embodiment to illustrate.
[0113] 1. Data acquisition:
[0114] The test was conducted on a five-axis CNC machine tool produced by a machine tool factory. The same type of integral end mill was used each time. The tool material was aluminum-containing high-speed steel, the number of tool teeth n was 3, the tool outer diameter D was 16 mm, and the tool helix angle β was 35°. The workpiece being cut was No. 40 steel, and each pass of the tool continuously cut 420 mm along the y-axis direction of the machine tool. The spindle vibration signal was collected by the Donghua 1A302A three-way sensor. This embodiment uses the vibration signal in the y-axis direction of the machine tool as the spindle vibration signal S of this embodiment, and the sampling frequency f z A total of 6 tools were used for wear cutting experiments, and the process parameters corresponding to each tool are shown in Table 1.
[0115] Table 1 Process parameters corresponding to the 6 tools
[0116]
[0117] After each pass, the GAOSUO digital microscope was used to record the flank width (VB) with the largest wear until the VB value exceeded 0.3 mm. According to the VB value of 0-0.1 mm, 0.1 mm-0.2 mm, 0.2 mm-0.3 mm, and greater than 0.3 mm, the milling cutter wear state was divided into the initial wear stage, stable wear stage, rapid wear stage, and failure stage.
[0118] 2. Data preprocessing:
[0119] First, all the acquired original signals are processed with zero mean; then the signals are subjected to Fourier low-pass filtering, and the cutoff frequency of the low-pass filtering is 10 times the tooth pass frequency in the working condition, that is, when the speed is 1000RPM, the cutoff frequency is 500Hz; when the speed is 1200RPM, the cutoff frequency is 600Hz; then the signal is non-overlappingly cut off with a length of 6000 and normalized to [-1,1].
[0120] Finally, 600, 440, 440, 660, 410, and 368 samples were obtained for tools C1 to C6, respectively. All samples of C1 and C2 were used as the multi-source domain (D s , K = 2) for model training, and all samples of all other tools are used as target domains for testing.
[0121] 3. Model construction:
[0122] The model was built based on Python 3.8.18-Anaconda 2.1.1-Pytorch 2.1.0 and trained on i5-12490F32GB-NVIDIA GeForce RTX 3060Ti; the hyperparameter settings of the model are shown in Table 2. The hyperparameter settings of all modules in the training phase are consistent.
[0123] Table 2 Model training hyper parameters
[0124] Hyperparameters value Learning Rate 0.0001 Optimizer Adam Batchsize 64 Edge threshold α 1 Number of training rounds 100
[0125] The structure and parameters of the model in this embodiment are shown in Table 3.
[0126] Table 3 Model structure and parameters
[0127]
[0128]
[0129] The k×k pool =167; the standard trend sample S ST , the length of L1 is equal to 167.
[0130] IV.M ST1 Parameter determination:
[0131] right The scaling parameter a in D is determined. s A domain is randomly selected as the reference domain D R In this embodiment, C2 (spindle speed is 1200RPM) is selected as the reference domain D R , the other domains are fixedly scaled using C2 as the standard for spatial transformation; that is, when the spindle speed of other source domains or target domains is 1000RPM, A θ The scaling parameter a in is equal to 1.2; when the spindle speed of other source domains or target domains is 1200RPM, A θ The scaling parameter a in is equal to 1; the method for confirming the scaling parameter a is as follows:
[0132]
[0133] 5. Sampling
[0134] A regular grid coordinate G of the same length as the sample is created by a grid generator; G is an empty grid with an initial coordinate of [0, 6000]; the coordinate values of G and the coordinate values of the input sample are normalized to [-1, 1] to obtain a coordinate-normalized G and a coordinate-normalized sample; the coordinate-normalized G and the coordinate-normalized sample are transformed point by point to obtain a filled G; the point-by-point transformation process is as follows:
[0135]
[0136] The padded G and the coordinate normalized sample are sampled by a sampler; the sampled feature vector V is obtained. i ; After completing the sampling of all input samples, the transformed feature set is obtained The sampling method is as follows:
[0137]
[0138] 6. Model training:
[0139] Will After the samples in the sample are randomly shuffled, they are input into the M in batches of Batch=64. SA ; Get the spatial attention weight w-att; combine w_att with The corresponding input samples are weighted to obtain the weighted feature x-att1; x-att1 is input into the M ST2 , and obtain the feature x_st2 after adaptive translation transformation; x_st2 and the S TPerform spatial scale consistency (L mse ) constraint, and obtain the feature x_st3 with consistent spatial scale; input x_st3 into M F , get the multi-source feature x_fea, and perform global distribution alignment on x_fea (L cor ) and local clustering (L tri ); Input x_fea to M C , and obtain the output classification probability; perform cross entropy operation on the classification probability and the wear stage label corresponding to the input sample to obtain the source domain loss L ce ; Using L ce , after back propagation to M C 、M SA Optimize; use L ce +L cor +L tri , after back propagation to M F Optimize; use L ce +L mse , after back propagation to M ST2 Optimize; repeat the above training process for 100 rounds to obtain the trained M SA _trained, M ST2 _trained, M F _trained, M C _trained.
[0140] 7. Model testing:
[0141] See also Figure 5 , input the samples in the target domain tool (C3-C6) into M ST1 , taking C2 as the reference domain D R , the tools of other target domains are respectively based on the reference domain D R The fixed-scale spatial transformation is performed for the standard, and the fixed-scaled features are input to the sequentially connected M SA _trained, M ST2 _trained, M F _trained, M C _trained, output tool wear status monitoring results. The accuracy statistics show that the recognition accuracy of the model in different target domains is 90.75%, 91.75%, 90.5% and 94.5% respectively, which can better meet the needs of tool wear monitoring in actual processing.
[0142] 8. Analysis of beneficial effects:
[0143] See also Figure 6, the changes in spatial scale of the signals processed by each module in the process of establishing the consistency of spatial scales between the source domain and the target domain are displayed. Figure 6 (a) and (b), the signals in the source domain and the target domain are smoother and purer after low-pass filtering; Figure 6 (b) and (c), the denoised signal is input into the fixed-scale spatial transformation module and then undergoes a preliminary spatial scale transformation, which greatly reduces the spatial scale difference between the source domain and the target domain, but there is still a position offset; comparison Figure 6 (c) and (d), the features obtained after input into the spatial attention module have strong periodic discontinuity characteristics and present a purer cutting signal; comparison Figure 6 (d) and (e), the weighted signal has a more obvious semantic structure than the original sample. Figure 6 (e) and (f), the position of the signal in the spatial scale is further adjusted under the action of the adaptive translation spatial transformation module. Finally, the signals in the source domain and the target domain establish an obvious correlation relationship in the spatial scale (i.e., scale consistency across speeds). Therefore, it can be proved that the proposed method establishes spatial scale consistency between the signals across speeds that meets theoretical expectations.
[0144] The method of the present invention utilizes the discontinuous mechanism characteristics between the cutter teeth and the workpiece during the milling process, and based on the function of STN spatial transformation, constructs a multi-parameter guided STN structure adaptation strategy for guiding the spatial consistency transformation of source domain monitoring signals under different speeds. At the same time, spatial attention is used to enhance the features after the consistency transformation to achieve effective constraints on common features between different source domains. At the same time, the proposed method can establish good spatial scale consistency constraints on source domain features and target domain features, so that the model can effectively reduce the data distribution differences of monitoring signals under different working conditions, and improve the generalization and interpretability of the model under variable working conditions. It is of great significance to promote the application of deep learning methods in the field of tool wear monitoring under cross-speed conditions.
[0145] The above embodiments are intended to illustrate the present invention rather than to limit the present invention. Any technician familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be included in the protection scope of the present invention.
Claims
1. A spatially constrained multi-source domain generalization method for cross-speed milling cutter wear monitoring, characterized in that: The invention comprises a domain generalization model based on mechanism-guided spatial scale enhancement; the domain generalization model based on mechanism-guided spatial scale enhancement comprises sequentially connected spatial transformation modules (M ST1 ), spatial attention module (M SA ), spatial translation module (M ST2 ), feature extraction module (M F ), classification module (M C ) and standard trend samples (S T ); the method comprises the following steps: S1: Collect the spindle vibration signal S of the machine tool in different processing processes, the tool wear stage label and process parameters at the corresponding time; the process parameters include rotation speed, axial cutting depth, radial cutting depth and feed speed; pre-process the S to form samples; divide the samples into different source domains according to the different process parameters; obtain a data set containing multiple source domains K represents the number of source domains; the corresponding rotation speeds in the data set are at least two or more; S2: Input the samples in the dataset described in S1 into M in batches according to the number of batches. ST1 , taking the source domain corresponding to any rotation speed as the reference domain R, spatially transforming all other source domains, and replacing and sampling the original samples; the M ST1 Contains a fixed 2D affine matrix A θ , grid generator, sampler; the process of the space transformation is as follows: S21: Calculate the fixed two-dimensional affine matrix A θ : Where a is the scaling parameter, which is calculated as follows: Where N speed is the corresponding rotation speed; is the speed corresponding to the reference domain R; L is the length of the single-tooth sampling signal per rotation of the tool; L R is the signal length corresponding to a single tooth when the tool rotates one circle in the reference domain R; S22: Create sampling grid: A regular grid coordinate G of the same length as the sample is created by a grid generator; the G is an empty grid with an initial coordinate of [0, 1]; the coordinate values of the G and the coordinate values of the input sample are normalized to [-1, 1] to obtain a coordinate-normalized G and a coordinate-normalized sample; S23: Point-by-point transformation: The coordinate-normalized G and the coordinate-normalized sample are transformed point by point to obtain the filled G. The point-by-point transformation process is as follows: In the formula, are the coordinate values corresponding to the coordinate-normalized G and the coordinate-normalized sample respectively; the value interval of the subscript i is = [0, l]; S24: Sampler sampling: The padded G and the coordinate normalized sample are sampled by a sampler; the sampled feature vector V is obtained. i ; After completing the sampling of all input samples, the transformed feature set is obtained The sampling method is as follows: Where U m is the amplitude of the coordinate-normalized sample at position m; S3:M SA , M ST2 , M F , M C train: S31: The above-mentioned After the samples in the sample are randomly shuffled, they are input into the M in batches according to the number of batches. SA ; Get the spatial attention weight w-att; combine w-att with The corresponding input samples are weighted to obtain the weighted feature x-att1; S32: Input x-att1 to the M ST2 ; The M ST2 Except A θ Except for some parameters, the rest of the process is the same as M ST1 Consistent; the M ST2 Middle A θ The parameter t x It is obtained through adaptive learning of the positioning network; the structure of the positioning network is 3 groups of sequentially connected convolutional layers and pooling layers, and the kernel size of the first convolutional layer of the positioning network shall not be less than f z is the signal sampling frequency of the input sample, n is the number of teeth of the tool; the M ST2 The point-by-point transformation process is as follows: Get the feature x_st2 after adaptive translation transformation; S33: x_st2 and S T Perform mean square error calculation to obtain the spatial scale consistency loss L mse ; S34: Input x_st2 to M F , obtain the multi-source feature set x_fea, and calculate the global distribution alignment loss (L cor ) and local clustering loss (L tri ); S35: Input x_fea to M C , get the output classification probability; S36: Perform cross entropy operation on the classification probability and the wear stage label corresponding to the input sample to obtain the source domain loss L ce ; S37: Using L ce , after back propagation to M C 、M SA Optimize; use L ce +L cor +L tri , after back propagation to M F Optimize; use L ce +L mse , after back propagation to M ST2 Optimize S38: After repeating S2 to S37 for a specified number of rounds, the trained M is obtained. SA _trained, M ST2 _trained, M F _trained, M C _trained; S4: Preprocess the monitoring signal of the milling cutter wear process to be monitored under the target domain working condition, intercept it according to the length l, obtain the signal to be monitored, and input it into M in sequence. ST1 、M SA _trained, M ST2 _trained, M F _trained, M C _trained, outputs the tool wear status monitoring result; the rotation speed of the target domain working condition can be consistent with any rotation speed in the source domain.
2. A spatially constrained multi-source domain generalization method for cross-speed milling cutter wear monitoring as claimed in claim 1, characterized in that: The M SA The structure is a sequentially connected average pooling layer (both the step size and the kernel size are k pool ), convolutional layer (kernel size is k, stride is 1), batch normalization layer, ReLU activation layer, element repetition layer (repetition multiple is k pool , the repeated dimension is the last dimension); the input and output channels of the convolutional layer are both 1; the M F is the WDCNN structure; the M C is a fully connected layer.
3. A spatially constrained multi-source domain generalization method for cross-speed milling cutter wear monitoring as claimed in claim 1, characterized in that: The preprocessing in S1 and S4 refers to first performing zero mean processing on the original signal; then performing Fourier low-pass filtering on the signal, and the cutoff frequency of the low-pass filtering is 10 times the tooth pass frequency under the working condition; then performing non-overlapping interception of the signal according to the length l and normalizing it to [-1,1]; the weighting in S32 refers to adding the weight w_att and the Multiply the elements of the corresponding samples at the same position in , and then add the product to the elements of the corresponding samples at the same position.
4. A spatially constrained multi-source domain generalization method for cross-speed milling cutter wear monitoring as claimed in claim 1, characterized in that: The spatial scale consistency loss (L mse ) is defined as follows: Where K is the number of source domains; is the number of samples in the kth source domain; is the feature of the kth source domain after adaptive translation transformation; S T is a standard trend sample, which is a vector {-1,…,1,0,…,0,…,-1,…,1,0,…,0}, which is composed of N sub-vectors {-1,…,1,0,…,0} of length l arranged in sequence; the sub-vector {-1,…,1,0,…,0} is periodically composed of a monotonically increasing vector {-1,…,1}(t1) from -1 to 1 and a continuous 0 vector {0,…,0}(t0); the sum of the lengths of t0 and t1 is L; the length of t1 Among them A p is the axial cutting depth (mm), β is the tool helix angle (°), D is the tool outer diameter (mm), π is the circumference, and n is the number of tool teeth; The global distribution alignment loss (L cor ) is defined as follows: Where d is the dimension of the feature; is the Frobenius norm of the matrix; and They represent the covariance matrices of the i-th and j-th source domain features respectively. The covariance matrices are as follows: Where n s is the sample size; D s represents a feature set; Τ represents transpose; 1 represents a column vector whose elements are all equal to 1; The local clustering loss (L tri ) is defined as follows: In the formula, f(·) represents the feature extraction module (M F ), and Represent anchor samples and positive samples The distance and and negative samples The Euclidean distance of ; a is the edge threshold, and its value range is [0,1]; traverse the samples one by one in the batch, and the currently selected sample is Iterate through the rest of the batch, and The closest European distance is and The longest European distance is The source domain loss L ce The definition is as follows: In the formula, K represents the number of source domains; Represents the number of samples in the kth source domain; and denote the true label and predicted label of the i-th sample in the k-th source domain respectively; L CE is the cross entropy loss, defined as follows: In the formula, and Represent the true label and the predicted label respectively; c represents different categories.
Citation Information
Cited By
Cross-domain-oriented tool wear monitoring method and system
CN120190677A
