Oversampling method, system and equipment for test data of avionics equipment and medium
Through density peak clustering and adversarial training of VAE-CGAN model, the problem of ignoring most types of information in the oversampling method of test data of existing avionics equipment is solved, and false sample data that approximates the true distribution is generated, which improves the performance and recognition capabilities of the model.
Patent Information
- Application Number
- CN202510448304.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-08-05
AI Technical Summary
The oversampling method of existing avionics equipment test data ignores the information of most classes of samples, making it difficult for the model to fully learn the spatial distribution of features. The generated few classes of samples are blind and overlapping, affecting the performance of the model.
The density peak clustering algorithm is used to cluster the samples, and a new unbalanced training set is constructed after removing the noise samples. The VAE-CGAN model generation module and discriminant module are used for adversarial training to generate false sample data that approximates the real distribution.
It improves the diversity and fidelity of sample generation, enhances the model's coverage of a few types of samples, and improves the integrity of data distribution and identification accuracy.
Smart Images

Figure CN120429636A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of unbalanced data processing, and in particular to an oversampling method, system, device and medium for avionics equipment test data. Background Art
[0002] To evaluate the performance, functionality, status, and reliability of avionics equipment, it is necessary to test the equipment. The various quantitative information and metrics obtained during testing constitute avionics test data. Data imbalance is a common problem in avionics test data. Normal operating data often dominates, while minority class samples, primarily faulty or abnormal data, are relatively rare. This data imbalance poses challenges to subsequent data analysis and fault diagnosis model training. When processing unbalanced data, diagnostic models such as machine learning tend to overlearn the characteristics of majority class samples and ignore minority class samples, resulting in poor recognition of minority class samples. This, in turn, affects the accurate identification and prediction of potential equipment issues, making it impossible to ensure the safe and stable operation of avionics equipment. Therefore, effective processing of unbalanced data is essential.
[0003] At present, there are three main categories of methods for imbalanced data classification: imbalanced data resampling methods, improved algorithms based on machine learning, and combined methods. Among them, the imbalanced data resampling method converts the original data set into a balanced data set by directly changing the structure of the imbalanced data, so that the existing classifier can better handle it. Among the resampling methods, oversampling technology has attracted much attention due to its advantage of not losing data sample information. The commonly used oversampling methods in the existing technology include the SMOTE method, which uses the K-nearest neighbor algorithm to randomly interpolate between minority class samples and their neighborhood samples to generate new samples. This can avoid the drawbacks of simply copying samples to a certain extent and improve the diversity of synthetic samples.
[0004] However, the existing SMOTE oversampling method performs linear interpolation based on the assumption that the feature space of minority class samples is linearly separable. However, the distribution of avionics equipment test data is complex, and this assumption is often difficult to hold. As a result, the generated samples cannot accurately represent the characteristics of minority class samples, and boundary fuzziness is prone to occur when processing boundary samples. In addition, during training, the existing methods often ignore the majority class sample information or sample condition information, making it difficult for the model to fully learn the feature space distribution of the samples. At the same time, due to the lack of guidance from the local density and condition information of the sample distribution, the existing methods are blind when generating new minority class samples, and are prone to uncontrollable sample generation and sample overlap, affecting the oversampling effect and subsequent model performance. Summary of the Invention
[0005] In view of the technical problems that the existing oversampling methods ignore the majority class sample information or sample condition information, which is not conducive to the model fully learning the feature space distribution of the samples; there is a certain degree of blindness when generating new minority class samples, which leads to uncontrollable sample generation and sample overlap, the present application provides an oversampling method, system, equipment and medium for avionics equipment test data, which can highly fit and approximate the true distribution of minority class samples, enhance the comprehensiveness, diversity and realism of the generated samples, and effectively improve the performance of the sample generation model.
[0006] In a first aspect, the present application provides a method for oversampling test data of avionics equipment, comprising the following steps: S1. Divide the original avionics test data into minority class samples and majority class samples; S2. Cluster the two types of samples using the density peak clustering algorithm. Assign new labels to each sample based on the cluster it belongs to, remove noise samples, and then merge them into a new unbalanced training set. S3. Build a sample generation model and train it with the new imbalanced training set. The sample generation model consists of a sample generation module and a discriminator module. During training, the sample generation module inputs real sample data and their labels from the imbalanced dataset, which then outputs fake sample data. The real sample data, fake sample data, and labels are then input into the discriminator module to generate a discriminant result. The discriminant result is used for model training. Through adversarial training between the sample generation module and the discriminator module, the output of the generation module converges to the true distribution of the samples. S4. Determine the number of new minority class samples to be generated, and input the minority class samples in the new imbalanced training set into the trained sample generation model to obtain the required number of new minority class samples.
[0007] It should be further explained that, in step S1, the minority class samples are fault or abnormal data, and the majority class samples are normal operation data; Among them, fault or abnormal data includes sensor fault data, electronic component fault data, system function abnormality data, and data communication abnormality data.
[0008] It should be further explained that, in step S2, all minority class samples are used to construct a minority class sample set, and all majority class samples are used to construct a majority class sample set, and the following operations are performed on the two sample sets respectively: S201. Calculate the distance between any two sample points in this sample set , construct the distance matrix D, and for all distances in the lower triangle of the distance matrix D that do not contain diagonal elements Sort in ascending order and select the first 0.5% to 10% of the distance as the cutoff distance Selection range ; S202. Use Gaussian kernel function to calculate the potential energy of all samples in this sample set , the calculation formula is:
[0009] Where N is the total number of samples in the sample set; is the influence factor of the Gaussian function, ; Then calculate the Gini index of the data domain , the calculation formula is:
[0010] The influence factor of the Gaussian function Traverse at certain intervals , choose the Gini index smallest As the cutoff distance ; S203. Calculate the relative distance between each sample point and other sample points in this sample set , the formula is:
[0011] in, For the The local density of sample points, Equal to the impact factor Potential energy ; S204. Provisions , calculate the value of each sample point in this sample set Values, and normalized ascending sorting, the corresponding sample sorting is ; Determine the critical point of cluster center p, The formula is:
[0012] Will The sample points are determined as the preliminary cluster center set ; S205. Extract the initial cluster center set from the distance matrix D The distance matrix DC is marked as being less than the cutoff distance Elements ,get The two corresponding sample points, and Smaller sample points from Eliminate and get the actual cluster center; S206. Sort the sample points in the sample set outside the actual cluster center in descending order of local density, set noise sample selection rules, and remove noise samples; Each remaining sample point after elimination is assigned to the cluster where the closest point with a local density greater than its own is located; S207. Assign the same sample label vector to the sample points belonging to the same cluster, and enter all the remaining sample points after removing the noise samples into the new imbalanced training set.
[0013] It should be further explained that in step S206, the selection rule of noise samples is: normalize the local density and relative distance of all samples respectively. and , then it is regarded as an outlier, and the security level of all outliers is calculated based on the security level assessment method of K-nearest neighbor distance, and the outliers with a security level less than the set value are regarded as noise samples.
[0014] It should be further explained that step S3 constructs a sample generation model based on the VAE-CGAN model.
[0015] It should be further explained that in step S3, the sample generation module includes an encoder and a decoder, wherein the encoder receives the sample data and outputs a vector and vector , both of them and the standard normal distribution sample value synthesize the latent space vector ; The sample label vector corresponding to the sample data As conditional information, with Input the decoder together to generate fake sample data with the same sample label vector.
[0016] It should be further explained that the optimization goal of the encoder is to output a standard normal distribution, and the objective function is:
[0017] Where, For the i Sample data; are the network parameters of encoder E; The optimization goal of the discriminator is to determine the authenticity of the sample data as accurately as possible. The objective function is:
[0018] Where, the latent space vector , Sampled from a normal distribution ; The optimization goal of the decoder is to make it difficult for the discriminator to distinguish the authenticity of fake sample data. The objective function is: .
[0019] It should be further explained that step S4 includes: S401. Determine the number of new minority class samples to be generated based on the difference between the number of majority class samples and the number of minority class samples in the new unbalanced training set ; S402. Calculate the number of samples of each minority class in the new imbalanced training set Security level , then calculate based on each minority class sample The number of new minority class samples generated , the formula is:
[0020] like If the calculated value is not an integer, it will be rounded up; Where, is the total number of minority class samples in the new imbalanced training set; S403. Minority samples copy and randomly shuffle them, input the trained sample generation model, and generate new minority class samples; S404. Summarize the new minority class samples generated based on each minority class sample to obtain new minority class samples.
[0021] In a second aspect, the present invention provides an avionics equipment test data oversampling system, which is used to implement the above-mentioned avionics equipment test data oversampling method, comprising: A sample partitioning module is used to divide the original avionics equipment test data into minority class samples and majority class samples; The clustering processing module is used to cluster the two types of samples using the density peak clustering algorithm, assign new labels according to the cluster to which each sample belongs, remove noise samples, and then merge them into a new unbalanced training set; Sample generation model module, used to build and train sample generation models; The sample generation quantity determination module is used to determine the number of new minority class samples that need to be generated.
[0022] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor is configured to implement the steps of the above-mentioned method for oversampling test data of avionics equipment when executing the computer program.
[0023] In a fourth aspect, the present invention provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-mentioned method for oversampling test data of avionics equipment.
[0024] It can be seen from the above technical solutions that this application has the following advantages: 1. This application divides the raw avionics equipment test data into minority and majority class samples, and performs clustering processing on samples of different categories. This allows for more targeted operations on data with different characteristics, making subsequent processing more targeted and avoiding the inefficiency and poor results caused by blind data processing.
[0025] 2. This application uses the density peak clustering algorithm to cluster the two types of samples separately, assigns new labels according to the clusters to which the samples belong, removes noise samples, and then merges them into a new unbalanced training set. It can accurately identify cluster centers and noise samples, which not only avoids the subjectivity of manual parameter setting, but also improves clustering efficiency and noise recognition ability, providing a reliable data basis for the training of subsequent sample generation models and improving model training effects.
[0026] 3. This application constructs a sample generation model that includes a sample generation module and a discrimination module, and trains it with a new unbalanced training set. During training, real sample data and its labels are input into the sample generation module to generate fake sample data, and then the real sample data, fake sample data and labels are input into the discrimination module for adversarial training to converge to the true distribution of the samples. By simultaneously utilizing real sample data and label information, the spatial distribution of sample features is fully considered in the sample generation process, and the adversarial training mechanism of the sample generation module and the discrimination module makes the distribution of the generated samples closer to the real data, significantly improving the sample diversity and realism.
[0027] 4. After determining the required number of new minority samples, this application will input the minority samples in the new unbalanced training set into the trained sample generation model to obtain new samples. When determining the number of new minority samples, factors such as the difference in the number of majority and minority samples in the new unbalanced training set and the security level of each minority sample are comprehensively considered. The number of new samples generated for each minority sample is determined through scientific calculations. This makes the number of new samples generated more reasonable, better balances the data distribution, enhances the integrity of the data distribution, and improves the sample generation model's coverage of minority samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for the description. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0029] Figure 1 FIG. 1 is a flow chart of a method for oversampling test data of avionics equipment according to an embodiment of the present invention.
[0030] Figure 2 FIG. 4 is an algorithm architecture diagram of an oversampling method for avionics equipment test data in one embodiment of the present invention.
[0031] Figure 3 The present invention is a circuit diagram of a series voltage stabilizing circuit for collecting test data of avionics equipment according to an embodiment of the present invention.
[0032] Figure 4 This is a histogram of the F1 values of each oversampling algorithm on the Regulator dataset in one embodiment of the present invention. Figure 5 FIG. 4 is a schematic block diagram of an oversampling system for avionics equipment test data according to an embodiment of the present invention.
[0033] Figure 6 FIG. 1 is a schematic diagram of the hardware structure of an electronic device in one embodiment of the present invention. DETAILED DESCRIPTION
[0034] In order to make the application objectives, features, and advantages of this application more obvious and easy to understand, the technical solutions protected by this application will be clearly and completely described below using specific embodiments and drawings. Obviously, the embodiments described below are only part of the embodiments of this application, not all of them. Based on the embodiments in this patent, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this patent.
[0035] The oversampling method of avionics equipment test data involved in the present application is mainly aimed at the field of unbalanced data processing technology. The original avionics equipment test data is divided into minority class samples and majority class samples, and clustering processing is performed on samples of different categories respectively, which can operate on data with different characteristics more targetedly, making the subsequent processing process more targeted and avoiding the low efficiency and poor effect caused by blindly processing data; the density peak clustering algorithm is used to cluster the two types of samples respectively, and new labels are assigned according to the clusters to which the samples belong and noise samples are eliminated, and then merged into a new unbalanced training set, which can accurately identify cluster centers and noise samples, not only avoiding the subjectivity of manual parameter setting, but also improving clustering efficiency and noise recognition ability, providing a reliable data basis for the training of subsequent sample generation models, and improving model training effects; constructing a sample generation model including a sample generation module and a discrimination module, and training with a new unbalanced training set, and inputting real sample data and its labels into the training set during training. The sample generation module generates fake sample data, and then inputs the real sample data, fake sample data and labels into the discriminant module for adversarial training, converging to the real distribution of the samples. By simultaneously utilizing real sample data and label information, the sample feature space distribution is fully considered in the sample generation process, and the adversarial training mechanism of the sample generation module and the discriminant module makes the distribution of the generated samples closer to the real data, significantly improving the sample diversity and realism; after determining the required number of new minority class samples, the minority class samples in the new unbalanced training set are input into the trained sample generation model to obtain new samples. When determining the number of new minority class samples, the difference in the number of majority class samples and minority class samples in the new unbalanced training set, the security level of each minority class sample and other factors are comprehensively considered. The number of new samples generated for each minority class sample is determined through scientific calculation, so that the number of new samples generated is more reasonable, which can better balance the data distribution, enhance the integrity of the data distribution, and improve the coverage ability of the sample generation model for minority class samples.
[0036] The oversampling method for avionics equipment test data involved in this application is mainly aimed at the technical problems that the existing oversampling method ignores the majority class sample information or sample condition information, which is not conducive to the model fully learning the feature space distribution of the samples; there is a certain blindness when generating new minority class samples, which leads to uncontrollable sample generation and sample overlap.
[0037] The following describes in detail the method for oversampling test data for avionics equipment involved in this application. Specific details, such as specific system structures and techniques, are provided for illustrative purposes, not for limitation, to facilitate a thorough understanding of the embodiments of this application. However, it will be apparent to those skilled in the art that this application may also be implemented in other embodiments without these specific details.
[0038] In the oversampling method for avionics equipment test data involved in this application, the term "comprising" is used to indicate the presence of the described features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or their collections. The terms "including," "comprising," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.
[0039] To facilitate the clear description of the technical solutions of this application, the words "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or order of execution, and the words "first" and "second" do not necessarily mean different.
[0040] The phrases "one embodiment" or "some embodiments" described in this application mean that the specific features, structures, or characteristics described in the embodiment are included in one or more embodiments of the application. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. that appear in different places in this application do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized.
[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0042] The oversampling method for avionics equipment test data provided by the embodiment of the present invention is executed by a computer device. Accordingly, the oversampling system for avionics equipment test data runs in the computer device.
[0043] Figure 1 The flowchart of the oversampling method of avionics equipment test data according to one embodiment of the present invention is shown in FIG. Figure 1 The execution subject may be an oversampling system for test data of avionics equipment. According to different requirements, the order of the steps in the flowchart may be changed, and some steps may be omitted.
[0044] like Figure 1 As shown, the oversampling method of the avionics equipment test data includes: Step S1: Divide the original avionics equipment test data into minority class samples and majority class samples.
[0045] Distinguishing data categories with different characteristics and importance lays the foundation for subsequent targeted data processing, so that subsequent steps can focus on minority samples, avoiding information loss caused by ignoring these key data during the data processing process, and making subsequent processing more targeted and efficient.
[0046] In some specific embodiments, the minority class samples are fault or abnormal data, and the majority class samples are normal operating data; Among them, fault or abnormal data includes sensor fault data, electronic component fault data, system function abnormality data, and data communication abnormality data.
[0047] Clarifying the specific types of minority and majority samples can make data processing more targeted. For avionics equipment, accurately focusing on fault and abnormal event data can avoid missing potential equipment problems caused by ignoring these important data, thereby improving the safety and reliability of equipment operation.
[0048] In step S2, the two types of samples are clustered separately using the density peak clustering algorithm, new labels are assigned according to the cluster to which each sample belongs, noise samples are removed, and then merged into a new unbalanced training set.
[0049] The Density Peak Cluster (DPC) algorithm is a density-based clustering algorithm that calculates the local density and relative distance of data points. It can quickly determine cluster centers without prior knowledge or iteration, identifying data points with high density and large distances as cluster centers, thereby achieving data clustering. It has the advantages of simple parameters, ease of implementation, and the ability to handle non-spherical clusters. The Density Peak Cluster algorithm can effectively explore the inherent structure of data, automatically identify cluster centers, reduce manual intervention, and improve clustering efficiency. Eliminating noise samples improves data quality, reduces noise interference on model training, and makes the training set more reflective of the actual data distribution, thereby improving the accuracy and stability of subsequent model training.
[0050] In some specific embodiments, all minority class samples are used to construct a minority class sample set, and all majority class samples are used to construct a majority class sample set, and the following operations are performed on the two sample sets: S201. Calculate the distance between any two sample points in this sample set , construct the distance matrix D, and for all distances in the lower triangle of the distance matrix D that do not contain diagonal elements Sort in ascending order and select the first 0.5% to 10% of the distance as the cutoff distance Selection range ; S202. Use Gaussian kernel function to calculate the potential energy of all samples in this sample set , the calculation formula is:
[0051] Where N is the total number of samples in the sample set; is the influence factor of the Gaussian function, ; Then calculate the Gini index of the data domain , the calculation formula is:
[0052] The influence factor of the Gaussian function Traverse at certain intervals , choose the Gini index smallest As the cutoff distance ; S203. Calculate the relative distance between each sample point and other sample points in this sample set , the formula is:
[0053] in, For the The local density of sample points, Equal to the impact factor Potential energy ; S204. Provisions , calculate the value of each sample point in this sample set Values, and normalized ascending sorting, the corresponding sample sorting is ; Determine the critical point of cluster center p, The formula is:
[0054] Will The sample points are determined as the preliminary cluster center set ; S205. Extract the initial cluster center set from the distance matrix D The distance matrix DC is marked as being less than the cutoff distance Elements ,get The two corresponding sample points, and Smaller sample points from Eliminate and get the actual cluster center; S206. Sort the sample points in the sample set outside the actual cluster center in descending order of local density, set noise sample selection rules, and remove noise samples; Each remaining sample point after elimination is assigned to the cluster where the closest point with a local density greater than its own is located; S207. Assign the same sample label vector to the sample points belonging to the same cluster, and enter all the remaining sample points after removing the noise samples into the new imbalanced training set.
[0055] Clarifying the specific operating steps of the density peak clustering algorithm makes the clustering process more scientific and standardized. By reasonably determining the cutoff distance, cluster center and eliminating noise samples, it can effectively improve data purity, enhance clustering effect, and provide high-quality data sets for subsequent model training, thereby improving model performance; clarifying the specific values of the cutoff distance selection range provides a clear reference basis for actual operations, reduces the uncertainty of parameter selection, and helps to improve the stability and repeatability of clustering results, ensuring that different people can obtain similar clustering effects using this method.
[0056] In some specific embodiments, in step S206, the selection rule of noise samples is: normalize the local density and relative distance of all samples respectively. and , then it is regarded as an outlier, and the security level of all outliers is calculated based on the security level assessment method of K-nearest neighbor distance, and the outliers with a security level less than the set value are regarded as noise samples.
[0057] Clarifying the selection rules for noise samples and combining them with the K-nearest neighbor distance security level assessment method can more accurately identify and eliminate noise samples, effectively avoid noise interference on data, ensure data quality, and thus improve the accuracy and reliability of model training.
[0058] In some specific embodiments, for a sample point , security level The calculation formula is:
[0059] Where, For samples The minority class samples among the K-nearest neighbors of ; M is The number of For samples The majority class samples among the K-nearest neighbors of ; N is The number of Represents the Euclidean distance between two samples.
[0060] The calculation formula for clarifying the security level provides a quantitative indicator for evaluating the reliability of samples. When eliminating noise samples, the calculation results based on this formula can enable more scientific decision-making, improve the rationality of data processing and the accuracy of model training.
[0061] Step S3, construct a sample generation model, and train the sample generation model with the new unbalanced training set. The sample generation model includes a sample generation module and a discrimination module. During the training process, the real sample data and its label in the unbalanced data set are input into the sample generation module, and fake sample data is output. Then, the real sample data, fake sample data and labels are input into the discrimination module to generate a discrimination result. The discrimination result is used for model training. Through adversarial training of the sample generation module and the discrimination module, the output of the generation module converges to the real distribution of the sample.
[0062] The adversarial training of the sample generation module and the discriminant module can learn the true distribution of samples. The generated fake sample data can expand the number of minority class samples, increase the diversity of samples, alleviate the data imbalance problem, enable the model to learn more comprehensive sample features during training, and improve the model's recognition ability for minority class samples.
[0063] In some specific embodiments, a sample generation model is constructed based on a VAE-CGAN model.
[0064] VAE-CGAN is a model that combines the Variational Autoencoder (VAE) and the Conditional Generative Adversarial Networks (CGAN). A sample generation model is constructed based on the VAE-CGAN model. The VAE part can accurately capture the potential distribution of avionics equipment test data with its powerful probabilistic modeling capabilities, providing a more reasonable and accurate latent variable representation for the data, making the generated data samples more consistent with the inherent laws of real data; the introduction of CGAN, with its discriminant training mechanism and the integration of conditional information, can effectively improve the quality of generated samples, making the generated test data realistic and targeted, and enhancing the controllability and practicality of the model.
[0065] In some specific embodiments, the sample generation module includes an encoder and a decoder, wherein the encoder receives sample data and outputs a vector and vector , both of them and the standard normal distribution sample value synthesize the latent space vector ; The sample label vector corresponding to the sample data As conditional information, with Input the decoder together to generate fake sample data with the same sample label vector.
[0066] The internal structure and working principle of the sample generation module are clarified. Fake sample data is generated through the collaborative work of the encoder and generator. The sample label vector is used as conditional information to make the generated samples more consistent with the distribution characteristics of real data and enhance the diversity and authenticity of the samples.
[0067] In some specific embodiments, the optimization goal of the encoder is to output a standard normal distribution, and the objective function is:
[0068] Where, is the i-th sample data; are the network parameters of encoder E; The optimization goal of the discriminator is to determine the authenticity of the sample data as accurately as possible. The objective function is:
[0069] Where, the latent space vector , Sampled from a normal distribution ; The optimization goal of the decoder is to make it difficult for the discriminator to distinguish the authenticity of fake sample data. The objective function is: .
[0070] Clarifying the optimization goals and objective functions of the encoder, discriminator, and generator provides a clear direction and quantitative standards for model training and optimization, which helps improve the efficiency and effectiveness of model training, makes the generated samples closer to real data, and enhances the model's generation and discrimination capabilities for minority class samples.
[0071] Step S4: Determine the number of new minority class samples to be generated, input the minority class samples in the new unbalanced training set into the trained sample generation model, and obtain the required number of new minority class samples.
[0072] In some specific embodiments, step S4 includes: S401. Determine the number of new minority class samples to be generated based on the difference between the number of majority class samples and the number of minority class samples in the new unbalanced training set ; S402. Calculate the number of samples of each minority class in the new imbalanced training set Security level , then calculate based on each minority class sample The number of new minority class samples generated , the formula is:
[0073] like If the calculated value is not an integer, it will be rounded up; Where, is the total number of minority class samples in the new imbalanced training set; S403. Minority samples copy and randomly shuffle them, input the trained sample generation model, and generate new minority class samples; S404. Summarize the new minority class samples generated based on each minority class sample to obtain new minority class samples.
[0074] By comprehensively considering the difference in the number of majority and minority samples, as well as the security level of each minority sample, the number of new samples generated is more reasonable. This helps to more effectively balance data distribution, enhance the model's coverage of minority samples, and improve the model's recognition accuracy for minority samples.
[0075] In some specific embodiments, the security level calculation method in step S402 is the same as that in step S206 .
[0076] In a specific embodiment, a method for oversampling avionics equipment test data includes: Step S1, dividing the original avionics equipment test data into minority class samples and majority class samples; Minority class samples are fault or abnormal data, and majority class samples are normal operating data; Among them, fault or abnormal data includes sensor fault data, electronic component fault data, system function abnormality data, and data communication abnormality data; Step S2: Use the density peak clustering algorithm to cluster the two types of samples respectively, assign new labels according to the cluster to which each sample belongs, remove noise samples, and then merge them into a new unbalanced training set. The specific steps are as follows: Use all minority class samples to construct the minority class sample set, and use all majority class samples to construct the majority class sample set. Perform the following operations on the two sample sets: S201. Calculate the distance between any two sample points in this sample set , construct the distance matrix D, and for all distances in the lower triangle of the distance matrix D that do not contain diagonal elements Sort in ascending order and select the first 0.5% to 10% of the distance as the cutoff distance Selection range ; S202. Use Gaussian kernel function to calculate the potential energy of all samples in this sample set , the calculation formula is:
[0077] Where N is the total number of samples in the sample set; is the influence factor of the Gaussian function, ; Then calculate the Gini index of the data domain , the calculation formula is:
[0078] The influence factor of the Gaussian function Traverse at certain intervals , choose the Gini index smallest As the cutoff distance ; S203. Calculate the relative distance between each sample point and other sample points in this sample set , the formula is:
[0079] in, For the The local density of sample points, Equal to the impact factor Potential energy ; S204. Provisions , calculate the value of each sample point in this sample set Values, and normalized ascending sorting, the corresponding sample sorting is ; Determine the critical point of cluster center p, The formula is:
[0080] Will The sample points are determined as the preliminary cluster center set ; S205. Extract the initial cluster center set from the distance matrix D The distance matrix DC is marked as being less than the cutoff distance Elements ,get The two corresponding sample points, and Smaller sample points from Eliminate and get the actual cluster center; S206. Sort the sample points outside the actual cluster center in the sample set in descending order of local density, set the noise sample selection rule, and remove the noise samples. The noise sample selection rule is: normalize the local density and relative distance of all samples respectively. If a sample point and , then it is regarded as an outlier, and the security level of all outliers is calculated based on the security level assessment method of K-nearest neighbor distance, and the outliers with a security level less than the set value are regarded as noise samples; Each remaining sample point after elimination is assigned to the cluster where the closest point with a local density greater than its own is located; For a sample point , security level The calculation formula is:
[0081] Where, For samples The minority class samples among the K-nearest neighbors of ; M is The number of For samples The majority class samples among the K-nearest neighbors of ; N is The number of Represents the Euclidean distance between two samples; S207. Assign the same sample label vector to sample points belonging to the same cluster, and enter all remaining sample points after removing noise samples into the new unbalanced training set; Step S3: construct a sample generation model based on the VAE-CGAN model, and train the sample generation model with the new unbalanced training set. The sample generation model includes a sample generation module and a discrimination module. The sample generation module includes an encoder and a decoder, wherein the encoder receives sample data and outputs a vector and vector , both of them and the standard normal distribution sample value synthesize the latent space vector ; The sample label vector corresponding to the sample data As conditional information, with Input the decoder together to generate fake sample data with the same sample label vector; During the training process, the real sample data and its labels in the imbalanced dataset are input into the sample generation module, which outputs fake sample data. The real sample data, fake sample data, and labels are then input into the discriminant module to generate the discrimination results. The discrimination results are used for model training. Through adversarial training between the sample generation module and the discriminant module, the output of the generation module converges to the true distribution of the samples. The optimization goal of the encoder is to output a standard normal distribution, and the objective function is:
[0082] Where, is the i-th sample data; are the network parameters of encoder E; The optimization goal of the discriminator is to determine the authenticity of the sample data as accurately as possible. The objective function is:
[0083] Where, the latent space vector , Sampled from a normal distribution ; The optimization goal of the decoder is to make it difficult for the discriminator to distinguish the authenticity of fake sample data. The objective function is: ; Step S4, determining the number of new minority class samples to be generated, inputting the minority class samples in the new unbalanced training set into the trained sample generation model to obtain the required number of new minority class samples, the steps include: S401. Determine the number of new minority class samples to be generated based on the difference between the number of majority class samples and the number of minority class samples in the new unbalanced training set ; S402. Calculate the number of samples of each minority class in the new imbalanced training set Security level , then calculate based on each minority class sample The number of new minority class samples generated , the formula is:
[0084] like If the calculated value is not an integer, it will be rounded up; Where, is the total number of minority class samples in the new imbalanced training set; The security level calculation method is the same as step S206; S403. Minority samples copy and randomly shuffle them, input the trained sample generation model, and generate new minority class samples; S404. Summarize the new minority class samples generated based on each minority class sample to obtain new minority class samples; The algorithm architecture diagram of the oversampling method for avionics equipment test data in this embodiment is shown in FIG. Figure 2 shown.
[0085] The oversampling method for avionics equipment test data in this embodiment is denoted as OBDC (Oversampling Based on DPC and CGAN). To verify the effectiveness of OBDC, a comparative experiment was conducted with five commonly used oversampling methods: ADASYN, SMOTE, BorderlineSMOTE, SVMSMOTE, and SMOTE Tomek. Targeting applications in the professional fields of electronic equipment testing and fault diagnosis, a common series voltage regulator analog circuit was measured to obtain an unbalanced dataset. Comparative experiments were conducted on this unbalanced dataset to verify the professional applicability of OBDC.
[0086] The steps of the comparative experiment are: T1. Build a series voltage regulator circuit for collecting avionics equipment test data, such as Figure 3 As shown in Figure 1, the series voltage regulator circuit contains 20 replaceable units, which can generate a total of 58 hard faults. The faults are specifically manifested as short circuits and open circuits on various components. T2. Apply a 10 V, 50 Hz sinusoidal signal to the input of the series voltage regulator circuit. Then, collect steady-state voltage information from eight test points. The voltage characteristics are used as raw test data, resulting in a total of 176 sets of normal-state sample data. After C1 failed, 37 sets of sample data under the fault state were manually collected; The characteristic dimension of all sample data is 9. In the figure, test point 1 is the output point of the rectifier bridge, and the maximum voltage V1_max and minimum voltage V1_min after the signal is stable are collected; test points 2 to 8 all collect the effective voltage values after the signal is stable, that is, V2 to V8. All normal state sample data and fault state sample data are aggregated into an unbalanced dataset, denoted as "Regulator". The imbalance ratio (the ratio of the number of majority class samples to the number of minority class samples) of the Regulator dataset is 3.911:1. T3. Split the Regulator dataset into training and test sets in an 8:2 ratio. Then, oversample the training set using OBDC and ADASYN, SMOTE, Borderline SMOTE, SVMSMOTE, and SMOTE Tomek, respectively, to generate a specific number of minority class samples. This data is then merged with the training set to obtain a new, balanced training set. This new training set is used to train a classifier. Finally, the trained classifier is used to predict the test set. Recall, F-measure, G-mean, AUC, and Avg precision evaluation metrics are obtained. A total of 50 experiments are conducted, and the experimental results of these evaluation metrics are statistically averaged for performance comparison.
[0087] In this embodiment, three classifiers, namely Random Forest (RF), SVM (Support Vector Machine), and KNN (K-Nearest Neighbors), are used for comparative experiments. The results of the comparative experiments are shown in Table 1.
[0088] Table 1 Experimental results of various oversampling algorithms on the Regulator dataset
[0089] Figure 4 : is a histogram of the F1 values of each oversampling algorithm in this embodiment on the Regulator dataset.
[0090] As can be seen from Table 1, the OBDC algorithm has basically achieved the optimal value in various evaluation indicators; Figure 4 It can be seen that no matter which classifier is used, the F1 value of the OBDC algorithm is significantly better than that of other oversampling algorithms, which proves that the OBDC algorithm of this embodiment has good applicability in the professional fields of electronic equipment testing and fault diagnosis.
[0091] The following is an embodiment of an oversampling system for avionic equipment test data provided by an embodiment of the present disclosure. This oversampling system and the oversampling methods for avionic equipment test data in the aforementioned embodiments are based on the same inventive concept. For details not fully described in the embodiment of the oversampling system for avionic equipment test data, reference can be made to the embodiments of the oversampling methods for avionic equipment test data described above.
[0092] A mobile terminal implementing various embodiments of the present invention will now be described with reference to the accompanying drawings. In the subsequent description, suffixes such as "module," "component," or "unit" used to denote components are used solely to facilitate description of the embodiments of the present invention and do not inherently have specific meanings. Therefore, "module" and "component" may be used interchangeably.
[0093] like Figure 5 As shown, the oversampling system for avionics test data includes: A sample partitioning module is used to divide the original avionics equipment test data into minority class samples and majority class samples; The clustering processing module is used to cluster the two types of samples using the density peak clustering algorithm, assign new labels according to the cluster to which each sample belongs, remove noise samples, and then merge them into a new unbalanced training set; Sample generation model module, used to build and train sample generation models; The sample generation quantity determination module is used to determine the number of new minority class samples that need to be generated.
[0094] The oversampling system of this embodiment is used to implement an oversampling method for avionics equipment test data, and the steps include: S1. Divide the original avionics test data into minority class samples and majority class samples; S2. Cluster the two types of samples using the density peak clustering algorithm. Assign new labels to each sample based on the cluster it belongs to, remove noise samples, and then merge them into a new unbalanced training set. S3. Build a sample generation model and train it with the new imbalanced training set. The sample generation model consists of a sample generation module and a discriminator module. During training, the sample generation module inputs real sample data and their labels from the imbalanced dataset, which then outputs fake sample data. The real sample data, fake sample data, and labels are then input into the discriminator module to generate a discriminant result. The discriminant result is used for model training. Through adversarial training between the sample generation module and the discriminator module, the output of the generation module converges to the true distribution of the samples. S4. Determine the number of new minority class samples to be generated, and input the minority class samples in the new imbalanced training set into the trained sample generation model to obtain the required number of new minority class samples.
[0095] The present application also provides an electronic device for implementing various embodiments of the present invention. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor.
[0096] Those skilled in the art will understand that the electronic device structure involved in the embodiments of the present invention does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0097] Figure 6 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.
[0098] The electronic device includes, but is not limited to, components such as a processor and a memory. Those skilled in the art will appreciate that the electronic device structures described in the embodiments of the present invention do not limit the electronic device, and the electronic device may include more or fewer components than shown, or may combine certain components or arrange the components differently.
[0099] In the embodiments of the present invention, electronic devices include, but are not limited to, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of the present application described and / or claimed herein.
[0100] In the embodiment of the present application, the processor can be implemented by using at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a processor, a controller, a microcontroller, a microprocessor, and an electronic unit designed to perform the functions described herein. In some cases, such an implementation can be implemented in a controller. For software implementation, implementations such as processes or functions can be implemented with separate software modules that allow execution of at least one function or operation. The software code can be implemented by a software application (or program) written in any appropriate programming language, and the software code can be stored in a memory and executed by a controller.
[0101] In addition, the electronic device includes some functional modules not shown, which will not be described here.
[0102] Those skilled in the art will appreciate that various aspects of the electronic device provided herein can be implemented as a system, method, or program product. Therefore, various aspects of the present disclosure can be implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits," "modules," or "systems."
[0103] The present application also provides a storage medium storing a program product capable of implementing a method for oversampling avionics equipment test data. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product comprising program code. When the program product is executed on a terminal device, the program code is configured to cause the terminal device to execute the steps described in the "Exemplary Methods" section above according to various exemplary embodiments of the present disclosure.
[0104] The storage medium may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0105] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for oversampling test data of avionics equipment, characterized in that: The following steps are involved: S1. Divide the original avionics test data into minority class samples and majority class samples; S2. Cluster the two types of samples using the density peak clustering algorithm. Assign new labels to each sample based on the cluster it belongs to, remove noise samples, and then merge them into a new unbalanced training set. S3. Build a sample generation model and train it with the new imbalanced training set. The sample generation model consists of a sample generation module and a discriminator module. During training, the sample generation module inputs real sample data and their labels from the imbalanced dataset, which then outputs fake sample data. The real sample data, fake sample data, and labels are then input into the discriminator module to generate a discriminant result. The discriminant result is used for model training. Through adversarial training between the sample generation module and the discriminator module, the output of the generation module converges to the true distribution of the samples. S4. Determine the number of new minority class samples to be generated, and input the minority class samples in the new imbalanced training set into the trained sample generation model to obtain the required number of new minority class samples.
2. The oversampling method according to claim 1, wherein: In step S1, the minority class samples are fault or abnormal data, and the majority class samples are normal operation data; Among them, fault or abnormal data includes sensor fault data, electronic component fault data, system function abnormality data, and data communication abnormality data.
3. The oversampling method according to claim 1, wherein: In step S2, all minority class samples are used to construct a minority class sample set, and all majority class samples are used to construct a majority class sample set. The following operations are performed on the two sample sets: S201. Calculate the distance between any two sample points in this sample set , construct the distance matrix D, and for all distances in the lower triangle of the distance matrix D that do not contain diagonal elements Sort in ascending order and select the first 0.5% to 10% of the distance as the cutoff distance Selection range ; S202. Use Gaussian kernel function to calculate the potential energy of all samples in this sample set , the calculation formula is: Where N is the total number of samples in the sample set; is the influence factor of the Gaussian function, ; Then calculate the Gini index of the data domain , the calculation formula is: The influence factor of the Gaussian function Traverse at certain intervals , choose the Gini index smallest As the cutoff distance ; S203. Calculate the relative distance between each sample point and other sample points in this sample set , the formula is: in, For the The local density of sample points, Equal to the impact factor Potential energy ; S204. Provisions , calculate the value of each sample point in this sample set Values, and normalized ascending sorting, the corresponding sample sorting is ; Determine the critical point of cluster center p, The formula is: Will The sample points are determined as the preliminary cluster center set ; S205. Extract the initial cluster center set from the distance matrix D The distance matrix DC is marked as being less than the cutoff distance Elements ,get The two corresponding sample points, and Smaller sample points from Eliminate and get the actual cluster center; S206. Sort the sample points in the sample set outside the actual cluster center in descending order of local density, set noise sample selection rules, and remove noise samples; Each remaining sample point after elimination is assigned to the cluster where the closest point with a local density greater than its own is located; S207. Assign the same sample label vector to the sample points belonging to the same cluster, and enter all the remaining sample points after removing the noise samples into the new imbalanced training set.
4. The oversampling method according to claim 3, wherein: In step S206, the selection rule of noise samples is: normalize the local density and relative distance of all samples respectively. and , then it is regarded as an outlier, and the security level of all outliers is calculated based on the security level assessment method of K-nearest neighbor distance, and the outliers with a security level less than the set value are regarded as noise samples.
5. The oversampling method according to claim 1, wherein: Step S3 builds a sample generation model based on the VAE-CGAN model; The sample generation module includes an encoder and a decoder, where the encoder receives sample data and outputs a vector and vector , both of them and the standard normal distribution sample value synthesize the latent space vector ; The sample label vector corresponding to the sample data As conditional information, with Input the decoder together to generate fake sample data with the same sample label vector.
6. The oversampling method according to claim 1, wherein: Step S4 includes: S401. Determine the number of new minority class samples to be generated based on the difference between the number of majority class samples and the number of minority class samples in the new unbalanced training set ; S402. Calculate the number of samples of each minority class in the new imbalanced training set Security level , then calculate based on each minority class sample The number of new minority class samples generated , the formula is: like If the calculated value is not an integer, it will be rounded up; Where, is the total number of minority class samples in the new imbalanced training set; S403. Minority samples copy and randomly shuffle them, input the trained sample generation model, and generate new minority class samples; S404. Summarize the new minority class samples generated based on each minority class sample to obtain new minority class samples.
7. The oversampling method according to claim 4 or claim 6, wherein: For a sample point , security level The calculation formula is: Where, For samples The minority class samples among the K-nearest neighbors of ; M is The number of For samples The majority class samples among the K-nearest neighbors of ; N is The number of Represents the Euclidean distance between two samples.
8. An oversampling system for avionics equipment test data, characterized in that: The method for implementing the oversampling method according to any one of claims 1 to 7 comprises: A sample partitioning module is used to divide the original avionics equipment test data into minority class samples and majority class samples; The clustering processing module is used to cluster the minority class samples and the majority class samples using the density peak clustering algorithm, assign new labels according to the cluster to which each sample belongs, remove noise samples, and then merge them into a new unbalanced training set; Sample generation model module, used to build and train sample generation models; The sample generation quantity determination module is used to determine the number of new minority class samples that need to be generated.
9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor is configured to implement the steps of the oversampling method according to any one of claims 1 to 7 when executing the computer program.
10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the oversampling method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Hydrological data automatic classification and dynamic label generation method and system
CN122286454A
Hydrological data automatic classification and dynamic label generation method and system
CN122286454B