audrey06100 commited on
Commit
e0bb4b6
·
1 Parent(s): cac86c3
Files changed (1) hide show
  1. app.py +1 -45
app.py CHANGED
@@ -53,50 +53,6 @@ icunet = """
53
  Electroencephalography (EEG) signals are often contaminated with artifacts. It is imperative to develop a practical and reliable artifact removal method to prevent the misinterpretation of neural signals and the underperformance of brain–computer interfaces. Based on the U-Net architecture, we developed a new artifact removal model, IC-U-Net, for removing pervasive EEG artifacts and reconstructing brain signals. IC-U-Net was trained using mixtures of brain and non-brain components decomposed by independent component analysis. It uses an ensemble of loss functions to model complex signal fluctuations in EEG recordings. The effectiveness of the proposed method in recovering brain activities and removing various artifacts (e.g., eye blinks/movements, muscle activities, and line/channel noise) was demonstrated in a simulation study and four real-world EEG experiments. IC-U-Net can reconstruct a multi-channel EEG signal and is applicable to most artifact types, offering a promising end-to-end solution for automatically removing artifacts from EEG recordings. It also meets the increasing need to image natural brain dynamics in a mobile setting.
54
  """
55
 
56
- chk_html = """
57
- <form name="test" id="chs-form">
58
- <input type="checkbox" />
59
- </form>
60
- """
61
-
62
- chk_script = """
63
-
64
- let channels = document.getElementById("chs-checkbox");
65
-
66
- // init generate checkboxgroup
67
- let obj = document.getElementById("map-result").value; // emmm......
68
- let channels = obj.channels;
69
- let num = channels.length;
70
-
71
- for(i=0; i<num; i++){
72
- document.getElementById("gen-checkbox").
73
- innerHTML += '<input type="checkbox" class="channels" name="channel" value=channels[i].name />'
74
- }
75
-
76
- // check if mapping just finished
77
- const result = document.getElementById("map-result")
78
- result.addEventListener("change", function() {
79
- const res_obj = this.value;
80
-
81
- if(res_obj.fill_mode=="mean" && res_obj.missing_channels.length!=0 && !res_obj.start){
82
- gen_chkbox(res_obj.missing_channels);
83
- res_obj.start = True;
84
- }
85
- })
86
-
87
- function gen_chkbox(channels){
88
- let num = channels.length;
89
- let chs_form = document.getElementById("chs-form");
90
-
91
- chs_form.innerHTML = "";
92
- for(i=0; i<num; i++){
93
- chs_form.innerHTML += '<input type="checkbox" class="channels" name="channel" value=channels[i].name />'
94
- }
95
- }
96
-
97
-
98
- """
99
-
100
  with gr.Blocks() as demo:
101
 
102
  state_json = gr.JSON(elem_id="state", visible=False)
@@ -384,4 +340,4 @@ with gr.Blocks() as demo:
384
 
385
 
386
  if __name__ == "__main__":
387
- demo.launch(server_name="0.0.0.0", server_port=7860, share=True)
 
53
  Electroencephalography (EEG) signals are often contaminated with artifacts. It is imperative to develop a practical and reliable artifact removal method to prevent the misinterpretation of neural signals and the underperformance of brain–computer interfaces. Based on the U-Net architecture, we developed a new artifact removal model, IC-U-Net, for removing pervasive EEG artifacts and reconstructing brain signals. IC-U-Net was trained using mixtures of brain and non-brain components decomposed by independent component analysis. It uses an ensemble of loss functions to model complex signal fluctuations in EEG recordings. The effectiveness of the proposed method in recovering brain activities and removing various artifacts (e.g., eye blinks/movements, muscle activities, and line/channel noise) was demonstrated in a simulation study and four real-world EEG experiments. IC-U-Net can reconstruct a multi-channel EEG signal and is applicable to most artifact types, offering a promising end-to-end solution for automatically removing artifacts from EEG recordings. It also meets the increasing need to image natural brain dynamics in a mobile setting.
54
  """
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  with gr.Blocks() as demo:
57
 
58
  state_json = gr.JSON(elem_id="state", visible=False)
 
340
 
341
 
342
  if __name__ == "__main__":
343
+ demo.launch()