Small sample expansion method based on data distribution and related device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING YIZHUANG REUSABLE ROCKET TECHNOLOGY INNOVATION CENTER CO LTD
- Filing Date
- 2025-11-18
- Publication Date
- 2026-05-12
Smart Images

Figure CN121561269B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a small sample augmentation method and related equipment based on data distribution. Background Technology
[0002] With the development of society and economy and the advancement of science and technology, the application of virtual simulation technology is becoming increasingly widespread. Virtual simulation technology has advantages such as low cost, process safety, good repeatability, convenience, and high efficiency, and can significantly shorten the prediction process for product performance. At the same time, the reliability assessment of simulation systems has also received increasing attention. To obtain relatively accurate assessment results, it is necessary to compare and analyze a large amount of simulation data and measured data. Although this data can all be obtained through real simulations and measurements, it has unavoidable drawbacks such as high cost and excessive time consumption, failing to truly meet practical needs. Furthermore, limited small sample data makes it difficult to clearly and accurately display the overall information of the process, which inevitably affects the predictive performance of the established model.
[0003] In existing technologies, SMOTE oversampling is a classic method for small-sample augmentation, generating new synthetic samples between two original samples through linear interpolation. The basic principle of this algorithm is to first randomly select each sample from the original samples. As the root sample for synthesizing new samples; then from of Randomly select one sample from the nearest neighbor samples as an auxiliary sample for synthesizing the new sample, and then... The corresponding auxiliary samples are connected by the formula: Perform linear interpolation, where for Random numbers within the range, repeated Next, finally generated A synthetic sample, such as Figure 1 As shown. However, while the existing SMOTE algorithm alleviates overfitting caused by randomly copied samples and has been widely used in many fields, it also has some problems. SMOTE simply follows the selected sample and arbitrary... The line connecting nearest neighbors generates a new composite sample. This method cannot generate data that approximates the original discrete samples, and the generated samples have significant sparsity, meaning that areas sparse in the original samples remain sparse. Furthermore, because the data distribution in the combination is fixed, it can easily lead to data marginalization.
[0004] Therefore, there is an urgent need for a small sample augmentation method that can overcome the above-mentioned defects, enabling the generation of synthetic samples with more reasonable distribution and richer features within the geometric space composed of the original samples, thereby effectively supporting practical engineering applications such as the credibility assessment of simulation systems. Summary of the Invention
[0005] The technical problem to be solved by this invention is to address the shortcomings of existing technologies. Specifically, it provides a small sample augmentation method and related equipment based on data distribution, as detailed below:
[0006] 1) In a first aspect, the present invention provides a small sample augmentation method based on data distribution, the specific technical solution of which is as follows:
[0007] S1. Obtain the original small sample dataset for virtual simulation, and represent each original sample in the original small sample dataset with corresponding coordinates;
[0008] S2. Randomly select one original sample from the original small sample dataset as the preset original sample;
[0009] S3. Based on the coordinates of the preset original sample, obtain the coordinates of the k nearest neighbor original samples corresponding to the preset original sample;
[0010] S4. Randomly select two nearest-neighbor original samples from k nearest-neighbor original samples as the first nearest-neighbor original sample and the second nearest-neighbor original sample. The coordinates of the first nearest-neighbor original sample, the coordinates of the second nearest-neighbor original sample, and the coordinates of the preset original sample form a first triangle.
[0011] S5. Based on the coordinates of the first nearest original sample, the coordinates of the second nearest original sample, and the coordinates of the preset original sample, generate the coordinates of the first temporary sample, the coordinates of the second temporary sample, and the coordinates of the third temporary sample. The coordinates of the first temporary sample, the coordinates of the second temporary sample, and the coordinates of the third temporary sample form a second triangle, which is completely located inside the first triangle.
[0012] S6. Take the center coordinates of the second triangle as the coordinates of the newly generated synthetic sample, and obtain the synthetic sample based on the coordinates of the synthetic sample.
[0013] The beneficial effects of the small sample augmentation method based on data distribution provided by this invention are as follows:
[0014] By acquiring the original small sample dataset and representing each original sample with coordinates, a foundation is laid for subsequent geometric operations. A preset original sample is randomly selected from the original small sample dataset, and the coordinates of its k nearest neighbor original samples are obtained, ensuring the representativeness of the sample selection. A first and second nearest neighbor original sample are randomly selected from the k nearest neighbor original samples and form a first triangle with the preset original sample, establishing a reasonable geometric space boundary. Based on the coordinates of the first and second nearest neighbor original samples and the preset original sample, the coordinates of the first, second, and third temporary samples are generated, forming a second triangle. The second triangle is completely located inside the first triangle, ensuring the spatial rationality of the generated samples. The center coordinates of the second triangle are used as the coordinates of the newly generated synthetic sample, effectively avoiding the problem of sparse distribution of the original samples. Compared with existing SMOTE technology, the new synthetic samples generated by this invention are no longer limited to linear interpolation along the lines connecting the original samples, but rather generate more uniformly distributed synthetic samples within the geometric space formed by the original samples, significantly improving the sample marginalization phenomenon. Meanwhile, through multi-level random interpolation and triangle center synthesis mechanism, the newly generated synthetic samples contain richer feature information and can more comprehensively and systematically reflect the distribution characteristics of the original samples, thereby improving the prediction accuracy of the model built based on the expanded data and providing a more reliable data foundation for the credibility assessment of the simulation system.
[0015] Based on the above scheme, the small sample augmentation method based on data distribution of the present invention can be further improved as follows.
[0016] Furthermore, based on the coordinates of the preset original sample, the coordinates of the k nearest neighbor original samples corresponding to the preset original sample are obtained, including:
[0017] The Euclidean distance from the coordinates of each original sample (excluding the coordinates of the preset original sample) in the original small sample dataset to the coordinates of the preset original sample is calculated.
[0018] Sort all original samples except the preset original samples according to the Euclidean distance in ascending order to obtain a first sequence. Select the coordinates of the first k nearest neighbor original samples in the first sequence as the coordinates of the k nearest neighbor original samples of the preset original sample. Alternatively, sort all original samples except the preset original samples according to the Euclidean distance in descending order to obtain a second sequence. Select the coordinates of the last k nearest neighbor original samples in the second sequence as the coordinates of the k nearest neighbor original samples of the preset original sample.
[0019] The beneficial effects of adopting the above-mentioned further technical solution are as follows: In the existing SMOTE oversampling technology, the generation of new synthetic samples relies solely on the linear interpolation of a single nearest neighbor sample. This method easily leads to the inability to effectively fill sparse regions of the original sample distribution. The newly generated samples are often concentrated near the lines connecting the original samples, failing to fully cover the geometric space of the data distribution, thus causing sample sparsity and marginalization problems, affecting the accuracy and generalization ability of subsequent model training. This invention effectively overcomes the above-mentioned defects by calculating the Euclidean distance from the coordinates of each original sample (excluding the coordinates of the preset original sample) in the original small sample dataset to the coordinates of the preset original sample, and selecting the coordinates of the k nearest neighbor original samples according to the Euclidean distance. This technique ensures that nearest neighbor selection is based on accurate geometric distance metrics, thus fully capturing the local data distribution characteristics of the original samples. Through a systematic distance sorting and nearest neighbor selection process, it guarantees that the generation of new samples always takes place within a reasonable local geometric space, avoiding the instability caused by random nearest neighbor selection. At the same time, this method provides a reliable data foundation for the subsequent construction of the first triangle, thereby generating synthetic samples that better match the original data distribution characteristics, significantly improving the sample sparsity problem, reducing marginalization, and ultimately improving the quality and practicality of small sample augmentation.
[0020] Furthermore, based on the coordinates of the first nearest original sample, the coordinates of the second nearest original sample, and the coordinates of the preset original sample, the coordinates of the first temporary sample, the coordinates of the second temporary sample, and the coordinates of the third temporary sample are generated, including:
[0021] The coordinates of a first transition sample are generated between the coordinates of the first nearest original sample and the coordinates of the second nearest original sample using random linear interpolation. The coordinates of a first temporary sample are also generated between the coordinates of the first transition sample and the coordinates of a preset original sample using random linear interpolation. The coordinates of a second transition sample are generated between the coordinates of the first nearest original sample and the coordinates of the preset original sample using random linear interpolation. The coordinates of a second temporary sample are also generated between the coordinates of the second transition sample and the coordinates of the second nearest original sample using random linear interpolation. Finally, the coordinates of a third transition sample are generated between the coordinates of the second nearest original sample and the coordinates of the preset original sample using random linear interpolation. The coordinates of a third temporary sample are also generated between the coordinates of the third transition sample and the coordinates of the first nearest original sample using random linear interpolation.
[0022] The beneficial effects of adopting the above-mentioned further technical solution are as follows: In the existing SMOTE oversampling technology, the generation of new synthetic samples relies solely on simple linear interpolation between two original samples. This results in new samples being confined to a narrow region along the line connecting the original samples, failing to effectively fill the sparsely distributed space of the original samples, and easily causing data marginalization problems, affecting the integrity of the data distribution and the model prediction accuracy. This invention generates the coordinates of a first transition sample between the coordinates of the first nearest-neighbor original sample and the coordinates of the second nearest-neighbor original sample using random linear interpolation, and generates the coordinates of a first temporary sample between the coordinates of the first transition sample and the coordinates of a preset original sample; it also generates the coordinates of a second transition sample between the coordinates of the first nearest-neighbor original sample and the coordinates of the preset original sample using random linear interpolation, and generates the coordinates of a second temporary sample between the coordinates of the second transition sample and the coordinates of the second nearest-neighbor original sample; and finally, it generates the coordinates of a third transition sample between the coordinates of the second nearest-neighbor original sample and the coordinates of the preset original sample using random linear interpolation, and generates the coordinates of a third temporary sample between the coordinates of the third transition sample and the coordinates of the first nearest-neighbor original sample. This multi-path random interpolation method ensures that temporary samples are widely distributed within the first triangle, rather than being generated only along the boundary, thus significantly improving sample sparsity and marginalization. By introducing multiple independent random factors, the generation of temporary samples has higher diversity and spatial coverage, enabling a more comprehensive capture of the distribution characteristics of the original data. This provides a more balanced and representative data foundation for subsequent synthetic samples, ultimately improving the quality and practicality of small sample augmentation.
[0023] Furthermore, it also includes: repeating S2 to S6 until the number of synthesized samples generated reaches N, where N is a positive integer.
[0024] 2) In a second aspect, the present invention also provides a small sample augmentation system based on data distribution, the specific technical solution of which is as follows:
[0025] It includes a dataset acquisition module, a raw sample selection module, a coordinate acquisition module, a nearest-neighbor raw sample selection module, a coordinate generation module, and a sample synthesis module;
[0026] The dataset acquisition module is used to: acquire the original small sample dataset for virtual simulation, and represent each original sample in the original small sample dataset with corresponding coordinates;
[0027] The original sample selection module is used to: randomly select one original sample from the original small sample dataset as the preset original sample;
[0028] The coordinate acquisition module is used to: obtain the coordinates of the k nearest neighbor original samples corresponding to the preset original sample based on the coordinates of the preset original sample;
[0029] The nearest original sample selection module is used to: randomly select two nearest original samples from k nearest original samples as the first nearest original sample and the second nearest original sample. The coordinates of the first nearest original sample, the coordinates of the second nearest original sample, and the coordinates of the preset original sample form a first triangle.
[0030] The coordinate generation module is used to generate the coordinates of a first temporary sample, a second temporary sample, and a third temporary sample based on the coordinates of the first nearest original sample, the coordinates of the second nearest original sample, and the coordinates of the preset original sample. The coordinates of the first temporary sample, the second temporary sample, and the third temporary sample form a second triangle, which is completely located inside the first triangle.
[0031] The sample synthesis module is used to: take the center coordinates of the second triangle as the coordinates of the newly generated synthesized sample, and obtain the synthesized sample based on the coordinates of the synthesized sample.
[0032] Based on the above scheme, the small sample augmentation system based on data distribution of the present invention can be further improved as follows.
[0033] Furthermore, the coordinate acquisition module is specifically used for:
[0034] The Euclidean distance from the coordinates of each original sample (excluding the coordinates of the preset original sample) in the original small sample dataset to the coordinates of the preset original sample is calculated.
[0035] Sort all original samples except the preset original samples according to the Euclidean distance in ascending order to obtain a first sequence. Select the coordinates of the first k nearest neighbor original samples in the first sequence as the coordinates of the k nearest neighbor original samples of the preset original sample. Alternatively, sort all original samples except the preset original samples according to the Euclidean distance in descending order to obtain a second sequence. Select the coordinates of the last k nearest neighbor original samples in the second sequence as the coordinates of the k nearest neighbor original samples of the preset original sample.
[0036] Furthermore, the coordinate generation module is specifically used for:
[0037] The coordinates of a first transition sample are generated between the coordinates of the first nearest original sample and the coordinates of the second nearest original sample using random linear interpolation. The coordinates of a first temporary sample are also generated between the coordinates of the first transition sample and the coordinates of a preset original sample using random linear interpolation. The coordinates of a second transition sample are generated between the coordinates of the first nearest original sample and the coordinates of the preset original sample using random linear interpolation. The coordinates of a second temporary sample are also generated between the coordinates of the second transition sample and the coordinates of the second nearest original sample using random linear interpolation. Finally, the coordinates of a third transition sample are generated between the coordinates of the second nearest original sample and the coordinates of the preset original sample using random linear interpolation. The coordinates of a third temporary sample are also generated between the coordinates of the third transition sample and the coordinates of the first nearest original sample using random linear interpolation.
[0038] Furthermore, it also includes a repeated call module, which is used to repeatedly call the original sample selection module, coordinate acquisition module, nearest neighbor original sample selection module, coordinate generation module and sample synthesis module until the number of synthesized samples reaches N, where N is a positive integer.
[0039] 3) In a third aspect, the present invention also provides an electronic device, the electronic device including a processor coupled to a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor, so that the electronic device implements any of the above-mentioned small sample augmentation methods based on data distribution.
[0040] 4) In a fourth aspect, the present invention also provides a computer-readable storage medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements any of the above-mentioned small sample augmentation methods based on data distribution.
[0041] It should be noted that the beneficial effects of the technical solutions of the second to fourth aspects of the present invention and their corresponding possible implementations can be found in the above description of the technical effects of the first aspect and its corresponding possible implementations, and will not be repeated here. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments of the present invention will be briefly introduced below:
[0043] Figure 1 This is a schematic diagram of the SMOTE oversampling method.
[0044] Figure 2 This is a flowchart illustrating a small-sample augmentation method based on data distribution according to an embodiment of the present invention.
[0045] Figure 3 This is a schematic diagram of a small sample augmentation method based on data distribution according to an embodiment of the present invention;
[0046] Figure 4 The image shows the effect of generating new samples using the SMOTE oversampling method;
[0047] Figure 5 The image shows the effect of generating new samples using a small sample augmentation method based on data distribution according to the present invention.
[0048] Figure 6 This is a schematic diagram of a small sample augmentation system based on data distribution according to an embodiment of the present invention. Detailed Implementation
[0049] The principles and features of the present invention are described below. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.
[0050] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present invention will now be described with reference to the accompanying drawings.
[0051] like Figure 2 As shown in the figure, a small sample augmentation method based on data distribution according to an embodiment of the present invention includes the following steps:
[0052] S1. Obtain the original small sample dataset for virtual simulation, and represent each original sample in the original small sample dataset with corresponding coordinates;
[0053] S10. Obtain the original small sample dataset S. The original small sample dataset S originates from the output of the virtual simulation system or a set of actual measurement data. The virtual simulation system generates a series of data points by simulating a real scene or process, with each data point representing the output of a simulation instance. Due to cost and time constraints in simulation execution, the number of original data points is usually limited, constituting a small sample situation. The acquisition process includes exporting the original data from the simulation software or data storage system; the data format may be tabular, matrix, or list-like. The original small sample dataset S contains multiple original samples, each corresponding to an independent data record, which includes the values of multiple feature parameters. For example, in the credibility evaluation of the simulation system, feature parameters may include performance indicators, environmental variables, or system state quantities. The acquisition of the original small sample dataset S must ensure data integrity and consistency, avoiding the influence of missing or outlier values.
[0054] S11. Represent each original sample in the original small sample dataset S using corresponding coordinates. Each original sample is mapped to a point in the feature space, and the position of the point is determined by its eigenvalues. These eigenvalues constitute the coordinates of the sample. Assuming the feature space has d dimensions, each original sample corresponds to a d-dimensional coordinate. Specifically, let the original small sample dataset S contain n original samples, denoted as: Each original sample is a d-dimensional vector, represented as: ,in, Represents the i-th original sample, symbol This represents the coordinates of the i-th original sample on the first-dimensional feature, with the symbol... This represents the coordinates of the i-th original sample on the second-dimensional feature, and so on. The symbol... This represents the coordinates of the i-th original sample in the d-th feature dimension. Coordinate representation involves data preprocessing, including feature standardization or normalization, to ensure that coordinates in each dimension are on the same scale and to prevent certain features from dominating distance calculations due to different units. For example, in a two-dimensional feature space, the coordinates of an original sample can be specifically represented as... Here, X and Y represent the values of the two feature dimensions, respectively. Using coordinate representation, the original sample is transformed into points in geometric space, facilitating subsequent calculations of Euclidean distance and spatial interpolation operations.
[0055] S12. After converting the original samples to coordinates, it is necessary to check whether the coordinate values truly reflect the distribution characteristics of the original data. This includes calculating basic statistics of the data, such as mean, variance, and covariance, to ensure that the coordinate representation does not introduce bias. Furthermore, visualization tools (such as scatter plots or 3D plots) should be used to visually verify whether the coordinate points are reasonably distributed in the feature space, avoiding clustering or outlier problems. If the original data contains categorical variables, they must first be encoded into numerical form (such as one-hot encoding) to be incorporated into the coordinate representation. The entire process ensures that the coordinates of each original sample are unique and traceable, providing a reliable foundation for subsequent small-sample expansion.
[0056] In virtual simulation, a raw sample refers to a single data record generated by a computer simulation system that simulates real-world processes or phenomena. Each such raw sample represents the output of a single operation of the system under specific input parameters or environmental conditions. For example, in aircraft simulation, a raw sample might contain a set of parameter values describing the aircraft's attitude, velocity, and acceleration at different times. In circuit simulation, a raw sample might contain a set of data on the response characteristics of components under different test voltages and currents. These raw samples are the basic units for constructing a raw small sample dataset S.
[0057] S2. Randomly select one original sample from the original small sample dataset as the preset original sample. Specifically:
[0058] S20. The original small sample dataset S is a set containing a finite number of original samples, each represented by its coordinates in the feature space. The original small sample dataset S is a set containing n data points, denoted as: ,in, Represents the original small sample dataset, symbol Represents the total number of original samples in the original small sample dataset, with the symbol... arrive These represent the first to the nth original samples in the original small sample dataset, respectively.
[0059] S21. The scope of the random selection operation is limited to all original samples contained in the original small sample dataset S. This means that only those original samples that have been included in the original small sample dataset S are eligible to be selected as the preset original samples xi. The selection scope does not include any external data points, nor any new synthetic samples that may be generated in subsequent steps, ensuring that the selection process is entirely based on the initial original data.
[0060] S22. A random number is generated by calling a pseudo-random number generator configured to produce a uniformly distributed integer in the interval [1, n]. Specifically, a random floating-point number uniformly distributed in the interval [0, 1) is first generated, denoted as . . This represents a random floating-point number uniformly distributed between 0 and 1. This random floating-point number is then mapped to the target index range. The calculation process uses the following formula:
[0061]
[0062] in, The calculated original sample index number is an integer between 1 and n. This function represents the floor function, ensuring the result is an integer. This formula guarantees that every integer index from 1 to n has an equal probability of being selected, which is 0. This achieves a fair random selection.
[0063] S23. Using the index number calculated in the previous step, extract the corresponding original sample from the original small sample dataset S. Specifically, in the program implementation, if the original small sample dataset S is stored as an array or list, then the operation is to access the index-th element of that data structure. This accessed and extracted original sample is formally designated as the preset original sample for this iteration, denoted as […]. Preset original samples This will serve as the central point for subsequent neighbor search and generation of new synthetic samples.
[0064] S3. Based on the coordinates of the preset original sample, obtain the coordinates of the k nearest neighbor original samples corresponding to the preset original sample. Specifically:
[0065] S30. Calculate the Euclidean distance from the coordinates of each original sample (excluding the coordinates of the preset original sample) in the original small sample dataset to the coordinates of the preset original sample. Specifically:
[0066] S300. From the complete original small sample dataset S, the preset original samples... Temporarily exclude them. Form a new set containing n-1 original samples, denoted as S'. The symbol S' represents a temporary dataset, which contains the original small sample dataset S excluding the preset original samples. All other original samples. This step ensures that the pre-defined original samples are not calculated. The meaningless distance to itself, which is always zero and interferes with the accurate judgment of nearest neighbors.
[0067] S301. Obtain the preset original sample The coordinate representation of the preset original sample In the d-dimensional feature space, this is represented by a coordinate. This coordinate is labeled as: ,in, Indicates the preset original sample The coordinates on the first dimension feature, Indicates the preset original sample Coordinates on the second dimension feature Indicates the preset original sample The coordinates of the d-th dimension feature.
[0068] S302. Traverse each original sample in the temporary dataset S' and obtain its coordinates. Specifically, for the j-th original sample in the temporary dataset S', its coordinates are: ,in, arrive These represent the coordinates of the j-th original sample in the temporary dataset S' along each feature dimension. The index j here is used to iterate through all the original samples in the temporary dataset S'.
[0069] S303. For each original sample in the temporary dataset S', calculate its relationship with the preset original sample. The Euclidean distance between them. The formula for calculating the Euclidean distance is as follows:
[0070]
[0071] in, This represents the pre-defined original sample obtained through calculation. Compared with the j-th original sample in the temporary dataset S' The Euclidean distance between them. It is an index variable used to iterate through each feature dimension from 1 to d. This represents the j-th original sample in the temporary dataset S'. In the Coordinate values on the dimensional feature. Indicates the preset original sample In the The coordinate values are defined on the dimensional features. The calculation process is as follows: first, the difference between the coordinate values of two samples is calculated in each dimension; then, this difference is squared; next, the squared differences in all dimensions are summed; finally, the square root of the sum is taken to obtain the final Euclidean distance. This calculation process is implemented in the program using a loop structure, repeating the process once for each original sample in the temporary dataset S', ultimately obtaining a set of Euclidean distance values that correspond one-to-one with the temporary dataset S'.
[0072] S31. Sort all original samples except the preset original samples according to the Euclidean distance in ascending order to obtain a first sequence. Select the coordinates of the first k nearest neighbor original samples in the first sequence as the coordinates of the k nearest neighbor original samples of the preset original sample. Alternatively, sort all original samples except the preset original samples according to the Euclidean distance in descending order to obtain a second sequence. Select the coordinates of the last k nearest neighbor original samples in the second sequence as the coordinates of the k nearest neighbor original samples of the preset original sample.
[0073] S4. Randomly select two nearest-neighbor original samples from the k nearest-neighbor original samples as the first nearest-neighbor original sample and the second nearest-neighbor original sample. The coordinates of the first nearest-neighbor original sample, the coordinates of the second nearest-neighbor original sample, and the coordinates of the preset original sample form a first triangle. Specifically:
[0074] S40. Prepare a candidate list of k nearest neighbor original samples. In the previous step, by calculating and sorting the Euclidean distances, a set containing k nearest neighbor original samples has been determined. The k nearest neighbor original samples are those that are far from the preset original samples. The k most recent original samples. This set is denoted as . .gather Each element in the array is a nearest neighbor original sample, and each nearest neighbor original sample has its own coordinate representation.
[0075] S41. Use a random sampling method without replacement to ensure that the two selected indices point to the set. Two distinct nearest neighbor original samples are used. This can be implemented using a random number generator in a programming language. First, a random floating-point number uniformly distributed in the interval [0,1) is generated, denoted as r1. The symbol r1 represents the first random floating-point number. This is achieved through the formula...
[0076]
[0077] Map it to an integer index from 0 to k-1, or via The mapping is to integer indices from 1 to k, depending on the starting index of the list in the programming. This represents the random index generated for selecting the first nearest neighbor original sample. Then, this process is repeated to generate a second random floating-point number. and the second random index . This represents the second random floating-point number. This represents the random index generated for selecting the second nearest neighbor original sample. It must be checked to ensure... index 1 Not equal to index 2 If an equality occurs, regenerate. index 2 This process continues until a distinct index value is obtained. This process guarantees the selection of two distinct nearest-neighbor original samples from the k candidates without repetition.
[0078] S42. Extract the first nearest neighbor original sample from the candidate list according to the random index. Second nearest neighbor original sample Use the non-repeating random index determined in the previous step. and Take the corresponding two nearest-neighbor original samples from the k nearest-neighbor original samples. index 1 The nearest original sample pointed to by the index is officially designated as the first nearest original sample. .quilt The nearest original sample pointed to by the index is officially designated as the second nearest original sample. At this point, the first nearest neighbor original sample... The coordinates of the second nearest neighbor original sample The coordinates have been determined.
[0079] S43. In the feature space, the preset original samples Coordinates, first nearest neighbor original sample The coordinates of the second nearest neighbor original sample The coordinates of these three points are geometrically related. These three points together define a two-dimensional shape. Logically, it needs to be confirmed that these three points are not collinear, meaning they can indeed form a triangle with area. Although there is a theoretical possibility that the three points are collinear due to random selection and the original data distribution, in practical applications, this rarely occurs when the feature dimension is high or the data distribution is reasonable. The algorithm assumes that these three points form a valid first triangle, which serves as the geometric boundary for generating subsequent temporary samples. If they cannot form a first triangle, the first nearest neighbor original sample needs to be randomly selected again. Second nearest neighbor original sample Until the preset original sample. Coordinates, first nearest neighbor original sample The coordinates of the second nearest neighbor original sample The coordinates are used until the first triangle can be formed.
[0080] S44, Set the original sample Coordinates, first nearest neighbor original sample The coordinates of the second nearest neighbor original sample This data unit is passed as a complete data unit to the next stage of the algorithm. This data unit contains all the geometric information that constitutes the first triangle, laying a solid foundation for subsequent multi-level linear interpolation within the triangle to generate temporary samples.
[0081] S5. Based on the coordinates of the first nearest original sample, the coordinates of the second nearest original sample, and the coordinates of the preset original sample, generate the coordinates of the first temporary sample, the coordinates of the second temporary sample, and the coordinates of the third temporary sample. The coordinates of the first temporary sample, the coordinates of the second temporary sample, and the coordinates of the third temporary sample form a second triangle, which is completely located inside the first triangle.
[0082] The process of generating coordinates for a first temporary sample, a second temporary sample, and a third temporary sample based on the coordinates of the first nearest original sample, the second nearest original sample, and a preset original sample includes: generating coordinates for a first transition sample between the coordinates of the first and second nearest original samples using random linear interpolation; generating coordinates for a first temporary sample between the coordinates of the first transition sample and the preset original sample using random linear interpolation; generating coordinates for a second transition sample between the coordinates of the first and second nearest original samples using random linear interpolation; generating coordinates for a second temporary sample between the coordinates of the second transition sample and the second nearest original sample using random linear interpolation; generating coordinates for a third transition sample between the coordinates of the second and second nearest original samples using random linear interpolation; and generating coordinates for a third temporary sample between the coordinates of the third transition sample and the first nearest original sample using random linear interpolation. Specifically:
[0083] S50, Generate the first temporary sample The specific implementation process of coordinates:
[0084] S500, in the first nearest neighbor original sample The coordinates of the second nearest neighbor original sample Generate the first transition sample between the coordinates. The coordinates of the point are determined. This step involves creating a random point on one side of the first triangle. This is done using random linear interpolation, calculated using the following formula:
[0085]
[0086] in, This represents the first oversample generated. The coordinates. Represents the first nearest neighbor original sample The coordinates. Indicates the original sample of the second nearest neighbor. The coordinates. Let represent a random number uniformly distributed in the interval [0,1]. This calculation is performed in vector space, and the result is: It is located in the connection and A random point on the line segment between them.
[0087] S501, in the first excessive sample coordinates and preset original samples Generate the first temporary sample between the coordinates. The coordinates. This step is: connect the third vertex of the first triangle to the preset original sample. The coordinates of the first transition sample The coordinates are determined, and a random point is created on that line. This is then performed using random linear interpolation, calculated as follows:
[0088]
[0089] in, This represents the first temporary sample generated. The coordinates. Indicates the preset original sample The coordinates. This represents the first oversample generated in the previous step. The coordinates. Let represent a new random number uniformly distributed in the interval [0,1], and . They are independent of each other. This calculation ensures the first temporary sample... The coordinates are located at a random position inside the first triangle.
[0090] S51. Generate a second temporary sample. The coordinates, and the specific implementation process:
[0091] S510, in the first nearest neighbor original sample Coordinates and preset original samples Generate a second transition sample between the coordinates. The coordinates are then determined. This step involves creating a random point on the other side of the first triangle. This is done using random linear interpolation, calculated using the following formula:
[0092]
[0093] in, Indicates the generated second oversample The coordinates. Represents the first nearest neighbor original sample The coordinates. Indicates the preset original sample The coordinates. Let represent a new random number that is uniformly distributed on the interval [0, 1], independent of . and .
[0094] S511, in the second oversample The coordinates of the second nearest neighbor original sample Generate a second temporary sample between the coordinates. The coordinates. This step is: connecting the second transition sample on the edge. The coordinates of the second nearest neighbor original sample The coordinates are determined, and a random point is created on that line. This is done using random linear interpolation, calculated as follows:
[0095]
[0096] in, Indicates the generated second temporary sample The coordinates. Indicates the original sample of the second nearest neighbor. The coordinates. This represents the second oversample generated in the previous step. The coordinates. Let represent a new random number uniformly distributed in the interval [0,1], independent of all previous δ values. This calculation ensures the second temporary sample. The coordinates are also located at a random position inside the first triangle, and are usually related to the first temporary sample. The coordinates do not coincide.
[0097] S52, Generate a third temporary sample The coordinates, and the specific implementation process:
[0098] S520, in the second nearest neighbor original sample Coordinates and preset original samples Generate a third transition sample between the coordinates. The coordinates are determined. This step involves creating a random point on the last side of the first triangle. This is done using random linear interpolation, calculated using the following formula:
[0099]
[0100] in, Indicates the generated third oversample The coordinates. Indicates the original sample of the second nearest neighbor. The coordinates. Indicates the preset original sample The coordinates. Symbol It represents a new random number that is uniformly distributed in the interval [0,1] and is independent of all previous random numbers.
[0101] S521, in the third oversample The coordinates and the first nearest neighbor original sample Generate a third temporary sample between the coordinates. The coordinates. This step is: connecting the third transition sample on the edge. The coordinates of the first nearest neighbor original sample The coordinates are determined, and a random point is created on that line. This is done using random linear interpolation, calculated as follows:
[0102]
[0103] in, This indicates the generated third temporary sample. The coordinates. Represents the coordinates of the first nearest neighbor original sample. Indicates the generated third oversample The coordinates. This represents a new random number uniformly distributed in the interval [0, 1], independent of all previous random numbers. This calculation ensures that the coordinates of the third temporary sample l3 are also located at a random position inside the first triangle.
[0104] The second triangle is entirely located inside the first triangle. This is because the algorithm for generating the coordinates of the three temporary samples strictly follows the principle of convex combination and constrains the generated points within the boundary of the first triangle. The specific reasons are as follows:
[0105] 1) First oversample Coordinates, second transition sample coordinates and third transition sample The coordinates are obtained by passing through the first nearest neighbor original sample. The coordinates of the second nearest neighbor original sample The coordinates between the first nearest neighbor original samples Coordinates and preset original samples The coordinates between the original samples and the second nearest neighbor. Coordinates and preset original samples It is generated by random linear interpolation between the coordinates. The mathematical form of linear interpolation is: (in A point is defined within the interval [0,1]. Must be located at point and points The connecting line segments. Therefore, each transition sample falls precisely on the three sides of the first triangle.
[0106] 2) First temporary sample The coordinates are obtained by using preset original samples. Coordinates and the first transition sample (Located on the edge) This is generated by linear interpolation between the coordinates of (above). This means the first temporary sample... The coordinates must be located at the point connecting the vertices. and edge A little bit On the line segment. According to the geometric properties of triangles, any line segment connecting a vertex to any point on the opposite side has all its points inside the triangle. Similarly, the second temporary sample Located at the connecting vertex With edge A little bit On the line segment; the third temporary sample Located at the connecting vertex With edge A little bit Therefore, all three temporary samples are undoubtedly located inside the first triangle.
[0107] 3) Since all three vertices of the second triangle (i.e., the three temporary samples) are located inside the first triangle, all convex combinations formed by these three interior points (i.e., all points inside the second triangle) must also be contained within the larger convex set of the first triangle. Therefore, the entire second triangle is completely located inside the first triangle.
[0108] The key advantage of ensuring that the second triangle is completely inside the first triangle is that it plays a crucial positive role in the small sample augmentation method of this invention, directly addressing the shortcomings of the SMOTE method mentioned in the background art. Specifically:
[0109] 1) The SMOTE method generates new samples by connecting sample points, but it cannot fill sparsely distributed regions of the original samples and is prone to generating marginalized samples at data boundaries. This invention, by strictly confining the source of the newly synthesized samples (i.e., the second triangle) within the geometric space (first triangle) formed by the original samples, fundamentally ensures the quality of the newly generated synthesized samples. The center of the second triangle will fall within the "heart" of the original sample distribution, rather than its edge. This helps to fill the sparse areas of the original sample distribution, making the expanded samples more evenly and continuously distributed in the feature space, thereby improving the sparsity of the original samples.
[0110] 2) Three random temporary samples are generated within the first triangle through multi-level interpolation, and then their centers are selected. This process introduces greater randomness and complexity than the simpler two-point linear interpolation of SMOTE. Because the positions of the three temporary samples are random, the shape, size, and position of the second triangle they form are also variable. This makes the final synthesized sample... The location of the sample is no longer limited to a fixed line, but varies within a region inside the first triangle, which greatly enriches the diversity of the generated samples and avoids the problem of limited information that may arise from the SMOTE method.
[0111] 3) Due to the newly generated synthetic samples It is the center of three temporary samples, and these three temporary samples originate from a random combination of the three vertices (original samples) of the first triangle, which makes... Instead of simply mimicking two samples, it fuses feature information from three original samples. This "fusion" effect ensures that the generated new samples are not simple copies or slight perturbations of any single original sample, but rather produce samples with new combinations of features. This mechanism helps learning algorithms capture the overall trend of the data distribution, rather than memorizing noise or details of specific samples, thus largely avoiding overfitting.
[0112] S5. Take the center coordinates of the second triangle as the coordinates of the newly generated synthetic sample, and obtain the synthetic sample based on the coordinates of the synthetic sample. Specifically:
[0113] S50. Obtain the coordinates of the three vertices of the second triangle. Following the aforementioned process, the coordinates of the three temporary samples constituting the second triangle have been successfully generated, namely the first temporary sample. Coordinates, second temporary sample Coordinates and third temporary sample The coordinates. These coordinates are the input data for calculating the center point. The coordinates of the first temporary sample, symbol The coordinates of the second temporary sample, symbol The coordinates represent the third temporary sample.
[0114] S51. Calculate the sum of the coordinates of the three vertices of the second triangle. In the vector space, use the first temporary sample... coordinates Second temporary sample Coordinates and third temporary sample The coordinates are summed element by element. The calculation formula is as follows:
[0115]
[0116] in, This represents the sum vector obtained by adding the coordinates of three temporary samples. The dimension of this sum vector is the same as the coordinate dimension of the original samples. This operation initially aggregates the spatial location information of the three points.
[0117] S52. Calculate the arithmetic mean of the sum vectors to determine the center coordinates. Then, use the sum vector obtained in the previous step... Divide by the number of vertices, 3, to obtain the coordinates of the center of the second triangle. This center is geometrically called the centroid or geometric center. The calculation formula is as follows:
[0118]
[0119] in, This represents the coordinates of the newly generated synthetic sample. In the program implementation, this calculation involves the sum vector. Each vector component is divided by 3.
[0120] S53. Construct a synthetic sample based on the center coordinates. .at this time, This is already a coordinate system containing d feature values. Based on this coordinate system, the newly generated synthetic sample is formally constructed. Synthetic samples It is a complete data entity that inherits the feature space representation of the original small sample dataset S. Its data structure and format are completely consistent with any original sample in the original small sample dataset S, ensuring that it can be seamlessly used in subsequent simulation analysis or model training processes.
[0121] S54. Output and store newly generated synthetic samples The newly generated synthetic sample Add the samples to the synthetic sample set prepared for this expansion task. Simultaneously, ensure that the algorithm's main loop can accurately determine the number of synthetic samples already generated in order to decide whether to continue to the next iteration. Thus, from a pre-set original sample... From the beginning to the final generation of a new synthetic sample The entire process has ended.
[0122] Optionally, the above technical solution further includes: repeatedly executing S2 to S5 until the number of synthesized samples generated reaches N. Here, N is a positive integer.
[0123] The technical solution of the present invention will be further described through another embodiment, which specifically includes the following steps:
[0124] S101. Obtain the original small-sample dataset S for virtual simulation. This dataset contains a limited number of original samples. The original small-sample dataset S comes from the output of the virtual simulation system or the actual measurement data set. Each original sample represents the output of a simulation instance. Determine the number of samples N to be synthesized, and the nearest neighbor range parameter k, where the value of k must be greater than 2. The original small-sample dataset S can be represented as:
[0125]
[0126] in, This represents the original small sample dataset. Represents the i-th original sample in the dataset. This represents the total number of samples in the original small sample dataset. Each original sample is mapped to a point in the feature space, and the position of the point is determined by its feature values, which constitute the coordinates of the sample.
[0127] S102. Randomly select one original sample from the original small sample dataset S as the preset original sample. By calculating the preset original samples Determine the k nearest neighbors of a sample by calculating its Euclidean distance to all other samples in the dataset. The formula for calculating the Euclidean distance is:
[0128]
[0129] in, This represents the Euclidean distance between two points. Indicates the preset original sample The coordinates of the m-th feature. This represents the coordinates of other sample points on the m-th feature. This is the index variable for the feature dimension. After calculation, all distances are sorted, and the k samples with the smallest distances are selected as the preset original samples. The k nearest neighbors of the original sample.
[0130] S103, From the preset original sample From the k nearest neighbor original samples, two different nearest neighbor original samples are randomly selected using a random sampling method without replacement, and these are denoted as the first nearest neighbor original sample. Second nearest neighbor original sample . Preset original sample Coordinates, first nearest neighbor original sample The coordinates of the second nearest neighbor original sample The coordinates of the points are connected, forming a first triangle in the feature space. This first triangle serves as the geometric boundary for generating new samples subsequently.
[0131] S104, in the first nearest neighbor original sample Second nearest neighbor original sample The first transition sample is generated through random linear interpolation. Then, in the first oversample and preset original samples The first temporary sample is generated through random linear interpolation. ;
[0132] S105, in the first nearest neighbor original sample and preset original samples A second transition sample is generated between them using random linear interpolation. Then, in the second oversample Second nearest neighbor original sample A second temporary sample is generated between them using random linear interpolation. .
[0133] S106, Second nearest neighbor original sample and preset original samples A third transitional sample is generated between them using random linear interpolation. Then, in the third excessive sample and the first nearest neighbor original sample A third temporary sample is generated between them using random linear interpolation. .
[0134] S107, will consist of three temporary samples , , The triangle formed by the coordinates of the first triangle is called the second triangle, and this second triangle is completely inside the first triangle. The center coordinates of this second triangle are calculated as the newly generated synthetic sample. The coordinates.
[0135] The specific synthesis principle described above is as follows: Figure 3 As shown, this invention first randomly generates three temporary samples from three original samples: a preset original sample, a first nearest neighbor original sample, and a second nearest neighbor original sample. Then, the center of the second triangle formed by these three temporary samples is used as the newly generated synthetic sample. This method replaces the simple linear interpolation method between two original samples used in the original SMOTE oversampling technique. This improved scheme retains the advantage of the original SMOTE oversampling technique, which can infinitely expand the number of samples, while significantly reducing the risk of the newly generated samples containing limited information and overfitting.
[0136] S108. Repeat steps S102 to S107 until the number of newly generated synthetic samples reaches the preset value N. In each iteration, a different preset original sample is randomly selected from the original small sample dataset S. A new synthetic sample is generated through the above multi-level interpolation process. This process ensures that the newly generated synthetic samples fully cover the distribution space of the original samples.
[0137] In a practical application, assuming the original small sample dataset S contains 10 samples, to make the synthesis effect more obvious, the number of synthesized samples N=10000, and the nearest neighbor range parameter k=9. The new synthesized samples generated by the method of this invention can effectively avoid overlapping with the original samples and are concentrated within the geometric space formed by the original samples, more clearly and accurately reflecting the distribution characteristics of the original dataset. By fully utilizing the geometric space composed of the original small samples to generate new synthesized samples, the expanded overall sample has more diverse and richer feature information and can more comprehensively and systematically reflect the distribution of the original samples. After randomly selecting the original samples N times, N new synthesized samples can be generated. These new synthesized samples can completely avoid overlapping with the original samples and are concentrated within the geometric space formed by the original samples, more clearly and accurately reflecting the distribution characteristics of the original sample dataset. For detailed comparisons, see [link to comparison]. Figure 4 and Figure 5 By comparing the results of the small-sample augmentation method used in this invention with those of the original SMOTE oversampling method, it can be clearly observed that in the original SMOTE oversampling method's results image, areas where there were almost no samples, or even areas where it was impossible to generate samples, now have new samples synthesized in the results image of the small-sample augmentation method used in this invention, and the distribution is more uniform. This phenomenon proves that this invention can effectively improve the sparsity of the original samples by randomly generating new synthetic samples within the geometric space constituted by the original samples.
[0138] Compared to the traditional SMOTE oversampling method, this invention generates synthetic samples randomly within the geometric space formed by the original samples. This allows for the generation of new sample points even in sparsely distributed areas of the original samples, resulting in a more uniform sample distribution. This method retains the advantage of SMOTE technology in expanding the number of samples while significantly reducing the risk of single-source information and overfitting by introducing multi-level random interpolation and a triangle center synthesis mechanism. The expanded overall samples possess more diverse and richer feature information, enabling a more comprehensive and systematic reflection of the original sample distribution.
[0139] In another embodiment, it includes:
[0140] S201. This implementation plan focuses on virtual simulation and credibility assessment of aerodynamic characteristics during the aircraft design phase. The original small sample dataset S is derived from high-fidelity computational fluid dynamics simulation results of a certain type of civil airliner wing. Due to the enormous computational resources required for high-precision simulation across the entire parameter space, only 32 simulation calculations were performed for key flight state points, resulting in an original small sample dataset S containing 32 original samples. Each original sample is a three-dimensional data point containing three key aerodynamic characteristic parameters: angle of attack (unit: degrees), Mach number (dimensionless), and lift coefficient (dimensionless). The formal representation of the original small sample dataset S is as follows:
[0141]
[0142] in, This represents the angle of attack feature value of the i-th original sample. This represents the Mach number eigenvalue of the i-th original sample. This represents the lift coefficient feature value of the i-th original sample. These original samples form the basic input for subsequent small sample augmentation methods.
[0143] S202. Determine the required number of synthetic samples N=1000, and the nearest neighbor range parameter k=6. Before performing distance calculation, perform feature standardization on the original small sample dataset S, normalizing the values of the three feature dimensions—angle of attack, Mach number, and lift coefficient—to the [0,1] interval, eliminating the influence of different feature dimensions and numerical ranges on distance calculation. The standardized original small sample dataset S' will be used as the direct input for the small sample augmentation method.
[0144] S203. Start the sample generation loop until the number of synthesized samples reaches 1000. The specific process of a single loop is as follows: Randomly select one original sample from the standardized original small sample dataset S' as the preset original sample. Calculate the preset original samples. The Euclidean distance to all other original samples in dataset S' is calculated using the following formula:
[0145]
[0146] in, Represents Euclidean distance. Indicates the preset original sample The coordinate values of each feature dimension, This represents the coordinates of other original samples across each feature dimension. After sorting all distances, the six samples with the smallest distances are selected as the preset original samples. The nearest original sample.
[0147] Two samples are randomly selected without replacement from these six nearest-neighbor original samples, and these two are used as the first nearest-neighbor original samples. Second nearest neighbor original sample Preset original samples First nearest neighbor original sample Second nearest neighbor original sample In the three-dimensional feature space, it forms the first triangle.
[0148] Then, three temporary samples are generated through a three-level path. Specifically, the first path generates the first temporary sample. First in and First oversample generated Then and First temporary sample generated The second path generates a second temporary sample. First in and Generate a second oversample Then and Generate a second temporary sample The third path generates a third temporary sample. First in and Generate a third oversample Then and Generate a third temporary sample Three temporary samples A second triangle is constructed in the feature space, and the coordinates of its center point are calculated as the newly generated synthetic sample. After denormalization, the synthetic sample set is added. This loop is repeated 1000 times to generate an expanded dataset containing 1000 synthetic samples.
[0149] S204. The original 32 samples are merged with the generated 1000 synthetic samples to form an expanded dataset containing 1032 samples. Based on this expanded dataset, a Kriging surrogate model is trained. This surrogate model uses angle of attack and Mach number as input features and lift coefficient as the predicted output. Due to the sufficient number of training samples and their uniform distribution in the feature space, the surrogate model can accurately capture the complex nonlinear relationship between angle of attack, Mach number, and lift coefficient.
[0150] S205. The trained Kriging surrogate model is integrated into the aircraft simulation system for rapid prediction of aerodynamic characteristics under different flight conditions. When evaluating the reliability of the simulation system, 50 wind tunnel test data points with high confidence are selected as validation benchmarks. The lift coefficients at these 50 state points are predicted using the surrogate model, and compared with the wind tunnel test results. Statistical indicators of the prediction error, including mean absolute error and coefficient of determination, are calculated to quantitatively evaluate the reliability of the original CFD simulation system. The results show that the prediction results of the surrogate model trained on the expanded data are highly consistent with the wind tunnel test data, proving that the original simulation system has high reliability.
[0151] S206. Utilizing a high-precision Kriging surrogate model, aerodynamic performance under different flight conditions can be rapidly analyzed. During the aircraft conceptual design phase, the lift characteristics of hundreds of design schemes can be quickly evaluated using the surrogate model, significantly shortening the design cycle. Compared to traditional methods, optimization design based on the Kriging surrogate model reduces aerodynamic analysis time from weeks to hours while maintaining design accuracy.
[0152] This implementation plan fully demonstrates the application of a small-sample augmentation method based on data distribution in the simulation and credibility assessment of aircraft aerodynamic characteristics. By augmenting limited and expensive simulation data into a rich training dataset, it successfully supports the construction of a high-precision surrogate model, thereby enabling rapid credibility assessment and design optimization of the simulation system. This process fully demonstrates that the present invention resolves the key technical contradiction between the cost of high-precision simulation and data requirements in the field of virtual simulation, providing a complete technical solution from data augmentation to engineering applications, and possessing clear technical and practical value.
[0153] Building upon the SMOTE oversampling technique, this invention, considering the practical needs of data quality and distribution integrity in the field of simulation system credibility assessment, proposes a small-sample augmentation method based on data distribution. This method effectively solves the problem of sparse and marginalized distribution of newly generated synthetic samples in the original SMOTE oversampling technique by constructing geometric relationships between the original samples and randomly generating new synthetic samples within the geometric space formed by the original samples. Specifically, a first triangle is constructed by pre-setting the original samples and their first and second nearest neighbors to form a reasonable sample generation boundary; three temporary samples are generated using a multi-path random linear interpolation method to ensure uniform distribution of samples within the geometric space; and the final synthetic sample is obtained by calculating the center of the second triangle, ensuring the representativeness of the newly generated samples. This method not only increases new sample information but also largely avoids overfitting. When the original samples are extremely scarce, compared to the SMOTE method, the random interpolation method based on the geometric space of the original samples used in this invention can more effectively improve the sparse distribution of the original samples. By generating transitional samples sequentially with three sides as bases inside a triangle, then generating temporary samples between the transitional samples and the vertices, and finally taking the center of the second triangle formed by the temporary samples as the newly synthesized sample, this method significantly enriches the diversity of the samples, enabling the newly synthesized samples to more comprehensively contain the feature information of the original samples, thereby effectively improving the sparsity problem of the original samples. Furthermore, as an upsampling method, this invention has good algorithmic portability, with no particular limitations on the characteristics of the original dataset, and can be used as a dataset preprocessing method in various virtual simulation scenarios. Since small sample sizes are prevalent in many fields such as engineering simulation, medical diagnosis, and industrial inspection in real life, this invention has great promotional value and application prospects.
[0154] In the above embodiments, although the steps are numbered S1, S2, etc., they are only specific embodiments given by the present invention. Those skilled in the art can adjust the execution order of S1, S2, etc. according to the actual situation. The scheme after adjusting the order is also within the protection scope of the present invention. It can be understood that in some embodiments, some or all of the above embodiments may be included.
[0155] like Figure 6 As shown, a small sample augmentation system 200 based on data distribution according to an embodiment of the present invention includes a dataset acquisition module 201, an original sample selection module 202, a coordinate acquisition module 203, a nearest neighbor original sample selection module 204, a coordinate generation module 205, and a sample synthesis module 206.
[0156] The dataset acquisition module 201 is used to: acquire the original small sample dataset for virtual simulation, and represent each original sample in the original small sample dataset with corresponding coordinates;
[0157] The original sample selection module 202 is used to: randomly select an original sample from the original small sample dataset as a preset original sample;
[0158] The coordinate acquisition module 203 is used to: acquire the coordinates of the k nearest neighbor original samples corresponding to the preset original sample based on the coordinates of the preset original sample;
[0159] The nearest original sample selection module 204 is used to: randomly select two nearest original samples from k nearest original samples as the first nearest original sample and the second nearest original sample, and the coordinates of the first nearest original sample, the coordinates of the second nearest original sample and the coordinates of the preset original sample form a first triangle;
[0160] The coordinate generation module 205 is used to generate the coordinates of a first temporary sample, a second temporary sample, and a third temporary sample based on the coordinates of the first nearest original sample, the coordinates of the second nearest original sample, and the coordinates of a preset original sample. The coordinates of the first temporary sample, the second temporary sample, and the third temporary sample form a second triangle, which is completely located inside the first triangle.
[0161] The sample synthesis module 206 is used to: take the center coordinates of the second triangle as the coordinates of the newly generated synthesized sample, and obtain the synthesized sample based on the coordinates of the synthesized sample.
[0162] Optionally, in the above technical solution, the coordinate acquisition module 203 is specifically used for:
[0163] The Euclidean distance from the coordinates of each original sample (excluding the coordinates of the preset original sample) in the original small sample dataset to the coordinates of the preset original sample is calculated.
[0164] Sort all original samples except the preset original samples according to the Euclidean distance in ascending order to obtain a first sequence. Select the coordinates of the first k nearest neighbor original samples in the first sequence as the coordinates of the k nearest neighbor original samples of the preset original sample. Alternatively, sort all original samples except the preset original samples according to the Euclidean distance in descending order to obtain a second sequence. Select the coordinates of the last k nearest neighbor original samples in the second sequence as the coordinates of the k nearest neighbor original samples of the preset original sample.
[0165] Optionally, in the above technical solution, the coordinate generation module 205 is specifically used for:
[0166] The coordinates of a first transition sample are generated between the coordinates of the first nearest original sample and the coordinates of the second nearest original sample using random linear interpolation. The coordinates of a first temporary sample are also generated between the coordinates of the first transition sample and the coordinates of a preset original sample using random linear interpolation. The coordinates of a second transition sample are generated between the coordinates of the first nearest original sample and the coordinates of the preset original sample using random linear interpolation. The coordinates of a second temporary sample are also generated between the coordinates of the second transition sample and the coordinates of the second nearest original sample using random linear interpolation. Finally, the coordinates of a third transition sample are generated between the coordinates of the second nearest original sample and the coordinates of the preset original sample using random linear interpolation. The coordinates of a third temporary sample are also generated between the coordinates of the third transition sample and the coordinates of the first nearest original sample using random linear interpolation.
[0167] Optionally, the above technical solution also includes a repeated call module, which is used to repeatedly call the original sample selection module, the coordinate acquisition module, the nearest original sample selection module, the coordinate generation module, and the sample synthesis module until the number of synthesized samples reaches N, where N is a positive integer.
[0168] It should be noted that the beneficial effects of the small-sample augmentation system 200 based on data distribution provided in the above embodiments are the same as those of the small-sample augmentation method based on data distribution described above, and will not be repeated here. Furthermore, the system provided in the above embodiments is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to the actual situation to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, and will not be repeated here.
[0169] An electronic device according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any of the above-mentioned small sample augmentation methods based on data distribution. That is, an electronic device according to an embodiment of the present invention may include, but is not limited to: a processor and a memory; the memory is used to store the computer program; the processor is used to execute the small sample augmentation method based on data distribution shown in any embodiment of the present invention by calling the computer program.
[0170] An embodiment of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-described small sample augmentation methods based on data distribution.
[0171] Alternatively, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, a floppy disk, and an optical data storage device, etc.
[0172] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.
[0173] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A small-sample augmentation method based on data distribution, characterized in that, include: S1. Obtain the original small sample dataset for virtual simulation, and represent each original sample in the original small sample dataset with corresponding coordinates; S2. Randomly select an original sample from the original small sample dataset as the preset original sample; S3. Based on the coordinates of the preset original sample, obtain the coordinates of the k nearest neighbor original samples corresponding to the preset original sample; S4. Randomly select two nearest-neighbor original samples from the k nearest-neighbor original samples as the first nearest-neighbor original sample and the second nearest-neighbor original sample. The coordinates of the first nearest-neighbor original sample, the coordinates of the second nearest-neighbor original sample, and the coordinates of the preset original sample form a first triangle. S5. Based on the coordinates of the first nearest original sample, the coordinates of the second nearest original sample, and the coordinates of the preset original sample, generate the coordinates of the first temporary sample, the coordinates of the second temporary sample, and the coordinates of the third temporary sample. The coordinates of the first temporary sample, the coordinates of the second temporary sample, and the coordinates of the third temporary sample form a second triangle, which is completely located inside the first triangle. S6. Take the center coordinates of the second triangle as the coordinates of the newly generated synthetic sample, and obtain the synthetic sample based on the coordinates of the synthetic sample; Based on the coordinates of the preset original sample, obtain the coordinates of the k nearest neighbor original samples corresponding to the preset original sample, including: The Euclidean distance from the coordinates of each original sample in the original small sample dataset (excluding the coordinates of the preset original sample) to the coordinates of the preset original sample is calculated. Sort all original samples except the preset original sample according to the Euclidean distance in ascending order to obtain a first sequence. Select the coordinates of the first k nearest neighbor original samples in the first sequence as the coordinates of the k nearest neighbor original samples of the preset original sample. Alternatively, sort all original samples except the preset original sample according to the Euclidean distance in descending order to obtain a second sequence. Select the coordinates of the last k nearest neighbor original samples in the second sequence as the coordinates of the k nearest neighbor original samples of the preset original sample. Based on the coordinates of the first nearest original sample, the coordinates of the second nearest original sample, and the coordinates of the preset original sample, the coordinates of the first temporary sample, the coordinates of the second temporary sample, and the coordinates of the third temporary sample are generated, including: Using random linear interpolation, coordinates of a first transition sample are generated between the coordinates of the first nearest-neighbor original sample and the coordinates of the second nearest-neighbor original sample. Similarly, coordinates of a first temporary sample are generated between the coordinates of the first transition sample and the coordinates of the preset original sample. Furthermore, coordinates of a second transition sample are generated between the coordinates of the first nearest-neighbor original sample and the preset original sample. Finally, coordinates of a third transition sample are generated between the coordinates of the second nearest-neighbor original sample and the preset original sample. Finally, coordinates of a third temporary sample are generated between the coordinates of the third transition sample and the coordinates of the first nearest-neighbor original sample using random linear interpolation.
2. The small sample augmentation method based on data distribution according to claim 1, characterized in that, Also includes: Repeat steps S2 through S6 until the number of synthesized samples generated reaches N, where N is a positive integer.
3. A small-sample augmentation system based on data distribution, characterized in that, It includes a dataset acquisition module, a raw sample selection module, a coordinate acquisition module, a nearest-neighbor raw sample selection module, a coordinate generation module, and a sample synthesis module; The dataset acquisition module is used to: acquire the original small sample dataset for virtual simulation, and represent each original sample in the original small sample dataset with corresponding coordinates; The original sample selection module is used to: randomly select one original sample from the original small sample dataset as a preset original sample; The coordinate acquisition module is used to: obtain the coordinates of the k nearest neighbor original samples corresponding to the preset original sample based on the coordinates of the preset original sample; The nearest original sample selection module is used to: randomly select two nearest original samples from the k nearest original samples as the first nearest original sample and the second nearest original sample, and the coordinates of the first nearest original sample, the coordinates of the second nearest original sample and the coordinates of the preset original sample form a first triangle; The coordinate generation module is used to: generate the coordinates of a first temporary sample, a second temporary sample, and a third temporary sample based on the coordinates of the first nearest original sample, the coordinates of the second nearest original sample, and the coordinates of the preset original sample. The coordinates of the first temporary sample, the second temporary sample, and the third temporary sample form a second triangle, and the second triangle is completely located inside the first triangle. The sample synthesis module is used to: take the center coordinates of the second triangle as the coordinates of the newly generated synthesized sample, and obtain the synthesized sample based on the coordinates of the synthesized sample; The coordinate acquisition module is specifically used for: The Euclidean distance from the coordinates of each original sample in the original small sample dataset (excluding the coordinates of the preset original sample) to the coordinates of the preset original sample is calculated. Sort all original samples except the preset original sample according to the Euclidean distance in ascending order to obtain a first sequence. Select the coordinates of the first k nearest neighbor original samples in the first sequence as the coordinates of the k nearest neighbor original samples of the preset original sample. Alternatively, sort all original samples except the preset original sample according to the Euclidean distance in descending order to obtain a second sequence. Select the coordinates of the last k nearest neighbor original samples in the second sequence as the coordinates of the k nearest neighbor original samples of the preset original sample. The coordinate generation module is specifically used for: Using random linear interpolation, coordinates of a first transition sample are generated between the coordinates of the first nearest-neighbor original sample and the coordinates of the second nearest-neighbor original sample. Similarly, coordinates of a first temporary sample are generated between the coordinates of the first transition sample and the coordinates of the preset original sample. Furthermore, coordinates of a second transition sample are generated between the coordinates of the first nearest-neighbor original sample and the preset original sample. Finally, coordinates of a third transition sample are generated between the coordinates of the second nearest-neighbor original sample and the preset original sample. Finally, coordinates of a third temporary sample are generated between the coordinates of the third transition sample and the coordinates of the first nearest-neighbor original sample using random linear interpolation.
4. The small sample augmentation system based on data distribution according to claim 3, characterized in that, It also includes a repeated call module, which is used to repeatedly call the original sample selection module, the coordinate acquisition module, the nearest original sample selection module, the coordinate generation module and the sample synthesis module until the number of synthesized samples reaches N, where N is a positive integer.
5. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the small sample augmentation method based on data distribution as described in any one of claims 1 to 2.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the small sample augmentation method based on data distribution as described in any one of claims 1 to 2.