Exploring how deep learning decodes anomalous diffusion via Grad-CAM

Domain: physics
Published: 2026-03-29
Editorial outcome: minor_revision

Abstract
While deep learning has been successfully applied to the data-driven classification of anomalous diffusion mechanisms, how the algorithm achieves the feat remains a mystery. Using a well-known technique aimed at achieving explainable AI, namely the Gradient-weighted Class Activation Map (Grad-CAM), we investigate how deep learning (implemented by ResNets) recognizes the distinctive features of a particular anomalous diffusion model from the raw trajectory data. Our results show that Grad-CAM reveals the portions of the trajectory that hold crucial information about the underlying mechanism of anomalous diffusion, which can be utilized to enhance the robustness of the trained classifier against the measurement noise. Moreover, we observe that deep learning distills unique statistical characteristics of different diffusion mechanisms at various spatiotemporal scales, with larger-scale (smaller-scale) features identified at higher (lower) layers.

Introduction
As our ability to generate, store, and analyze large datasets has dramatically increased, data analysis has become an essential component of modern science, including physics [1]. Recent developments of deep learning have revolutionized the way we extract information from the data, allowing us to recognize meaningful patterns from complex, unprocessed empirical data [2]. Besides applications to speech recognition [3], computer vision [4], self-driving cars [5], and natural language processing [6], deep learning has demonstrated remarkable efficacy for analyzing various physical data, such as tracking specific events in complex environments [7], extracting signals from astronomical data [8], and predicting valid protein configurations [9].

More recently, deep learning was also applied to analyze anomalous diffusion [10–13]. The phenomenon, characterized by nonlinear growth in time of the mean square displacement, is observed in diverse disciplines encompassing biology [14–16], social science [17], and finance [18]. Various mathematical models have been proposed to describe the mechanism of anomalous diffusion, including continuous-time random walk [19], fractional Brownian motion [20], L´evy walk [21], annealed transient time motion [22], and scaled Brownian motion [23]. However, identifying the correct mechanism underlying a given trajectory is a challenging task, as long-range temporal correlations often make it difficult to identify useful statistical features [24]. Despite various statistical features proposed for direct identification of the diffusion mechanism [25–29] and for preprocessing data for machine learning [30–32], a consensus on this issue is yet to be reached. To address this long-standing problem, the recent anomalous diffusion (AnDi) challenge applied a variety of machine learning techniques to the task [33], confirming the enhanced accuracy and efficiency of deep-learning approaches (for algorithms that excelled in the classification of two-dimensional trajectories, see [34–38]) compared to the conventional statistical methods.

However, the black-box nature of deep learning poses a significant challenge as to how to interpret its outcomes—it is unclear which features of the data are used by the algorithm to perform the given task. Notably, a recent study [39] employed Bayesian learning techniques to provide error estimates of the outcomes, whose behaviors as the training data are varied indicate how properties of the underlying diffusion mechanism affect the learning performance. However, this approach does not explicitly reveal which features of the data lead to the observed outcomes.

In this study, we propose a method to highlight regions within the input trajectory that are key to how deep learning classifies the diffusion mechanisms. Similar problems have been addressed in different contexts, especially computer vision, using the techniques aiming to achieve explainable AI [40–53]. Among these, noting that many of the deep learning methods in the AnDi challenge were based on convolutional neural networks (CNNs), we employ the gradient-weighted class activation mapping (Grad-CAM) developed for the architecture. The versatility of Grad-CAM has been demonstrated in various problems, which is now widely accepted as a standard technique of explainable AI [48–53]. By integrating Grad-CAM with the diffusion model classifier based on deep learning, we aim to identify substructures within trajectories that contain key information about the underlying mechanism, which can be further applied to enhancing the robustness of the learning performance.

Results
Before proceeding, let us clarify what we aim to accomplish with deep learning. The task is to identify the anomalous diffusion mechanism underlying a two-dimensional particle trajectory. The trajectory is generated using one of the five standard models of anomalous diffusion: annealed transient time motion (ATTM), continuous-time random walk (CTRW), fractional Brownian motion (FBM), L´evy walk (LW), and scaled Brownian motion (SBM). While the original AnDi challenge focused on classifying trajectories into these five categories, we also require the neural network to distinguish between subdiffusive and superdiffusive trajectories. By adding the prefixes “Sub-” and “Sup-” to indicate subdiffusion and superdiffusion, respectively, our classification task involves seven distinct mechanisms of anomalous diffusion: SubATTM, SubCTRW, SubFBM, SubSBM, SupFBM, SupLW, and SupSBM. Additionally, we include ordinary Brownian motion (BM) as the eighth mechanism.

