Search

CN-122020364-A - Domain self-adaptive identification method based on dynamic boundary loss and multi-stage training

CN122020364ACN 122020364 ACN122020364 ACN 122020364ACN-122020364-A

Abstract

The invention provides a domain self-adaptive recognition method based on dynamic boundary loss and multi-stage training, and belongs to the technical field of sensor data processing and pattern recognition. The method solves the technical problems that the performance of a target domain is poor and the generalization capability is weak in the sensor data pattern recognition of the existing model. The method comprises the steps of constructing a double-branch-domain self-adaptive network architecture, defining a dynamic boundary loss function, executing a three-stage training process, realizing independent and collaborative processing of two-domain data by constructing the double-branch-domain self-adaptive network architecture and combining self-attention, causal convolution and graph neural network extraction channels and time information, designing a dynamic boundary loss mechanism, correcting differences of the two-domain feature extractors through a feature offset fitter and a dynamic loss training target domain feature extractor, and finally executing a three-stage training scheme to improve generalization capability of a model. The method has better target domain performance and stronger generalization capability in the sensor data pattern recognition.

Inventors

  • Ding Muzi
  • DING HONG
  • ZHANG XIAOFENG
  • LI XIAOJIAO
  • XIE JIAOLEI

Assignees

  • 南通大学

Dates

Publication Date
20260512
Application Date
20260105

