Table of Contents
Method overview
Experiment and Analysis
Home Technology peripherals AI The picture in your brain can now be restored in high definition

The picture in your brain can now be restored in high definition

Jul 06, 2023 pm 07:17 PM
ai creativity

In recent years, great progress has been made in the field of image generation, especially in text-to-image generation: as long as we use text to describe our thoughts, AI can generate novel and realistic images.

But in fact we can go one step further - the step of converting the thoughts in the mind into text can be omitted and controlled directly through brain activity (such as EEG (electroencephalogram) recording) Generative creation of images.

This "thinking-to-image" generation method has broad application prospects. For example, it can greatly improve the efficiency of artistic creation and help people capture fleeting inspiration; it may also be possible to visualize people's dreams at night; it may even be used in psychotherapy to help autistic children and language disorders patient.

Recently, researchers from Tsinghua University Shenzhen International Graduate School, Tencent AI Lab and Pengcheng Laboratory jointly published a research paper on "Thinking to Image", using pre- The powerful generation capabilities of trained text-to-image models (such as Stable Diffusion) generate high-quality images directly from EEG signals.

The picture in your brain can now be restored in high definitionPicture

Paper address: https://arxiv.org/pdf/2306.16934.pdf

Project address: https://github.com/bbaaii/DreamDiffusion

Method overview

Some recent related research (e.g. MinD-Vis) attempts to reconstruct visual information based on fMRI (functional magnetic resonance imaging signals). They have demonstrated the feasibility of using brain activity to reconstruct high-quality results. However, these methods are still far from the ideal use of brain signals for fast and efficient creation. This is mainly due to two reasons:

First, fMRI equipment is not portable and requires It is operated by professionals, so it is difficult to capture fMRI signals;

Secondly, the cost of fMRI data collection is high, which will greatly hinder the use of this method in actual artistic creation. .

In contrast, EEG is a non-invasive, low-cost method of recording brain electrical activity, and there are now portable commercial products on the market that can obtain EEG signals.

However, there are still two main challenges in realizing the generation of "thoughts to images":

1) EEG signals are generated through non-invasive methods to capture, so it is noisy in nature. In addition, EEG data are limited and individual differences cannot be ignored. So, how to obtain effective and robust semantic representations from EEG signals under so many constraints?

2) Text and image spaces in Stable Diffusion are well aligned due to the use of CLIP and training on a large number of text-image pairs. However, EEG signals have their own characteristics and their space is quite different from text and images. How to align EEG, text and image spaces on limited and noisy EEG - image pairs?

To address the first challenge, this study proposes to use large amounts of EEG data to train EEG representations instead of only rare EEG image pairs. This study uses a masked signal modeling method to predict missing tokens based on contextual clues.

Different from MAE and MinD-Vis, which treat the input as a two-dimensional image and mask spatial information, this study considers the temporal characteristics of the EEG signal and digs deeper into the temporal changes in the human brain semantics. This study randomly blocked a portion of tokens and then reconstructed these blocked tokens in the time domain. In this way, the pre-trained encoder is able to develop a deep understanding of EEG data from different individuals and different brain activities.

For the second challenge, previous solutions usually fine-tune the Stable Diffusion model directly, using a small number of noisy data pairs for training. However, it is difficult to learn accurate alignment between brain signals (e.g., EEG and fMRI) and text space by only fine-tuning SD end-to-end with the final image reconstruction loss. Therefore, the research team proposed using additional CLIP supervision to help achieve alignment of EEG, text, and image spaces.

Specifically, SD itself uses CLIP’s text encoder to generate text embeddings, which is very different from the masked pre-trained EEG embeddings of the previous stage. Leverage CLIP's image encoder to extract rich image embeddings that are well aligned with CLIP's text embeddings. These CLIP image embeddings were then used to further refine the EEG embedding representation. Therefore, the improved EEG feature embeddings can be well aligned with CLIP's image and text embeddings and are more suitable for SD image generation, thereby improving the quality of the generated images.