In this study, we use the CNN-based architecture of neural networks to perform the task. This is due to the following two reasons. First, they provide a natural way to detect structures of trajectories at various time scales by stacking convolutional layers. Second, they allow application of Grad-CAM in its native setting and straightforward visualization of which subtrajectories are critical for the classification task. Previous works also support the viability of CNN-based architectures for identifying diffusion mechanisms [11, 54, 55]. With these considerations in mind, we introduce ResAnDi, a deep learning algorithm designed to identify the anomalous diffusion mechanism underlying an empirical trajectory. This algorithm utilizes a neural network architecture based on the residual neural network (ResNet) [56]. ResNet enhances the standard CNN by incorporating skip connections between layers, allowing the use of deeper networks while mitigating the vanishing gradient problem. Specifically, our model is based on ResNet18, which consists of one convolutional layer, four convolutional blocks (4 convolutional layers with skip connections in each block), and one fully-connected (FC) layer. While ResNet was originally developed for processing RGB images through three channels of two-dimensional arrays, we have modified the architecture to handle time series data of two-dimensional particle trajectories using two channels of one-dimensional arrays. In the end, the network produces a vector with components representing the probabilities that the trajectory belongs to each of the eight mechanisms.

2.1 Relevance of Grad-CAM
Previous studies have shown that Grad-CAM effectively highlights the most relevant features of an image that contribute to its correct classification [48, 49]. We show that the same holds for the identification of diffusion mechanisms. For this purpose, we employ two different approaches. First, we show that the accuracy of ResAnDi is more adversely affected by targeted erasure of particle trajectories with a higher Grad-CAM score. Second, we show that the accuracy of ResAnDi is more robust against noisy input if the training data are augmented using trajectories with a higher Grad-CAM score.

Grad-CAM. For completeness, we first give a brief description of Grad-CAM. The method was developed with the architecture of CNNs in mind. It focuses on the last convolutional layer, which is expected to possess the highest-level of semantic information while retaining some spatial information [49, 57, 58]. Within this layer, let Ak denote the activation of node i of the k-th feature map Ak. If the probability of the CNN correctly classifying the input data is p, then the influence of the k-th feature map on the decision can be quantified as

ak ≡ 1 \sum_i \frac{\partial p}{\partial A^k_i} / |A^k|, (1)

where |Ak| is the size of the k-th feature map.

The Grad-CAM scores G are obtained by averaging the activations of all feature maps, where each feature map is weighted by its influence on the correct classification. This is expressed by the formula

G ≡ \sum_k a^k A^k. (2)

Given a trained CNN and an input sample, G can be obtained readily using the standard backpropagation method. In this study, we used the Captum Python package [59] to implement the calculation.

It should be noted that the Grad-CAM scores defined above are assigned to the nodes in the last convolutional layer, whose activation pattern is a coarse-grained representation of the original input. To reassign these scores to the nodes of the input data, an interpolation scheme is needed. For efficiency, we partition the input nodes into (approximately) equal-length subintervals, with the number of subintervals matching the number of nodes in the final convolutional layer. This creates a one-to-one correspondence between the nodes in the final convolutional layer and the subintervals in the input layer. Through this correspondence, the Grad-CAM score is transferred from the final convolutional layer to the input trajectory.

Targeted erasure based on Grad-CAM. To check whether Grad-CAM captures the relevant features of trajectories, we propose the following test inspired by the occlusion-based perturbation which was used to test the reliability of Grad-CAM in computer vision [49]. First, we prepare a new set of trajectories not used in the training, whose temporal duration varies from 10 to 1000. Given this test dataset, targeted erasure is implemented as follows. We start with partitioning each trajectory into subintervals so that the Grad-CAM score can be assigned to each of them. By letting ResAnDi classify the trajectory, we obtain the Grad-CAM score of each subinterval. This allows us to modify a trajectory by “erasing” all subintervals whose Grad-CAM score falls within a targeted range. More specifically, erasing a subinterval means that the particle is forced to stay at the origin (x = y = 0) during the whole subinterval. By comparing the effects of targeted erasure with those of random erasure, where randomly chosen subintervals are erased, we can assess how the Grad-CAM score relates to the presence of useful information about diffusion mechanisms.

