This was a single-center, cross-sectional observational study designed to compare task-evoked fNIRS responses and exploratory machine-learning classification performance between young children with ASD and typically developing controls. This study was approved by the Ethics Committee of Nanjing Women and Children’s Healthcare Hospital (Women’s Hospital of Nanjing Medical University; approval no. 2022KY-021-02) and was conducted in accordance with the Declaration of Helsinki. Written informed consent was obtained from the legal guardians of all participating children before enrollment.
Experimental paradigm design
Based on prior pediatric and ASD fNIRS literature, video- and picture-viewing paradigms were selected because they are feasible for young children and have been used to examine social and perceptual processing11,12,17. To minimize head-movement artifacts during data acquisition, animated stimuli were incorporated into the experimental design. The emotional stimuli consisted of 30 validated facial-expression images (10 positive, 10 neutral, and 10 negative) selected from the Chinese Facial Affective Picture System (CFAPS). For social-interaction stimuli, video clips demonstrating three prototypical social games were recorded: (1) greeting exchange, (2) finger-play interaction (“Flying Bugs”), and (3) peek-a-boo. Non-social control stimuli included static images of houses and vehicles. All experimental paradigms were programmed using stimulus-presentation software (see the Table of Materials), with precise timing control and randomized stimulus presentation to ensure methodological rigor.
Participants
ASD group inclusion criteria were as follows: (1) fulfillment of the Diagnostic and Statistical Manual of Mental Disorders, Fifth Edition (DSM-5) diagnostic criteria for ASD18; (2) a positive Autism Diagnostic Observation Schedule (ADOS) assessment19; (3) a Childhood Autism Rating Scale (CARS) score ≥ 3020; (4) aged 2–6 years; (5) gestational age at birth > 37 weeks with birth weight > 2,500 g; and (6) written informed consent obtained from legal guardians. Exclusion criteria were as follows: (1) comorbid genetic or metabolic disorders (e.g., Rett syndrome, fragile X syndrome); (2) other neurodevelopmental disorders independent of ASD (e.g., isolated language delay or intellectual disability); (3) history of traumatic brain injury; and (4) neurological or severe systemic diseases.
The control group consisted of typically developing (TD) children recruited from routine health screenings at the Department of Child Health Care. Inclusion criteria were as follows: (1) age 2–6 years; (2) full-term birth (gestational age > 37 weeks) with normal birth weight (>2,500 g); and (3) written informed consent provided by legal guardians. Exclusion criteria were as follows: (1) diagnosed genetic or metabolic disorders, such as Rett syndrome or fragile X syndrome; (2) documented history of traumatic brain injury; and (3) neurological impairments or significant systemic illnesses. Individual matching by age or sex was not performed; instead, the potential confounding effects of age and sex were evaluated statistically in each paradigm-specific analytic sample. Participant inclusion was determined separately for each paradigm according to the availability of analyzable task-specific fNIRS data. Paradigm 1 included 60 participants (29 ASD and 31 TD), whereas Paradigm 2 included 58 participants (28 ASD and 30 TD). Fifty-three participants contributed analyzable data to both paradigms, seven contributed only to Paradigm 1, and five contributed only to Paradigm 2. Therefore, the two paradigm-specific sample sizes describe partially overlapping analytic datasets and should not be summed. The baseline characteristics of the two groups are summarized in Table 1.
| Characteristic | ASD | TD | p |
| Panel A. Paradigm 1 analytic sample (ASD, n = 29; TD, n = 31) |
| Age, years | 4.02 ± 1.14 | 3.67 ± 0.91 | 0.195 |
| Sex, male | 28 (96.6) | 20 (64.5) | 0.003 |
| ABC score | 57.24 ± 28.00 | 30.19 ± 8.96 | <0.001 |
| CARS score | 32.95 ± 2.52 | 19.68 ± 3.08 | <0.001 |
| Adaptive behavior | 67.79 ± 15.97 | 98.84 ± 11.66 | <0.001 |
| Gross motor | 77.48 ± 11.93 | 100.16 ± 11.03 | <0.001 |
| Fine motor | 69.34 ± 14.92 | 99.45 ± 11.56 | <0.001 |
| Language | 57.52 ± 20.53 | 105.13 ± 11.82 | <0.001 |
| Personal-social | 62.66 ± 12.77 | 107.87 ± 12.86 | <0.001 |
| Panel B. Paradigm 2 analytic sample (ASD, n = 28; TD, n = 30) |
| Age, years | 4.16 ± 1.12 | 3.58 ± 0.89 | 0.036 |
| Sex, male | 28 (100.0) | 20 (66.7) | <0.001 |
| ABC score | 58.39 ± 28.05 | 30.57 ± 9.33 | <0.001 |
| CARS score | 33.36 ± 2.68 | 19.73 ± 2.94 | <0.001 |
| Adaptive behavior | 66.54 ± 15.99 | 98.60 ± 11.89 | <0.001 |
| Gross motor | 78.50 ± 11.19 | 102.40 ± 12.20 | <0.001 |
| Fine motor | 68.61 ± 14.47 | 99.17 ± 12.30 | <0.001 |
| Language | 57.18 ± 19.63 | 105.53 ± 12.51 | <0.001 |
| Personal-social | 61.07 ± 12.56 | 107.13 ± 12.72 | <0.001 |
Table 1: Demographic and clinical characteristics of the paradigm-specific analytic samples. Values are presented as mean ± standard deviation or n (%). Continuous variables were compared using Welch’s t test, and sex distributions were compared using Fisher’s exact test. The two paradigm-specific analytic samples partially overlapped and should not be summed. Abbreviations: ABC = Autism Behavior Checklist; ASD = autism spectrum disorder; CARS = Childhood Autism Rating Scale; TD = typically developing.
fNIRS data acquisition
Cortical hemodynamic signals were acquired using a wearable, wireless, battery-powered, eight-channel continuous-wave fNIRS system. The system operated at wavelengths of 760 and 850 nm at a sampling rate of 10 Hz. The source–detector separation was set at 30 mm. Changes in HbO, HbR, and total hemoglobin (HbT) concentrations were calculated using the modified Beer–Lambert law.
The optode array comprised eight source–detector channels positioned bilaterally over the prefrontal cortex, with four channels covering each hemisphere. Channels 1–4 were formed by transmitters Tx1–Tx4 paired with detector Rx1 over the right prefrontal cortex, whereas Channels 5–8 were formed by transmitters Tx5–Tx8 paired with detector Rx2 over the left prefrontal cortex. The approximate anatomical locations, Brodmann areas, and Montreal Neurological Institute (MNI) coordinates of the channels are presented in Supplementary Table S1.
Experimental stimuli were presented using the referenced software (see the Table of Materials), which also generated event triggers to mark the onset and offset of each experimental condition. The fNIRS signals and event markers were transmitted to a computer and recorded.
Data description
β activation values from eight channels were used as classification features, with group labels used to distinguish samples. ASD was defined as the positive class and TD as the negative class. Paradigm 1 included three task-specific β-value sets and 24 features per participant (3 tasks × 8 channels); its analytic sample comprised 60 participants, including 29 children with ASD and 31 TD children. Paradigm 2 included two task-specific β-value sets and 16 features per participant (2 tasks × 8 channels); its analytic sample comprised 58 participants, including 28 children with ASD and 30 TD children.
Data preprocessing and feature extraction
fNIRS signal preprocessing and β-value estimation
The recorded optical signals were converted into concentration changes in oxygenated hemoglobin (HbO), deoxygenated hemoglobin (HbR), and total hemoglobin (HbT) using the modified Beer–Lambert law implemented in OxySoft. The HbO concentration time series were subsequently imported into NIRS-SPM version 4, implemented in MATLAB, for preprocessing and activation analysis21.
Wavelet minimum description length (wavelet-MDL) detrending was applied to remove slow baseline drift and global trends unrelated to task activation22. A hemodynamic response function (HRF)-based low-pass filter was then applied to attenuate high-frequency physiological noise21. No dedicated automated motion-artifact correction algorithm was applied during preprocessing. Recording completeness, rather than a quantitative channel-level signal-quality index, was used as the eligibility criterion. No prespecified channel-quality threshold was applied, and all eight channels were retained for β-value estimation. At the participant and paradigm levels, data were included only when the child completed the full experimental procedure and both the fNIRS recording and required clinical data were complete.
Participants with incomplete fNIRS signals were excluded from the corresponding paradigm analysis. Because the availability of complete task-specific data differed between paradigms, participant composition was determined separately for each paradigm-specific analytic dataset. For each participant and channel, a general linear model (GLM) was constructed using the HbO concentration time series as the dependent variable. The onset and duration of each task condition were convolved with the canonical HRF and its temporal and dispersion derivatives to generate the task regressors.
The regression coefficients (β values) corresponding to each task condition were extracted separately from each of the eight channels and used as task-evoked activation features. Paradigm 1 included three task conditions and therefore generated 24 features per participant (3 tasks × 8 channels), whereas Paradigm 2 included two task conditions and generated 16 features per participant (2 tasks × 8 channels).
Data partitioning, normalization, and principal component analysis
Leave-one-out cross-validation (LOOCV) was performed separately for each paradigm, and no fixed training/test split (e.g., 80%/20%) was used. In each LOOCV iteration, one participant was held out as the test sample, while all remaining participants constituted the training set. Thus, for Paradigm 1, each iteration included 59 of 60 participants from the training set (98.3%) and 1 participant from the test set (1.7%). For Paradigm 2, each iteration included 57 of 58 participants from the training set (98.3%) and 1 participant from the test set (1.7%). This procedure was repeated until every participant had served once as the held-out test sample, and the held-out predictions from all iterations were combined to evaluate classification performance.
Feature normalization was performed independently within each LOOCV iteration using z-score standardization. For each feature (j), the standardized value was calculated as:

The held-out test sample was standardized using the mean and standard deviation derived from the training set. No information from the test sample was used to calculate the normalization parameters.
Z-score standardization was selected because the β-value features obtained from different task conditions and channels varied in magnitude. Standardizing each feature to a mean of zero and a standard deviation of one prevented features with larger numerical scales from disproportionately influencing scale-sensitive classifiers, such as K-nearest neighbors and support vector machines, as well as the subsequent principal component analysis.
Principal component analysis (PCA) was subsequently fitted using only the standardized training data within each LOOCV iteration. The minimum number of principal components explaining at least 80% of the cumulative variance in the training set was retained. The held-out test sample was projected onto the retained principal components using the PCA transformation parameters derived exclusively from the corresponding training set. This fold-specific procedure prevented information from the held-out test sample from influencing feature preprocessing or dimensionality reduction.
Classification model training and performance evaluation
Seven machine learning classifiers were evaluated to assess classification performance between the ASD and TD groups: K-nearest neighbors (KNN), logistic regression (LR), support vector machines (SVMs), decision trees (DTs), random forests (RFs), gradient-boosted decision trees (GBDTs), and XGBoost. All classification analyses were performed in Python 3.9. The seven classifiers were implemented using their default hyperparameter settings, and no data-driven hyperparameter search or optimization was performed. Statistical significance was assessed using 5,000 label permutations. For receiver operating characteristic (ROC) and area under the ROC curve (AUC) analyses, the prediction score for the ASD class was used. For classifiers that provide class probabilities, the probability for class 1 was extracted; for SVMs, the decision function score was oriented toward class 1. Within each LOOCV iteration, each classifier was trained on standardized, PCA-transformed training data and then applied to the held-out test sample.
The ASD group was defined as the positive class, and the typically developing (TD) group was defined as the negative class. Predictions obtained for the held-out samples across all LOOCV iterations were combined to calculate accuracy, sensitivity, specificity, ROC curves, and the AUC. Accuracy was calculated as:
Specificity was calculated as:


