dataesr/scientific-paragraphs-categorization huggingface dataset:
This work highlighted a significant difference (p<0. 0001) between healthy and diabetic subjects. The dataset used in this study consisted of 24 healthy subjects and 20 diabetic subjects who were asked to acquire finger PPG signals for one minute. These studies demonstrated how PPG signal shape can be used to classify DT2 with traditional approaches. However, to achieve good classification performance, these methods sometimes involve several steps, such as filtering, feature extraction, and outlier detection. To simplify the preprocessing step, researchers began to utilize machine learning methods with basic PPG features and demographic data. Monte-Moreno et al. [14]  used a random forest and gradient boosted model to detect diabetes with physiologically relevant PPG features and demographic features, achieving an area under the curve (AUC) of 0.
7. The dataset in this study consisted of 1,170 subjects who were asked to acquire PPG signals twice for one minute. 29% of the subjects were labeled as diabetic based on their clinical records. In  [15] , Hettiarachchi used a Decision Tree model fitted with PPG features and physiological data to detect DT2 in the presence of hypertension (HT) and pre-hypertension. They used a public dataset composed of short PPG signals (2. 1 seconds) acquired from 219 subjects with various pathologies  [16]. The best AUC score was obtained when detecting DT2 in the absence of hypertension (9 healthy subjects, 9 diabetic subjects). They achieved an AUC of 0. 83. In  [17] , Nirala et al. proposed a support vector machine model (SVM) to classify diabetic and healthy subjects. They selected the ten best morphological PPG features from a total of 37 total features, showing an AUC of 0.
97. Their dataset consisted of 141 subjects with a five-minute-long recording each, with the diabetic subjects represented by 69% of the total dataset. Although the results are promising, feature extraction and identification of fiducial points can be heavily affected by signal quality. Thus, quality assessment is needed before applying this handcrafted feature extraction process. Over the past few years, the advent of deep learning has significantly impacted the analysis of biomedical signals  [18]. Convolutional neural networks (CNN) are often used in PPG analysis due to their capability of autoextracting discriminant features from the 1D PPG signal or  VOLUME 11, 2023  its 2D representations  [19]. In  [20] , Srinivasan and Foroozan proposed a CNN model (VGGNet architecture) that utilizes the scalogram obtained from 30-second finger PPG signals to detect DT2.
The used dataset is a subset of the MIMIC-III dataset composed of 808 subjects (58% with type I and type II diabetes). A total of 592 subjects presented HT, of which 290 had DT2 as well (62% of diabetics also had HT). In addition to the baseline model, they tested different architectures with several different inputs such as HT (yes/no), age, biological sex, and heart rate. The model scored an AUC of 0. 83 when trained with the PPG scalogram, age, biological sex, and HT classification. However, the main limitation of this approach is the difficulty of using it in portable devices such as smartphones and smartwatches. The idea of using raw PPG signals as input to CNN models to classify DT2 is not yet widely explored. Avram et al. [9]  proposed a CNN model to classify the prevalence of diabetes.
They used three different datasets: the first with 53,870 subjects (7% with diabetes), and the second and third to further validate the model, with 7,806 (8. 7% with diabetes) and 181 (21% with diabetes) subjects, respectively. The proposed model takes a 21. 3-second-long raw PPG signal as input. The PPG signal is defined as a sequence of PPG waves. The model achieved an averaged AUC of 0. 69 over the three different datasets using a CNN output threshold of 0. 427. Furthermore, they proposed a fusion approach where the CNN outputs and demographic data are taken as input by a logistic regression model to classify whether or not a PPG signal belongs to a diabetic subject. In this case, the AUC score increased up to 0. 83. The proposed CNN model is a large network composed of 18 convolutional layers and requires a long PPG measure to detect DT2.
B. DATASETS In this study, we utilized three datasets. A PPG wave is defined as the portion of the PPG signal that contains all information related to one heartbeat. The primary dataset consists of type 2 diabetic PPG waves (DB_DT2). Two additional datasets were employed to assess the impact of transfer learning. The first one (DB_shape) comprises 12,000 PPG waves that have been classified as high and low quality using our CNN model proposed in  [29] , then segmented into pulses, and manually labeled into four different classes based on their shape, as suggested in  [30]. The second dataset (DB_HT) is composed of hypertension (HT) PPG waves. DB_HT and DB_DT2 are composed of two separate datasets, one available online  [16] , and one collected at the University Hospital of Nice (cohort register referenced BS-004) using the pOpmétre device  [31].
Since HT and DT2 frequently coexist in the same subject, individuals who had both pathologies were excluded from the datasets to better isolate the effect of each pathology on the PPG signal. Table  2  summarizes the details of the datasets used. The pOpmétre device  [31]  acquires finger photoplethysmography (PPG) signals using red and infrared LEDs, and the signals are sampled at 1 kHz. The public dataset  [16]  consists of finger PPG signals acquired at 1 kHz with infrared light. Firstly, we applied a slight filter to the signals to remove high-frequency noise that could affect the PPG shape. We then identified the minimum points before and after the systolic maximum to segment the signals into single pulses. The pulses were normalized in time and amplitude. To perform inter-subject assessment and avoid overfitting, pulses belonging to the same subject were used either in training or testing.
E. TRANSFER LEARNING We implemented several models to classify whether a PPG wave belongs to a diabetic subject or not. Firstly, we trained a model on the DB_shape dataset to perform classification according to the four PPG shapes proposed by  [30]. We then used the weights and biases of this shape model to pre-train the HT model. Additionally, we employed the same shape model weights and biases to pre-train three different models to detect diabetes. The HT weights and biases were also used to pre-train three DT2 models that differ in their required inputs. The first model is trained to classify the presence of DT2 based only on PPG pulse waves, the second requires PPG pulse waves along with age and biological sex, while the third model utilizes PPG pulse waves and PPG-based features. Each of the proposed models was tested with three different architectures.
During the transfer learning process, we trained the models and unfroze the layers starting from the last layer to the input layer. In each new simulation, a new layer was unfrozen, and the net was trained on the selected dataset to fine-tune the model. To compare the benefits of transfer learning, we implemented the same architectures for DT2 detection without using any pre-trained models. A summary of all the implemented architectures is presented in Table  11 , Table  12 , and Table  13.
C. DISCUSSION Our results suggest that PPG signals have the potential to detect diabetes. It is possible that with a larger dataset, we could obtain even better results. Thus, the proposed method could become competitive with traditional approaches, such as the HbA1c test, which requires wellequipped medical centers. A summary of the advantages and disadvantages of the database is shown in Table  8. As presented in the previous section, the DT2 and DT2[age/biological sex] models obtained the best performances when trained without transfer learning (Table  10 ). The only model that benefited from transfer learning was the DT2[features] one. Despite the fact that, when applying transfer learning from HT we reached the best performances defreezing only the final layers, highlighting the similarity between HT and DT2 PPG waves, the fact that it did not improve the results could be consistent with the results proposed by  [15] , who reported a lower AUC score in classifying DT2 in the presence of HT.
We will explore new features and their relation with diabetes. In addition, we will study other architecture combination schemes between the features and the handcrafted features. Overall, the best performance was obtained by the CNN model trained with PPG waves, age, and biological sex without transfer learning, reaching an AUC of 75. 5. When tested negative, a subject has a probability of 95% of truly being negative (NPV). When tested positive, the probability decreases to 33% (PPV). The model architecture is presented in Table  9. The model has much fewer parameters than the deep learning architectures considered in  [9]. Our results are consistent with  [33] , which showed that low-complexity models perform comparably well or better than high-complexity models when dealing with small datasets.
With small model small dataset is likely to be sufficient for reliable training of the parameters without the need for transfer learning. Although there is certainly room for improvement, the presented results are comparable to the state of the art  [9]. To better compare our results with  [9] , we additionally computed the performance analysis using the same CNN output threshold (0. 427). The results are presented in Figure  6. In  [9] , the model has been tested on different datasets. The first reference (Ref1) is when the model is tested over the test dataset (11,313 subjects), the second (Ref 2) when tested on a contemporary cohort dataset (7,806 subjects), and the last one (Ref 3) is when the model is tested over a clinic cohort (181 subjects). Our test set is composed of 31 subjects.
The reference results are represented in gray in the figure, while the performance of our model is represented in green. The performance parameters have been computed also in this case with the recording level, subject's average, and majority voting approach. Our model scored a comparable NPV and sensitivity, while our PPV and specificity performances overcome the state of the art. We a comparable AUC. To obtain a more reliable model, we should train our model over a more stratified dataset containing more specific information about the subjects' disease.
1) LIMITATIONS Our study has some limitations. First, the diagnosis of diabetes was based solely on the subject's medical record, and no additional glucose measurements were taken. Second, information about the drug treatments followed by the patients was not included in the available databases. Third, the lack of information about medical history, such as cardiovascular accidents, biological sex transition, and drug treatment, could  VOLUME 11, 2023  lead to biased results due to mislabeled data, as discussed in previous studies  [34] ,  [35]. To compensate for the unbalanced classes, we used penalization weights in our analysis. However, a larger and more balanced database would be needed to obtain a clinical validation of the model.
Future improvements will focus on obtaining a more balanced and complete database with glucose measurements and drug treatments and validating the model with a permutation test. We will also search for better PPG handcrafted features to enhance DT2 detection. Since we normalized the length of the PPG waves, one possible improvement is to inject this information, which is related to the heart rate, as an additional feature to the neural net. Further studies are needed to explore the possibility of using a fused approach between PPG waves, demographic data, and PPG features. Another interesting future improvement is to assess the vascular status of diabetic subjects through PPG signals.
This is analogous to deep learning architectures for object recognition, which currently provide the most accurate identification of objects in natural images and movies, possibly mimicking neural processes in primate visual cortex  [25] [26] [27]. Yet, the current experimental paradigms to measure perceptual grouping and segmentation are still very basic, and they fall short of providing a sufficiently detailed representation that would be necessary for a quantitative understanding of the algorithmic bases of those perceptual processes  [28]. We can identify at least three shortcomings of existing human segmentation databases of natural images, that have been used to train machine learning algorithms  [29] [30] [31] [32] [33]. First, these databases invariably rely on manual tracing of the contours of visual groups, but do not control for interactions between perceptual processes and motor planning and execution that can introduce bias and variability, neither of which reflects perceptual processing per se.
Specifically, smooth tracing movements require less effort than discontinuous movements, therefore participants may be biased to segment the image using smoother boundaries than what they perceive. Furthermore, this effect can translate into variability between different participants, because their effort level is also likely to vary. Second, typically there are no constraints on, nor measurements of timing, thereby introducing additional uncontrolled variability across participants. Third, even though some databases include segmentation maps produced by multiple participants for the same image, and thus allow an analysis of variability across participants, existing databases do not measure the variability of the segmentation map produced by an individual participant. This is a crucial shortcoming when one considers perception as probabilistic inference to extract meaning from uncertain sensory inputs  [34] [35] [36].
First, our formulation rests on probabilistic segmentation maps, namely it assumes that participants evaluate the probability that each location in the image belongs to any segment. We demonstrate that our approach offers accurate reconstructions of these probabilistic segmentation maps, thereby providing a quantification of the perceptual uncertainty involved in grouping and segmentation. In particular, by manipulating synthetic compound textures, we show that the perceptual uncertainty of human participants tracks the overall intrinsic image uncertainty, and is concentrated near texture boundaries. Second, we provide reconstruction code to fit the data with any parametric model (deterministic or probabilistic) that predicts either the underlying segmentation maps or the measured same/different judgments.
We show these features on our empirical data, where we find that the participants correctly weigh different orientation channels, and that their weight profile further reflects image uncertainty. This aspect of our method enables systematic, quantitative comparison of multiple models on the same data and with the same cost function. Our code, the vseg package https://vseg. gitlab. io/vseg/ implemented in python using PyTorch, can thus form the basis for benchmarking diverse algorithms and theories of perceptual grouping and segmentation.
Experimental participants Adult participants were recruited on the online platform Prolific (www. prolific. co). From this website, they were redirected to our experiment page produced with jsPsych 6. 3 (www. jspsych. org/6. 3/,  [53] ). Then, after calibrating the size of images to be shown on the screen of the participants by estimating their viewing distance  [54]  and correcting for their monitor gamma  [55] , they started to perform the experiment as described above. In the experiments of involving artificial texture stimuli, we recruited 30 participants in total. They were divided in two groups of 15 participants, and each group performed the experiment on a different image. In the experiments involving natural image stimuli, we recruited 64 participants. We collected data for 8 different natural images, and data for each image were collected over 8 sessions (as explained above).
Stimuli For the experiments with natural images, we used cropped natural images from the database BSD500  [29]. For the experiments involving artificial texture stimuli, we used composite textures as follows. Stimuli are images divided in two random areas which are filled with two different (but close) bandpass Gaussian noise textures (oriented textures). Image synthesis is achieved by convolving a white Gaussian noise image with a spatially-dependent filter giving the desired spectral content in each areas. Additional details are in Appendix B in S1 Text.
In the experiments involving natural image stimuli, K was not constrained. We used N b = 1 and a grid of size N = 16, and we collected the minimal number of trials needed to reconstruct up to K = 5 segments, that is we collected responses to N t = (K -1)N 2 = 1024 trials. In these experiments, to limit the duration of each sessions, we divided the number of trials by 8 and collected responses to 128 trials per session, thus completing one image along 8 experimental sessions. The participants completed a session in approximately 30 minutes, including voluntary breaks. Therefore, the maps for each image were reconstructed from the aggregate data of 8 participants, not from an individual participant. See section Discussion for further considerations on the duration of the experimental session.
Because each pair is distinct from all other pairs in the same block, the variability of the responses of one participant can only be assessed by running multiple blocks. The response of a participant at block n and for a pair of pixels ði; jÞ ¼ ðði x ; i y Þ; ðj x ; j y ÞÞ 2 I 2 is denoted r ðnÞ i;j (note that it will be uninformative to test pairs of identical points, therefore in our experiments we exclude such pairs). We assume that participant responses r ðnÞ i;j 2 f0; 1g are independent samples of a Bernoulli random variable R ðnÞ i;j � Bðp i;j Þ, with p i,j denoting the probability that pixels (i, j) are perceived as belonging to the same segment. The negative log-likelihood of the dataset D N b ¼ r ðnÞ i;j � � ði;jÞ2P n � � n2f1;. ;N b g is ' 0 ððp i;j Þ ði;jÞ2I 2 ; D N b Þ ¼ X N b n¼1 X ði;jÞ2P n BCEðr ðnÞ i;j jp i;j Þ ð1Þ where, BCE is the Binary Cross-Entropy or simply the negative log-likelihood of a Bernoulli sample r (the participant's response) knowing the parameter p i.
Implementation and algorithm We implemented the models described above in Python using PyTorch. In the non-parametric case defined by Eq (8), we use exponentiated gradient descent to perform the inference  [58]. The pseudo code implementing this model is described in Algorithm 1. In the parametric case, defined by Eq  (10) , we use a quasi-Newton gradient descent (PyTorch implementation of the L-BFGS algorithm). 'ðp; D N b Þ and ℓ (u) ℓ (u+1) + 1 while |ℓ (u+1) -ℓ (u) | > ε do p pexp À l r r'ðp; D N b Þ � � p p= P K k¼1 p½k� ℓ (u) ℓ (u+1) ' ðuþ1Þ 'ðp; D N b Þ u u + 1 end end.
Robust reconstruction with limited data. We generated synthetic data with moderate underlying uncertainty, and studied how the accuracy of the inferred maps depends on the dataset size and on the use of regularization (see the section Spatial regularization). First, we found that regularization substantially improves the accuracy, i. e. it reduces the mean absolute error (MAE) between the ground truth (GT) and inferred maps (Fig 2, bottom left). Importantly, the MAE is measured on the probabilistic maps, therefore it reflects the accuracy of the estimation of uncertainty. This is also appreciable by visual inspection of the reconstructed maps (Fig 2, right panels). Next, in additional simulations, we studied how the accuracy depends on the number of data points collected. We observed (Fig  4 , left) that reconstruction accuracy improved at approximately the same rate with or without regularization, but was 2 to 3 times better on average when using regularization, regardless of dataset size.
Measured uncertainty in human participants correlates with image uncertainty To demonstrate the use of our method to study human visual segmentation, we conducted a pilot study online in which we manipulated the segmentation-related uncertainty in artificial images (see Appendix B in S1 Text). Note that our goal here is to reconstruct and analyze the probabilistic maps of each individual participant, not those reconstructed from aggregate data as in the previous section. We analyzed data from 15 participants in the low-uncertainty and in the high-uncertainty conditions. To not bias our analysis towards reconstructing smooth probabilistic maps we have not used regularization i. e. λ = 0. We observe that the segmentation maps (Fig  7 , second column) are very similar between conditions, except for a few, noisier pixels in the high-uncertainty condition.
We have illustrated this with parametric models where the probabilistic segmentation maps capture the. Therefore, our work indicates that measuring and modeling segmentation uncertainty will be important to test theories of perceptual segmentation and to better quantify the performance of segmentation algorithms. Our protocol closely integrates two key innovations to substantially improve over existing approaches to study segmentation. First, it relies on repeated trials that accumulate same/different perceptual decisions to a single pair of points on an image. Same/different judgments is a classical paradigm in visual psychophysics  [38] , yet it had not been used before to measure full segmentation maps. Thanks to this approach, our method addresses the three main shortcomings of existing segmentation databases used so far in computer vision that are typically based on manual tracing of contours  [29] [30] [31] [32] [33].
The first shortcoming is that manual tracing introduces biases and variations unrelated to perceptual processing. The manual tracing task can bias a participants to draw smoother contours than perceived, because that requires less effort, and can add variability across individuals due to uncontrolled variation in effort level. In our task, the effort required to report a perceptual judgment does not depend on the smoothness of the contours. Importantly, the effort to reach that perceptual judgment certainly depends on the visual features (including contour smoothness), and our method measures potential behavioral correlates of that effort, i. e. reaction times and across-trial variability. The second shortcoming of existing databases is the lack of control and measurement of timing, which introduces another factor of variation unrelated to visual processing.
This opens up two broad directions for future applications. The first one is to collect enough data on individual participants to constrain models that implement specific hypotheses about visual segmentation, and compare them quantitatively using the same data and cost function. The second direction is to use our protocol for massive online data collection to create the first dataset of purely perceptual segmentation maps, along with clearly defined benchmark metrics. Creating benchmarks based on intra-subject variability would be particularly interesting and novel. The vseg python package we have provided (https://vseg. gitlab. io/vseg/) includes code that automates remote data collection, and it allows to seamlessly plug in any segmentation algorithm, thus facilitating both applications described above.