Claims (4)

  1. 1. A domain adaptive recognition method based on dynamic boundary loss and multi-stage training, comprising the steps of: S1, constructing a double-branch-domain self-adaptive network architecture, namely, enabling input multi-element sensor time series data to pass through 64 one-dimensional convolution filters with the size of 5 along a time axis, then processing the multi-element sensor time series data through four layers of convolution layers, extracting the first K main frequencies through fast Fourier transformation, sequencing the first K main frequencies to obtain the maximum main frequencies, dividing an original time series into a plurality of data blocks according to the maximum main frequencies, constructing a graph matrix for each data block, and inputting a single-layer LSTM network to extract time-related features; S2, defining a dynamic boundary loss function, namely introducing the dynamic boundary loss function to correct the parameter difference between a source domain feature extractor SFE_theta and a target domain feature extractor TFE_g, setting two feature offset fitters FSF_theta and FSF_g with the same structure but different parameters, wherein the FSF_theta adopts a mean square error loss adjustment parameter, and the FSF_g estimates a preprocessing error lower bound through exponential moving average of FSF_theta weights; S3, executing a three-stage training process, namely adding dynamic loss obtained by a feature offset fitting device to the features extracted by a source domain encoder in a stage A and a target domain feature after feature offset, fixing all parameters except a source domain classifier and a target domain classifier to maximize the difference between the classifiers in a stage B, fixing the parameters of the two classifiers in a stage C, minimizing the loss between the source domain offset feature and the target domain feature, and minimizing the classifier loss to train model parameters; S4, model reasoning and recognition, namely inputting the preprocessed target domain sensor data into a trained dual-branch network, and outputting a mode recognition result through a feature extractor, a feature offset fitter and a classifier of a target domain processing branch.
  2. 2. The domain adaptive recognition method based on dynamic boundary loss and multi-stage training according to claim 1, wherein S1 comprises the steps of: s11, input data x passes through 64 one-dimensional convolution filters with the size of 5 along a time axis, then is processed by four convolution layers, original time sequence data are divided into a plurality of data blocks, the first k main frequencies are extracted through fast Fourier transform FFT and are ordered, the maximum main frequency is obtained, and each data block contains periodic information: ; ; ; If it is Then Wherein: An ith value output for the first layer; is the first Layer number The weights of the convolution kernels; is the first Bias terms of the layers; The representation is from the first The layer and the position are Is a feature of the input of (a); A frequency index corresponding to the maximum fourier magnitude; points that are fourier transforms; a vector representation of a current layer signal or time sequence; is the frequency index in the fourier transform; The output after the split tensor is subjected to the blocking operation; Splicing h and zero tensors according to channel dimensions as tensor splicing functions; For the data block function, the spliced tensor is calculated according to the maximum main frequency Dividing into a plurality of data blocks; Representing the shape as Of (3), wherein In the case of a batch size of the product, In order to provide the number of channels, In order to fill the length of the tube, Is a variable channel number; S12, constructing a graph structure for each data block, and inputting the collected channel related features into an LSTM network to extract time related features among the data blocks, and capturing the channel related features, the time sequence dependent features among the data blocks and key time sequence key features by using time attentions: ; ; ; Wherein: for linear transformation function, data block The features of (a) are mapped to the same dimension and are used for calculating a graph matrix of channel association; is the first The graph of the individual data blocks; And To act on the first Individual data blocks Is a function of (2); is the i-th data block; Representing the dimension along which the data blocks are spliced; Is a fully connected layer for mapping features to attention weight dimensions; S13, performing feature mapping and selection by using a multi-layer perceptron MLPs to ensure that the source domain features can be aligned with the target domain features after being shifted: ; Wherein: Is the model number The layer is subjected to convolution operation in a time step t and added with characteristic output after the bias item; The size of the convolution kernel after the expansion rate; is the first Layer at time step The feature output processed by the attention mechanism represents the feature after attention correction; for the index of the current layer, the range is from 1 to Wherein The total layer number of the network is; is the first Attention correction characteristics of the layers after being processed by an attention mechanism; is the first Query matrix of layers, composed of input features Obtained through linear transformation; is the first Key matrix of layers, defined by input features Obtained through linear transformation; for querying matrices Sum key matrix Is a dimension of (2); is the first Input feature tensors for a layer; Representing final attention modifying features after processing all layers Applying the full connection layer to generate a final output characteristic representation; Attention, abbreviations, which represent the attentive mechanisms processed; The residual network ResNet classifier consists of three such basic blocks, with one full connection layer for final classification, whose output corresponds to the expected class probability for each input sample: ; ; Wherein: For passing through L stacks An output characteristic representation after the layer; number of stacked layers of BasicBlock, ranging from 1 to ; A convolution operation representing a first layer; Representing a residual join convolution operation of the first layer; The prediction category probability corresponding to each input sample is used as a final prediction result; for the flattening operation, the multi-dimensional feature tensor is converted into a one-dimensional vector.
  3. 3. The domain adaptive recognition method based on dynamic boundary loss and multi-stage training according to claim 2, wherein S2 comprises the following: Introducing two networks And Extracting features from two domains using a single feature extractor, equivalent to minimizing And Alignment error between outputs, capture of the data from two different sets of network parameters And g, introducing an additional characteristic offset fitting device FSF to process the characteristic offset generated when the same input X is processed, and continuously adjusting network parameters in the process of multiple iterations, namely theorem 1, namely fixed measurable function And g; Order the And (2) and If the following two conditions are satisfied: (a) For all of , There is ; (B) For all of There is Then ; Under condition (a), if present So that for all There is Then: ; Wherein: The number of sensor channels; For the front of extraction The number of primary frequencies; Parameters for source domain network At the position of Prediction error of the position; For target domain network parameters At the position of Prediction error of the position; is a linear orthogonal symbol, and indicates that the two vectors have no correlation; Using And a target network , Adjusting the parameters by means of MSE loss Then an appropriate lower bound for the preprocessing error is estimated, Is updated by Exponential moving average decisions for network weights, assuming The offset characteristic is fitted and the offset characteristic, By approximation Updates its parameters according to the result of (2) Parameter iterative adjustment of (a) Is defined by the parameters: ; Wherein: The method comprises the steps of calculating differences between predicted characteristic values and target characteristics in a plurality of time steps T as a dynamic loss function; A characteristic predictive value representing a time step t; indicating the use of the parameters at time step t When in use, for Is a characteristic predictive value of (1); Indicating that at time step t, using parameter g, the pair of Is a characteristic predictive value of (1); Is a small positive constant; is a smoothing factor for controlling the previous parameter value g and the new parameter Weight allocation of (2); is a time step Is a characteristic predictive value of (1); Minimizing using mean square error Output of (2) Loss between the displaced features will Features and characteristics produced The resulting features add: ; Wherein: Is that An output characteristic representation of the data block at the ith time step; Is that An output characteristic representation of the data block at the ith time step; Is that The output characteristics of the data block at the i-th time step are represented.
  4. 4. A domain adaptive recognition method based on dynamic boundary loss and multi-stage training according to claim 3, wherein said S3 comprises the steps of: S31, training a feature extractor, a feature offset fitter and a classifier, minimizing FSF_theta and FSF_g output losses, maximizing TFE_g output and SFE_theta plus offset feature SFE_theta+FSF_theta losses, wherein the loss function is as follows: ; Wherein: Is a source domain classifier, the parameters are ; The parameters are as target domain classifier ; Prediction output for source domain classifier With real labels Loss between; Prediction output for a target domain classifier With real labels Loss between; S32, stage B is the maximization of classifier difference, namely fixing the parameters of a feature extractor and a feature offset fitting device of a source domain and a target domain, training a classifier, and adding the classifier difference loss Maximizing the output difference of the source domain classifier and the target domain classifier, and the loss function is as follows: ; Wherein: Representing a loss of difference between the source domain classifier and the target domain classifier prediction results; S33, stage C is feature alignment and performance optimization, namely fixing classifier parameters, training a feature extractor and a feature offset fitter, minimizing source domain offset feature loss, target domain feature loss and classifier loss, and reserving dynamic loss and classifier difference loss, wherein a loss function is as follows: 。

