An image recognition method and system based on data augmentation and contrastive learning

By using data augmentation and contrastive learning methods based on VAE-GAN and CRL, high-quality artificial samples are generated and feature extraction is enhanced, which solves the problems of poor model adaptability and data scarcity in EEG image recognition and improves the classification and recognition accuracy of EEG data.

CN118072109BActive Publication Date: 2026-11-17NANJING UNIV OF INFORMATION SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410431556.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-11
Publication Date
2026-11-17
Estimated Expiration
2044-04-11

AI Technical Summary

Technical Problem

Existing EEG image recognition methods suffer from poor adaptability of EEG models, excessive redundancy in EEG data, and scarcity of data, making it difficult to effectively extract valuable features and generate high-quality artificial samples.

Method used

Artificial samples are generated using a VAE-GAN-based data augmentation model. A feature learning model combining CRL and a multi-task autoencoder is used to enhance feature extraction through contrastive learning, and a Softmax classifier is used for recognition.

Benefits of technology

It improves the classification and recognition accuracy of EEG image data, realizes an end-to-end model architecture, reduces the reliance on manual feature extraction, and fully explores EEG-related information on depression.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118072109B_ABST
    Figure CN118072109B_ABST
Patent Text Reader

Abstract

This invention discloses an image recognition method and system based on data augmentation and contrastive learning, relating to the field of image recognition technology. The method includes the following steps: receiving raw EEG data; preprocessing the raw EEG data to obtain clean EEG data; segmenting the clean EEG data into segments to obtain an EEG dataset; inputting the EEG dataset into a pre-established VAE-GAN data augmentation model to output artificial EEG samples; inputting the clean EEG data and artificial EEG samples into a pre-established feature learning model based on CRL and a multi-task autoencoder to output learned features; and inputting the learned features into a Softmax classifier to obtain classification and recognition results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition technology, specifically an image recognition method and system based on data augmentation and contrastive learning. Background Technology

[0002] Electroencephalography (EEG) is an image that captures electrical potential signals directly from the central nervous system in the cerebral cortex, reflecting the brain's activity. EEG analysis is crucial; however, traditional methods require extensive prior knowledge to extract deep features, leading to significant time and effort spent on manual feature extraction. Deep learning can uncover latent features from data, making deep learning-based EEG image recognition methods increasingly mainstream and achieving good performance in various applications. However, current EEG image recognition methods have limitations, such as poor model adaptability and a large amount of redundant information in EEG data. Effectively reducing the differences between EEG images and extracting valuable features are current challenges. Furthermore, EEG image data is scarce, and deep learning requires sufficient labeled data for model training; generating high-quality artificial samples is another problem that needs to be addressed. Summary of the Invention

[0003] To address the shortcomings mentioned in the background section, the present invention aims to provide an image recognition method and system based on data augmentation and contrastive learning.

[0004] Firstly, the objective of this invention can be achieved through the following technical solution: an image recognition method based on data augmentation and contrastive learning, the method comprising the following steps:

[0005] Receive raw EEG data, preprocess the raw EEG data to obtain clean EEG data, and divide the clean EEG data into segments to obtain an EEG dataset.

[0006] The EEG dataset is input into the pre-built VAE-GAN data augmentation model, and the output is an artificial EEG sample;

[0007] Pure EEG data and artificial EEG samples are input into a pre-established feature learning model based on CRL and multi-task autoencoder. The output is the learned features, which are then input into a Softmax classifier to obtain the classification and recognition results.

[0008] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the process of preprocessing the raw EEG data includes rereference, filtering to remove power frequency interference, and independent component analysis to remove irrelevant signals such as eye artifacts.

[0009] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the pre-established VAE-GAN data augmentation model comprises: a variational autoencoder, a decoder, and a discriminator in the GAN, expressed as follows:

[0010] The loss function expression for VAE is as follows:

[0011]

[0012] The loss function includes KL divergence and reconstruction loss, where x is the initial data and z is the latent distribution feature of x after passing through the encoder. It is the result calculated using the encoder, p θ (z) is the posterior probability. θ and θ are the parameters of the encoding and decoding networks, respectively. l This represents the latent representation of the discriminator at layer l.

[0013] The loss function expression for GAN is as follows:

[0014] L gan =log(Dis(x))+log(1-Dis(Gen(z)))

[0015] Where Dis represents the discriminator and Gen represents the generator composed of VAE decoders.