In Fig. 3, we show how the classification accuracy of ResAnDi is affected by targeted erasure of subintervals whose Grad-CAM scores fall between each consecutive pair of deciles (i.e., every tenth percentile). Clearly, erasing subintervals of the higher Grad-CAM score leads to lower accuracy of ResAnDi. Compared to the random erasure of subintervals, erasing subintervals whose Grad-CAM score belongs to the upper 70% has more adverse effects on the classifier. These suggest that certain parts of the particle trajectories contain more information about the underlying diffusion mechanism than others, and that the Grad-CAM score can be used as an indicator of those crucial parts. One may question how the information contents of the trajectory can be inhomogeneous when the generation mechanism itself is homogeneous in time. Even if the mechanism involves homogeneous dynamics, the generated trajectory exhibits inhomogeneities coming from rare fluctuations. That said, subtrajectories representing characteristic rare fluctuations (such as those resembling persistent biased random walks exhibited by SupFBM) can help the algorithm recognize the underlying generation mechanism, whereby they receive high Grad-CAM scores. In this sense, some subtrajectories can be more informative than others.

Dataset augmentation via Grad-CAM. Dataset augmentation aims to enhance machine learning performance by expanding the diversity of training data. This typically involves making variants of certain samples through random cropping, resizing, or rotating, which modifies non-critical aspects of the data while preserving the features crucial for classification tasks [60]. However, these conventional approaches do not evaluate the usefulness of individual samples for training, generating an augmented dataset only through random selection. This prompts the question of whether the procedure could be improved by making informed decisions about which samples to augment.

We hypothesize that if a trajectory has a higher mean value of the Grad-CAM score, it has a higher density of information useful for discerning the underlying diffusion mechanism, which makes it a better candidate for the augmented dataset. To test this, we propose targeted augmentation, which is implemented as follows. First, we select trajectories that ranked in the top 60% based on their mean Grad-CAM scores, calculated by averaging the scores across subintervals of each trajectory. Then, these selected trajectories are rotated by a random angle and added to the original training dataset to form the augmented dataset.

The advantage of targeted augmentation over random counterpart becomes evident in the presence of noise in the test trajectory data, which stems from the measurement error present in the experimental data. We simulate this effect by generating the test dataset from the models and then applying Gaussian noise to every point of the trajectories. Since every trajectory has been rescaled so that the standard deviation of particle displacement per time step is unity, the amplitude of the Gaussian noise can be regarded as the inverse signal-to-noise ratio (SNR). In Fig. 5, we show that targeted augmentation consistently achieves more robust performance than random augmentation for a broad range of 1/SNR, with the maximum enhancement (≈4% pt) exceeding the error range. This demonstrates that Grad-CAM indeed captures the features that contain information about the underlying diffusion mechanism, which can be utilized to mitigate the adverse effects of data contamination by erasure or noise.

2.2 Features indicated by Grad-CAM
We have demonstrated that Grad-CAM, as it does for image classification tasks, reliably indicates the relative importance of different subtrajectories in identifying the diffusion mechanism. Now we address the question of which characteristics of the mechanisms are captured by the Grad-CAM score. We take a two-step approach. First, by visualizing how ResAnDi architecture encodes trajectories generated by different mechanisms at various depths of the network, we construct a set of statistical features which might be useful for the classification task. Second, we calculate the correlations between these features and the Grad-CAM score, quantifying the extent to which Grad-CAM highlights those characteristics. For the ease of statistical analysis, through this section we use a newly trained ResAnDi, which was trained on a noiseless dataset comprising 8×10^4 × 5 trajectories of temporal duration fixed at 1000. In this case, ResAnDi achieved the classification accuracy of 94.89%, which is higher than 90.36% achieved when the trajectory length was uniformly distributed between 10 and 1000. For the calculation of correlations, a test dataset of the same size is used.

Visualization of the classification process. As previously described, ResAnDi architecture comprises four convolutional blocks, which successively process the trajectory data to identify its underlying diffusion mechanism. For every input trajectory, each block yields a high-dimensional output vector. Since ResAnDi is trained to distinguish between trajectories generated by different mechanisms, the output vectors must be clustered so that trajectories of “similar” mechanisms are close to each other, while those from “dissimilar” mechanisms are farther apart. In shallower layers, trajectories are likely to be clustered according to local features. In deeper layers, the network focuses more upon longer-range features. Hence, examining clustering patterns across different layers can provide us with useful clues as to which statistical features are used by ResAnDi to classify trajectories.

