dataesr/scientific-paragraphs-categorization huggingface dataset:
Physionet Challenge 2018 dataset (PC18) The Physionet Challenge 2018 (PC18) dataset  [82, 83]  contains recordings from a total of 1,983 different individuals with (suspected) sleep apnea whose EEG, EOG, chin EMG, respiration airflow and oxygen saturation were monitored overnight. Bipolar EEG channels F3-M2, F4-M1, C3-M2, C4-M1, O1-M2 and O2-M1 were recorded at 200 Hz. Sleep stage annotations were obtained from 7 trained scorers following the AASM manual  [34]  (W, N1, N2, N3 and R). We focused our analysis on a subset of 994 recordings for which these annotations are publicly available. In this subset of the data, mean age is 55 years (min: 18, max: 93) and 33% of participants are female. For PC18, the EEG was first filtered using a 30 Hz FIR lowpass filter with a Hamming window to reject higher frequencies that are not critical for sleep staging  [14, 85].
Muse Sleep Dataset (MSD) We lastly tested our approach on mobile EEG data, in which channel corruption is likely to occur naturally. We used an internal dataset of overnight sleep recordings collected with the Muse S EEG headband from InteraXon Inc. (Toronto, Canada). This data was collected in accordance with the privacy policy (July 2020) users must agree to when using the Muse headband  6  and which ensures their informed consent concerning the use of EEG data for scientific research purposes. The Muse S is a four-channel dry EEG device (TP9, Fp1, Fp2, TP10, referenced to Fpz), sampled at 256 Hz. The Muse headband has been previously used for event-related potentials research  [86] , brain performance assessment  [6] , research into brain development  [87] , sleep staging  [88] , and stroke diagnosis  [89] , among others.
A total of 98 partial and complete overnight recordings (mean duration: 6. 3 h) from 67 unique users were selected from InteraXon's anonymized database of Muse customers, and annotated by a trained scorer following the AASM manual. Mean age across all recordings is 37. 9 years (min: 21, max: 74) and 45. 9% of recordings are of female users. Preprocessing of MSD data was the same as for PC18, with the following differences: (1) channels were downsampled to 128 Hz, (2) missing values (occurring when the wireless connection is weak and Bluetooth packets are lost) were replaced by linear interpolation using surrounding valid samples, (3) after filtering and downsampling, samples which overlapped with the original missing values were replaced by zeros, and (4) channels were zero-meaned window-wise.
This was done to emulate a situation where training data is mostly clean, and strong channel corruption occurs unexpectedly at test time. We performed hyperparameter selection on each of the three datasets using a cross-validation strategy on the combined training and validation sets. We repeated training on different training-validation splits (two for PC18, three for TUAB and MSD). Neural networks and random forests were trained three times per split on TUAB and MSD (two times on PC18) with different parameter initializations. Training ran for at most 40 epochs or until the validation loss stopped decreasing for a period of a least 7 epochs on TUAB and PC18 (a maximum of 150 epochs with a patience of 30 for MSD, given the smaller size of the dataset). Finally, balanced accuracy (bal acc), defined as the average per-class recall, was used to evaluate model performance on the sleep staging downstream task, while accuracy was used for pathology detection.
Evaluation under conditions of noise The impact of noise on downstream performance and on the predicted DSF filters was evaluated in three steps. First, we artificially corrupted the input EEG windows of TUAB and PC18 by using a similar process to our data augmentation strategy (Equation  4 ). We used the same values for η, σ and p, but used a single mask ν per recording, such that the set of corrupted channels remained the same across a recording. Before corrupting, we subsampled a few EEG channels to recreate the sparse montage settings of TUAB (Fp1, Fp2, T3, T4, Fz, Cz) and PC18 (F3-M2, F4-M1, O1-M2, O2-M1). We then analyzed downstream performance under varying noise level conditions. Second, we ran experiments on real corrupted data (MSD) by training our models on the cleanest recordings and evaluating their performance on the noisiest recordings.
We trained a filter-bank Riemannian geometry pipeline (blue), a random forest on handcrafted features (orange) and a standard ShallowNet architecture (green) on the TUAB dataset, given montages of 2 (T3, T4), 6 (Fp1, Fp2, T3, T4, Fz, Cz) or 21 (all available) channels. Performance was then evaluated on artificially corrupted test data under two scenarios: (A) the η noise strength parameter was varied given a constant channel corruption probability of 50%, and (B) the number of corrupted channels was varied given a constant noise strength of 1. Error bars show the standard deviation over 3 models for handcrafted features and 6 models for neural networks. While traditional feature-based models fared slightly better than a vanilla neural network in some cases (bottom right), adding noise predictably degraded the performance of all three models.
the matrix logarithm and the soft-thresholding nonlinearity (DSFm-st, in magenta) yielded marginal improvements over DSFd. Notably, under strong noise corruption (η = 1) our best performing model (DSFm-st + data augmentation) yielded an accuracy improvement of 29. 4% over the vanilla net without denoising. Overall, this suggests that learning end-to-end to both predict and handle channel corruption at the same time is key to successfully improving robustness. Next, we repeated this analysis on a sleep staging task using the PC18 dataset (Fig. 4 ). Similarly to previous results, not using a denoising strategy led to a steep decrease in performance. Once more, Autoreject leveled out differences between the different methods and boosted performance under single-channel corruption, but otherwise did not generally improve or degrade performance as compared to training models without a denoising strategy.
Data augmentation, in contrast, again helped improve the robustness of all methods. Interestingly, it benefited non-deep learning approaches more clearly than was observed in pathology detection, enabling for instance the handcrafted features to reach a similar performance to the vanilla StagerNet. DSF remained the most robust though with both DSFd and DSFm-st consistently outperforming all other methods. Notably, the performance of these two methods was highly similar, producing mostly overlapping lines in Fig. 4. Finally, do these results hold under more intricate, naturally occurring corruption such as found in at-home settings? To verify this, we trained the same sleep staging models as above on the cleanest recordings of MSD (4-channel mobile EEG), and evaluated their performance on the 17 most corrupted recordings of the dataset.
For instance, without any additional corruption, the DSF module focused most of its attention on channels T3 and T4 (Fig. 6A , first column), known to be highly relevant for pathology detection  [43, 44]. However, when channel T3 was replaced with white noise, the DSF module reduced its attention to T3 and instead further increased its attention on other channels (second column). no denoising strategy, (2) Autoreject and (3) data augmentation. We compared the test balanced accuracy on PC18 (4-channel montage) as (A) the η noise strength parameter was varied given a constant channel corruption probability of 50%, and (B) the number of corrupted channels was varied given a constant noise strength of 1. Error bars show the standard deviation over 3 models for handcrafted features and 4 models for neural networks.
Attention was also applied in the spatial dimension to allow dynamically combining information from different EEG channels  [100, 101]  or even from heterogeneous channel types  [98]. Likewise, the Squeeze-and-Excitation block  [10]  was used to provide both spatial and temporal attention in BCI classification tasks  [102]. Attention mechanisms have also been used to enable transfer learning between different datasets with possibly different montages. In  [103] , two parallel attention mechanisms allowed the neural network to focus on the channels and windows that were the most transferable when training classifiers that needed to generalize from one dataset to another. Combined with an adversarial loss, this approach improved domain adaptation performance on a cross-dataset sleep staging task.
Discussion We introduced Dynamic Spatial Filtering (DSF), a new method to handle channel corruption in EEG based on an attention mechanism architecture and a data augmentation transform. Plugged into a neural network whose input has a spatial dimension (e. g. , EEG channels), DSF predicts spatial filters that allow the model to dynamically focus on important channels and ignore corrupted ones. DSF shares links with interpolation-based methods traditionally used in EEG processing to recover bad channels, but in contrast does not require separate preprocessing steps (often expensive when many channels are available or poorly adapted when only few channels are available). DSF outperformed feature-based approaches and automated denoising pipelines under simulated corruption on two large public datasets and in two different predictive tasks.
On naturally corrupted data however, using the full spatial information along with soft-thresholding was critical to outperforming other methods (Fig. 5 ). This is likely because the naturally occuring noise in at-home recordings was often correlated spatially. In addition, corrupted channels in MSD usually arose from electronic noise that completely overpowered EEG signals (Appendix D). In this case, DSF could completely ignore these channels to get rid of noise. Related attention block architectures have used average-pooling  [10]  or a combination of average-and max-pooling  [11]  to summarize channels. Intuitively, average pooling should not result in a useful representation of input EEG channels, as EEG channels are often assumed to have zero-mean, or are explicitly highpass filtered to remove their DC offset.
Interpreting dynamic spatial filters to measure channel importance The results in Fig. 6  demonstrated that the spatial filters produced by the DSF module can be visualized to understand what spatial patterns a model has learned to focus on (Section 4. 3). As observed in our experiments, a higher φ indicates higher importance of a channel for the downstream task: for instance, temporal channels were given a higher importance in the pathology detection task, as expected from previous work on the TUAB dataset  [43, 44]. To further facilitate the quantitative interpretation of channel contribution, e. g. , in real-time settings where the user might want to monitor signal quality, a relative channel contribution metric φ rel ∈ [0, 1] could be obtained by dividing φ by its maximum across channels.
Conclusion We presented Dynamic Spatial Filtering (DSF), an attention mechanism architecture that improves robustness to channel corruption in EEG prediction tasks. Combined with a data augmentation transform, DSF outperformed other noise handling procedures under simulated and real channel corruption on three datasets. Moreover, DSF enables efficient end-to-end handling of channel corruption, works with few channels, is interpretable and does not require expensive preprocessing. We hope that our method can be a useful tool to improve the reliability of EEG processing in challenging non-traditional settings such as user-administered, at-home recordings. C in {10 2 , 10 3 , 10 4 , 10 5 }. The selected hyperparameter configurations are listed in Tables  3  and 4  for the experiments in Sections 4.
1 and 30 Hz was above -0. 5 (unitless) and its variance was above 1,000 µV 2. We then computed a single channel corruption metric per recording by computing the fraction of windowed channels which were flagged as corrupted. About two-thirds of the recordings had no channel corruption according to this metric, while the remaining had a value of up to 25% (Fig. 9 ). For our experiments on MSD, we therefore selected the 81 cleanest recordings (i. e. , with the lowest corruption fraction) for training and validation and kept the 17 noisiest recordings for testing. This procedure allowed testing whether a model trained on relatively clean data could perform well even when random channel corruption was introduced at inference time.
Acknowledgements This work was supported by  Mitacs  (project number  IT14765 ) and  InteraXon Inc. (graduate funding support) for HB and by the  BrAIN  ( ANR-19-DATA-0023 ) and  AI-cog  ( ANR-20-IADJ-0002 ) ANR grants for AG and DAE. This work was performed using HPC resources from  GENCI-IDRIS. We would like to thank the Python [110,111] community for developing many of the tools used in the making of this article: NumPy [112], SciPy [113], matplotlib [114], seaborn [115], pandas [116], scikit-learn [68], MNE-Python [64], PyTorch [65], hydra [117], pyRiemann [118] and braindecode [12].
Data and code availability statement The TUAB and PC18 datasets are openly available online 11 12. MSD recordings were collected on users of the Muse S headband according to InteraXon's privacy policy  13. According to this policy, recordings cannot be shared unless a formal data sharing agreement has been put in place with InteraXon Inc. Code used for data analysis can be found at https://github. com/hubertjb/dynamic-spatial-filtering.
NOEMA We obtained NOEMA observations of the CO J = 3 → 2 ≡ CO(3 -2) emission line ( ν rest = 345. 796 GHz) and its underlying continuum (rest wavelength ∼0. 9 mm) for four of our targets (three systems): FLS02, SWIRE5, and SWIRE7 (projects W19BV and W20GC, PI: S Garcia-Burillo). We used the C configuration of NOEMA and the observations for FLS02 took place o v er sev en nights between 2019 December 29 and 2020 February 25, with SWIRE5 being observed on 2021 March 28 and SWIRE7 on three nights between 2020 March 31 and 2020 April 4. The field of view for these targets was ≈20-21 arcsec. The data were reduced using the standard pipeline in the Grenoble Image and Line Data Analysis Software (GILDAS) 1  software package. Bad visibilities were flagged and remo v ed, and the flux, RF and amplitude/phase were calibrated using standard NOEMA calibrators.
ALMA We obtained Band 6 ALMA observations of CO(3 -2) and continuum for CDFS1 (two merging galaxies) using 43 antennas of the 12-m Array (project 2016. 1. 00896. S, PI: D Rigopoulou). The observations were taken on 2016No v ember 4, with a total on source integration time of 0. 2 h and field of view of ≈23. 5 arcsec. One spectral window was centred on the e xpected frequenc y of the CO(3 -2) line and the other three spectral windows were used to observe the underlying continuum. The data were reduced using the standard pipeline in the Common Astronomy Software Applications ( CASA ) software package  (McMullin et al. 2007  ). Bad visibilities were flagged and remo v ed and we used standard ALMA calibrators to calibrate the source. The continuum map was created by using multifrequency synthesis mode within CASA on spectral windows that did not contain the CO(3 -2) emission line.
PS19 also made moment maps and fit kinematics to SWIRE5 with the H α emission line (see fig. B6 in PS19  ). The 0th moment map of the H α line does not show a similar asymmetry in the flux map but the velocity dispersion shows similar high values in the south-east region of the galaxy. These observations were taken by the SWIFT telescope and due to the seeing limitations (the seeing FWHM for SWIRE5 was 2. 7 arcsec), it does not provide higher spatial resolution data compared to our NOEMA observations. This disturbance may be an unresolved region of clumpy star formation caused by disc instabilities (e. g. Behrendt, Schartmann & Burkert 2019 )  or another possibility is that we are seeing interacting galaxies hiding behind each other and appearing as one, such as that potentially observed in optical images of a lowz system in Mazzilli  Ciraulo et al.
The Joint ALMA Observatory is operated by ESO, A UI/NRA O, and NA OJ. This work is based on observations carried out under project number W19BV and W20GC with the IRAM NOEMA Interferometer. IRAM is supported by INSU/CNRS (France), MPG (Germany), and IGN (Spain). DR and IGB acknowledge support from STFC through grant ST/S000488/1. NT acknowledges support from STFC through grants ST/N002717/1 and ST/S001409/1. MPS acknowledges support from the Comunidad de Madrid through Atracci ón de Talento Investigador Grant 2018-T1/TIC-11035. SGB and AAH acknowledge support from research grant PGC2018-094671-B-I00 (MCIU/AEI/FEDER,UE).
Introduction Many scientists work to understand data that is inherently three-dimensional, such as in physics and biology. They explore such data traditionally as projections on 2D screens, with an inherently limited depth perception. As the availability of immersive devices increases, however, hybrid or fully stereoscopic data exploration and analysis become possible. We explore the use of augmented reality headmounted displays (AR-HMDs) as the basis of such an approach, and ask about how best to interact in this space. We notably focus on the interactive selection of data points based on their 3D spatial properties. Such spatial selection-a fundamental exploratory tool  [Tuk77, KI13] -is essential for users to specify regions of interest (ROIs) in unstructured datasets as they often cannot be isolated by filtering some properties.
While such interaction has been studied in the past, most research focused on 2D rendering as opposed to immersive means [BYK * 21]. We investigate the use of AR-HMDs as they integrate interaction, visualization, and the users' physical 3D spaces, and as their immersive displays are suitable for 3D data visualization [FCL09, KMLM16, HRD * 19]. Standalone AR-HMDs (e. g. , Microsoft's HoloLens) are now also powerful enough for real-time 3D rendering. This environment being new, many research questions remain regarding how to explore large scientific datasets and how AR-based exploration tools differ from past setups. An essential point to consider is that AR-HMDs cannot rely on the same input as PCs. Researchers have proposed to explore speech input, eye tracking, and mid-air gestures for AR-HMDs, yet this input is often limited.
Moreover, not all datasets possess suitable physical properties. We are thus interested in general techniques that work for every type of datasets (i. e. , point clouds [Ste12, CZY * 20], volumes  [WVFH12] , and vector fields [JLS * 13]). We also cannot only rely on predefined geometries, e. g. , boxes [UZW * 07], as we want a flexible, data-independent way to specify ROIs. Moreover, we are interested in better understanding the users' mental models in AR environments, compared to non-immersive ones, for 6 DoF interaction techniques that make use of a tangible tablet. We thus rely on Tangible Brush [BSA * 19], on whose tablet interface a user draws a lasso in an orthographic view and extrudes it in virtual 3D space by moving the tablet. The orthographic view may lead to lower cognitive loads and higher accuracy as both its interactive and its visualization spaces are in 2D [BSB * 18, BIRW19], while perspective views would not allow users to understand how the lasso shape relates to the objects in the scene.
AR Concept and Differences to Tangible Brush In our AR version we replace the external 2D screen with an AR-HMD stereoscopic view. Users can then use their physical tablet superimposed with its virtual counterpart. We define three mappings for the actual realization of our AR Tangible Brush (see Fig. 1 ). In all three cases users need to set the virtual camera of the tablet (still using an orthographic projection), before actually drawing the lasso. This allows users to relate their lasso-to-be-extruded with the dataset. We freeze the 2D orthographic view on the tablet for a given position, allowing users to draw their lasso on a static view for precise input  [LODI16]. We describe next our three AR mappings. Naïve Approach (NA): As a Naïve Approach (NA), we map the position, orientation, and size of the tablet from the physical space to their virtual counterparts.
These reasons led us to create a virtual selection tablet, different in size, position, and orientation to its physical counterpart, and to use relative motions. We propose two types of relative motions as we discuss next. Relative-Aligned (RA) and Relative-Full (RF): For RA and RF, the user first initializes the virtual tablet within the 3D visualization space using NA. They then move the physical tablet and observe the motions of the virtual tablet in the visualization space, to either start an extrusion or to replace the virtual tablet from afar. Those mappings are then suitable for remote interactions on datasets that require large overviews. For RF, similar to the original implementation, we use a clutched interaction so that the tablet's actual orientation may differ from its virtual alignment.
Experimental Verification We conducted two controlled experiments. In the first we determined the "best" AR mapping from the three we introduced in Sect. A, and in the second we compare that to the original Tangible Brush. We make all gathered data available online along their respective pre-registrations (details below). We did not pre-register the criteria for selecting the AR mapping of the second experiment because they depended on the results from the first. We recruited 18 participants per experiment. Each participant performed only one of the two experiments to avoid learning effects. We reused the Galaxies and the Cylinder datasets from Besançon et al. 's study [BSA * 19] (Fig. 3(b)-(c) ). As all their datasets rely on extruded shapes along an axis, we added a helical Spring as a third dataset (Fig.
Implementation Our system (github. com/MickaelSereno/SciVis_Server/ tree/CHI2020) comprises four devices: an AR-HMD Microsoft HoloLens 2 (Fig. 4 ), a Samsung Galaxy Tab S4 tablet (Fig. 5 ) which we track with a VICON, and a server. Users can move and rotate the datasets, which we placed at a fixed position, on the tablet via FI3D [YSI * 10]. While Tangible Brush works for any 3D data, we used point clouds in our study to measure the accuracy of the techniques we compare. We give more details of our implementation in Appendix B as, in this paper, we focus on our two experiments. When users start a selection, we show a yellow outline to represent the virtual tablet in the AR view, and an orthographic projection of the data as seen from its virtual position on the tablet. The nearclipping plane is placed at z = 0 within the tablet camera's space.
To not influence our study with the differences of the screen quality of AR-HMDs compared to large 2D screens, we simulate the original technique inside the AR-HMD using a 1. 22 m × 0. 68 m virtual screen. We adapted the original technique as follows to make it more comparable with our AR implementations, and to accommodate the AR-HMD setup: (i) we added the FI3D widgets to move/rotate datasets, (ii) we set the bird-of-view position to ease users with translations which do not rely on tangible movements anymore, (iii) we added the 3D wireframe volumes for users to (in)validate, (iv) we added tangible rotation to adjust the 3D scene at any step of the extrusion as rotations are strong depth cues, and (v) we allowed users to scale the tablet's view.