Based on the above two carefully designed solutions, this study proposes a new method DreamDiffusion. DreamDiffusion generates high-quality and realistic images from electroencephalogram (EEG) signals.

The picture in your brain can now be restored in high definitionPicture

Specifically, DreamDiffusion mainly consists of three parts:

1) Mask signal pre-training to achieve effective and robust EEG encoder;

2) Use pre-trained Stable Diffusion and limited EEG image pairs for fine-tuning;

3) Use the CLIP encoder to align EEG, text and image spaces.

First, the researchers used EEG data with a lot of noise, used mask signal modeling, trained the EEG encoder, and extracted contextual knowledge. The resulting EEG encoder is then used to provide conditional features for Stable Diffusion via a cross-attention mechanism.

The picture in your brain can now be restored in high definitionPicture

#In order to enhance the compatibility of EEG features with Stable Diffusion, the researchers further reduced the EEG embedding in the fine-tuning process The distance from CLIP image embeddings further aligns the embedding spaces of EEG, text and images.

Experiment and Analysis

Comparison with Brain2Image

Researchers Compare this article's method with Brain2Image. Brain2Image uses traditional generative models, namely variational autoencoders (VAEs) and generative adversarial networks (GANs), for conversion from EEG to images. However, Brain2Image only provides results for a few categories and does not provide a reference implementation.

With this in mind, this study performed a qualitative comparison of several categories presented in the Brain2Image paper (i.e., airplanes, jack-o-lanterns, and pandas). To ensure a fair comparison, the researchers used the same evaluation strategy as described in the Brain2Image paper and show the results generated by the different methods in Figure 5 below.

The first row of the figure below shows the results generated by Brain2Image, and the last row is generated by DreamDiffusion, the method proposed by the researchers. It can be seen that the image quality generated by DreamDiffusion is significantly higher than that generated by Brain2Image, which also verifies the effectiveness of this method.

The picture in your brain can now be restored in high definitionPicture

Ablation experiment

The role of pre-training: In order to prove the effectiveness of large-scale EEG data pre-training, this study used untrained encoders to train multiple models for verification. One of the models was identical to the full model, while the other model had only two EEG coding layers to avoid overfitting the data. During the training process, the two models were trained with/without CLIP supervision, and the results are shown in columns 1 to 4 of the Model in Table 1. It can be seen that the accuracy of the model without pre-training is reduced.

The picture in your brain can now be restored in high definition

mask ratio: This article also studies the use of EEG data to determine the best MSM pre-training Mask ratio. As shown in columns 5 to 7 of the Model in Table 1, a mask ratio that is too high or too low can adversely affect model performance. The highest overall accuracy is achieved when the mask ratio is 0.75. This finding is crucial because it suggests that, unlike natural language processing, which typically uses low mask ratios, high mask ratios are a better choice when performing MSM on EEG.

CLIP Alignment: One of the keys to this approach is the alignment of the EEG representation to the image via a CLIP encoder. This study conducted experiments to verify the effectiveness of this method, and the results are shown in Table 1. It can be observed that the performance of the model drops significantly when CLIP supervision is not used. In fact, as shown in the lower right corner of Figure 6, using CLIP to align EEG features can still yield reasonable results even without pre-training, which highlights the importance of CLIP supervision in this method.

The picture in your brain can now be restored in high definitionpicture

The above is the detailed content of The picture in your brain can now be restored in high definition. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to implement file sorting by debian readdir How to implement file sorting by debian readdir Apr 13, 2025 am 09:06 AM

In Debian systems, the readdir function is used to read directory contents, but the order in which it returns is not predefined. To sort files in a directory, you need to read all files first, and then sort them using the qsort function. The following code demonstrates how to sort directory files using readdir and qsort in Debian system: #include#include#include#include#include//Custom comparison function, used for qsortintcompare(constvoid*a,constvoid*b){returnstrcmp(*(