Description

Domain self-adaptive identification method based on dynamic boundary loss and multi-stage training Technical Field The invention relates to the technical field of sensor data processing and pattern recognition, in particular to a domain self-adaptive recognition method based on dynamic boundary loss and multi-stage training, which is suitable for high-precision pattern recognition of a wearable sensor in industrial safety, intelligent home, sports health and other scenes. Background With the development of wearable sensor technology, pattern recognition based on sensor data is widely applied in the fields of industrial safety monitoring, intelligent home control, sports health management and the like. The deep learning technology has remarkable progress in sensor data pattern recognition by virtue of the strong feature extraction capability, and can directly extract fine-grained features from the original sensor data, so that compared with the traditional manual feature extraction method, the recognition precision and efficiency are greatly improved. However, the conventional sensor data pattern recognition method based on deep learning still has key technical bottlenecks that on one hand, due to factors such as user difference, use scene change and the like, the data distribution of a source domain (domain where model training data is located) and a target domain (domain where model practical application data is located) has significant deviation, so that the recognition performance of a model in the target domain is far lower than that of the source domain, and on the other hand, although the conventional migration learning method tries to align the characteristics of the source domain and the target domain, the conventional migration learning method often depends on the data of the target domain to participate in training, and cross-domain public characteristics are easy to be excessively extracted, and domain characteristics special for the target domain are omitted, so that the generalization capability of the model is limited. In addition, the existing model architecture design does not fully consider the multichannel time characteristics of sensor data and the network parameter difference of a source domain and a target domain, and further influences the adaptation capability of the model to the target domain data. Therefore, on the premise that a large amount of target domain data is not needed, the problem of deviation between source domain and target domain data distribution is effectively solved, the specific characteristics of the target domain are reserved, the domain crossing generalization capability of the model is improved, and the method and the device are the technical problems to be solved in the current sensor data pattern recognition field. Disclosure of Invention The invention aims to provide a domain self-adaptive recognition method based on dynamic boundary loss and multi-stage training, which solves the technical problems of poor target domain performance and weak generalization capability of the existing model in sensor data pattern recognition, realizes efficient adaptation of a target domain without a large amount of target domain data, and improves cross-domain recognition precision. The technical scheme adopted by the invention for realizing the purpose of the invention is as follows, namely a domain self-adaptive identification method based on dynamic boundary loss and multi-stage training, comprising the following steps: The method comprises the steps of S1, constructing a double-branch-domain self-adaptive network architecture, wherein the double-branch-domain self-adaptive network architecture comprises a source domain processing branch and a target domain processing branch, the two branches are isomorphic in structure and independent in parameters, each branch consists of a characteristic extractor, a characteristic offset fitting device and a classifier, the characteristic extractor is used for extracting multichannel characteristics and time characteristics of sensor data, firstly, the input multi-element sensor time series data pass through 64 one-dimensional convolution filters with 5 sizes along a time axis and are processed by four layers of convolution layers, the first K main frequencies are extracted through fast Fourier transformation and are sequenced to obtain the maximum main frequency, an original time series is divided into a plurality of data blocks according to the maximum main frequency, a graph matrix is constructed for each data block, a single-layer LSTM network is input to extract time-related characteristics, the time-attention mechanism-based characteristic representation is combined, the characteristic offset fitting device adopts a short-term and long-term dependence relation of the multi-layer causal convolution and self-attention mechanism to extract the time series data, the linear layer is combined to carry out up sampling and characteristic