[0016] The final loss function of VAE-GAN consists of KL divergence, reconstruction error, and discriminator loss, as follows:

[0017]

[0018] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the variational autoencoder is used to learn the latent distribution of EEG signals in the EEG dataset and input the latent distribution into the decoder; the decoder generates initial artificial EEG samples based on the latent distribution and sends the initial artificial EEG samples to the discriminator in the GAN; the discriminator in the GAN is used to implement adversarial learning between the initial artificial EEG samples and real samples to obtain artificial EEG samples.

[0019] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the pre-established feature learning model based on CRL and multi-task autoencoder includes an encoder component, a decoder component, and a contrastive learning network, as expressed below:

[0020]

[0021] in This represents the feature representation of the i-th sample from subject A within a single mini-batch. This represents the feature representation of the i-th sample from subject B within a single mini-batch. Let C represent the feature representations of the remaining j samples from a single mini-batch (C specifically refers to the remaining subjects in different states from subjects A and B). sim(*, *) represents the calculation of the cosine similarity between the two. τ is a temperature hyperparameter used to adjust the model's sensitivity to negative samples.

[0022] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the encoder component encodes the EEG signals in the clean EEG data and the artificial EEG samples, maps the latent representation in the latent space to obtain vector feature decoding, the decoder component reconstructs the vector feature decoding to extract the latent feature vector, and the contrastive learning network performs reinforcement learning on the latent feature vector to output the learned features.

[0023] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the contrastive learning network is trained using InfoNCE loss, and the InfoNCE loss reflects the lower bound mutual information between potential feature vectors of different categories.

[0024] Secondly, in order to achieve the above objectives, the present invention discloses an image recognition system based on data augmentation and contrastive learning, characterized in that it comprises:

[0025] The data processing module is used to receive raw EEG data, preprocess the raw EEG data to obtain clean EEG data, and divide the clean EEG data into segments to obtain an EEG dataset.

[0026] The data augmentation module is used to input the EEG dataset into the pre-built VAE-GAN data augmentation model and output artificial EEG samples.

[0027] The contrastive learning module is used to input clean EEG data and artificial EEG samples into a pre-built feature learning model based on CRL and multi-task autoencoder, outputting learned features, which are then input into a Softmax classifier to obtain classification and recognition results.

[0028] In conjunction with the second aspect, in some implementations of the second aspect, the system further includes: the process of preprocessing the raw EEG data within the data processing module includes rereference, filtering to remove power frequency interference, and independent component analysis to remove irrelevant signals such as eye artifacts;

[0029] Alternatively, the pre-built VAE-GAN data augmentation model within the data augmentation module includes: a variational autoencoder, a decoder, and a discriminator in the GAN, as shown in the following expression:

[0030] The loss function expression for VAE is as follows:

[0031]

[0032] The loss function includes KL divergence and reconstruction loss, where x is the initial data and z is the latent distribution feature of x after passing through the encoder. It is the result calculated using the encoder, p θ (z) is the posterior probability. θ and θ are the parameters of the encoding and decoding networks, respectively. l This represents the latent representation of the discriminator at layer l.

[0033] The loss function expression for GAN is as follows:

[0034] L gan =log(Dis(x))+log(1-Dis(Gen(z)))

[0035] Where Dis represents the discriminator and Gen represents the generator composed of VAE decoders.

[0036] The final loss function of VAE-GAN consists of KL divergence, reconstruction error, and discriminator loss, as follows:

[0037]

[0038] Alternatively, the variational autoencoder in the data augmentation module is used to learn the latent distribution of EEG signals in the EEG dataset and input the latent distribution into the decoder. The decoder generates initial artificial EEG samples based on the latent distribution and sends the initial artificial EEG samples to the discriminator in the GAN. The discriminator in the GAN is used to implement adversarial learning between the initial artificial EEG samples and real samples to obtain artificial EEG samples.

[0039] Preferably, the feature learning model pre-established within the contrastive learning module, based on CRL and a multi-task autoencoder, includes an encoder component, a decoder component, and a contrastive learning network, as shown in the following expression:

[0040]

[0041] in This represents the feature representation of the i-th sample from subject A within a single mini-batch. This represents the feature representation of the i-th sample from subject B within a single mini-batch. Let C represent the feature representations of the remaining j samples from a single mini-batch (C specifically refers to the remaining subjects in different states from subjects A and B). sim(*, *) represents the calculation of the cosine similarity between the two. τ is a temperature hyperparameter used to adjust the model's sensitivity to negative samples.

