Long-term independent use of an intracortical brain-computer interface for speech and cursor control.
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Jupyter notebook · 516 lines · 20 KB · no license
- # %%
- import pickle
- import numpy as np
- import os
- import pandas as pd
- import datetime
- import re
- from scipy.ndimage import gaussian_filter1d
- import matplotlib.pyplot as plt
- from matplotlib import rcParams
- from tqdm.notebook import tqdm
- sigma=4
- # 1. Configure Matplotlib for optimal vector graphic output
- rcParams.update({
- 'pdf.fonttype': 42, # Use TrueType fonts in PDF
- 'ps.fonttype': 42, # Use TrueType fonts in PS
- 'svg.fonttype': 'none', # Keep text as text in SVG
- 'font.size': 12, # Set a default font size
- 'axes.labelsize': 12, # Font size for axis labels
- 'xtick.labelsize': 10, # Font size for x-axis tick labels
- 'ytick.labelsize': 10, # Font size for y-axis tick labels
- 'legend.fontsize': 10, # Font size for legends
- 'figure.autolayout': True, # Automatically adjust subplot params
- })
- dat_info_path = 'data/dat_info.csv'
- personal_use_data_path = 'data/personal_use_data.csv'
- usage_by_session_data_path = 'data/usage_by_session_data.csv'
- dat_info = pd.read_csv(dat_info_path)
- personal_use_data = pd.read_csv(personal_use_data_path)
- usage_by_session_data = pd.read_csv(usage_by_session_data_path)
- # %% [markdown]
- # ## cumulative hours of use over time
- # %%
- plt.figure(figsize=(8, 4))
- plt.plot(usage_by_session_data['post_implant_day'], np.cumsum(usage_by_session_data['usage_hours']), linestyle='-')
- plt.xlabel('Post-Implant Day')
- plt.ylabel('Cumulative Usage Duration (hours)')
- plt.title(f'Cumulative Usage Duration Over Time: {usage_by_session_data["usage_hours"].sum():.1f} hours total')
- plt.grid(alpha=0.3)
- plt.gca().spines['top'].set_visible(False)
- plt.gca().spines['right'].set_visible(False)
- plt.ylim(0, 4000)
- plt.show()
- # %% [markdown]
- # # words per minute by post-implant day
- # %%
- dat_info
- # %%
- unique_post_implant_days = list(set(dat_info['post_implant_day']))
- unique_post_implant_days.sort()
- num_words_by_day = []
- speaking_time_s_by_day = []
- # calculate aggregate words per minute for each day, only including logs where speaking duration > 0.3s and num words > 3
- for day in unique_post_implant_days:
- day_idx_logs = np.where(dat_info['post_implant_day'] == day)[0]
- all_valid_num_words = []
- all_valid_speaking_time_s = []
- all_valid_wpm = []
- for i in day_idx_logs:
- if (
- dat_info['speaking_duration_s'][i] > 0.3
- and dat_info['num_words'][i] > 3
- ):
- all_valid_num_words.append(dat_info['num_words'][i])
- all_valid_speaking_time_s.append(dat_info['speaking_duration_s'][i])
- all_valid_num_words = np.array(all_valid_num_words)
- all_valid_speaking_time_s = np.array(all_valid_speaking_time_s)
- num_words_by_day.append(np.array(all_valid_num_words))
- speaking_time_s_by_day.append(np.array(all_valid_speaking_time_s))
- # calculate 95% confidence intervals for each day via boostrap resampling
- n_resamples = 10000
- wpm_mean_by_day = []
- wpm_ci_by_day = []
- from tqdm.notebook import tqdm
- pbar = tqdm(total=len(num_words_by_day), desc='Calculating WPM confidence intervals')
- for i in range(len(num_words_by_day)):
- resampled_wpm = np.zeros([n_resamples,])
- for n in range(n_resamples):
- resample_idx = np.random.randint(0, num_words_by_day[i].shape[0], [speaking_time_s_by_day[i].shape[0]])
- resampled_wpm[n] = np.sum(num_words_by_day[i][resample_idx]) / (np.sum(speaking_time_s_by_day[i][resample_idx]) / 60)
- wpmCI = np.percentile(resampled_wpm, [2.5, 97.5])
- wpm_mean_by_day.append(np.sum(num_words_by_day[i]) / (np.sum(speaking_time_s_by_day[i]) / 60))
- wpm_ci_by_day.append(wpmCI)
- pbar.update(1)
- pbar.close()
- # %%
- # moving average of mean WPM by day
- plt.figure(figsize=(10, 5))
- plt.plot(unique_post_implant_days, wpm_mean_by_day, '.', color='lightblue', alpha=0.5)
- plt.plot(unique_post_implant_days, wpm_mean_by_day, '-', color='lightblue', alpha=0.35)
- for i in range(len(unique_post_implant_days)):
- plt.plot([unique_post_implant_days[i], unique_post_implant_days[i]], [wpm_ci_by_day[i][0], wpm_ci_by_day[i][1]], color='lightblue', linewidth=0.4)
- plt.plot(unique_post_implant_days, gaussian_filter1d(wpm_mean_by_day, sigma=sigma), color='blue', linewidth=2)
- plt.xlabel('Post-implant Day')
- plt.ylabel('Words Per Minute (WPM)')
- plt.title('Words Per Minute (WPM) Over Time')
- plt.grid(axis='y', alpha=0.3)
- plt.ylim([0,100])
- plt.gca().spines['top'].set_visible(False)
- plt.gca().spines['right'].set_visible(False)
- plt.tight_layout()
- plt.show()
- # %% [markdown]
- # # speech decoding performance over time plots
- # %%
- unique_post_implant_days = list(set(dat_info['post_implant_day']))
- unique_post_implant_days.sort()
- correct_counts = []
- correct_with_correction_counts = []
- incorrect_counts = []
- one_word_wrong_counts = []
- mostly_correct_counts = []
- false_positive_counts = []
- no_response_counts = []
- blank_counts = []
- skipped_counts = []
- total_counts = []
- sentence_lengths = []
- syllables_per_word = []
- sentence_lengths_spelling_mode = []
- trials_per_day = []
- for day in unique_post_implant_days:
- day_idx_logs = np.where(personal_use_data['post_implant_day'] == day)[0]
- correct_counts.append(0)
- correct_with_correction_counts.append(0)
- incorrect_counts.append(0)
- one_word_wrong_counts.append(0)
- mostly_correct_counts.append(0)
- false_positive_counts.append(0)
- no_response_counts.append(0)
- blank_counts.append(0)
- skipped_counts.append(0)
- for idx in day_idx_logs:
- if personal_use_data['sentence_correctness_rating'][idx] == 'correct':
- correct_counts[-1] += 1
- elif personal_use_data['sentence_correctness_rating'][idx] == 'correct with correction':
- correct_with_correction_counts[-1] += 1
- elif personal_use_data['sentence_correctness_rating'][idx] == 'incorrect':
- incorrect_counts[-1] += 1
- elif personal_use_data['sentence_correctness_rating'][idx] == 'one word wrong':
- one_word_wrong_counts[-1] += 1
- elif personal_use_data['sentence_correctness_rating'][idx] == 'mostly correct':
- mostly_correct_counts[-1] += 1
- elif personal_use_data['sentence_correctness_rating'][idx] == 'no response':
- no_response_counts[-1] += 1
- elif personal_use_data['sentence_correctness_rating'][idx] == 'blank':
- blank_counts[-1] += 1
- elif personal_use_data['sentence_correctness_rating'][idx] == 'skipped':
- skipped_counts[-1] += 1
- elif personal_use_data['sentence_correctness_rating'][idx] == 'false positive':
- false_positive_counts[-1] += 1
- total_counts.append(correct_counts[-1] + correct_with_correction_counts[-1] + incorrect_counts[-1] + one_word_wrong_counts[-1] + mostly_correct_counts[-1])
- sentence_length = 0
- num_sentences = 0
- num_syllables = 0
- perplexity = 0
- correct_sentences = 0
- sentence_length_spelling_mode = 0
- num_sentences_spelling_mode = 0
- for idx in day_idx_logs:
- # skip if sentence correctness rating is blank, no response, or skipped
- if personal_use_data['sentence_correctness_rating'][idx] in ['skipped', 'no response', 'blank']:
- continue
- # check if this is a spelling mode trial
- if not personal_use_data['spelling_mode'][idx]:
- # not a spelling mode trial
- sentence_length += personal_use_data['num_words'][idx]
- num_sentences += 1
- else:
- # this is a spelling mode trial
- sentence_length_spelling_mode += personal_use_data['num_words'][idx]
- num_sentences_spelling_mode += 1
- sentence_lengths.append(sentence_length / num_sentences if num_sentences > 0 else 0)
- sentence_lengths_spelling_mode.append(sentence_length_spelling_mode / num_sentences_spelling_mode if num_sentences_spelling_mode > 0 else 0)
- trials_per_day.append(len(day_idx_logs))
- correct_counts = np.array(correct_counts)
- correct_with_correction_counts = np.array(correct_with_correction_counts)
- incorrect_counts = np.array(incorrect_counts)
- one_word_wrong_counts = np.array(one_word_wrong_counts)
- mostly_correct_counts = np.array(mostly_correct_counts)
- no_response_counts = np.array(no_response_counts)
- blank_counts = np.array(blank_counts)
- skipped_counts = np.array(skipped_counts)
- total_counts = np.array(total_counts)
- sentence_lengths = np.array(sentence_lengths)
- sentence_lengths_spelling_mode = np.array(sentence_lengths_spelling_mode)
- syllables_per_word = np.array(syllables_per_word)
- trials_per_day = np.array(trials_per_day)
- hours_per_day = np.array(usage_by_session_data['usage_hours'])
- correct_perc = 100 * correct_counts / total_counts
- correct_perc_with_correction_perc = 100 * correct_with_correction_counts / total_counts
- one_word_wrong_perc = 100 * one_word_wrong_counts / total_counts
- mostly_correct_perc = 100 * mostly_correct_counts / total_counts
- incorrect_perc = 100 * incorrect_counts / total_counts
- # %%
- np.array(unique_post_implant_days)[~np.isnan(correct_perc)]
- # %%
- fig = plt.figure(figsize=(7, 7))
- plt.subplot2grid((6, 1), (0, 0), rowspan=2)
- plt.plot(
- np.array(unique_post_implant_days)[~np.isnan(correct_perc)],
- correct_perc[~np.isnan(correct_perc)],
- '.', color='green', alpha=0.1, markeredgecolor='none',
- )
- plt.plot(
- np.array(unique_post_implant_days)[~np.isnan(correct_perc_with_correction_perc)],
- correct_perc_with_correction_perc[~np.isnan(correct_perc_with_correction_perc)],
- '.', color='mediumseagreen', alpha=0.1, markeredgecolor='none',
- )
- plt.plot(
- np.array(unique_post_implant_days)[~np.isnan(one_word_wrong_perc + mostly_correct_perc)],
- (one_word_wrong_perc + mostly_correct_perc)[~np.isnan(one_word_wrong_perc + mostly_correct_perc)],
- '.', color='xkcd:tangerine', alpha=0.1, markeredgecolor='none',
- )
- plt.plot(
- np.array(unique_post_implant_days)[~np.isnan(incorrect_perc)],
- incorrect_perc[~np.isnan(incorrect_perc)],
- '.', color='xkcd:scarlet', alpha=0.1, markeredgecolor='none',
- )
- plt.plot(
- np.array(unique_post_implant_days)[~np.isnan(correct_perc)],
- gaussian_filter1d(correct_perc[~np.isnan(correct_perc)], sigma=sigma),
- '-', label='correct w/o correction', color='green',
- )
- plt.plot(
- np.array(unique_post_implant_days)[~np.isnan(correct_perc_with_correction_perc)],
- gaussian_filter1d(correct_perc_with_correction_perc[~np.isnan(correct_perc_with_correction_perc)], sigma=sigma),
- '-', label='correct after correction', color='mediumseagreen',
- )
- plt.plot(
- np.array(unique_post_implant_days)[~np.isnan(one_word_wrong_perc + mostly_correct_perc)],
- gaussian_filter1d((one_word_wrong_perc + mostly_correct_perc)[~np.isnan(one_word_wrong_perc + mostly_correct_perc)], sigma=sigma),
- '-', label='mostly correct', color='xkcd:tangerine',
- )
- plt.plot(
- np.array(unique_post_implant_days)[~np.isnan(incorrect_perc)],
- gaussian_filter1d(incorrect_perc[~np.isnan(incorrect_perc)], sigma=sigma),
- '-', label='incorrect', color='xkcd:scarlet',
- )
- plt.legend(ncols=2, fontsize=7)
- plt.ylim([0, 100])
- plt.grid(axis='y', alpha=0.3)
- plt.gca().spines['top'].set_visible(False)
- plt.gca().spines['right'].set_visible(False)
- plt.ylabel('Percentage of trials', fontsize=8)
- xlimits = plt.xlim()
- plt.xlim([xlimits[0], xlimits[1]])
- plt.xticks([100,200,300,400,500,600,700], labels=['', '', '', '', '', '', ''])
- # wpm
- plt.subplot2grid((6, 1), (2, 0), rowspan=1)
- plt.plot(unique_post_implant_days, wpm_mean_by_day, '.', color='lightblue', alpha=0.4, markeredgecolor='none')
- plt.plot(unique_post_implant_days, gaussian_filter1d(wpm_mean_by_day, sigma=sigma), '-', color='blue')
- plt.ylabel('Words / minute', fontsize=8)
- plt.grid(axis='y', alpha=0.3)
- plt.gca().spines['top'].set_visible(False)
- plt.gca().spines['right'].set_visible(False)
- plt.ylim([25,75])
- plt.yticks([25,50,75])
- plt.xlim([xlimits[0], xlimits[1]])
- plt.xticks([100,200,300,400,500,600,700], labels=['', '', '', '', '', '', ''])
- # sentence length
- plt.subplot2grid((6, 1), (3, 0), rowspan=1)
- plt.plot(np.array(unique_post_implant_days)[sentence_lengths>0], sentence_lengths[sentence_lengths>0], '.', color='lightblue', alpha=0.4, markeredgecolor='none')
- plt.plot(np.array(unique_post_implant_days)[sentence_lengths>0], gaussian_filter1d(sentence_lengths[sentence_lengths>0], sigma=sigma), '-', label='regular', color=(0/255, 0/255, 200/255))
- plt.grid(axis='y', alpha=0.3)
- plt.gca().spines['top'].set_visible(False)
- plt.gca().spines['right'].set_visible(False)
- plt.ylabel('Words / sentence', fontsize=8)
- plt.ylim([0, 25])
- plt.yticks([0, 10, 20])
- plt.xlim([xlimits[0], xlimits[1]])
- plt.xticks([100,200,300,400,500,600,700], labels=['', '', '', '', '', '', ''])
- plt.subplot2grid((6, 1), (4, 0), rowspan=1)
- plt.plot(unique_post_implant_days, trials_per_day, '.', color='lightgray', alpha=0.4, markeredgecolor='none')
- plt.plot(unique_post_implant_days, gaussian_filter1d(trials_per_day, sigma=sigma), '-', color=(100/255, 100/255, 100/255))
- plt.grid(axis='y', alpha=0.3)
- plt.gca().spines['top'].set_visible(False)
- plt.gca().spines['right'].set_visible(False)
- plt.yticks([0,500,1000])
- plt.ylabel('Sentences / day', fontsize=8)
- plt.xlim([xlimits[0], xlimits[1]])
- plt.xticks([100,200,300,400,500,600,700], labels=['', '', '', '', '', '', ''])
- plt.subplot2grid((6, 1), (5, 0), rowspan=1)
- plt.plot(unique_post_implant_days, hours_per_day, '.', color='lightgray', alpha=0.4, markeredgecolor='none')
- plt.plot(unique_post_implant_days, gaussian_filter1d(hours_per_day, sigma=sigma), '-', color=(100/255, 100/255, 100/255))
- plt.grid(axis='y', alpha=0.3)
- plt.gca().spines['top'].set_visible(False)
- plt.gca().spines['right'].set_visible(False)
- plt.yticks([0,10,20])
- plt.ylabel('Hours / day', fontsize=8)
- plt.xlabel('Days since implant', fontsize=12)
- plt.xlim([xlimits[0], xlimits[1]])
- plt.tight_layout()
- fig.align_labels()
- plt.show()
- # %%
- # pie chart
- labels = [
- f'Correct: {correct_counts.sum():,}',
- f'Correct with correction: {correct_with_correction_counts.sum():,}',
- f'Mostly correct: {one_word_wrong_counts.sum() + mostly_correct_counts.sum():,}',
- f'Incorrect: {incorrect_counts.sum():,}',
- ]
- sizes = [
- correct_counts.sum(),
- correct_with_correction_counts.sum(),
- one_word_wrong_counts.sum() + mostly_correct_counts.sum(),
- incorrect_counts.sum(),
- ]
- colors = [
- 'green',
- 'lightgreen',
- 'xkcd:tangerine',
- 'lightcoral',
- ]
- fig, ax = plt.subplots()
- ax.pie(sizes, labels=labels, colors=colors,
- autopct='%1.1f%%', shadow=False, startangle=90)
- ax.axis('equal')
- plt.title(f'Personal use sentence correctness ratings\nTotal sentences: {np.sum(sizes):,}')
- plt.tight_layout()
- plt.show()
- # %% [markdown]
- # # accuracy statistics
- # %%
- start_idx = unique_post_implant_days.index(412)
- from scipy.stats import ranksums
- # compare correct_perc before and after start_idx
- before = correct_perc[~np.isnan(correct_perc)][:start_idx]
- after = correct_perc[~np.isnan(correct_perc)][start_idx:]
- stat, p_value = ranksums(before, after)
- print(f'Rank sum test of % correct before and after post-implant day {unique_post_implant_days[start_idx]}: statistic={stat:.4f}, p-value={p_value:.8f}')
- # plot histogram of correct_perc before and after start_idx
- plt.figure(figsize=(10, 5))
- plt.subplot(1, 2, 1)
- plt.hist(before, range=(0,100), bins=25, alpha=0.5, label='Before', color='blue')
- plt.hist(after, range=(0,100), bins=25, alpha=0.5, label='After', color='orange')
- plt.xlabel('Correct Percentage')
- plt.ylabel('Frequency')
- plt.title(f'Correct Percentage Histogram\nBefore and After {unique_post_implant_days[start_idx]} Days')
- plt.legend()
- plt.subplot(1, 2, 2)
- plt.boxplot([before, after], tick_labels=['Before', 'After'])
- plt.ylabel('Correct Percentage')
- plt.title(f'Correct Percentage Boxplot\nBefore and After {unique_post_implant_days[start_idx]} Days')
- plt.ylim(0,100)
- plt.grid(axis='y', alpha=0.3)
- plt.tight_layout()
- plt.show()
- # compare sentence lengths before and after start_idx
- before = sentence_lengths[sentence_lengths>0][:start_idx]
- after = sentence_lengths[sentence_lengths>0][start_idx:]
- stat, p_value = ranksums(before, after)
- print(f'Rank sum test of sentence lengths before and after post-implant day {unique_post_implant_days[start_idx]}: statistic={stat:.4f}, p-value={p_value:.8f}')
- # %% [markdown]
- # # sentence correctness vs sentence length
- # %%
- # sentence correctness rating vs length
- num_word_ranges = [
- (1, 2),
- (2, 3),
- (3, 4),
- (4, 5),
- (5, 6),
- (6, 7),
- (7, 8),
- (8, 9),
- (9, 10),
- (10, 15),
- (15, 20),
- (20, 25),
- (25, 30),
- (30, 35),
- (35, 40),
- (40, 45),
- (45, 50),
- (50, 75),
- (75, 100),
- (100, 1000),
- ]
- correctness_by_num_words = {}
- for i in range(len(personal_use_data['num_words'])):
- num_words = personal_use_data['num_words'][i]
- correctness = personal_use_data['sentence_correctness_rating'][i]
- if correctness in ['skipped', 'no response', 'blank', 'false positive']:
- continue
- if num_words == 0:
- continue
- for r in num_word_ranges:
- if num_words >= r[0] and num_words < r[1]:
- if r not in correctness_by_num_words:
- correctness_by_num_words[r] = {
- 'correct': 0,
- 'correct with correction': 0,
- 'one word wrong': 0,
- 'mostly correct': 0,
- 'incorrect': 0,
- }
- correctness_by_num_words[r][correctness] += 1
- break
- # convert to percentages
- totals = []
- for r in correctness_by_num_words:
- total = sum(correctness_by_num_words[r].values())
- totals.append(total)
- for correctness in correctness_by_num_words[r]:
- correctness_by_num_words[r][correctness] = 100 * correctness_by_num_words[r][correctness] / total
- # plot
- fig = plt.figure(figsize=(8, 5))
- plt.subplot2grid((3, 1), (0, 0), rowspan=2)
- colors = ['green', 'mediumseagreen', 'xkcd:dirty yellow', 'xkcd:tangerine', 'xkcd:scarlet']
- for c, correctness in enumerate(['correct', 'correct with correction', 'one word wrong', 'mostly correct', 'incorrect']):
- x = []
- y = []
- for i, r in enumerate(num_word_ranges):
- if r in correctness_by_num_words:
- x.append(i)
- y.append(correctness_by_num_words[r][correctness])
- plt.plot(x, y, '.-', label=correctness, color=colors[c], alpha=0.6)
- plt.ylabel('Percentage of\nsentences')
- plt.title('Sentence correctness rating vs length')
- plt.legend()
- plt.grid(axis='y', alpha=0.2)
- plt.gca().spines['top'].set_visible(False)
- plt.gca().spines['right'].set_visible(False)
- plt.ylim([0, 100])
- xlimits = plt.xlim()
- plt.xticks([])
- plt.yticks(horizontalalignment='right', rotation=0)
- plt.subplot2grid((3, 1), (2, 0), rowspan=1)
- plt.semilogy(range(len(num_word_ranges)), totals, '.-', color='gray')
- plt.xlabel('Number of words in sentence')
- plt.xlim(xlimits)
- plt.ylim([10, 1e5])
- plt.yticks([10, 1000, 100000], horizontalalignment='right', rotation=0)
- plt.xticks(range(len(num_word_ranges)), [f'{r[0]}-{r[1]-1}' if (r[1]-r[0]) > 1 else f'{r[0]}' for r in num_word_ranges], rotation=90, verticalalignment='top')
- plt.ylabel('Number of\nsentences')
- plt.grid(axis='y', alpha=0.2)
- plt.gca().spines['top'].set_visible(False)
- plt.gca().spines['right'].set_visible(False)
- plt.tight_layout()
- fig.align_labels()
- plt.show()
- # %% [markdown]
- # # other general stats
- # %%
- print(f'Total decoded words: {personal_use_data["num_words"].sum():,}')
- print(f'Total decoded sentences: {len(personal_use_data["num_words"]):,}')
- print(f'Words per sentence: {personal_use_data["num_words"].sum() / len(personal_use_data["num_words"]):0.2f}')
- print(f'Total hours of BCI usage: {usage_by_session_data["usage_hours"].sum():0.2f}')
- print(f'Total speech hours: {dat_info["speaking_duration_s"].sum() / 60 / 60:0.2f}')
- print(f'Total number of sessions: {len(usage_by_session_data["post_implant_day"])} spanning {usage_by_session_data["post_implant_day"].min()} to {usage_by_session_data["post_implant_day"].max()} days post-implant')
- print(f'Avg hours per day: {np.mean(hours_per_day):0.2f} (median: {np.median(hours_per_day):0.2f})')
- print(f'Max hours per day: {np.max(hours_per_day):0.2f}')
speech_decoding_plots.ipynb at commit 22d5931, no license · at the source
Overview
- Department of Neurological Surgery, University of California, Davis, Davis, CA USA
- Department of Neurology and Neurosurgery, University Medical Center Utrecht Brain Center, Utrecht University, Utrecht, the Netherlands
- School of Engineering and Carney Institute for Brain Science, Brown University, Providence, RI USA
- VA Center for Neurorestoration and Neurotechnology, Rehabilitation Research Development and Translation Service, Department of Veterans Affairs, Providence, RI USA
- Department of Neurology, Massachusetts General Hospital, Boston, MA USA
Abstract
Brain–computer interfaces (BCIs) can provide naturalistic communication and digital access to people with severe paralysis by decoding neural activity associated with attempted speech and movement. Recent work has demonstrated highly accurate intracortical BCIs for speech and cursor control, but two critical capabilities needed for practical viability were unmet: independent at-home operation without researcher assistance and reliable long-term performance supporting accurate speech and cursor decoding. Here we demonstrate the independent and near-daily use of a multimodal BCI with novel brain-to-text speech and computer cursor decoders by a man with paralysis and severe dysarthria due to amyotrophic lateral sclerosis. Over nearly 2 years, the participant used the BCI for more than 3,800 h at home with no researchers present to maintain rich interpersonal communication with his family and friends, independently control his personal computer and sustain full-time employment—despite being paralyzed. He communicated 183,060 sentences—totaling 1,960,163 words—at an average rate of 56 words per minute. He labeled 92% of sentences as being decoded at least mostly correctly. In formal quantifications of performance where he was asked to say words presented on a screen, attempted speech was consistently decoded with more than 99% word accuracy (125,000 word vocabulary). The participant also used the speech BCI as keyboard input and the cursor BCI as mouse input to control his personal computer, enabling him to send text messages and emails and to browse the internet. These results demonstrate that intracortical BCIs have the potential to support independent use in the home, marking a critical step toward practical assistive technology for people with severe motor impairment.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above.
Neuroprosthetics-Lab/NatMed_independent_personal_use
22d593152ff45f569a168c90bbdea3f2d8d0e181, 1 April 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
2 files
- speech_decoding_plots.ip
ynb , Jupyter, 516 lines - README.md, Text, 2 lines
Code availability
Code to reproduce the figures and statistical results in this manuscript are available via GitHub at https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 1 script, each with its path and the digest of its content;
- no match between paragraphs and code yet;
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data Availability Statement
Neural data and speech decoding transcripts recorded during the participant’s independent use of the BCI system cannot be shared to preserve the participant’s privacy. Data to reproduce the figures and statistical results in this manuscript are available via GitHub at https://
Code to reproduce the figures and statistical results in this manuscript are available via GitHub at https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 2, 28 September 2026
- Publisher: n/a → Nature Portfolio
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 11 authors, 3 keywords, 8 MeSH terms, 10 funders, 33 references.
Cite
This paper
Card, N. S., Singer-Clark, T., Peracha, H., Iacobacci, C., Hou, X., Wairagkar, M., Fogg, Z., Offenberg, E. C., Hochberg, L. R., Stavisky, S. D., & Brandman, D. M. (2026). Long-term independent use of an intracortical brain-computer interface for speech and cursor control. Nature medicine, 32(7), 2504-2510. https://
BibTeX
@article{card2026long,
author = {Card, Nicholas S and Singer-Clark, Tyler and Peracha, Hamza and Iacobacci, Carrina and Hou, Xianda and Wairagkar, Maitreyee and Fogg, Zachery and Offenberg, Elena C and Hochberg, Leigh R and Stavisky, Sergey D and Brandman, David M},
title = {{Long-term independent use of an intracortical brain-computer interface for speech and cursor control}},
journal = {Nature medicine},
year = {2026},
month = jun,
volume = {32},
number = {7},
pages = {2504--2510},
publisher = {Nature Portfolio},
issn = {1078-8956},
doi = {10.1038/
url = {https://
pmid = {42297978},
pmcid = {PMC13375540}
}
RIS
TY - JOUR
AU - Card, Nicholas S
AU - Singer-Clark, Tyler
AU - Peracha, Hamza
AU - Iacobacci, Carrina
AU - Hou, Xianda
AU - Wairagkar, Maitreyee
AU - Fogg, Zachery
AU - Offenberg, Elena C
AU - Hochberg, Leigh R
AU - Stavisky, Sergey D
AU - Brandman, David M
TI - Long-term independent use of an intracortical brain-computer interface for speech and cursor control
T2 - Nature medicine
J2 - Nat Med
PY - 2026
DA - 2026/
VL - 32
IS - 7
SP - 2504
EP - 2510
SN - 1078-8956
PB - Nature Portfolio
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Long-term independent use of an intracortical brain-computer interface for speech and cursor control",
"container-title": "Nature medicine",
"author": [
{
"family": "Card",
"given": "Nicholas S"
},
{
"family": "Singer-Clark",
"given": "Tyler"
},
{
"family": "Peracha",
"given": "Hamza"
},
{
"family": "Iacobacci",
"given": "Carrina"
},
{
"family": "Hou",
"given": "Xianda"
},
{
"family": "Wairagkar",
"given": "Maitreyee"
},
{
"family": "Fogg",
"given": "Zachery"
},
{
"family": "Offenberg",
"given": "Elena C"
},
{
"family": "Hochberg",
"given": "Leigh R"
},
{
"family": "Stavisky",
"given": "Sergey D"
},
{
"family": "Brandman",
"given": "David M"
}
],
"container-title-short":
"volume": "32",
"issue": "7",
"page": "2504-2510",
"DOI": "10.1038/
"PMID": "42297978",
"PMCID": "PMC13375540",
"ISSN": "1078-8956",
"publisher": "Nature Portfolio",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
15
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1088/1741-2552/add0e5
- Speech motor cortex enables BCI cursor control and click.Journal: Journal of neural engineeringIn common: other condition, 17 references, 6 authors
- [2] doi:10.1038/s41467-026-71284-4 [code]
- Encoding of speech modes and loudness in ventral precentral gyrus.Journal: Nature communicationsIn common: pandas, SciPy, Matplotlib, 1 other tool, cognitive, 8 references, 6 authors
- [3] doi:10.1088/1741-2552/ad3b3a [code]
- BRAND: a platform for closed-loop experiments with deep network models.Journal: Journal of neural engineeringIn common: NumPy, 7 references, 5 authors
- [4] doi:10.1038/s41586-026-10653-x [code]
- A mosaic of whole-body representations on the human precentral gyrus.Journal: NatureIn common: SciPy, Matplotlib, NumPy, other condition, 5 references, 5 authors
- [5] doi:10.1016/j.cell.2025.06.015
- Inner speech in motor cortex and implications for speech neuroprostheses.Journal: CellIn common: 11 references, 3 authors
- [6] doi:10.1016/j.celrep.2026.117162 [code]
- Decoding intended speech with an intracortical brain-computer interface in a person with long-standing anarthria and locked-in syndrome.Journal: Cell reportsIn common: pandas, SciPy, Matplotlib, 1 other tool, cognitive, other condition, 14 references, author Leigh R Hochberg
- [7] doi:10.1088/1741-2552/ad88a4 [code]
- Reducing power requirements for high-accuracy decoding in iBCIs.Journal: Journal of neural engineeringIn common: pandas, SciPy, Matplotlib, 1 other tool, 13 references, author Leigh R Hochberg
- [8] doi:10.1038/s42003-024-06784-4 [code]
- Measuring instability in chronic human intracortical neural recordings towards stable, long-term brain-computer interfaces.Journal: Communications biologyIn common: 12 references, author Leigh R Hochberg
- [9] doi:10.1038/s41591-024-03341-8 [code]
- A high-performance brain-computer interface for finger decoding and quadcopter game control in an individual with paralysis.Journal: Nature medicineIn common: SciPy, Matplotlib, NumPy, other condition, 9 references, author Leigh R Hochberg
- [10] doi:10.1038/s41598-024-51617-3 [code]
- Brain control of bimanual movement enabled by recurrent neural networks.Journal: Scientific reportsIn common: SciPy, NumPy, 9 references, author Leigh R Hochberg
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 1 script, and 0 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:bc88fe025ff19c56…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1038/s41591-026-04414-6)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41591-026-04414-6.svg
:target: https://openscicode.org/badge/doi/10.1038/s41591-026-04414-6
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41591-026-04414-6"><img src="https://openscicode.org/badge/doi/10.1038/s41591-026-04414-6.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
