Aerospace equipment electromechanical product anomaly detection method based on cross-domain small sample learning
Through the meta-learning model of cross-domain small sample learning, the problem of anomaly detection of aerospace equipment electromechanical products in cross-domain and small sample scenarios is solved, and efficient and accurate fault detection and early warning are achieved, which is suitable for the safe operation of aerospace equipment under complex working conditions.
Patent Information
- Application Number
- CN202510917265.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-09-23
AI Technical Summary
Anomaly detection in electromechanical products of aerospace equipment is difficult, especially in cross-domain and small sample scenarios, where it is difficult to adapt to frequent changes in data distribution, resulting in inaccurate detection and limited generalization capabilities.
A meta-learning model based on cross-domain small sample learning is adopted. By constructing multiple source domain tasks and target domain tasks, and using inner loop and outer loop gradient optimization methods, the distribution offset problem is alleviated, the computational complexity is reduced, and efficient anomaly detection is achieved.
It improves the accuracy and robustness of anomaly detection in electromechanical products of aerospace equipment, enables efficient adaptation to different working conditions, and provides reliable fault warning support.
Smart Images

Figure CN120687989A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of aerospace technology, and in particular to a method for detecting anomalies in electromechanical products of aerospace equipment based on cross-domain small sample learning. Background Art
[0002] Abnormality detection for electromechanical products in aerospace equipment is crucial to ensuring operational safety and reliability. It not only enables timely detection of potential faults and prevents major accidents, but also increases the mission success rate and service life of aerospace equipment, significantly impacting national security and modern warfare. Currently, abnormality detection for electromechanical products in aerospace equipment is difficult. Summary of the Invention
[0003] This application provides a method for detecting anomalies in electromechanical products of aerospace equipment based on cross-domain small sample learning, which can make anomaly detection in electromechanical products of aerospace equipment simpler.
[0004] To achieve the above objectives, this application adopts the following technical solutions: In the first aspect, a method for detecting anomalies of aerospace equipment electromechanical products based on cross-domain small sample learning is provided. The method is based on a meta-learning model and includes: constructing multiple tasks, wherein the multiple tasks include multiple source domain tasks and one target domain task. In the inner loop phase of the meta-learning model, according to the initial parameters And the support set of each source domain task, obtain the training parameters corresponding to each source domain task In the outer loop phase of the meta-learning model, according to the training parameters corresponding to each source domain task , get the updated initial parameters In the test phase of the meta-learning model, the support set, query set and updated initial parameters of the target domain task are used. , get the model parameters According to the model parameters and the inspection data of aerospace equipment electromechanical products, and obtain whether the inspection data indicates that the aerospace equipment electromechanical products are abnormal.
[0005] In this technical solution, a meta-learning framework is introduced for anomaly detection in aerospace equipment and electromechanical products. Training is performed using data from multiple source domains, enabling efficient anomaly detection under diverse operating conditions with only a small amount of target domain data. This simplifies anomaly detection for aerospace equipment and electromechanical products. By constructing a task support set and query set, the anomaly detection task for aerospace equipment and electromechanical products is effectively modeled. Leveraging task-level shared knowledge, the model can efficiently adapt to diverse operating conditions and unseen target domains using a small amount of target domain data, based on multiple source domains. This reduces the reliance on manually defined features and thresholds and large amounts of annotated data. Furthermore, in scenarios involving multiple operating conditions and small sample sizes, the model can better adapt to frequent changes in data distribution, addressing distribution shift and small sample size issues in cross-domain scenarios, thereby improving the stability and generalization capabilities of anomaly detection for aerospace equipment and electromechanical products. This significantly improves the detection accuracy, cross-domain adaptability, and robustness of the detection model, providing more reliable technical support for the safe operation and fault warning of aerospace equipment and electromechanical products under complex operating conditions such as extreme environments and changing missions. This approach is applicable to scenarios in the aerospace equipment field where sample acquisition is difficult.
[0006] In a possible implementation of the first aspect, in the outer loop phase of the meta-learning model, according to the training parameters corresponding to each source domain task , get the updated initial parameters , including: in the outer loop stage of the meta-learning model, according to the initial parameters and training parameters , through Taylor expansion and Hessian matrix, we get the outer loop gradient Replacement value According to the initial parameters and the outer loop gradient Replacement value , get the updated initial parameters Among them, the outer loop gradient is a second-order gradient. In the above possible implementation, by introducing the outer loop gradient replacement method, the calculation of higher-order derivatives can be avoided, thereby reducing the computational complexity of the model training process. This not only improves training efficiency but also optimizes the computational process, making the overall model training process more efficient. This is applicable to the highly complex anomaly detection tasks of aerospace equipment and electromechanical products.
[0007] In a possible implementation of the first aspect, in the inner loop phase of the meta-learning model, according to the initial parameters And the support set of each source domain task, obtain the training parameters corresponding to each source domain task , including: in the inner loop stage of the meta-learning model, according to the initial parameters And the support set of each source domain task, obtain the inner loop gradient corresponding to each source domain task : ,in, represents the βth source domain task, represents the support set of the βth source domain task, β ranges from 1 to B, B is the total number of multiple source domain tasks, E represents the expectation, Represents the loss in the support set. According to the inner loop gradient , use the gradient descent method to obtain the training parameters corresponding to each source domain task : , where i is the number of update steps and α is the learning rate. In the outer loop phase of the meta-learning model, according to the initial parameters and training parameters , through Taylor expansion and Hessian matrix, we get the outer loop gradient Replacement value , including: according to the initial parameters and training parameters , for the inner loop gradient Perform Taylor expansion: . Where O is the Peano remainder. Substitute the result of Taylor expansion into the Hessian matrix and ,get: .in, is the Hessian matrix used to replace the second-order derivative. The calculation results are: . The calculation yields: .in, is the Hessian matrix of the quadratic derivative of the Taylor expansion of the k-step gradient. Calculation yields: .in, is the Hessian matrix of the loss function with respect to the model parameters at the p-th step update, is the gradient of the j-th update. is the Hessian matrix of the loss function with respect to the model parameters at the qth step update, is the gradient of the j-th update. Calculation: . The calculation yields: . Where L represents the loss. Calculate the outer loop gradient Replacement value : In the above possible implementation, the outer loop gradient is obtained through Taylor expansion and Hessian matrix Replacement value , which can avoid the calculation of high-order derivatives and thus reduce the computational complexity during model training.
[0008] In a possible implementation of the first aspect, in the inner loop phase of the meta-learning model, according to the initial parameters And the support set of each source domain task, obtain the training parameters corresponding to each source domain task , including: in the inner loop stage of the meta-learning model, according to the initial parameters And the support set of each source domain task, obtain the inner loop gradient corresponding to each source domain task : ,in, represents the βth source domain task, represents the support set of the βth source domain task, β ranges from 1 to B, B is the total number of multiple source domain tasks, E represents the expectation, Represents the loss in the support set. According to the inner loop gradient , get the gradient inner product regularization term According to the initial parameters and the support set of each source domain task to obtain the empirical risk optimization paradigm . According to the gradient inner product regularization term and the empirical risk optimization paradigm , get the target loss function . In the target loss function When it is minimum, obtain the training parameters corresponding to each source domain task Among the possible implementations mentioned above, by introducing an optimization method based on gradient alignment, the distribution shift problem between different data distribution domains can be alleviated and the cross-domain generalization capability can be improved.
[0009] In a possible implementation of the first aspect, in the outer loop phase of the meta-learning model, according to the training parameters corresponding to each source domain task , get the updated initial parameters , including: in the outer loop stage of the meta-learning model, according to the training parameters corresponding to each source domain task , get the outer loop gradient According to the outer loop gradient , get the gradient inner product regularization term According to the query set of each source domain task and the corresponding training parameters , obtain the empirical risk optimization paradigm . According to the gradient inner product regularization term and the empirical risk optimization paradigm , get the target loss function . In the target loss function When it is minimum, get the updated initial parameters Among the possible implementations mentioned above, by introducing an optimization method based on gradient alignment, the distribution shift problem between different data distribution domains can be alleviated and the cross-domain generalization capability can be improved.
[0010] In the second aspect, a device for detecting anomalies of electromechanical products of aerospace equipment based on cross-domain small sample learning is provided. The device is used to detect anomalies of electromechanical products of aerospace equipment based on a meta-learning model. The device includes a construction module, an inner loop module, an outer loop module, a test module, and a detection module. The construction module is used to construct multiple tasks, and the multiple tasks include multiple source domain tasks and one target domain task. The inner loop module is used to, in the inner loop phase of the meta-learning model, determine the initial parameters of the task according to the initial parameters. And the support set of each source domain task, obtain the training parameters corresponding to each source domain task The outer loop module is used to train the corresponding training parameters of each source domain task in the outer loop phase of the meta-learning model. , get the updated initial parameters The testing module is used to test the meta-learning model in the testing phase based on the support set, query set and updated initial parameters of the target domain task. , get the model parameters . Detection module, used to detect and the inspection data of aerospace equipment electromechanical products, and obtain whether the inspection data indicates that the aerospace equipment electromechanical products are abnormal.
[0011] In a possible implementation of the second aspect, the outer loop module is specifically configured to, in the outer loop phase of the meta-learning model, calculate the initial parameters and training parameters , through Taylor expansion and Hessian matrix, we get the outer loop gradient Replacement value The outer loop module is also used to calculate the initial parameters. and the outer loop gradient Replacement value , get the updated initial parameters Among them, the outer loop gradient is a second-order gradient.
[0012] In a possible implementation of the second aspect, the inner loop module is specifically configured to, in the inner loop phase of the meta-learning model, And the support set of each source domain task, obtain the inner loop gradient corresponding to each source domain task : ,in, represents the βth source domain task, represents the support set of the βth source domain task, β ranges from 1 to B, B is the total number of multiple source domain tasks, E represents the expectation, Represents the loss in the support set. The inner loop module is also used to calculate the inner loop gradient. , get the gradient inner product regularization term The inner loop module is also used to calculate the initial parameters. and the support set of each source domain task to obtain the empirical risk optimization paradigm The inner loop module is also used to regularize the term based on the inner product of the gradient and the empirical risk optimization paradigm , get the target loss function The inner loop module is also used in the target loss function. When it is minimum, obtain the training parameters corresponding to each source domain task .
[0013] In a third aspect, a computer-readable storage medium is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, the method provided by the first aspect or any possible implementation of the first aspect is implemented.
[0014] In a fourth aspect, a computer program product is provided, which includes a computer program or instructions. When the computer program or instructions are executed by a device, the device implements the method provided by the first aspect or any possible implementation of the first aspect.
[0015] It can be understood that the devices, computer-readable storage media and computer program products provided in the above aspects all include the contents described in the above methods. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the above methods and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 Schematic diagram of a method for detecting anomalies of electromechanical products of aerospace equipment based on cross-domain small sample learning provided in an embodiment of the present application Figure 1 ; Figure 2 Schematic diagram of a method for detecting anomalies of electromechanical products of aerospace equipment based on cross-domain small sample learning provided in an embodiment of the present application Figure 2 ; Figure 3 Schematic diagram of a method for detecting anomalies of electromechanical products of aerospace equipment based on cross-domain small sample learning provided in an embodiment of the present application Figure 3 . DETAILED DESCRIPTION
[0017] The following description provides many different embodiments or examples for implementing different features of the embodiments of the present application. The components and arrangements described in the following specific examples are only used to simplify the embodiments of the present application and are only examples and are not intended to limit the embodiments of the present application.
[0018] It should be noted that the terms "first" and "second" in the embodiments of this application are used only to distinguish features of the same type and should not be understood as indicating relative importance, quantity, sequence, etc. The step numbers in the embodiments of this application are used only to distinguish different steps and should not be understood as indicating relative importance, quantity, sequence, etc.
[0019] The terms "exemplary" or "for example" in the embodiments of this application are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0020] First, the application scenarios of the embodiments of the present application are introduced. The embodiments of the present application can be applied to anomaly detection of aerospace equipment electromechanical products. Aerospace equipment electromechanical products can be electromechanical products on aerospace equipment. Aerospace equipment can include, for example, aircraft, rockets, satellites, deep space probes, and other equipment. Aerospace equipment electromechanical products can include, for example, instrument panels and sensors. Anomaly detection of aerospace equipment electromechanical products refers to determining whether aerospace equipment electromechanical products are abnormal based on the test data of aerospace equipment electromechanical products. Aerospace equipment electromechanical products typically operate in complex and changing environments, and their operating conditions and usage conditions often exhibit cross-domain and small sample characteristics.
[0021] Cross-domain may mean that aerospace equipment electromechanical products may operate under multiple working conditions such as ground testing, orbital operation, and mission switching (such as switching flight orbits), and the test data under different working conditions vary greatly.
[0022] The small sample characteristic can refer to: the high cost of R&D, manufacturing and operation of aerospace equipment electromechanical products makes it extremely difficult to obtain test data, especially data on certain special working conditions or failure modes are even more scarce.
[0023] In some possible implementations, rule-based expert systems or threshold-based methods can be used to identify anomalies in the test data of aerospace equipment and electromechanical products. This approach relies heavily on manually defined features and thresholds. When the test data for aerospace equipment and electromechanical products is cross-domain, it struggles to adapt to the frequent changes in data distribution, leading to inaccurate anomaly detection.
[0024] In other possible implementations, data-driven anomaly detection methods can be used to identify anomalies in the test data of aerospace equipment and electromechanical products. This approach has limited generalization capabilities and unstable anomaly detection results when the test data of aerospace equipment and electromechanical products is cross-domain and has small sample sizes.
[0025] In other possible implementations, a meta-learning model can be used to detect anomalies in aerospace equipment and electromechanical products. The goal of a meta-learning model is to extract common features from multiple tasks by training them, thereby acquiring general knowledge. This allows the model to quickly learn and achieve good performance on new, unseen tasks using a small number of samples. This allows the meta-learning model to achieve cross-domain generalization even when the inspection data for aerospace equipment and electromechanical products is cross-domain and small in sample size.
[0026] Based on this, the embodiment of the present application provides a method for detecting anomalies of electromechanical products of aerospace equipment based on cross-domain small sample learning. The method is based on a meta-learning model, such as Figure 1 As shown, the method may include at least one or more of the following steps: S110: Construct multiple tasks, where the multiple tasks include multiple source domain tasks and one target domain task.
[0027] For example, the meta-learning model may be a Model Agnostic Meta Learning (MAML) model. The meta-learning model may include a training phase and a testing phase. The training phase may include an inner loop phase and an outer loop phase.
[0028] As another example, multiple tasks are all anomaly detection tasks for aerospace equipment electromechanical products. Multiple tasks come from different data domain distributions. In other words, multiple tasks include detection data of aerospace equipment electromechanical products under different working conditions. The source domain task can be a task used in the training phase. The target domain task can be a task used in the testing phase. Each task can include a support set and a query set. The support set of the source domain task can be used in the inner loop phase, and the query set of the source domain task can be used in the outer loop phase. The support set of the target domain task can be used to fine-tune the model to adapt to the data distribution, and the query set of the target domain can be used to test the performance of the model on the target task. The feature-label pairs in the support set and query set can be defined as training samples and test samples, respectively.
[0029] For example, multiple source domain tasks include .in, represents the βth source domain task, represents the support set of the βth source domain task, represents the query set of the βth source domain task, where β ranges from 1 to B, and B is the total number of source domain tasks. and The feature-label pairs in can be defined as and .in, and represent the number of samples in the support set and query set respectively.
[0030] During the training phase of the meta-learning model, data from multiple source domains can be used to construct tasks and perform meta-learning training. The model learns general knowledge from the source domain and optimizes the initial model parameters.
[0031] S120: In the inner loop phase of the meta-learning model, according to the initial parameters And the support set of each source domain task, obtain the training parameters corresponding to each source domain task .
[0032] For example, in the inner loop, for each source domain task, the support set data is used to update the model parameters by gradient descent to train the basic learner. The initial parameters of the basic learning period are are copied from the meta-learner parameters. Using gradient descent to update .
[0033] For example, S120 may specifically include: in the inner loop phase of the meta-learning model, according to the initial parameters And the support set of each source domain task, obtain the inner loop gradient corresponding to each source domain task Please refer to formula (1): According to the inner circulation gradient , use the gradient descent method to obtain the training parameters corresponding to each source domain task Please refer to formula (2): .
[0034] Among them, E stands for expectation, represents the loss on the support set, i is the number of update steps, and α is the learning rate.
[0035] S130: In the outer loop phase of the meta-learning model, according to the training parameters corresponding to each source domain task , get the updated initial parameters .
[0036] For example, in the outer loop, based on the performance of each base learner on the query set, the parameters of the meta-learner are updated to improve the generalization ability to other tasks. The update formula is as follows: .in, is the learning rate of the meta-learner, are the parameters of the meta-learner before updating, are the updated meta-learner parameters, As initial parameters .
[0037] S140: In the testing phase of the meta-learning model, according to the support set, query set and updated initial parameters of the target domain task , get the model parameters .
[0038] For example, during the testing phase, when encountering target domain data, a small amount of target domain data is used to adapt the model and update the model parameters to achieve efficient adaptation to the target domain task and accurate anomaly detection (similar to the operation on the support set during the training phase). The update formula for the target domain adaptation process is as follows: .
[0039] S150: According to model parameters and the inspection data of aerospace equipment electromechanical products, and obtain the abnormal conditions of aerospace equipment electromechanical products represented by the inspection data.
[0040] For example, the abnormality of aerospace equipment electromechanical products may include: whether the aerospace equipment electromechanical products are abnormal, and the abnormality location or degree of the aerospace equipment electromechanical products. Abnormal detection of aerospace equipment electromechanical products can provide early warning of potential faults under different working conditions, ensuring the safe operation of aerospace equipment electromechanical products.
[0041] Each source domain task can be from a different distribution domain, sharing both common and specific characteristics. The goal of meta-learning is to learn the common characteristics of source domain tasks, namely, general knowledge. When faced with a specific task, only a small number of samples are needed to transfer this general knowledge to the specific distribution domain of the task, forming task-specific knowledge. The task of anomaly detection for aerospace equipment and electromechanical products under various operating conditions can be considered a unique meta-learning task. Constrained by practical engineering conditions, multiple training tasks from different data distribution domains can be constructed based on limited data (source domain data constitutes the training task). The model trained through meta-learning is applicable to anomaly detection tasks for aerospace equipment and electromechanical products under different operating conditions, not just those within a single data distribution domain. Furthermore, when faced with previously unseen detection tasks (target domain data constitutes the test task), the model only requires a small amount of data for adaptation to achieve satisfactory performance.
[0042] In this implementation, a meta-learning framework is introduced for anomaly detection in aerospace equipment and electromechanical products. Training is performed using data from multiple source domains, enabling efficient anomaly detection under various operating conditions with only a small amount of target domain data. This simplifies anomaly detection for aerospace equipment and electromechanical products. By constructing a task support set and query set, effective modeling of the anomaly detection task for aerospace equipment and electromechanical products is achieved. Leveraging task-level shared knowledge, a small amount of target domain data, built on top of multiple source domains, allows efficient adaptation to diverse operating conditions and unseen target domains. This alleviates the reliance on manually defined features and thresholds, as well as large amounts of labeled data. Furthermore, in scenarios involving multiple operating conditions and small sample sizes, the model can better adapt to frequent changes in data distribution, addressing distribution shift and small sample size issues in cross-domain scenarios, thereby improving the stability and generalization capabilities of anomaly detection for aerospace equipment and electromechanical products. This significantly improves the detection accuracy, cross-domain adaptability, and robustness of the detection model, providing more reliable technical support for the safe operation and fault warning of aerospace equipment and electromechanical products under complex operating conditions such as extreme environments and variable tasks. This approach is applicable to scenarios in the aerospace equipment field where sample acquisition is difficult.
[0043] In some possible implementations, in order to mitigate the distribution offset between different data domains (e.g., different working conditions of aerospace detection, i.e., cross-domain), gradient alignment technology can be used to align the gradient direction of the source domain data during the inner loop. , please refer to formula (3): . Where L represents the loss. This is an empirical risk optimization paradigm. argmin is the minimization formula.
[0044] In some examples, the optimization paradigm based on empirical risk minimization tends to learn domain-specific features. In the embodiments of the present application, the gradient inner product regularization term An optimization objective is introduced to ensure that the model can learn domain-invariant features.
[0045] S120 may further include: , get the gradient inner product regularization term ; According to the initial parameters and the support set of each source domain task, obtaining the empirical risk optimization paradigm ; According to the gradient inner product regularization term and the empirical risk optimization paradigm , get the target loss function ; In the objective loss function When the minimum value is reached, the training parameters corresponding to each source domain task are obtained. .
[0046] In some examples, the outer loop can also regularize the inner product of the gradient Introducing optimization objectives.
[0047] S130 may specifically include: in the outer loop stage of the meta-learning model, according to the training parameters corresponding to each source domain task , get the outer loop gradient ; According to the external circulation gradient , get the gradient inner product regularization term ; According to the query set of each source domain task and the corresponding training parameters , obtain the empirical risk optimization paradigm ; According to the gradient inner product regularization term and the empirical risk optimization paradigm , get the target loss function ; In the objective loss function When it is minimum, get the updated initial parameters .
[0048] Please refer to formula (4): .in, is the sum of the inner products of all gradient pairs.
[0049] In this implementation, by introducing an optimization method based on gradient alignment, the distribution shift problem between different data distribution domains can be alleviated, improving cross-domain generalization capabilities. By aligning the gradient directions of the source domain data, the model can be ensured to learn domain-invariant features, thereby achieving efficient adaptation to new target domains and maintaining high anomaly detection performance in different working environments.
[0050] In some possible implementations, if the outer loop involves calculating second-order gradients, this can result in a high computational load. Therefore, a Taylor expansion can be used to approximate the second-order gradients, reducing the computational complexity of higher-order derivatives and improving optimization efficiency.
[0051] In some examples, S130 may specifically include: in the outer loop phase of the meta-learning model, according to the initial parameters and the training parameters , through Taylor expansion and Hessian matrix, we get the outer loop gradient Replacement value According to the initial parameters and the outer loop gradient Replacement value , obtain the updated initial parameters Wherein, the outer circulation gradient is a second-order gradient. For example, It can also be called an approximation of the outer loop gradient.
[0052] In this implementation, by introducing outer loop gradient replacement (e.g., approximating the outer loop gradient), the calculation of higher-order derivatives can be avoided, thereby reducing the computational complexity of the model training process. This not only improves training efficiency but also optimizes the computational process, making the overall model training process more efficient. This makes it suitable for highly complex aerospace equipment electromechanical product anomaly detection tasks.
[0053] In some examples, in the outer loop of the meta-learning model, according to the initial parameters and training parameters , through Taylor expansion and Hessian matrix, we get the outer loop gradient Replacement value , which can include: First, using Taylor expansion to approximate the gradient, because MAML uses quadratic gradient to update, at a certain step in the inner loop, according to the initial parameters and training parameters , for the inner loop gradient To perform the Taylor expansion (also called second-order Taylor expansion), please refer to formula (5): . Where O is the Peano remainder. After expansion, it can be simplified by substituting the Hessian matrix, formula (2) and formula (5). That is, substitute the result of the Taylor expansion into the Hessian matrix and formula (2) (i.e. ), we can get formula (6): .in, is the Hessian matrix used to replace the second-order derivatives.
[0054] Then, further deduction based on formula (2) can obtain formula (7): .
[0055] Substituting formula (6) into formula (7) yields formula (8): .in, is the Hessian matrix of the quadratic derivative of the Taylor expansion of the k-step gradient.
[0056] Expanding formula (8) yields formula (9): , and we can get formula (10): .in, It is the Hessian matrix of the loss function with respect to the model parameters at the time of the p-th step update, which describes the curvature information of the loss function at the corresponding step. is the gradient of the j-th update. is the Hessian matrix of the loss function with respect to the model parameters at the qth step update, is the gradient of the j-th update.
[0057] According to formula (10), formula (11) can be derived: .
[0058] According to formula (3) and formula (11), the gradient of L can be approximately calculated. Calculate the outer loop gradient Replacement value , you can refer to formula (12): That is, using the outer loop gradient The approximate value (i.e., the replacement value) ) Used as outer loop gradient for subsequent calculations.
[0059] For example, combining formula (4) and formula (10) can derive the specific form of formula (11): According to formula (4) and formula (11), it can be approximately calculated The gradient of , we get the specific form of formula (12): .
[0060] In this embodiment, the outer loop gradient is obtained by Taylor expansion and Hessian matrix Replacement value , which can avoid the calculation of high-order derivatives and thus reduce the computational complexity during model training.
[0061] Next, the above method is illustrated based on the anomaly detection scenario of aerospace equipment electromechanical products.
[0062] like Figure 2 As shown, input signals such as current, voltage, vibration, and load of aerospace equipment electromechanical products. The specific number of signals can be set according to actual needs. Set parameter values, such as the number of detection categories and the number of samples in the mission support set. , the learning rate of the base learner , the learning rate of the meta-learner Initialize the meta-learner parameter space Initialize the basic learner parameter space . Sample B tasks. Calculate the tasks The loss value of the base learner on the support set . Update the base learner: . There are i update steps in total. Let . judge Is it equal to B. If not, calculate the tasks The loss value of the base learner on the support set , and perform subsequent calculations. If so, perform an outer loop to update the meta-learner: . Update the parameters of the meta-learner, let . Determine whether the number of training rounds has been reached. If not, initialize the basic learner parameter space again , and perform subsequent calculations. If yes, then end.
[0063] like Figure 3 As shown, the meta-learning model can include an inner loop and an outer loop. The inner loop can include a base learner, which can use an attention mechanism. After the base learner is calculated, multi-task training is performed. For example, using source domain task data, deep network model feature extraction is performed, detection and classification (for example, including category 1, category 2, ..., category n) are performed, the true labels of the task data are obtained, and the multi-task inner loop training loss is calculated. The inner loop gradient is then obtained, gradient approximation is performed, and the outer loop gradient is obtained. The outer loop can include a meta-learner, which can use an attention mechanism. Without the target domain task data, deep network model feature extraction is performed, detection and classification (for example, including category 1, category 2, ..., category n) are performed.
[0064] An embodiment of the present application also provides an aerospace equipment electromechanical product anomaly detection device based on cross-domain small sample learning, which is used to perform anomaly detection on aerospace equipment electromechanical products based on a meta-learning model. The device includes a construction module, an inner loop module, an outer loop module, a test module and a detection module.
[0065] The construction module is used to construct multiple tasks, where the multiple tasks include multiple source domain tasks and one target domain task.
[0066] The inner loop module is used to learn the inner loop of the meta-learning model according to the initial parameters and the support set of each source domain task, and obtain the training parameters corresponding to each source domain task ;.
[0067] The outer loop module is used to, in the outer loop phase of the meta-learning model, train the training parameters corresponding to each source domain task according to the training parameters corresponding to each source domain task. , obtain the updated initial parameters .
[0068] A testing module is used to test the support set, query set and updated initial parameters of the target domain task in the testing phase of the meta-learning model. , get the model parameters .
[0069] Detection module, for and detection data of the aerospace equipment electromechanical product, and obtaining whether the aerospace equipment electromechanical product is abnormal as indicated by the detection data.
[0070] The building module, inner loop module, outer loop module, test module and detection module can be hardware modules or software modules. Whether it is hardware or software can refer to actual needs.
[0071] In some possible implementations, the outer loop module is specifically configured to, in the outer loop phase of the meta-learning model, and the training parameters , through Taylor expansion and Hessian matrix, we get the outer loop gradient Replacement value .
[0072] The outer loop module is further used to calculate the initial parameters and the outer loop gradient Replacement value , obtain the updated initial parameters Wherein, the outer circulation gradient is a second-order gradient.
[0073] In some possible implementations, the inner loop module is specifically configured to, in the inner loop phase of the meta-learning model, calculate the initial parameters according to the initial parameters. And the support set of each source domain task, obtain the inner loop gradient corresponding to each source domain task : ,in, represents the βth source domain task, represents the support set of the βth source domain task, β ranges from 1 to B, B is the total number of the multiple source domain tasks, E represents the expectation, represents the loss on the support set.
[0074] The inner loop module is further configured to generate an inner loop gradient according to the inner loop gradient. , use the gradient descent method to obtain the training parameters corresponding to each source domain task : , where i is the number of update steps and α is the learning rate.
[0075] The outer loop module is specifically used to and the training parameters , for the inner loop gradient Perform the Taylor expansion: .
[0076] The outer loop module is further used to substitute the result of the Taylor expansion into the Hessian matrix and ,get: .
[0077] The outer loop module is also used to calculate: .
[0078] The outer loop module is also used to calculate: .
[0079] The outer loop module is also used to calculate: .
[0080] The outer loop module is also used to calculate: .
[0081] The outer loop module is also used to calculate: . Where L represents the loss.
[0082] The outer loop module is also used to calculate the outer loop gradient Replacement value : .
[0083] In some possible implementations, the inner loop module is specifically configured to, in the inner loop phase of the meta-learning model, calculate the initial parameters according to the initial parameters. And the support set of each source domain task, obtain the inner loop gradient corresponding to each source domain task : ,in, represents the βth source domain task, represents the support set of the βth source domain task, β ranges from 1 to B, B is the total number of the multiple source domain tasks, E represents the expectation, represents the loss on the support set.
[0084] The inner loop module is further configured to generate an inner loop gradient according to the inner loop gradient. , get the gradient inner product regularization term .
[0085] The inner loop module is further used to calculate the initial parameters and the support set of each source domain task, obtaining the empirical risk optimization paradigm .
[0086] The inner loop module is also used to regularize the term based on the inner product of the gradient and the empirical risk optimization paradigm , get the target loss function .
[0087] The inner loop module is also used in the target loss function When the minimum value is reached, the training parameters corresponding to each source domain task are obtained. .
[0088] In some possible implementations, the outer loop module is specifically used in the outer loop phase of the meta-learning model to train the training parameters corresponding to each source domain task. , get the outer loop gradient .
[0089] The outer loop module is further configured to generate an outer loop gradient according to the outer loop gradient. , get the gradient inner product regularization term .
[0090] The outer loop module is further used to calculate the query set of each source domain task and the corresponding training parameters , obtain the empirical risk optimization paradigm .
[0091] The outer loop module is also used to regularize the term based on the inner product of the gradient and the empirical risk optimization paradigm , get the target loss function .
[0092] The outer loop module is also used in the target loss function When it is minimum, get the updated initial parameters .
[0093] An embodiment of the present application also provides a computer-readable storage medium, which stores program code. When the computer-readable storage medium is run on a device (for example, the device can be a single-chip microcomputer, chip, computer or processor, etc.), the program code therein can be called by the processor to execute one or more steps in the above method embodiment.
[0094] Based on this understanding, the embodiments of the present application also provide a computer program product containing instructions. The technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or the processor therein to execute all or part of the steps of the method described in each embodiment of the present application.
[0095] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A method for detecting anomalies of electromechanical products in aerospace equipment based on cross-domain small sample learning, characterized in that: The method is based on a meta-learning model and includes: Constructing multiple tasks, where the multiple tasks include multiple source domain tasks and one target domain task; In the inner loop phase of the meta-learning model, according to the initial parameters and the support set of each source domain task, and obtain the training parameters corresponding to each source domain task ; In the outer loop phase of the meta-learning model, according to the training parameters corresponding to each source domain task , obtain the updated initial parameters ; In the testing phase of the meta-learning model, the support set, query set and updated initial parameters of the target domain task are used to calculate the initial parameters. , get the model parameters ; According to the model parameters and the detection data of the aerospace equipment electromechanical product, and obtaining whether the aerospace equipment electromechanical product is abnormal as indicated by the detection data.
2. The method according to claim 1, characterized in that In the outer loop stage of the meta-learning model, according to the training parameters corresponding to each source domain task , obtain the updated initial parameters ,include: In the outer loop phase of the meta-learning model, according to the initial parameters and the training parameters , through Taylor expansion and Hessian matrix, we get the outer loop gradient Replacement value ; According to the initial parameters and the outer loop gradient Replacement value , obtain the updated initial parameters ; Wherein, the outer circulation gradient is a second-order gradient.
3. The method according to claim 2, characterized in that In the inner loop phase of the meta-learning model, according to the initial parameters and the support set of each source domain task, and obtain the training parameters corresponding to each source domain task ,include: In the inner loop phase of the meta-learning model, according to the initial parameters And the support set of each source domain task, obtain the inner loop gradient corresponding to each source domain task : ,in, represents the βth source domain task, represents the support set of the βth source domain task, β ranges from 1 to B, B is the total number of the multiple source domain tasks, E represents the expectation, represents the loss in the support set; According to the inner circulation gradient , use the gradient descent method to obtain the training parameters corresponding to each source domain task : , where i is the number of update steps and α is the learning rate; In the outer loop stage of the meta-learning model, according to the initial parameters and the training parameters , through Taylor expansion and Hessian matrix, we get the outer loop gradient Replacement value ,include: According to the initial parameters and the training parameters , for the inner loop gradient Perform the Taylor expansion: ; where O is the Peano remainder; Substitute the result of the Taylor expansion into the Hessian matrix and ,get: ;in, is the Hessian matrix used to replace the second-order derivative; Calculation yields: ; Calculation yields: ;in, is the Hessian matrix of the quadratic derivative of the Taylor expansion of the k-step gradient; Calculation yields: ;in, is the Hessian matrix of the loss function with respect to the model parameters at the p-th step update, is the gradient of the j-th update. is the Hessian matrix of the loss function with respect to the model parameters at the qth step update, is the gradient at the j-th step update; Calculation yields: ; Calculation yields: ; Where L represents loss; Calculate outer loop gradient Replacement value : .
4. The method according to any one of claims 1 to 3, characterized in that In the inner loop phase of the meta-learning model, according to the initial parameters and the support set of each source domain task, and obtain the training parameters corresponding to each source domain task ,include: In the inner loop phase of the meta-learning model, according to the initial parameters And the support set of each source domain task, obtain the inner loop gradient corresponding to each source domain task : ,in, represents the βth source domain task, represents the support set of the βth source domain task, β ranges from 1 to B, B is the total number of the multiple source domain tasks, E represents the expectation, represents the loss in the support set; According to the inner circulation gradient , get the gradient inner product regularization term ; According to the initial parameters and the support set of each source domain task, obtaining the empirical risk optimization paradigm ; According to the gradient inner product regularization term and the empirical risk optimization paradigm , get the target loss function ; In the objective loss function When the minimum value is reached, the training parameters corresponding to each source domain task are obtained. .
5. The method according to claim 1, wherein In the outer loop stage of the meta-learning model, according to the training parameters corresponding to each source domain task , obtain the updated initial parameters ,include: In the outer loop stage of the meta-learning model, according to the training parameters corresponding to each source domain task , get the outer loop gradient ; According to the external circulation gradient , get the gradient inner product regularization term ; According to the query set of each source domain task and the corresponding training parameters , obtain the empirical risk optimization paradigm ; According to the gradient inner product regularization term and the empirical risk optimization paradigm , get the target loss function ; In the objective loss function When it is minimum, get the updated initial parameters .
6. A device for detecting anomalies of electromechanical products of aerospace equipment based on cross-domain small sample learning, characterized in that: The device is used to perform anomaly detection on aerospace equipment electromechanical products based on a meta-learning model, and the device includes a construction module, an inner loop module, an outer loop module, a test module, and a detection module; The construction module is used to construct multiple tasks, where the multiple tasks include multiple source domain tasks and one target domain task; The inner loop module is used to, in the inner loop phase of the meta-learning model, and the support set of each source domain task, and obtain the training parameters corresponding to each source domain task ; The outer loop module is used to, in the outer loop phase of the meta-learning model, train the training parameters corresponding to each source domain task according to the training parameters corresponding to each source domain task. , obtain the updated initial parameters ; The testing module is used to test the support set, query set and updated initial parameters of the target domain task during the testing phase of the meta-learning model. , get the model parameters ; Detection module, for and the detection data of the aerospace equipment electromechanical product, and obtaining whether the aerospace equipment electromechanical product is abnormal as indicated by the detection data.
7. The device according to claim 6, characterized in that The outer loop module is specifically used in the outer loop phase of the meta-learning model, according to the initial parameters and the training parameters , through Taylor expansion and Hessian matrix, we get the outer loop gradient Replacement value ; The outer loop module is further configured to calculate the initial parameters and the outer loop gradient Replacement value , obtain the updated initial parameters ; Wherein, the outer circulation gradient is a second-order gradient.
8. The device according to claim 6 or 7, characterized in that The inner loop module is specifically used to, in the inner loop phase of the meta-learning model, And the support set of each source domain task, obtain the inner loop gradient corresponding to each source domain task : ,in, represents the βth source domain task, represents the support set of the βth source domain task, β ranges from 1 to B, B is the total number of the multiple source domain tasks, E represents the expectation, represents the loss in the support set; The inner circulation module is further configured to adjust the inner circulation gradient according to the inner circulation gradient. , get the gradient inner product regularization term ; The inner loop module is further configured to calculate the initial parameters and the support set of each source domain task, obtaining the empirical risk optimization paradigm ; The inner loop module is specifically used to regularize the term according to the gradient inner product and the empirical risk optimization paradigm , get the target loss function ; The inner loop module is specifically used to When the minimum value is reached, the training parameters corresponding to each source domain task are obtained. .
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program or instruction, and when the computer program or instruction is executed, the method according to any one of claims 1 to 5 is implemented.
10. A computer program product, characterized in that The computer program product includes a computer program or instructions, and when the computer program or instructions are executed by a device, the device is enabled to implement the method according to any one of claims 1 to 5.