[0042] Preferably, the encoder component in the contrastive learning module encodes the EEG signals in the clean EEG data and the artificial EEG samples, maps the latent representation in the latent space, and obtains the vector feature decoder. The decoder component reconstructs the vector feature decoder and extracts the latent feature vector. The contrastive learning network performs reinforcement learning on the latent feature vector, thereby outputting the learned features.

[0043] Preferably, the contrastive learning network within the contrastive learning module is trained using InfoNCE loss, which reflects the lower bound mutual information between potential feature vectors of different categories.

[0044] In another aspect of the present invention, in order to achieve the above-mentioned objective, a terminal device is disclosed, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. The memory stores the computer program capable of running on the processor, and when the processor loads and executes the computer program, it employs an image recognition method based on data augmentation and contrastive learning as described above.

[0045] The beneficial effects of this invention are:

[0046] This invention employs a VAE-GAN-based data augmentation model to generate artificially enhanced small-sample EEG data, achieving an end-to-end model architecture. It uses a sparse autoencoder to encode EEG signals, fully mining EEG-related information on depression without requiring manual feature extraction. It also uses contrastive learning to enhance the latent representations, thereby improving the classification and recognition accuracy of EEG image data. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is a schematic diagram of the method flow of the present invention;

[0049] Figure 2 This is a system block diagram of the present invention;

[0050] Figure 3 This is a schematic diagram of the sample generation model of the present invention;

[0051] Figure 4 This is a schematic diagram illustrating the basic idea of ​​comparative learning in this invention;

[0052] Figure 5 This is a schematic diagram of the system structure of the present invention;

[0053] Figure 6 This is a comparison chart of the average accuracy of each model under different frequency bands in this invention;

[0054] Figure 7 This is a comparison chart of the F1-score results of different models in different frequency bands of this invention;

[0055] Figure 8 This is a graph showing the comparison of the accuracy of various models after different proportions of data augmentation according to the present invention. Detailed Implementation

[0056] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0057] Example 1:

[0058] The following is a description of the relevant terms used in the embodiments of this application:

[0059] Data augmentation algorithms: Data augmentation algorithms are a common technique in machine learning used to improve the performance and generalization ability of models, especially when dealing with few-sample problems. These algorithms increase the diversity of the dataset by adding noise, transforming, or synthesizing new samples to the original data.

[0060] Contrastive learning networks: Contrastive learning is a machine learning technique where algorithms learn to distinguish between similar and dissimilar data points. The goal of contrastive learning is to learn representations of data to capture the basic structure and relationships between different data points.

[0061] In contrastive learning, the algorithm is trained to maximize the similarity between similar data points and minimize the similarity between dissimilar data points. A common approach is to train the algorithm to predict whether two data points belong to the same category.

[0062] like Figure 1 As shown, an image recognition method based on data augmentation and contrastive learning is characterized by the following steps:

[0063] Receive raw EEG data, preprocess the raw EEG data to obtain clean EEG data, and divide the clean EEG data into segments to obtain an EEG dataset.

[0064] The preprocessing of the raw EEG data includes rereference, filtering to remove power frequency interference, and independent component analysis to remove irrelevant signals such as eye artifacts.

[0065] The EEG dataset is input into the pre-built VAE-GAN data augmentation model, and the output is an artificial EEG sample;

[0066] The pre-built VAE-GAN data augmentation model includes a variational autoencoder, a decoder, and a discriminator in the GAN, expressed as follows:

[0067] The loss function expression for VAE is as follows:

[0068]

[0069] The loss function includes KL divergence and reconstruction loss, where x is the initial data and z is the latent distribution feature of x after passing through the encoder. It is the result calculated using the encoder, p θ (z) is the posterior probability. θ and θ are the parameters of the encoding and decoding networks, respectively. l This represents the latent representation of the discriminator at layer l.

[0070] The loss function expression for GAN is as follows:

[0071] L gan =log(Dis(x))+log(1-Dis(Gen(z)))

[0072] Where Dis represents the discriminator and Gen represents the generator composed of VAE decoders.

[0073] The final loss function of VAE-GAN consists of KL divergence, reconstruction error, and discriminator loss, as follows:

[0074]