How to optimize the performance of debian readdir How to optimize the performance of debian readdir Apr 13, 2025 am 08:48 AM

In Debian systems, readdir system calls are used to read directory contents. If its performance is not good, try the following optimization strategy: Simplify the number of directory files: Split large directories into multiple small directories as much as possible, reducing the number of items processed per readdir call. Enable directory content caching: build a cache mechanism, update the cache regularly or when directory content changes, and reduce frequent calls to readdir. Memory caches (such as Memcached or Redis) or local caches (such as files or databases) can be considered. Adopt efficient data structure: If you implement directory traversal by yourself, select more efficient data structures (such as hash tables instead of linear search) to store and access directory information

How debian readdir integrates with other tools How debian readdir integrates with other tools Apr 13, 2025 am 09:42 AM

The readdir function in the Debian system is a system call used to read directory contents and is often used in C programming. This article will explain how to integrate readdir with other tools to enhance its functionality. Method 1: Combining C language program and pipeline First, write a C program to call the readdir function and output the result: #include#include#include#includeintmain(intargc,char*argv[]){DIR*dir;structdirent*entry;if(argc!=2){

How to learn Debian syslog How to learn Debian syslog Apr 13, 2025 am 11:51 AM

This guide will guide you to learn how to use Syslog in Debian systems. Syslog is a key service in Linux systems for logging system and application log messages. It helps administrators monitor and analyze system activity to quickly identify and resolve problems. 1. Basic knowledge of Syslog The core functions of Syslog include: centrally collecting and managing log messages; supporting multiple log output formats and target locations (such as files or networks); providing real-time log viewing and filtering functions. 2. Install and configure Syslog (using Rsyslog) The Debian system uses Rsyslog by default. You can install it with the following command: sudoaptupdatesud

How to set the Debian Apache log level How to set the Debian Apache log level Apr 13, 2025 am 08:33 AM

This article describes how to adjust the logging level of the ApacheWeb server in the Debian system. By modifying the configuration file, you can control the verbose level of log information recorded by Apache. Method 1: Modify the main configuration file to locate the configuration file: The configuration file of Apache2.x is usually located in the /etc/apache2/ directory. The file name may be apache2.conf or httpd.conf, depending on your installation method. Edit configuration file: Open configuration file with root permissions using a text editor (such as nano): sudonano/etc/apache2/apache2.conf

Debian mail server firewall configuration tips Debian mail server firewall configuration tips Apr 13, 2025 am 11:42 AM

Configuring a Debian mail server's firewall is an important step in ensuring server security. The following are several commonly used firewall configuration methods, including the use of iptables and firewalld. Use iptables to configure firewall to install iptables (if not already installed): sudoapt-getupdatesudoapt-getinstalliptablesView current iptables rules: sudoiptables-L configuration

How to configure firewall rules for Debian syslog How to configure firewall rules for Debian syslog Apr 13, 2025 am 06:51 AM

This article describes how to configure firewall rules using iptables or ufw in Debian systems and use Syslog to record firewall activities. Method 1: Use iptablesiptables is a powerful command line firewall tool in Debian system. View existing rules: Use the following command to view the current iptables rules: sudoiptables-L-n-v allows specific IP access: For example, allow IP address 192.168.1.100 to access port 80: sudoiptables-AINPUT-ptcp--dport80-s192.16

How Debian OpenSSL prevents man-in-the-middle attacks How Debian OpenSSL prevents man-in-the-middle attacks Apr 13, 2025 am 10:30 AM

In Debian systems, OpenSSL is an important library for encryption, decryption and certificate management. To prevent a man-in-the-middle attack (MITM), the following measures can be taken: Use HTTPS: Ensure that all network requests use the HTTPS protocol instead of HTTP. HTTPS uses TLS (Transport Layer Security Protocol) to encrypt communication data to ensure that the data is not stolen or tampered during transmission. Verify server certificate: Manually verify the server certificate on the client to ensure it is trustworthy. The server can be manually verified through the delegate method of URLSession

See all articles