Encoder-Decoder flow field data smoothing method
Through the Encoder-Decoder flow field data smoothing method, the problem of low efficiency and lack of universality of existing flow field data processing is solved through the Encoder-Decoder flow field data smoothing method, and efficient flow field data smoothing and feature automation are achieved Learning improves data quality and processing efficiency.
Patent Information
- Application Number
- CN202411320792.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-31
AI Technical Summary
Existing flow field data processing methods are inefficient, require a lot of manual intervention, lack universality, are difficult to process complex and nonlinear data, and rely on experience to set thresholds, limiting their application.
Using Encoder-Decoder flow field data smoothing method, a data smoothing model is constructed through an autoencoder neural network, unsupervised learning, automatically learn data features, remove noise, and realize flow field data through MSE loss function and regularization term optimization model. smoothing.
It improves the quality of flow field data, reduces manual intervention, improves processing efficiency, has broad applicability and high generalization capabilities, and can effectively process complex and nonlinear data.
Smart Images

Figure CN119226701A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fluid dynamics, and in particular to an Encoder-Decoder flow field data smoothing method. Background Art
[0002] In the field of fluid velocity measurement, the acquisition of flow field data is a crucial step. These data are usually obtained through experimental measurement or numerical simulation, but due to the influence of factors such as equipment accuracy and environmental conditions, the data often contain noise and inaccurate parts. These noises may affect subsequent analysis and decision-making. Therefore, how to effectively deal with these noises and improve the quality of data is an urgent problem to be solved in the field of fluid velocity measurement.
[0003] The existing flow field data processing methods mainly filter and denoise the data by manually setting thresholds. The advantage of this method is that it is simple and easy to implement, but it requires multiple adjustments based on the actual data, and the threshold settings are different for different types of data, which greatly increases the complexity and difficulty of the work. In addition, some methods use complex algorithm thresholds, but the setting of these thresholds often requires experience and is not effective for nonlinear data.
[0004] The existing flow field data processing methods have the following main problems: first, they require a lot of manual intervention, which is labor-intensive and inefficient; second, for complex flow field data, it is difficult to achieve the desired effect by setting the threshold; third, the existing algorithm thresholds often rely on experience and lack a certain degree of universality; fourth, traditional threshold strategies are difficult to adapt to the complexity and nonlinear characteristics of flow field data. In addition, although there are some machine learning or deep learning methods, most of them are supervised learning and require complex labeled data, which also limits their application in flow field data processing. Summary of the invention
[0005] In view of the deficiencies in the prior art, the present invention provides an Encoder-Decoder flow field data smoothing method, which solves the technical problems of low efficiency, lack of universality and application limitations in traditional flow field data processing methods.
[0006] To solve the above technical problems, the present invention provides the following technical solutions: an Encoder-Decoder flow field data smoothing method, the method comprising the following steps:
[0007] S1, obtaining original flow field data and preprocessing it to obtain processed flow field data that eliminates the offset and scaling effects of the original flow field data;
[0008] S2, constructing a data smoothing model for smoothing and outputting the flow field data obtained when measuring the fluid velocity;
[0009] S3. Using the flow field data obtained by real-time measurement as input of a data smoothing model to obtain smoothed flow field data after smoothing processing.
[0010] Furthermore, in step S1, the preprocessing includes a normalization process of scaling the values of the original flow field data to the interval [0, 1] or [-1, 1], and a decentralized process of performing a normalization process on each small batch of the original flow field data.
[0011] Furthermore, in step S2, the specific process includes the following steps:
[0012] S21. Constructing the main network structure of the data smoothing model based on the autoencoder neural network. The main network structure includes an encoder and a decoder.
[0013] S22, construct the loss function MSE and constraint Loss of the data smoothing model;
[0014] S23. Using processed flow field data to train and optimize the data smoothing model.
[0015] Further, in step S21, the encoder is formed into a hierarchical structure by a plurality of convolutional layers, and each convolutional layer pair is connected to an average pooling layer for reducing the spatial dimension of the flow field data;
[0016] The decoder consists of multiple upsampling layers that gradually restore the spatial dimensions of the flow field data, and convolutional layers that further extract the features of the input data through convolution operations on the upsampled flow field data, and there are jump connections between the multiple upsampling layers.
[0017] Furthermore, in step S22, the expression of the loss function MSE is:
[0018]
[0019] In the above formula, N is the total dimension of a flow field data; Y i is the true value of the i-th flow field data; is the predicted value of the i-th flow field data.
[0020] Furthermore, in step S22, the expression of the constraint Loss of the loss function MSE is:
[0021] Loss=ω1*MSE+ω2*TV-ω3*SSMI(x,y)
[0022] In the above formula, ω1+ω2+ω3=1, ω i Used to balance the weights of different loss items; TV is the regularization term added to the loss function MSE; SSMI(x,y) is the structural similarity loss.
[0023] Furthermore, in step S23, the Adam optimizer is used for optimizing the data smoothing model, the learning rate is 0.001, and the number of training rounds is 1000 rounds.
[0024] Furthermore, in step S3, the one-dimensional tensor output by the data smoothing model is restored to 512*512, and then reversely restored using mirror padding to obtain flow field data with a final dimension of m*n.
[0025] By means of the above technical solution, the present invention provides an Encoder-Decoder flow field data smoothing method, which has at least the following beneficial effects:
[0026] 1. The present invention can automatically learn effective representation of data and remove noise, thereby achieving smooth processing of flow field data. For the field of fluid dynamics research, this can improve the quality of flow field data and facilitate more accurate analysis and prediction of fluid motion.
[0027] 2. The present invention adopts an unsupervised learning method, which does not require a large amount of labeled data, greatly reduces the workload of data processing and improves processing efficiency, which is very attractive in the field of data analysis.
[0028] 3. The present invention can automatically learn the effective features of flow field data and has strong generalization ability, which has great application potential in the field of artificial intelligence applications. At the same time, with the development of big data and artificial intelligence, the demand for high-quality data is increasing, and the flow field data smoothing method of the present invention is expected to be widely used in the market. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0030] Figure 1 It is a flow chart of the Encoder-Decoder flow field data smoothing method of the present invention;
[0031] Figure 2 A network structure diagram of the data smoothing model of the present invention;
[0032] Figure 3 This is a diagram showing the original flow field in the simulation of the classic double vortex flow field of the present invention;
[0033] Figure 4 This is a diagram showing the smoothed flow field in the simulation of the classic double vortex flow field of the present invention;
[0034] Figure 5 It is a display diagram of the original flow field in the real tail spoiler flow field of the present invention;
[0035] Figure 6 It is a diagram showing the smoothed flow field in the real tail spoiler flow field of the present invention. DETAILED DESCRIPTION
[0036] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods, so that the implementation process of how the present application uses technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly.
[0037] To eliminate the noise and inaccuracies in the flow field data due to factors such as equipment accuracy and environmental conditions, please refer to Figure 1-Figure 6 , showing a specific implementation of the present embodiment. Compared with the existing technology, the beneficial effects achieved by the present embodiment are as follows: 1. Automated processing: The present invention adopts an autoencoder for unsupervised learning, without the need for human intervention, which greatly reduces the workload and improves processing efficiency. 2. Effective feature extraction: The autoencoder can automatically learn the effective features of flow field data. Compared with the traditional threshold method, it can more accurately remove noise and improve data quality. 3. Wide applicability: Since the present invention adopts unsupervised learning and does not require labeled data, it is suitable for various types of flow field data and has strong versatility. 4. Complex data processing: The autoencoder network of the present invention can handle the complexity and nonlinear characteristics of flow field data well, and can achieve better processing effects than traditional threshold methods. 5. Reduced professionalism: The autoencoder network of the present invention can be trained through a large amount of flow field data, avoiding the problem of setting thresholds based on experience and reducing the professional requirements for processing flow field data. Please refer to Figure 1 , this embodiment proposes an Encoder-Decoder flow field data smoothing method, the method comprising the following steps:
[0038] S1. Obtain the original flow field data and preprocess it to obtain processed flow field data that eliminates the offset and scaling effects of the original flow field data. The preprocessing includes normalization processing to scale the values of the original flow field data to the interval [0,1] or [-1,1], and decentralization processing to normalize each small batch of original flow field data. Specifically, first, the original flow field data is preprocessed as necessary, including normalization, decentralization, etc., to eliminate the offset and scaling effects of the data, so that the data is more suitable for subsequent processing and analysis.
[0039] In data processing, normalization is usually used to scale the data values to the interval [0, 1] or [-1, 1]. In a neural network, normalization of input data can help the model converge faster. Considering the directional properties of the original flow field data, this embodiment chooses to scale the values of the original flow field data to the interval [-1, 1].
[0040] When training deep neural networks, decentralization is part of batch normalization, which helps speed up the training process and improve the generalization ability of the model by normalizing each small batch of data.
[0041] Since it is not easy to collect the original flow field data, this embodiment can also add data enhancement in the preprocessing stage to increase the number of samples of the original flow field data. Considering the flow characteristics of the fluid, data enhancement uses distortion + slicing operations to maximize the possibility that the augmented flow field data still conforms to the laws of fluid motion.
[0042] S2, constructing a data smoothing model for smoothing and outputting the flow field data measured when measuring the fluid velocity; in step S2, the specific process includes the following steps:
[0043] S21, the main network structure of the data smoothing model based on the autoencoder neural network, such as Figure 2 As shown in the figure, the main network structure includes two parts: encoder and decoder, wherein the encoder is formed by a hierarchy of multiple convolutional layers, and each convolutional layer pair is connected to an average pooling layer for reducing the spatial dimension of the flow field data; specifically, the encoder is formed by a hierarchy of multiple convolutional layers (Conv+Conv+BN+ReLU), each layer consists of two convolution operations, followed by an activation function, usually ReLU, and each convolutional layer pair is usually followed by an average pooling operation to reduce the spatial dimension of the feature map. The maximum pooling is not used to reduce the outliers from being learned as the main features. As the network goes deeper, the depth of the flow field data increases, but the spatial dimension decreases.
[0044] The decoder consists of multiple upsampling layers that gradually restore the spatial dimensions of the flow field data, and convolutional layers that further extract the input data features through convolution operations on the upsampled flow field data. There are jump connections between the multiple upsampling layers. Specifically, the decoder part gradually restores the spatial dimensions of the feature map through upsampling, and the upsampled flow field data is spliced with the flow field data of the corresponding layer of the encoder. This connection is called a skip connection, which helps the network recover the detailed information of the data. The upsampled flow field data is further refined through the convolutional layer, and the ReLU activation function is also used. Figure 2The dotted line corresponding to the Skip connection in the figure allows the network to reuse the context information captured by the encoder in the decoder, which helps to retain more detailed features of the flow field in the final output.
[0045] like Figure 2 As shown, there are four important links from input to output: convolution, downsampling, upsampling, and jump connection, as follows:
[0046] Convolution: Use kernels with different weights to weight the input. The weights are constrained by the loss function and iterated continuously to achieve the result of minimizing the loss function (or satisfying the threshold).
[0047] Downsampling: The purpose of downsampling is to reduce the resolution (dimension) of the input data. The process of downsampling is the process by which the network extracts the main features of the input flow field.
[0048] Upsampling: The purpose of upsampling is to restore the resolution (dimension) of the flow field. Upsampling uses deconvolution (transposed convolution), and the weight of its kernel is also learned and optimized through back propagation under the constraints of the loss function.
[0049] Jump connection: The purpose of jump connection is to integrate features of different scales to achieve detailed restoration of the flow field. There are two ways of jump connection: addition and splicing. Considering that the upper and lower bounds of different flow field values are inconsistent, the addition method will make the area with high flow velocity dominate during regression, or the positive and negative values will cancel each other out. Therefore, the splicing strategy is used here.
[0050] S22. Construct the loss function MSE and constraint Loss of the data smoothing model. The expression of the loss function MSE is:
[0051]
[0052] In the above formula, N is the total dimension of a flow field data; Y i is the true value of the i-th flow field data; is the predicted value of the i-th flow field data;
[0053] The expression of the constraint Loss of the loss function MSE is:
[0054] Loss=ω1*MSE+ω2*TV-ω3*SSMI(x,y)
[0055] In the above formula, ω1+ω2+ω3=1, ω i Used to balance the weights of different loss items; TV is the regularization term added to the loss function MSE; SSMI(x,y) is the structural similarity loss.
[0056] Among them, in order to encourage the data smoothing model to generate smooth output, a regularization term can be added to the loss function, such as Total Variation Regularization, which penalizes rapid changes between predicted values. The expression of the regularization term TV is:
[0057]
[0058] In the above formula, is the predicted value of the i+1th flow field data.
[0059] The similarity of two flow fields is quantified by comparing their modulus and curl, with a value range between -1 and 1, where 1 means that the two images are exactly the same. Therefore, the calculation formula of the structural similarity loss SSMI(x,y) is:
[0060]
[0061] In the above formula, x, y are the input and output flow field data; μ x and μ y is the modulus of each point in the two flow fields; σ x 2 and σ y 2 is the variance of the curl at each point; σ xy is the curl covariance; c1 and c2 are extremely small constants to ensure that the denominator is not zero.
[0062] In this embodiment, the sign of the structural similarity loss SSMI(x,y) is negative. The neural network uses the minimum loss function as the iteration termination condition. The larger the structural similarity loss SSMI(x,y), the more it meets the training expectations, so the sign is negative, and the smaller the better. In this embodiment, the main goal is filtering, so the higher the similarity between the final result flow field and the input flow field, the lower the smoothness. Here, a set of reference values [0.25, 0.5, 0.25] are given without verification.
[0063] S23, using processed flow field data to train and optimize the data smoothing model; specifically, using processed flow field data to train the data smoothing model. Through unsupervised learning, the data smoothing model can learn an effective representation of the data. This unsupervised learning method does not require a large amount of labeled data, greatly reduces the workload, and improves efficiency.
[0064] The Adam optimizer is used to optimize the data smoothing model, with a learning rate of 0.001 and 1000 training rounds. During the training process, the loss function MSE is used to evaluate the performance of the data smoothing model. The formula is:
[0065] loss`=(yy`)2
[0066] Among them, y is the true value and y` is the predicted value.
[0067] S3. The flow field data obtained by real-time measurement is used as the input of the data smoothing model to obtain smoothed flow field data after smoothing; the decoder part of the data smoothing model is used to smooth the flow field data to remove noise. This method can effectively remove noise in the flow field data, improve the quality of the data, make the data smoother, and be more conducive to subsequent analysis and decision-making.
[0068] Specifically, the data smoothing model outputs a one-dimensional tensor with a size of 1*262144. It needs to be dimensionally restored to 512*512, and then reversely restored based on mirror padding and resize to obtain the final m*n flow field. In order to handle the differences in dimensions of different vector fields, mirror padding is used here so that flow field data of different sizes can reach a unified input size through boundary padding and scaling. In order to reduce the edge effect caused by slicing, this embodiment uses mirror padding.
[0069] Considering that the flow field is calculated from the image collected by the high-speed camera through sub-area cross-correlation and other technologies, in order to meet the high-speed acquisition, 3000*4000 is already a large size in the high-speed camera. In this case, the full field of view is divided into 16*16 sub-areas, and the flow field size is less than 512*512 at a 50% overlap rate. Therefore, this embodiment uses 512*512 as a unified input, and a larger flow field can be cut into pieces and sent to the final network processing in batches.
[0070] This embodiment uses the trained data smoothing model to smooth the flow field data, which can effectively remove the noise in the flow field data and improve the quality of the data. Figure 3-Figure 6 is the test result, where Figure 3 and Figure 4 The simulation data shown in the figure shows that the double vortex flow randomly modifies some values to simulate noise. Figure 3 , 4 It can be seen that this solution achieves a good smoothing effect in areas where the flow field changes relatively slowly, and traditional methods generally perform well in this case. However, this solution still has a good smoothing effect on noisy flow field vectors in vortices where the flow field changes dramatically.
[0071] In order to further verify, the real shooting data (tail spoiler) is used to calculate the flow field, and the Figure 5 The flow field is shown. Figure 6It can be seen that the noisy flow field data is smoothed by the method of this scheme, which not only smoothes the global flow field, but also achieves a good smoothing effect for larger outliers.
[0072] Due to the advanced nature of this application, it can be widely used in the fields of fluid dynamics research, data analysis, artificial intelligence applications, etc. First, the present invention provides an unsupervised flow field data smoothing method based on an autoencoder, which can automatically learn the effective representation of data and remove noise, thereby achieving smooth processing of flow field data. For the field of fluid dynamics research, it can improve the quality of flow field data and facilitate more accurate analysis and prediction of fluid motion.
[0073] Secondly, the present invention adopts an unsupervised learning method, which does not require a large amount of labeled data, greatly reduces the workload of data processing and improves processing efficiency, which is very attractive in the field of data analysis.
[0074] Finally, the data smoothing model constructed by the present invention can automatically learn the effective features of flow field data and has strong generalization ability, which has great application potential for the application field of artificial intelligence. At the same time, with the development of big data and artificial intelligence, the demand for high-quality data is increasing, and the flow field data smoothing method of the present invention is expected to be widely used in the market.
[0075] Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, so the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0076] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the above embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0077] The above implementation methods have been described in detail. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. An Encoder-Decoder flow field data smoothing method, characterized in that: The method comprises the following steps: S1, obtaining original flow field data and preprocessing it to obtain processed flow field data that eliminates the offset and scaling effects of the original flow field data; S2, constructing a data smoothing model for smoothing and outputting the flow field data obtained when measuring the fluid velocity; S3. Using the flow field data obtained by real-time measurement as input of a data smoothing model to obtain smoothed flow field data after smoothing processing.
2. The Encoder-Decoder flow field data smoothing method according to claim 1, characterized in that: In step S1, the preprocessing includes a normalization process of scaling the values of the original flow field data to the interval [0, 1] or [-1, 1], and a decentralization process of performing the normalization process on each small batch of the original flow field data.
3. The Encoder-Decoder flow field data smoothing method according to claim 1, characterized in that: In step S2, the specific process includes the following steps: S21. Constructing the main network structure of the data smoothing model based on the autoencoder neural network. The main network structure includes an encoder and a decoder. S22, construct the loss function MSE and constraint Loss of the data smoothing model; S23. Using processed flow field data to train and optimize the data smoothing model.
4. The Encoder-Decoder flow field data smoothing method according to claim 3, characterized in that: In step S21, the encoder is formed into a hierarchical structure by a plurality of convolutional layers, and each convolutional layer pair is connected to an average pooling layer for reducing the spatial dimension of the flow field data; The decoder consists of multiple upsampling layers that gradually restore the spatial dimensions of the flow field data, and convolutional layers that further extract the features of the input data through convolution operations on the upsampled flow field data, and there are jump connections between the multiple upsampling layers.
5. The Encoder-Decoder flow field data smoothing method according to claim 3, characterized in that: In step S22, the expression of the loss function MSE is: In the above formula, N is the total dimension of a flow field data; Y i is the true value of the i-th flow field data; is the predicted value of the i-th flow field data.
6. The Encoder-Decoder flow field data smoothing method according to claim 3, characterized in that: In step S22, the expression of the constraint Loss of the loss function MSE is: Loss=ω1*MSE+ω2*TV-ω3*SSMI(x,y) In the above formula, ω1+ω2+ω3=1, ω i Weights used to balance different loss terms; TV is the regularization term added to the loss function MSE; SSMI(x,y) is the structural similarity loss.
7. The Encoder-Decoder flow field data smoothing method according to claim 3, characterized in that: In step S23, the Adam optimizer is used to optimize the data smoothing model, the learning rate is 0.001, and the number of training rounds is 1000 rounds.
8. The Encoder-Decoder flow field data smoothing method according to claim 1, characterized in that: In step S3, the one-dimensional tensor output by the data smoothing model is restored to 512*512, and then reversely restored using mirror padding to obtain flow field data with a final dimension of m*n.