[0075] The variational autoencoder learns the latent distribution of EEG signals within the EEG dataset and inputs this latent distribution into the decoder. The decoder generates initial artificial EEG samples based on the latent distribution and sends these samples to the discriminator in the GAN. The discriminator in the GAN performs adversarial learning between the initial artificial EEG samples and real samples, thereby further improving the quality of the artificial samples. This process yields the artificial EEG samples.

[0076] Pure EEG data and artificial EEG samples are input into a pre-established feature learning model based on CRL and multi-task autoencoder. The output is the learned features, which are then input into a Softmax classifier to obtain the classification and recognition results.

[0077] The pre-built feature learning model based on CRL and multi-task autoencoder includes encoder components, decoder components, and a contrastive learning network, as shown in the following expression:

[0078]

[0079] in This represents the feature representation of the i-th sample from subject A within a single mini-batch. This represents the feature representation of the i-th sample from subject B within a single mini-batch. Let C represent the feature representations of the remaining j samples from a single mini-batch (C specifically refers to the remaining subjects in different states from subjects A and B). sim(*, *) represents the calculation of the cosine similarity between the two. τ is a temperature hyperparameter used to adjust the model's sensitivity to negative samples.

[0080] The encoder component encodes the EEG signals in clean EEG data and artificial EEG samples, maps the latent representation in the latent space, and obtains vector feature decoding. The decoder component reconstructs the vector feature decoding and extracts the latent feature vector. The contrastive learning network performs reinforcement learning on the latent feature vector, thereby outputting the learned features.

[0081] The contrastive learning network is trained using InfoNCE loss, which reflects the lower bound mutual information between latent feature vectors of different categories.

[0082] Specifically, the present invention will be further illustrated below through embodiments:

[0083] Comparative learning ideas, such as Figure 4 As shown, the goal of the contrastive learning network is to maximize the similarity score between the positive sample and the given sample, while minimizing the similarity score between the negative sample and the given sample, thereby learning a discriminative representation and enhancing the discriminability of different categories.

[0084] Figure 6 and Figure 7 The experimental results of different models in each of the five frequency bands and the full frequency band are presented. It can be clearly seen that the classification performance of the proposed method in this experiment is higher than that of other models in both the five frequency bands and the full frequency band. The experimental results also show that the classification results obtained by the deep learning method are better than those of the machine learning method. At the same time, the results obtained for high-frequency EEG features (gamma band and full frequency band) are better than the classification performance of other frequency bands. The feature learning model based on CRL and multi-task autoencoder used in this experiment can achieve better feature extraction and obtain better classification and recognition accuracy.

[0085] Figure 8 The results show a comparison of the accuracy of each model after data augmentation at different proportions. The experiment revealed that as the proportion of artificial samples gradually increases, the classification performance of each model improves. The optimal performance is achieved when the data augmentation ratio is 100%, with the proposed method achieving the best performance at 94.47%. However, the results also show that when the data augmentation ratio increases to 150% and 200%, the model performance does not further improve with the increase of artificial samples; instead, it shows a downward trend. This may be because the generation of artificial samples is accompanied by the generation of some irrelevant features, preventing the model performance from being optimized.

[0086] Example 2: Second aspect, such as Figure 5 As shown, in order to achieve the above objectives, the present invention discloses an image recognition system based on data augmentation and contrastive learning, characterized in that it includes:

[0087] The data processing module is used to receive raw EEG data, preprocess the raw EEG data to obtain clean EEG data, and divide the clean EEG data into segments to obtain an EEG dataset.

[0088] The data augmentation module is used to input the EEG dataset into the pre-built VAE-GAN data augmentation model and output artificial EEG samples.

[0089] The contrastive learning module is used to input clean EEG data and artificial EEG samples into a pre-built feature learning model based on CRL and multi-task autoencoder, outputting learned features, which are then input into a Softmax classifier to obtain classification and recognition results.

[0090] In conjunction with the second aspect, in some implementations of the second aspect, the system further includes: the process of preprocessing the raw EEG data within the data processing module includes rereference, filtering to remove power frequency interference, and independent component analysis to remove irrelevant signals of eye artifacts;

[0091] Alternatively, the pre-built VAE-GAN data augmentation model within the data augmentation module includes: a variational autoencoder, a decoder, and a discriminator in the GAN, as shown in the following expression:

[0092] The loss function expression for VAE is as follows:

[0093]

[0094] The loss function includes KL divergence and reconstruction loss, where x is the initial data and z is the latent distribution feature of x after passing through the encoder. It is the result calculated using the encoder, p θ (z) is the posterior probability. θ and θ are the parameters of the encoding and decoding networks, respectively. l This represents the latent representation of the discriminator at layer l.