In Fig. 6, we visualize how each convolutional block clusters the training dataset trajectories by embedding the output vectors in two dimensions via t-distributed stochastic neighbor embedding (t-SNE). In the output of Block 1, we can discern four mechanism clusters, namely SubFBM, [SupFBM, SupLW] (FBM/LW), [SubATTM, SubCTRW] (ATTM/CTRW), and [SubSBM, SupSBM, BM] (SBM/BM). Among these, SupFBM, SupLW, SubATTM, and SubCTRW are identified as individual mechanisms in the output of Block 2. Finally, the SBM/BM cluster is fully classified only after Block 3, indicating that long-range features are required to distinguish between these mechanisms. Based on these observations, we propose four statistics that may be utilized by ResAnDi for the classification task.

Statistics correlated with Grad-CAM. To facilitate further statistical analysis, we begin with partitioning each trajectory of the training dataset into subtrajectories, so that the Grad-CAM score can be assigned to each of them. However, in this case, we let the subtrajectories overlap with each other, so that each subtrajectory is long enough for reliable statistics.

Now, guided by Fig. 6, let us construct the statistics that would be relevant to the classification task. In the output of Block 1, the SubFBM stands out as a single clearly distinct mechanism. Noting that SubFBM is the only model producing negative correlations between consecutive particle displacements, it is natural to conjecture that Block 1 utilizes the Autocorrelation (AC) defined as

AC ≡ 1/2 \sum_{r∈{x,y}} \frac{\langle \Delta r_t \Delta r_{t+1} \rangle - \langle \Delta r_t \rangle^2}{\langle \Delta r^2 \rangle}. (3)

Here \Delta r represents the displacement in the x or y direction during the time interval from t to t+1, and \langle \langle X^n \rangle \rangle denotes the nth cumulant of observable X over a chosen subtrajectory, with \langle X \rangle ≡ \langle \langle X \rangle \rangle.

With AC thus identified, it seems natural that SupFBM and SupLW should be clustered together (as FBM/LW cluster) by Block 1 since they share positive AC. But while SupLW tends to make the particle move in the same direction for a prolonged period of time, SupFBM results in frequent changes in the direction of motion. Thus, to distinguish these two mechanisms, we expect that Block 2 takes advantage of Consistency (CS) defined as

CS ≡ AC × \sqrt{\langle \langle (\Delta \theta / \pi)^2 \rangle \rangle}, (4)

where

\Delta \theta ≡ \arccos \frac{\Delta x_{t-1} \Delta x_t + \Delta y_{t-1} \Delta y_t}{\sqrt{(\Delta x^2_{t-1} + \Delta y^2_{t-1})(\Delta x^2_t + \Delta y^2_t)}} (5)

is the change in the direction of motion occurring at time t, and the notation X indicates that the quantity X is min-max normalized to the interval [0, 1]. Clearly, high (low) CS corresponds to SupFBM (SupLW).

As for the SubATTM and the SBM/BM cluster, the component mechanisms are all characterized by locally Gaussian displacements. This motivates us to divide each subtrajectory into n subintervals and consider the Non-Gaussianity (NG) defined as

NG ≡ | 1/(2n) \sum_{r∈{x,y}} \sum_{i=1}^n \frac{\langle \langle \Delta r_t^4 \rangle \rangle_i}{\langle \langle \Delta r^2 \rangle \rangle_i^2} |, (6)

where \langle \langle \cdot \rangle \rangle_i denotes a cumulant calculated over the ith subinterval. Since the fourth cumulant vanishes for the Gaussian distribution, NG is greater if the subtrajectory deviates farther from the Gaussian statistics at the subinterval level.

Now, we can guess how SubATTM and SubCTRW are established as individual mechanisms after Block 2. Both are distinct from the SBM/BM cluster in that their trajectories feature sudden changes in the magnitude of displacements. They are also distinguished from each other by the locally Gaussian nature of SubATTM and the strong non-Gaussianity of SubCTRW. Thus, we are led to consider Singularity (SG) defined as

SG ≡ max_{r∈{x,y}} [ \langle \langle (\frac{\Delta r_{t+1} + \epsilon}{\Delta r_t + \epsilon})^2 \rangle \rangle ]^{1/2} × NG, (7)

where \epsilon is a small positive number introduced to prevent the quantity from diverging. Throughout this study, we use \epsilon = 10^-6. We note that high (low) SG indicates SubCTRW (SubATTM), which features both higher (lower) probability of abrupt jumps and high (lower) NG.