Sensitivity was calculated as:

Where TP, TN, FP, and FN represent true positives, true negatives, false positives, and false negatives, respectively. The ROC curve depicts sensitivity against 1 − specificity across classification thresholds, and the AUC summarizes the overall discriminative performance of each classifier.
Permutation testing was used to assess whether the observed model performance was greater than expected by chance. For each classifier and paradigm, the group labels were randomly permuted 5,000 times. For every permutation, the complete modeling procedure, including fold-specific z-score standardization, PCA, model training, and held-out prediction, was repeated. The one-sided empirical permutation p value was calculated as:

Where Metricobserved represents the performance metric obtained using the original group labels, Metricperm represents the corresponding metric obtained after label permutation, and I denotes the indicator function. A permutation p value of less than 0.05 was considered evidence that the observed performance was greater than expected by chance.
Statistical analysis
Continuous data were summarized according to their distribution. Normally distributed variables are presented as the mean ± standard deviation (SD), whereas non-normally distributed variables are reported as the median and interquartile range (IQR). Categorical data are expressed as frequencies and percentages. Depending on the distribution of the continuous variables, between-group comparisons were performed using either the independent-samples t-test or the Mann–Whitney U test. Differences in categorical variables were assessed with the chi-square test or Fisher's exact test, as appropriate. Statistical significance was established at p < 0.05.
Potential confounding was evaluated separately for each paradigm-specific analytic sample. Age was calculated as the interval between the date of birth and the fNIRS assessment date divided by 365.2425. Baseline continuous characteristics were compared using Welch’s t test, and sex distributions were compared using Fisher’s exact test. For channel-level sensitivity analyses, β values were averaged across tasks within each channel, and ASD–TD group effects were estimated using ordinary least-squares regression with heteroscedasticity-consistent type 3 (HC3) robust standard errors, adjusted for age and sex. Benjamini–Hochberg false discovery rate (FDR) correction was applied across the eight channels within each paradigm. Because very few girls with ASD were included, a male-only sensitivity analysis adjusted for age was also performed.
Associations between the Autism Behavior Checklist (ABC), CARS, the five Gesell developmental-domain scores, and task-specific β features were assessed separately in the ASD and TD groups using Pearson correlation coefficients. FDR correction was applied separately within each paradigm, group, and participant characteristic across 24 β features in Paradigm 1 or 16 β features in Paradigm 2. ABC and CARS were not entered as covariates in the primary between-group models because they represent core diagnostic phenotype measures with limited overlap between the ASD and TD groups; their associations with fNIRS features were instead evaluated within groups.
As an additional classification sensitivity analysis, fixed L2-regularized logistic regression models using age and sex only, fNIRS β features only, or their combination were evaluated using fold-wise standardization and leave-one-out cross-validation. Incremental AUC was estimated relative to the age-and-sex model, with 95% confidence intervals obtained from 10,000 paired stratified bootstrap resamples.