[0095] The loss function expression for GAN is as follows:

[0096] L gan =log(Dis(x))+log(1-Dis(Gen(z)))

[0097] Where Dis represents the discriminator and Gen represents the generator composed of VAE decoders.

[0098] The final loss function of VAE-GAN consists of KL divergence, reconstruction error, and discriminator loss, as follows:

[0099]

[0100] Alternatively, the variational autoencoder in the data augmentation module is used to learn the latent distribution of EEG signals in the EEG dataset and input the latent distribution into the decoder. The decoder generates initial artificial EEG samples based on the latent distribution and sends the initial artificial EEG samples to the discriminator in the GAN. The discriminator in the GAN is used to implement adversarial learning between the initial artificial EEG samples and real samples to obtain artificial EEG samples.

[0101] Preferably, the feature learning model pre-established within the contrastive learning module, based on CRL and a multi-task autoencoder, includes an encoder component, a decoder component, and a contrastive learning network, as shown in the following expression:

[0102]

[0103] in This represents the feature representation of the i-th sample from subject A within a single mini-batch. This represents the feature representation of the i-th sample from subject B within a single mini-batch. Let C represent the feature representations of the remaining j samples from a single mini-batch (C specifically refers to the remaining subjects in different states from subjects A and B). sim(*, *) represents the calculation of the cosine similarity between the two. τ is a temperature hyperparameter used to adjust the model's sensitivity to negative samples.

[0104] Preferably, the encoder component in the contrastive learning module encodes the EEG signals in the clean EEG data and the artificial EEG samples, maps the latent representation in the latent space, and obtains the vector feature decoder. The decoder component reconstructs the vector feature decoder and extracts the latent feature vector. The contrastive learning network performs reinforcement learning on the latent feature vector, thereby outputting the learned features.

[0105] Preferably, the contrastive learning network within the contrastive learning module is trained using InfoNCE loss, which reflects the lower bound mutual information between potential feature vectors of different categories.

[0106] Based on the same inventive concept, this invention also provides a computer device, comprising: one or more processors, and a memory for storing one or more computer programs; the programs include program instructions, and the processor executes the program instructions stored in the memory. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, used to implement one or more instructions, specifically for loading and executing one or more instructions stored in a computer storage medium to implement the above-described method.

[0107] It should be further explained that, based on the same inventive concept, the present invention also provides a computer storage medium storing a computer program, which, when executed by a processor, performs the above-described method. This storage medium can be any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0108] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0109] The foregoing has shown and described the basic principles, main features, and advantages of this disclosure. Those skilled in the art should understand that this disclosure is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of this disclosure. Various changes and modifications can be made to this disclosure without departing from its spirit and scope, and all such changes and modifications fall within the scope of this disclosure as claimed.

Claims

1. An image recognition method based on data augmentation and contrastive learning, characterized in that, The method includes the following steps: Receive raw EEG data, preprocess the raw EEG data to obtain clean EEG data, and divide the clean EEG data into segments to obtain an EEG dataset. The preprocessing of raw EEG data includes rereference, filtering to remove power frequency interference, and independent component analysis to remove irrelevant signals of eye artifacts; The EEG dataset is input into the pre-built VAE-GAN data augmentation model, and the output is an artificial EEG sample; The pre-built VAE-GAN data augmentation model includes a variational autoencoder, a decoder, and a discriminator in the GAN, expressed as follows: The loss function expression for VAE is as follows: The loss function includes KL divergence and reconstruction loss. For initial data, for The latent distribution features after encoding It is the result calculated using an encoder. It is the posterior probability. and These are the parameters of the encoding and decoding networks. Indicates the discriminator's first... Layer latent representation; The loss function expression for GAN is as follows: in Indicates the discriminator, This represents a generator composed of VAE decoders; The final loss function of VAE-GAN consists of KL divergence, reconstruction error, and discriminator loss, as follows: A variational autoencoder is used to learn the latent distribution of EEG signals in an EEG dataset and input the latent distribution into a decoder. The decoder generates initial artificial EEG samples based on the latent distribution and sends the initial artificial EEG samples to the discriminator in a GAN. The discriminator in the GAN is used to implement adversarial learning between the initial artificial EEG samples and real samples to obtain artificial EEG samples. Pure EEG data and artificial EEG samples are input into a pre-established feature learning model based on CRL and multi-task autoencoder. The output is the learned features, which are then input into a Softmax classifier to obtain the classification and recognition results. The pre-built feature learning model based on CRL and multi-task autoencoder includes encoder components, decoder components, and a contrastive learning network, as shown in the following expression: in This represents the feature representation of the i-th sample from subject A within a single mini-batch. This represents the feature representation of the i-th sample from subject B within a single mini-batch. Let C represent the feature representations of the remaining j samples from a single mini-batch, where C specifically refers to the remaining subjects in different states from subjects A and B. This indicates that the cosine similarity between the two is calculated. It is a temperature hyperparameter; The encoder component encodes the EEG signals in clean EEG data and artificial EEG samples, maps the latent representation in the latent space, and obtains vector feature decoding. The decoder component reconstructs the vector feature decoding and extracts the latent feature vector. The contrastive learning network performs reinforcement learning on the latent feature vector, thereby outputting the learned features.