Finally, there still remains the SBM/BM cluster, which persists up to Block 3. The three mechanisms are similar in that their fluctuations are locally Gaussian without any sudden changes in the magnitude of displacements. Their unique characteristics become apparent only when one observes how diffusivity gradually changes over time. As a measure of this property, we propose Varying Diffusivity (VD) defined as

VD ≡ 1/(2n) \sum_{r∈{x,y}} \langle \langle \Delta r_t^2 \rangle \rangle^{1/n} / 2 - \langle \langle \Delta r_t^2 \rangle \rangle^{1/2} × NG, (8)

which quantifies how diffusivity changes over each subtrajectory. We note that positive (negative) VD indicates SupSBM (SubSBM).

In Fig. 7, we show how the statistics constructed by the above procedure correlate with the Grad-CAM score of the subtrajectories obtained using the output of Block 4. To track how successive blocks characterize the subtrajectories differently, in Fig. 8, we repeat the same analysis for the output of each of the other three blocks.

2.3 Ablation study
Feature ablation by subtrajectory replacement. To further demonstrate the relevance of the four features identified by the Grad-CAM scores, we also conduct an ablation study, whereby we examine how the classification performance of ResAnDi changes after the key parts of input trajectories are modified to weaken a target feature. Toward this goal, we propose a subtrajectory replacement scheme, which is implemented using the noiseless dataset as follows.

First, we partition each input trajectory into subtrajectories. Then we choose the subtrajectory with the highest (or lowest) value of the selected feature, which is to be replaced with a copy of another subtrajectory from the same trajectory. The replacement is to be done with appropriate position adjustments at the boundaries to preserve the trajectory continuity. The replacement subtrajectory is determined by minimizing the cost function

L = - \sum_i (s_i - s'_i)^2 + \sum_i \sum_r (r_i - r'_i)^2, (9)

where s_i and s'_i are the values of the selected feature of the ith subtrajectory before and after the replacement, respectively, and r_i and r'_i stand for the other three features of the ith subtrajectory before and after the replacement, respectively. In other words, the replacement subtrajectory is chosen to maximize the impact on the target feature, while minimizing the effects on the other features.

Effects of ablation. Using the method described so far, we examine how perturbing one of the features affects the classification accuracy of trajectories generated by each model. In Fig. 10, we show the percentage of misclassification for each diffusion model (columns) resulting from the ablation of a selected feature (rows), together with the name of the model (shown within the parentheses) accounting for the largest fraction of misclassification results. The colors indicate whether we target subtrajectories with the highest (red) or the lowest (blue) value of the chosen feature, which are darker for features causing a relatively larger accuracy drop compared to the other features.

A comparison between Figs. 7 and 10 reveals many common properties. The features most correlated with the Grad-CAM score in Fig. 7 tend to be the features whose perturbation lead to relatively large accuracy drops in Fig. 9 (AC for SubFBM, SupFBM and SubCTRW, CS for SupLW, SG for SubCTRW, and VD for SubCTRW, SubSBM, and SupSBM). Moreover, when these features are perturbed, ResAnDi tends to confuse models belonging to the same t-SNE cluster (SupLW tends to be misclassified as SupFBM, SubCTRW as SubATTM, SubATTM as SubCTRW, and SubSBM and SupSBM as BM). The results corroborate our previous observation that ResAnDi uses CS to distinguish SupLW from SupFBM, SG to tell SubCTRW from SubATTM, and VD to distinguish BM, SubSBM, and SupSBM from each other in the deeper layers.

Methods
4.1 Trajectory generation
Trajectories exhibiting anomalous diffusion are generated using the Python package provided by the AnDi challenge [33, 62]. A dataset, be it for training, validation, or testing, comprises an equal number of trajectories for each of the eight mechanisms. For models exhibiting subdiffusion, the diffusion exponents of the corresponding trajectories are uniformly distributed in the interval [0.1, 0.9]. Similarly, for models exhibiting superdiffusion, the diffusion exponents are uniformly distributed in the interval [1.1, 1.9]. Each trajectory is rescaled so that the displacement per unit time (\Delta t=1) has unit variance. Unless specified otherwise, the temporal duration of each trajectory is uniformly distributed between 10 and 1000. Without making any explicit assumptions about the measurement error, we only use noiseless trajectories for the training datasets. So are the trajectories in the test datasets unless specified otherwise.

