dataesr/scientific-paragraphs-categorization huggingface dataset:
Later, aberrant data can be interpolated before computing the final robust estimation of the average reference based on clean data. Adaptive thresholds present another crucial advantage; they do not have to be customized to each population or testing procedure (i. e. , age group, resting-state, or active task), providing and standard procedure to all datasets. Since the amplitude and properties of the signal radically change during development, and between-subjects variability is considerable, using adaptive thresholds is an essential feature for infant EEG. The detection of artifacts in continuous data rather than in segmented epochs also has its advantages. First, the properties of the EEG recording and the threshold for the different artifacts can be better estimated. Second, some transient artifacts that may lead to the rejection of the epoch can be corrected, facilitating the recovery of more data.
Third, it provides more flexibility, enabling performing multiple types of analysis using a common preprocessing pipeline. All the algorithms used in APICE compute a measure for each sample or in a sliding time window. Then, the algorithms reject the data when the measure is above or/and below a threshold. While all our functions allow using absolute thresholds, we advise using relative thresholds. Relative thresholds are determined based on the distribution of the measure throughout the entire recording. More precisely, a threshold is computed as, Thresh = Q 3 + k × (Q 3 -Q 1 ), and/or Thresh = Q 1 -k × (Q 3 -Q 1 ) , where Q 1 and Q 3 are the first and third quartiles of the distribution. k should be provided as an input (by default 3). Because the measures used by the algorithms usually have a normal distribution, this threshold definition successfully identifies extreme values (i.
It is important to highlight that while the reconstruction of non-functional channels is a common practice that can simplify the between-subjects analysis, the signal is estimated as a weighted sum of the good electrodes. Thus, it does not add new information, and the dataset becomes rank deficient. In our practice, we apply the artifacts correction as follows. First, we correct transient artifacts using target PCA. Second, we spatially interpolate channels not working during a certain period. We restrict this interpolation to good times, i. e. , samples with less than 30% of the channels tagged as bad. The underlying assumption is that when too many channels are affected by an artifact at a given time, the spatial interpolation is ineffective. Finally, we interpolate channels rejected during the whole recording (i.
Preprocessing report Within the EEGLAB structure, we register a report containing the size of the data, the amount of rejected data, and the amount of interpolated data after each data processing step. More specifically, we retain the number of channels, samples, epochs, the number of rejected and interpolated points, and the number of bad times, bad channels, and bad epochs. We also provide a function that prints a table in the command window and a text file to summarize these measures. The information is collected for all subjects at critical points during the pipeline. Specifically, it summarizes the rejection percentages before data epoching, before the rejection of bad epochs, and at the final stage. This summary information should enable evaluating the pipeline's performance and detect possible problems in some participants.
, 2020)  for automatic IC removal. While APICE can be used to preprocess data that might be used in its continuous form, we decided to validate it using ERPs for several reasons. First, ERPs remain the most frequent method to study infant cognition. Second, data quality measures have been described for ERPs  (Luck et al. , 2021). Third, data quality measures for ERPs should be valid for any other type of analysis based on stimuli evoked responses (e. g. , decoding, fast periodic stimulation). To have a more robust validation, we analyzed two very distinct datasets. Significant changes occur in the EEG features during infant development  (Eisermann et al. , 2013; Marshall et al. , 2002; Nelson and Monk, 2001) , and the level of contamination by motion artifacts can vary considerably according to infants' age, vigilance, and the type of task.
Therefore, we decided to use two datasets differing in infants' age and vigilance, stimulation modality, and type of task. The first dataset corresponds to an auditory experiment in sleeping neonates, and the task consisted of passive listening to syllables. Motion artifacts were thus minimally contaminating the data. The second experiment corresponded to a visual task where 5-month-old infants looked at a sequence of images on the screen. The infants were awake and actively engaged in the task, resulting in strong motion artifacts in the data.
Dataset 1: neonates dataset The neonate' dataset corresponds to an auditory experiment. During each trial, infants heard 4 or 5 syllables lasting 250 ms presented every 600 ms. 216 trials were presented to each infant. Scalp electrophysiological activity was recorded using a 128-electrode net (Electrical Geodesics, Inc. ) referred to the vertex with a sampling frequency of 250 Hz. Neonates were tested in a soundproof booth while sleeping or during quiet rest. Participants were 24 (11 males), healthy-full-term neonates, with normal pregnancy and birth (gestational age > 38 weeks of gestation, Apgar score ≥ 7/8 at 1 and 5 min, and cranial perimeter ≥ 33. 0 cm). All participants were tested at the Port Royal Maternity (AP-HP) in Paris, France. Parents provided informed consent.
Dataset 2: 5-month-old dataset The 5-month-old infants' dataset was a study investigating their capacity to associate two sets of images. During each trial, an attention grabber appeared on the center of the screen for 0. 6 s, followed by a first A. Fló et al. image lasting 1 s, a second image lasting 1. 2 s, and the attention grabber again during other 1. 0-1. 2 s. The experiment lasted until the infants were fussy (80-140 trials per participant). Scalp electrophysiological activity was recorded using a 128-electrode net (Electrical Geodesics, Inc. ) referred to the vertex with a sampling frequency of 500 Hz. Infants were tested in a soundproof shielded booth while sitting in their parents' lap. Participants were 26 (12 males), 22. 98-weeks-old infants  (SD 1. 41, min 20. 86, max 27). All participants were tested at NeuroSpin, in Gif/ Yvette, France.
MADE pipeline We implemented the MADE pipeline  (Debnath et al. , 2020)  using the codes available at https://github. com/ChildDevLab/MADE-EEG-pre processing-pipeline. In the MADE pipeline, the data is first filtered. Afterward, not working channels are identified using FASTER  (Nolan et al. , 2010). Then ICA is performed on a copy of the data high-passed filtered at 1 Hz. Before applying ICA, the data is epoched in one-second non-overlapping epochs, and electrodes and epochs containing artifacts are removed. After ICA decomposition, components associated with artifacts are automatically removed using adjusting-ADJUST  (Leach et al. , 2020). Then, data is segmented and baseline corrected. Epochs containing residual ocular artifacts (high amplitude on predefined frontal channels) are removed.
If any remaining channels show high amplitude activity, they are reconstructed using spherical spline interpolation. Epochs with too many interpolated channels are rejected. Here we filter the data between 0. 2 Hz and 40 Hz. To detect residual ocular artifacts and non-functional channels, the authors recommend an amplitude threshold of 150 μV for infant data. However, this value rejected almost all the data for most of the subjects of Dataset 2 (5month-old infants). We, therefore, increased it to 500 μV to Dataset 2. In the MADE pipeline, a limit of 10% of interpolated channels is used to reject epochs. We increased this value to 30% because otherwise, the rejection was very high (even when higher amplitude thresholds were used). Moreover, 30% is the limit used by APICE to define bad times; thus, the two pipelines become easy to compare.
Pipelines evaluation To control for systematic biases introduced by the different preprocessing approaches, we report the grand average responses and statistically compare them. To compare the pipeline's performance in terms of data quality, we report two metrics: (1) the proportion of retained epochs and (2) the SME  (Luck et al. , 2021). The proportion of retained epochs was computed as the number of epochs after rejection divided by the number of epochs before rejection. The SME was computed for the average response over a region of interest and time window corresponding to the auditory (Dataset 1) or visual ERPs (Dataset 2) using bootstrap. First, we randomly sampled with replacement N responses for each subject, where N is the number of retained epochs. Then, we computed the mean in time and space.
We repeated the process 1000 times, and the standard deviation of the measure across all iterations corresponded to the SME for each subject ERP  (Luck et al. , 2021). Higher SMEs denote nosier data and smaller SMEs cleaner data. The SME for Dataset 1 was computed over central electrodes in the time window 250-350 ms (Fig. 5 ), which corresponds to the auditory response  (Dehaene-Lambertz and Pena, 2001). The SME for Dataset 2 was computed over occipital electrodes in the time window 550-650 ms (Fig. 5 ), which corresponds to the P400 visual ERP (de Haan and  Nelson, 1999). We used a time window centered at the peak of the ERP of the same length for both datasets; however, a change in the time window length does not affect the pattern of results. We statistically compared the two metrics across the different preprocessing approaches.
APICE rejection level Before comparing the SME and the percentage of retained epochs with varying thresholds, it is worth noticing that, as expected, the level of artifact contamination in the two datasets was considerably different. By using APICE(3) the average percentage of data tagged as bad in Dataset 1 was 4. 19% (SD 3. 84%, min 0. 19%, max 12. 92%), and in Dataset 2 12. 19% (SD 8. 79%, min 1. 88%, max 30. 40%). Regarding the amount of bad times, it was for Dataset 1 6. 44% (SD 5. 46%, min 0. 29%, max 18. 30%), and for Dataset 2 17. 06% (SD 11. 93%, min 1. 93%, max 43. 93%). These results illustrate the differences in terms of artifacts contamination between datasets. The tables summarizing the rejection obtained from the continuous preprocessed data are presented in Appendix E. We ran two 1-way-ANOVAs to test the effect of three artifactrejection levels in APICE (2, 3, and 4) on the SME and the percentage of retained epochs.
For Dataset 1, on the SME, we observed a main effect of threshold (F(2,46) = 34. 83; p = 6. 16 × 10 -10 ; η 2 p = 0. 60; η 2 G = 0. 11). Pairwise comparisons, Bonferroni corrected, showed that the SME was lower in APICE(2) than in APICE(4) (p = 7. 8 × 10 -6 , d = 0. 82) and APICE(3) (p = 3. 0 × 10 -5 , d = 0. 46), and in APICE(3) than in APICE(4) (p = 7. 2 ×10 -5 , d = 0. 40) (Fig. 6A ). The effect of threshold on the amount of retained data was also significant (F(2,46) = 69. 31; p < 1. 3 × 10 -14 ; η 2 p = 0. 75; η 2 G = 0. 34). Pairwise comparisons, Bonferroni corrected, showed that, as expected, more epochs were retained in APICE(4) than APICE(2) (p = 4. 7 × 10 -8 , d = 1. 59) and APICE(3) (p = 3. 8 × 10 -7 , d = 0. 68), and in APICE(3) than APICE(2) (p = 7. 9 × 10 -8 , d = 1. 01) (Fig.
6B ). For Dataset 2, the threshold level 2 rejected all epochs for two subjects; thus, the SME could not be estimated, resulting in a smaller n. The effect of threshold on the SME was marginally significant (F(2,48) = 3. 19, p = 0. 05; η 2 p = 0. 12; η 2 G = 0. 01). Pairwise comparisons, Bonferroni corrected, showed no significant difference between APICE(2), and APICE(3) (p > 0. 1, d = 0. 12) and APICE(4) (p > 0. 1, d = 0. 25), and a significant difference between APICE(4) and APICE (3) (p = 0. 01, d = 0. 17) (Fig. 6C ). The effect of threshold on the amount of retained epochs was significant (F(2,50) = 48. 68; p = 1. 84 × 10 -12 ; η 2 p = 0. 66; η 2 G = 0. 25). Pairwise comparisons, Bonferroni corrected, showed that the proportion of epochs retained was larger in APICE(4) than APICE(2) (p = 6.
APICE modifications We evaluated the effect of interpolating localized artifacts by comparing our two metrics on the full and reduced pipelines, APICE vs. APICEa (Fig. 7 ). For both Datasets, APICE was better than APICEa. In Dataset 1, the SME was marginally lower in APICE (t(23) = -2. 11; p = 0. 046; mean of the difference -0. 011; d = 0. 09); and more data was retained after APICE (t(23) = 6. 038; p = 3. 7 × 10 -6 ; mean of the difference 3. 84%; d = 0. 50). In dataset 2, the SME was lower with APICE (t(25) = -3. 1488; p = 0. 0042; mean of the difference -0. 22; d = 0. 18), and more data retained after APICE (t(25) = 6. 12; p = 2. 12 × 10 -6 ; mean of the difference 4. 84%; d = 0. 28). To evaluate the effect of the two supplementary cleaning methods, ICA and DSS, we compared them with APICE.
The ICA step applied on Dataset 1 removed on average 11. 9% of the components (SD 8. 37%, min 0%, max 30%) and 0. 57% of the total variance (SD 0. 46%, min 0%, max 2. 09%). On Dataset 2, it removed on average 48. 3% of the components (SD 17. 18%, min 12%, max 75%) and 2. 89% of the total variance (SD 1. 71%, min 0. 07%, max 7. 30%). The DSS filter on Dataset 1 removed 13. 18% of the total variance (SD 4. 13%, min 6. 51%, max 23. 11%). On Dataset 2, it removed 33. 46% of the total variance (SD 5. 31%, min 19. 48%, max 44. 43%). ICA and DSS slightly improve the validation metrics on specific datasets. In Dataset 1, the SME did not differ between APICE and APICE + W-ICA (p > 0. 1; d = 0. 03), and the amount of retained epochs was slightly higher for APICE than APICE + W-ICA (t(23) = 2. 58; p = 0.
017, mean of the difference 0. 17%; d = 0. 02), denoting that ICA did not improved data quality. In Dataset 2, APICE resulted in a slightly higher SME than APICE + W-ICA (t(25) = 3. 55; p = 0. 0016; mean of the difference 0. 14; d = 0. 12), and there was not significant difference in the amount of retained epochs (p > 0. 1; d = 0. 03), which means a modest increase in data quality. On dataset 1, a slightly higher SME was observed for APICE than APICE+DSS (t(23) = 2. 86; p = 0. 0090; mean of the difference 0. 013; d = 0. 10). On dataset 2, the SME did not significantly differ when APICE and APICE + DSS were applied (p > 0. 1; d = 0. 04). Note that the percentage of retained epochs is not affected since the DSS is applied after bad epochs are removed.
APICE compared to other pipelines For Dataset 1, we compared the results obtained with MADE using the threshold for artifact rejection suggested by the authors for infant data (150 μV)  (Debnath et al. , 2020). For Dataset 2, since too much data was rejected using this threshold, we tested different thresholds and used the one providing the best performance. Figs. S4 and S5 show how the SME and percentage of retained epochs for MADE vary for different thresholds. To compare the performances of APICE, STD, and MADE pipelines, we run two 1-way-ANOVAs on the SME and the percentage of retained epochs. On dataset 1, there was a main effect of pipeline on the SME (F (2,46) = 28. 66; p = 8. 28 × 10 -9 ; η 2 p = 0. 55; η 2 G = 0. 24). Pairwise comparisons, Bonferroni corrected, showed that the SME was lower in APICE(3) than in STD (p = 1.
4 × 10 -5 ; d = 1. 15) and in MADE than in STD (p = 9. 9 × 10 -5 ; d = 1. 06), while there was no significant difference between APICE(3) and MADE (p > 0. 1; d = 0. 06). The main effect of the pipeline was also significant for the percentage of retained epochs (F(2,46) = 46. 22; p = 9. 89 × 10 -12 ; η 2 p = 0. 67; η 2 G = 0. 50). Pairwise comparisons, Bonferroni corrected, showed more retained epochs for STD than APICE (p = 5. 1 × 10 -7 ; d = 1. 76), and MADE (p = 1. 7 × 10 -7 ; d = 2. 17), and more retained epochs for APICE than MADE (p = 0. 00011; d = 1. 17). On dataset 2, on the SME, we observed a main effect of pipeline (F.
Discussion We tested the effect of the rejection level used for artifacts detection, the validity of the different steps composing APICE, and its performance relative to other available pipelines on two different infant datasets. We evaluated the pipelines by the stability and reproducibility of the obtained ERPs as measured by the SME, a procedure proposed by  Luck et al. (2021)  to quantify ERP quality. This procedure computes the subject ERP through multiple random draws of the epochs and examines the distribution of the ERP values across draws. When the averaging process is successful at neutralizing unwanted "noise," that is, if no unexpected large-amplitude non-evoked activity remains in the preprocessed data, the values of the SME are low. Further, we examined the number of kept epochs, crucial for complex paradigms where pertinent conditions comprise only a few trials.
, 2018). For the IC automatic classification, we used iMARA  (Haresign et al. , 2021) , a recent modification of MARA  (Winkler et al. , 2011) , adapted to infant data. Finally, the activity separated as non-neural was removed from the original data. For dataset 1 (neonates), ICA did not produce any improvement: the SME did not change, and it slightly reduced the number of retained epochs. For dataset 2 (5-month-old), ICA decreased the SME, but the size of the improvement was small, indicating that the obtained noise reduction was consistent across infants but meager in magnitude. The average number of components and the total variance removed was much bigger for dataset 2 than 1 (percentage of removed components: 48. 3% vs. 11. 9%; total variance: 2. 89% vs. 0. 57%). The difference in the number of removed components, together with the no change between APICE and APICE+W-ICA in terms of SME for dataset 1, suggest that the ICA less successfully identifies physiological artifacts in neonates' data.
The boxplot shows the median, 25 and 75 percentiles, and the whiskers 1. results suggest that this improvement might be less substantial in younger populations. Given the high computational cost of applying ICA and the risk of removing neural activity, we recommend evaluating the cost/benefit of implementing this routine on a case-by-case basis. For example, for sleeping neonates for whom physiological artifacts as ocular movements are less prominent, and the ICA algorithms seem to be less efficient at separating them, its use does not seem to be justified. Instead, for older infants involved in an active task, ICA might improve data quality by removing physiological artifacts that otherwise remain in the data. The application of DSS on the retained epochs led to a similar outcome: a statistically significant but minimal reduction of the SME, specifically in Dataset 1 (neonates).
APICE compared to other pipelines Results show that the APICE(3) pipeline outperformed the STD and MADE pipelines (Fig. 8 ). While the STD pipeline retained more epochs than APICE(3) for Dataset 1 (an auditory experiment in sleeping neonates), this was at the cost of a much higher SME. If a greater number of epochs is a priori an advantage to recover the ERP through the average process, this is no longer the case when it implies a decrease in data quality. The neonates were tested asleep, which means that the recording was only mildly contaminated by motion and that the EEG amplitude was low; thus, high-amplitude artifacts exceeding the absolute thresholds used in the standard pipeline were rare. The implementation of algorithms based on various signal features makes APICE more sensitive to outlier signals.
In Dataset 2 (a visual experiment in awake 5-month-old infants), where the contamination by motion artifacts was substantial, APICE(3) retained more data and yielded a smaller SME than STD. APICE(3) also outperformed MADE for both datasets. For Dataset 1, the SME was comparable between pipelines, but APICE retained a much higher number of epochs than MADE. For Dataset 2, APICE(3)'s performance was better in terms of both SME and epochs retention. The retention of more trials and smaller SMEs achieved by APICE than other pipelines entails smaller ERP errors, implying more statistical power  (Luck et al. , 2021). It is worth noticing that we needed to adjust the MADE rejection threshold in Dataset 2 to achieve a reasonable performance (Fig. S5 ). In APICE, thresholds are based on the distribution of the voltage values in each subject (and electrode), thereby ensuring optimal sensitivity across subjects and datasets and making APICE robust across different populations without main adjustments.
Pipelines for which the artifacts' detection relies on fixed thresholds need to be adjusted for each population, a costly and time-consuming process if it has to be done each time a dataset has to be analyzed. Moreover, even if the thresholds are adjusted, their performance remains poorer because differences in signal amplitude also exist between testing systems and subjects (e. g. , due to differences in resistance). One could argue that also APICE requires the experimenter to set an overall rejection level at the beginning of the analysis. However, the results across the two tested datasets suggest that the effects of the rejection level are considerably stable across different populations. Moreover, APICE outperformed STD and MADE irrespective of the particular choice at hand (see Figs.
Additionally, APICE includes functions for renaming events, correcting their timing, organizing epochs by condition, and computing the average ERP. APICE is freely available at https://github. com/neuroki dslab/eeg_preprocessing, with example scripts illustrating its application. APICE is currently limited to MATLAB. However, we are currently working on  (Savalle, 2022)  transferring it to Python and integrating it into MNE  (Gramfort et al. , 2013).
Acknowledgments This research has received funding from the  European Research Council (ERC)  under the European Union's  Horizon 2020 research and innovation program  (Grant agreement no. 695710 ). We thank the families that participated in the studies. We would also like to thank  Marie Palu  and  Chanel Valera  for their help in recruiting and testing the infants and the entire  Neurokids group at Neurospin  for their feedbacks.
( 2 ,Fig. 5. 25 Fig. 5. Grand average ERPs obtained using APICE with a threshold for artifact rejection of 3. (A) Central electrodes (in red) considered for dataset 1. (B) Grand average ERP for the electrodes of interest for dataset 1. The peaks after the dotted lines (syllables' onset) correspond to the auditory ERP following each syllable. The shaded area shows the time windows where the SME was computed (250-350 ms, peak of the auditory response to the last syllable of the epoch). (C) Occipital electrodes (in red) considered for dataset 2. (D) Grand average ERP for the electrodes of interest for dataset 2. The first two dotted lines indicate the onset of two images, and the third dotted line the appearance of the attention grabber. P1 and P400 are visible after the onset of the images, followed by the visual response to the attention grabber.
In this case, we know that facet F = conv(V \ {v k }) contains all minima according to Proposition 2. If the objective is zero, there is no facet containing all the minima, i. e. there is no δ k = 1, but there is a monotone direction d. Example 6. Following our example in Fig. 3  with S = conv{v 0 , v 1 , v 2 } the MIP (9) finds the positive objective function value 1 for n i=1 z i , stating that the facet corresponding to δ 2 = 1 provides a positive directional derivative for d = v 2v 0. Notice, that this direction is not the maximum directional derivative, but still positive, which is the main question. Interestingly, solving the LP-s and MIP-s in Matlab, the necessary time for this example was counter-intuitive: LP (6) 0. 521, LP (7) 0. 033, while MIP (9) 0. 048 s. We investigated whether the counter-intuitive result of a smaller solution time for the MIP than for the LP is a general trend.