2. The image recognition method based on data augmentation and contrastive learning according to claim 1, characterized in that, The contrastive learning network is trained using InfoNCE loss, which reflects the lower bound mutual information between potential feature vectors of different categories.

3. An image recognition system based on data augmentation and contrastive learning, characterized in that, include: The data processing module is used to receive raw EEG data, preprocess the raw EEG data to obtain clean EEG data, and divide the clean EEG data into segments to obtain an EEG dataset. The preprocessing of raw EEG data within the data processing module includes rereference, filtering to remove power frequency interference, and independent component analysis to remove irrelevant signals from eye artifacts. The data augmentation module is used to input the EEG dataset into the pre-built VAE-GAN data augmentation model and output artificial EEG samples. The pre-built VAE-GAN data augmentation model within the data augmentation module includes: a variational autoencoder, a decoder, and a discriminator in the GAN, expressed as follows: The loss function expression for VAE is as follows: The loss function includes KL divergence and reconstruction loss. For initial data, for The latent distribution features after encoding It is the result calculated using an encoder. It is the posterior probability. and These are the parameters of the encoding and decoding networks. Indicates the discriminator's first... Layer latent representation; The loss function expression for GAN is as follows: in Indicates the discriminator, This represents a generator composed of VAE decoders; The final loss function of VAE-GAN consists of KL divergence, reconstruction error, and discriminator loss, as follows: The variational autoencoder in the data augmentation module is used to learn the latent distribution of EEG signals in the EEG dataset and input the latent distribution into the decoder. The decoder generates initial artificial EEG samples based on the latent distribution and sends the initial artificial EEG samples to the discriminator in the GAN. The discriminator in the GAN is used to implement adversarial learning between the initial artificial EEG samples and real samples to obtain artificial EEG samples. The contrastive learning module is used to input clean EEG data and artificial EEG samples into a pre-built feature learning model based on CRL and multi-task autoencoder, outputting learned features, which are then input into a Softmax classifier to obtain classification and recognition results. The pre-built feature learning model based on CRL and multi-task autoencoder within the contrastive learning module includes an encoder component, a decoder component, and a contrastive learning network, as shown in the following expression: in This represents the feature representation of the i-th sample from subject A within a single mini-batch. This represents the feature representation of the i-th sample from subject B within a single mini-batch. Let C represent the feature representations of the remaining j samples from a single mini-batch, where C refers to the remaining subjects in different states from subjects A and B. This indicates that the cosine similarity between the two is calculated. It is a temperature hyperparameter; The encoder component in the contrastive learning module encodes the EEG signals in clean EEG data and artificial EEG samples, maps the latent representation in the latent space, and obtains vector feature decoding. The decoder component reconstructs the vector feature decoding and extracts the latent feature vector. The contrastive learning network performs reinforcement learning on the latent feature vector, thereby outputting the learned features.

4. The image recognition system based on data augmentation and contrastive learning according to claim 3, characterized in that, The contrastive learning network within the contrastive learning module is trained using InfoNCE loss, which reflects the lower bound mutual information between potential feature vectors of different categories.

5. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that, The memory stores a computer program that can run on a processor. When the processor loads and executes the computer program, it employs an image recognition method based on data augmentation and contrastive learning as described in any one of claims 1 to 2.

Citation Information

Patent Citations

  • Three-dimensional model automatic modeling method based on text information guidance

    CN115994990A

  • Comparative incremental learning-based model training method and malicious traffic classification method and system

    CN116244645A