4.2 Deep learning algorithm
To train ResAnDi, we use the PyTorch package [63] with the categorical cross-entropy loss function and the Adam optimizer [64], employing an early-stopping method to avoid overfitting. We tested the performance of ResAnDi using a dataset composed of 10^4 trajectories belonging to each of the eight classes. ResAnDi achieves an overall classification accuracy of 90.36%, which is comparable to the best algorithm [34] submitted to the AnDi challenge [33] (which achieved 89.16 %), even though our task involves a greater number of classes.

Peer review rounds
[{"round": 1, "reviewer_comments": {"reviewer_1": "The authors demonstrate the use of a Gradient-weighted Class Activation Map (Grad-CAM) to investigate how a machine learning algorithm decodes anomalous diffusion. First they demonstrate that Grad-CAM captures the relevant features of a trajectory by testing the performance changes when erasing the parts of a trajectory with the highest Grad-CAM scores. Additionally they propose and test a targeted augmentation procedure utilising Grad-CAM, for which trajectories with high Grad-CAM scores are preferred for augmentation. Building on depictions of two-dimensional projections of the activation vectors in intermediate layers of their convolutional neural network, they also construct features that are likely to be used at each step in the machine's classification process. They verify their feature selection by analysing the correlations between feature-magnitude and Grad-CAM scores, as well as by measuring the change in misclassification when a particular feature is distorted.\nOverall the authors present a very well presented work, with a detailed and interesting analysis. This work will certainly widen the scope of the field of advanced data analysis of anomalous stochastic analysis. Due to the wide applicability and importance of their results in various fields I strongly support publication of this work in Nature Communications, after minor changes.\n(1) Could you clarify whether the training set for part II/III included noise, and if yes, which type and level of noise? In the text I only find that the set in part IV is noiseless.\n(2) While I can easily understand what different Grad-cam scores within a trajectory mean, I have difficulty visualising what differences in Grad-cam between trajectories entail (as used in part IIIc). Maybe there is a way to clarify this?\n(3) For reference, could you include the overall accuracy of ResAnDi for part IV, since the testing/training set features constant trajectory length (and is noiseless), I assume it would be higher than the 90\\% mentioned before?\n(4) Could you clarify whether part V uses the data set from part IV or the previous one?\n(5) Could you clarify what is meant by the bar notation in Eqs. (4), (6), (7).\n(7) The authors should also mention feature-based analyses, e.g., as developed in these papers: J. Phys. A 55, 244005 (2022); Entropy 22, 1436 (2020).\n(8) Could the authors accommodate a change-point analysis in their approach? This is of increasing relevance in data analysis, see, e.g., the discussion in J. Phys. Photon. 6, 045025 (2024); Biophys. J. 122, 4360 (2023); Phys. Rev. Res. 6 013054 (2024).", "reviewer_2": "I co-reviewed this manuscript with one of the reviewers who provided the listed reports. This is part of the Nature Communications initiative to facilitate training in peer review and to provide appropriate recognition for Early Career Researchers who co-review manuscripts.", "reviewer_3": "Bae et al. use a standard convolutional neural network (ResNet) architecture to classify single-particle trajectories undergoing anomalous diffusion and use Grad-CAM to identify the trajectory segments most relevant for the model decision. They further investigate correlations between Grad-CAM scores and statistical features, with the goal of extracting interpretable insights.\nWhile the application of explainable AI in this context is timely and relevant, the manuscript raises substantial concerns regarding novelty, the robustness of the proposed evaluation strategies, and the interpretation of results.\nIn my opinion, key claims, such as those related to the informativeness of Grad-CAM scores and the inferred links to physical mechanisms, are insufficiently supported or rely on questionable assumptions. Overall, the contribution to the field remains limited. For these reasons, I cannot recommend the publication in its current form.\nComments:\n1) Convolutional Neural Networks, such as ResNet, have demonstrated good performance in classification tasks like the one discussed in the manuscript. However, their application to time series or sequential data is not necessarily optimal. Time series exhibit correlations that are better captured by architectures such as Recurrent Neural Networks or attention-based models. In RNNs, gradients can similarly be backpropagated from the output to hidden states, allowing a weighted combination of activations to highlight important time steps (see, e.g., 10.48550/arXiv.1706.07206). Therefore, a discussion of alternative architectures and a rationale for selecting a CNN over RNNs or other sequential models is warranted. This is a critical point, especially in the context of interpretability, as the relevance and granularity of the Grad-CAM results may also depend on the network architecture used.\n2) On page 1, the authors claim: “More recently, deep learning was also applied to analyze anomalous diffusion.” This statement lacks proper references. I suggest citing the pioneering works for this field, such as Ref. 28, Ref. 33, 10.1103/PhysRevE.100.032410, and 10.1088/1367-2630/ab6065\n3) The set of references [27–33] used to support the statement about the improved performance of deep learning methods seems arbitrarily selected. It is unclear why other top-performing approaches in the AnDi challenge, which also outperformed classical methods, are not cited. The authors should justify the criteria for inclusion.\n4) The authors reference works on explainable AI broadly, but in the specific context of time-series and trajectories, they might consider including /10.1038/s42256-022-00595-0, where attention heads are used to quantify the relevance of time-points for trajectory classification.\n5) I have doubts concerning the validity of Grad-CAM evaluation in Section III.B. The experiment of removing high Grad-CAM scoring segments is inherently self-referential and tautological, since the segments determined as most important by the model are naturally expected to affect classification when removed. A more meaningful control could involve randomly shuffling trajectory segments of varying lengths (e.g., from segments as short as 2 points) and observing the classification accuracy.\n6) I’m also puzzled by the data augmentation via rotation of Section II.C. Since trajectory rotation preserves all intrinsic statistical properties except for the absolute direction, they effectively replicates trajectories without introducing true variability, thus artificially enriching and biasing the dataset.\n7) On page 4, the authors state: “These suggest that certain parts of the particle trajectories contain more information about the underlying diffusion mechanism than others, and that the Grad-CAM score can be used as an indicator of those crucial parts.” Why do different parts of the trajectories encode more information about anomalous diffusion? This point is extremely relevant. One can intuitively understand it for inhomogeneous models, but it is surprising for models like FBM.\n8) Section IV starts by stating: “Now that the relevance of Grad-CAM to the classification of anomalous diffusion mechanisms has been demonstrated, …” Based on the previous comments, I find this claim an overstatement. Even if proved by proper tests, it could at most be claimed that Grad-CAM can qualitatively account for the relative importance of different parts of the trajectory for the trained task. But this is what Grad-CAM has been built for in the case of images, so it would only show that this holds for a different type of data.\n9) In the same section, they use a different model trained on noiseless data without sufficient justification. The phrase “for the ease of statistical analysis” is vague and should be clarified.\n10) The interpretation of the results presented in Fig. 6 is highly speculative. The data presented does not provide direct evidence of what information is encoded by each block. Trajectory generation based on the features extracted at each block, e.g., as done for images in style transfer or deepdreams might help to better elucidate what information each layer captures from the trajectory.\n11) The correlation properties of FBM and LW are well established in the literature. The other measures introduced can be inferred based on knowledge of the theoretical models. The logic for selecting these features seems loosely tied to the evidence presented on the basis of ResNet.\n12) The authors define a non-Gaussianity parameter that is formally similar to the kurtosis, and conceptually related to trajectory-level ergodicity breaking parameters (e.g., as proposed in 10.1103/PhysRevE.93.052146). It would be useful to clarify the connection or distinction between these metrics.\n13) The measure referred to as “consistency” by the authors resembles what is more commonly called “persistence” in the study of stochastic trajectories. Also in this case, it would be useful to clarify the connection or distinction between these metrics.\n14) The rationale for introducing the \"singularity\" measure, as well as its physical interpretation, is not presented and needs a more detailed discussion.\n15) Crucially, it remains unclear what role Grad-CAM played, if any, in motivating the selection of these statistical descriptors. The plots in Fig. 6 represent features from the ResNet model and have no apparent connection to the Grad-CAM scores discussed elsewhere in the paper. Without a direct link between the interpretability method (Grad-CAM) and the statistical features analyzed, the subsequent correlation analysis feels disjointed and adds little beyond reiterating known properties.\n16) The histogram in Fig. 3 does not start from 0, which is misleading and exaggerates visual differences. This is not considered good practice in data visualization.\n17) The accompanying code is poorly documented. Dependencies are not listed, and the notebooks mainly show final outputs without clear instructions on reproducing results or applying the method to other datasets. This limits reproducibility and broader adoption.\n18) Reference 47 is incomplete; I believe it should be: 10.5281/zenodo.4775311\n19) References 18 and 56 appear to be duplicates.", "reviewer_4": "This article builds on the datasets of the dataset created by the AnDi challenge to explore some novel ideas on how to extract information from anomalous diffusion from trajectories of particles.\nIn particular it constructs a ResNet classifier and uses the GradCam algorithm to determine the parts of the trajectories that most contribute to the classification of the trajectories into super-, sub- and diffusive (as well as the various kinds of anomalous diffusion models).\nAbout the approach, I think it's very interesting and sufficiently novel from the machine learnign point of view.\nThe work is well described, with enough details to permit reproduction of the results (even though I haven't tried to reproduce them myself as part of this referee process).\nThere are some important poins that I'd like to see addressed before this article is published:\nIt'd be good to add some figure to show what are the portions of the trajectories (in 2D plots) that most contribution to the classification in each case. This would help in gaining some intuition about how this approach works.\nWhat happens when trajectories with switching points are provided to the network? This is actually an very interesting topic in itself and should be addressed in the body of the article.\nI have also an additional question: Why the accuracy in figures 3 and 4 doesn't seem to reach the level of 90+% stated in page 2?\nAbout the code: I checked the GitHub repository, which looks good and well organized, but I haven't tested it myself."}, "author_response": "Response to Report of Referee 1 — NCOMMS-24-68269A-Z\n[...]\nR: We thank the Referee for a positive review of our manuscript and strongly supporting its publication. We also appreciate the Referee’s constructive comments, which we address in detail below.\n[...]\nResponse to Report of Referee 3 — NCOMMS-24-68269A-Z\n[...]\nR: We thank the Referee for the thorough reading and constructive comments. We have carefully addressed all comments in our response below.\n[...]\nResponse to Report of Referee 4 — NCOMMS-24-68269A-Z\n[...]\nR: We thank the Referee for the positive review and helpful comments. Here is our response to each point raised by the Referee."}, {"round": 2, "reviewer_comments": {"reviewer_1": "I appreciate the thorough revision and explanatory notes by the authors. I still find the study of high quality and broad interest. In this revised version I strongly support publication.", "reviewer_2": "I co-reviewed this manuscript with one of the reviewers who provided the listed reports. This is part of the Nature Communications initiative to facilitate training in peer review and to provide appropriate recognition for Early Career Researchers who co-review manuscripts.", "reviewer_3": "The authors have provided detailed replies to my comments, but in several important cases they did not support their arguments with quantitative evidence and their responses often rely on speculative reasoning without additional validation.\nIn particular, I remain concerned that comments 5, 6, 7, and 10 have not been properly addressed. For these points, the authors offer extended argumentation but no concrete analyses that could substantiate the claims. In my opinion, without such evidence, the robustness of the proposed method cannot be convincingly established.\nIn addition, replying to comment 9, the authors now state that “all of the experiments were conducted using noiseless datasets.” This raises a major concern about applicability to real experimental trajectories, as also evidenced by their reply to comment 3 of Reviewer 4. In fact, Figure 5 shows that noise has a significant effect on the performance, and, in contrast to their claim, the so-called targeted augmentation seems to produce only a minor improvement (<4%). Thus, the applicability of the proposed approach in realistic conditions remains unclear.", "reviewer_4": "I believe that the article can now be published."}, "author_response": "Response to the Report of Referee 1 — NCOMMS-24-68269B\nI appreciate the thorough revision and explanatory notes by the authors. I still find the study of high quality and broad interest. In this revised version I strongly support publication.\nR: We are grateful to the Referee for the positive evaluation and for the continued support toward the publication of our manuscript in Nature Communications.\nResponse to the Report of Referee 4 — NCOMMS-24-68269B\nI believe that the article can now be published.\nR: We thank the Referee for supporting the publication of our manuscript in Nature Communications.\nResponse to the Report of Referee 3 — NCOMMS-24-68269B\nThe authors have provided detailed replies to my comments, but in several important cases they did not support their arguments with quantitative evidence and their responses often rely on speculative reasoning without additional validation.\nIn particular, I remain concerned that comments 5, 6, 7, and 10 have not been properly addressed. For these points, the authors offer extended argumentation but no concrete analyses that could substantiate the claims. In my opinion, without such evidence, the robustness of the proposed method cannot be convincingly established.\nR: We thank the Referee for the careful reading of the manuscript and for the constructive comments. We would like to clarify that our methodology is based on standard practices and commonly used heuristic approaches in the field. The additional analyses introduced in our previous revision were chosen after careful consideration of their scope and applicability, and we believe that they provide adequate support for the main conclusions of the paper.\n[...]"}]

Decision letter