Introduction

One of the hallmark discoveries made possible by fluorescence nanoscopy methods is the existence of a periodical lattice of F-actin, spectrin, and associated proteins under the surface membrane of neuronal processes. This lattice, containing F-actin rings periodically spaced 180–190 nm apart, was initially discovered in axons1. The lattice was later observed in dendrites of multiple types of neurons, albeit to a lesser extent compared to axons2,3,4. Several isoforms of spectrin have been observed in the lattice, with variable prevalence in axons compared to dendrites and during development3,4. In addition to forming periodical rings, other F-actin structures have been described at the nanoscale in axons and dendritic shaft, including longitudinal fibers2,5,6,7.

The role and regulatory mechanisms of the periodical submembrane skeletal structure remain unclear. It has been shown to be regulated during development in axons, dendrites, and dendritic spines2,3,4,8. It was demonstrated that the submembrane lattice destabilization triggers axonal degeneration9,10. A recent study provided evidence that it serves as a signaling platform for receptor tyrosine kinase transactivation in neurons11.

The more variable appearance and sporadic presence of the F-actin/spectrin lattice in dendrites compared to axons suggests that the structure is differently regulated in these distinct processes2,3,4,12. A clear discrimination between spatially overlapping axons and dendrites, using a combination of specific markers, has been lacking in studies comparing the properties of the lattice, which may have impacted the analyses of its prevalence in dendrites. Furthermore, the greater diversity of F-actin nanostructures in dendrites compared to axons poses an additional challenge for quantitative analysis of the submembrane lattice. Several features of neuronal culture conditions, age, or fixation methods may have also contributed to discrepancies across studies of the dendritic lattice. One feature that has not been controlled or assessed is the level of electrical or synaptic activity. Ample evidence has shown, using conventional microscopy methods, that neuronal activity regulates the F-actin cytoskeleton13,14.

We thus set out to test whether neuronal activity regulates the F-actin-based lattice in dendrites and axons of cultured hippocampal neurons, using STimulated Emission Depletion (STED) nanoscopy. The complexity of the nanoscale F-actin patterns in dendrites and axons required the use of image segmentation to quantify their dynamics. The high diversity and variability of the reported F-actin patterns1, 2,4,6,8 prompted a high throughput analysis framework for the detection of those patterns on nanoscopy images. Recently, deep learning methods have been developed for automated feature detection in microscopy images from cells15,16,17,18,19. We show here that, using a weakly supervised deep learning approach20,21,22, we could train a modified U-Net architecture15 to segment regions containing fluorescent F-actin rings and/or longitudinal fibers in axons and dendrites. We demonstrate that this can be done without a significant decrease in segmentation quality, even in the presence of incomplete or coarse labeling. Our quantitative analysis highlights the profound diversity of F-actin patterns in dendrites, revealing an activity- and Ca2+-dependent remodeling, from a lattice pattern to longitudinal fibers, which does not occur in axons. The activity-dependent remodeling of F-actin structures in dendrites may explain the previous sporadic observations of the submembrane F-actin lattice in dendrites and may be necessary to regulate membrane dynamics and protein transport required for dendritic signaling and plasticity.

Figure 1
figure 1

STED nanoscopy reveals diverse nanostructures of F-actin, in cultured hippocampal neuronal processes, that cannot be resolved with confocal microscopy. (a) Representative image of the F-actin skeleton showing the diversity of nanostructures that can be observed with STED nanoscopy. Arrows point to regions exhibiting dendritic rings (green), axonal rings (orange), longitudinal fibers (magenta), compact assemblies (cyan), or undefined or diffuse signal (yellow). Orange arrowheads indicate regions of overlapping axonal and dendritic patterns. (b) Three color imaging of the region in (a) showing the overlap between axons (cyan, phosphorylated neurofilaments—SMI31) and dendrites (yellow, MAP2). MAP2 and SMI31 were imaged with confocal resolution to highlight the shape of the processes. (c) Insets show a magnification of the regions indicated with the dashed squares in (a) for both STED (top) and confocal (bottom) imaging modalities. Scale bar 2 \(\upmu\)m, insets \(3.2\times 3.2\,\upmu \text {m}\).

Results

Activity-dependent remodelling of dendritic but not axonal F-actin nanostructures

To resolve the nanoscale organization of the F-actin cytoskeleton in neurons, we used the F-actin fluorescent marker phalloidin-STAR635, in low density cultured rat hippocampal neurons (8 and 13 DIV), imaged with STED nanoscopy. We observed complex and diverse patterns of fluorescence inside the neuronal processes that were only distinguishable with super-resolution microscopy (Fig. 1). The F-actin periodical ring patterns were robustly detectable in axons (co-labelled with axonal marker SMI31 antibody, detecting phosphorylated neurofilaments, enriched in axons23) (Fig. 1). By contrast, dendrites (co-labelled with dendritic marker MAP2 antibody) exhibited patches of (i) F-actin rings perpendicular to the shaft, mixed with patches of what appeared as either (ii) unstructured patterns of F-actin, (iii) compact assemblies of F-actin, or (iv) longitudinal fibers parallel to the shaft axis (Fig. 1)2,6,8. We also observed a polygonal-like (2D) F-actin lattice in somatic regions, as previously described4 (Supplementary Fig. 1a). These results confirm previous work illustrating the difference in the patterns of F-actin labelling in axons and dendrites2,3,4. They also highlight the frequent spatial overlap of axons and dendrites in cultures, revealing clear axonal lattice patterns overlaying dendrites (Fig. 1, orange arrowheads). Hence, the triple staining (F-actin, dendrites, and axons) is necessary to investigate the regulation of the lattice in both compartments.

Figure 2
figure 2

Nanoscale activity-dependent remodelling of F-actin revealed by STED nanoscopy. Three color imaging of F-actin (STED, white), phosphorylated neurofilaments (confocal, cyan) and MAP2 (confocal, yellow) was performed to identify F-actin nanostructures in dendrites (yellow) and axons (cyan). STED imaging shows that the prevalence of dendritic rings (green arrows) and longitudinal fibers (magenta arrows) is modulated by neuronal activity, while axonal rings (orange arrows) are observed regardless of the activity level. Shown are example images for (a) the activity-reducing stimuli high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\) and the three activity-promoting stimuli (b) 0\(\text {Mg}^{2+}\)/glycine/bicuculline (0\(\text {Mg}^{2+}\)/Gly/Bic), (c) high \(\text {K}^{+}\), and (d) glutamate/glycine (Glu/Gly). Insets (right) show a magnification of the regions identified with a white rectangle on the left STED images. Scale bar left: 2 \(\upmu\)m, insets: 1 \(\upmu\)m. For the raw images without overlay see Supplementary Fig. 3.

To investigate the dynamics of the submembrane lattice in axons and dendrites, via the monitoring of F-actin patterns, we considered a number of labeling strategies that were previously exploited for F-actin imaging at the nanoscale. These include photoactivatable green fluorescent protein (GFP), Lifeact, and Actin-Chromobody. However, these labels were shown not to reveal the F-actin periodical ring structure24,25,26. We also considered and tested live staining of the F-actin rings with fluorescent Jasplakinolide-derivative, a drug known to promote actin polymerization2,27,28. We observed that this reagent, tagged with silicone rhodamine (SiR-actin), revealed both F-actin rings and longitudinal fibers, as previously shown (Supplementary Fig. 2a–c)2. However, it was also shown that the reagent altered F-actin dynamics29. In fact, we noticed that the presence of F-actin fibers and bundles increased with incubation time, higher concentration of the SiR-actin label, or even post-incubation delay. To measure the impact of this Jasplakinolide-derivative on the presence of F-actin rings and longitudinal fibers, we incubated the neurons with a very low concentration of SiR-actin (0.5 \(\upmu\)M) for only 8 min, well below the manufacturer specification. We then fixed the cells with PFA and stained with phalloidin-STAR635 to quantify the F-actin patterns. The results show that SiR-actin pre-incubation increases the prevalence of F-actin longitudinal fiber over rings in dendrites compared to untreated neurons. These results confirm that the SiR-actin interferes with F-actin dynamics in live neurons, indicating that this approach is unsuitable to investigate the activity-dependent dynamics of F-actin remodeling (Supplementary Fig. 2d).

Figure 3
figure 3

Two-color STED nanoscopy of F-actin and \(\beta\)II-spectrin in dendrites. (a) Low-activity high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\) condition and (b) Glutamate/Glycine neuronal stimulation. (a) Top-Left and (b) Left: Overlay of two-color STED nanoscopy of F-actin (green) and \(\beta\)II-spectrin (red) with confocal imaging of MAP2 (blue) to identify the dendrites. Insets show the magnified regions identified in the full single-color STED images of F-actin and \(\beta\)II-spectrin. Arrows indicate the detected F-actin and \(\beta\)II-spectrin patterns: dendritic rings (green), axonal rings (orange), and longitudinal fibers (magenta). Scale bars (a, b) 2 \(\upmu\)m, insets \(1\,\upmu \text {m}\).

We thus decided to fix the neurons and triple stain them with phalloidin-STAR635 along with dendritic and axonal markers (Fig. 12, and Supplementary Fig. 3) to further assess the F-actin regulation in both neuronal compartments. We next asked whether neuronal activity had an impact on the patterns of F-actin in axons and dendrites, by applying activity-promoting/inhibiting treatments on live neurons, which we then fixed and triple-stained. We manipulated neuronal activity by incubating coverslips of neurons in either (i) a high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\) solution (10 min) to reduce basal neuronal activity, (ii) a 0\(\text {Mg}^{2+}\)/glycine/bicuculline (0\(\text {Mg}^{2+}\)/Gly/Bic) solution (10 min) to promote synaptic NMDA receptor activity, (iii) a high \(\text {K}^{+}\) (40 mM) solution (2 min) to briefly depolarize neurons, or iv) a glutamate/glycine (Glu/Gly) solution (2 min) to produce a broad excitatory stimulation30,31. Using STED nanoscopy, we observed activity-dependent remodelling of F-actin nanostructures on dendrites that could not be resolved with diffraction-limited confocal microscopy (Fig. 2). Increasing neuronal activity led to the reorganization of F-actin from periodical rings to longitudinal fibers (Fig. 2, green and magenta arrows). While in the low activity, high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\) condition, dendritic F-actin rings were prevalent, the strong activity promoting stimulation Glu/Gly resulted in F-actin longitudinal fibers being predominant on most of the dendritic shaft. The brief high K+ treatment induced a less pronounced reorganisation, while the synaptic stimulation 0\(\text {Mg}^{2+}\)/Gly/Bic was associated with a patchy F-actin lattice of intercalating or overlapping rings and fibers. Strikingly, we observed little impact of any of these treatments on the presence of the axonal periodical F-actin ring pattern (Fig. 2, orange arrows). These results suggest that while the submembrane periodical F-actin rings in axons are unaffected by neuronal activity, the dendritic rings disappear with increasing neuronal activity, seemingly reorganizing into longitudinal F-actin fibers.

We next needed to apply a method to quantify the activity-dependent remodeling of the submembrane lattice. Several studies have examined the periodical pattern of \(\beta\)II-spectrin, which has been shown to be very clearly labelled in axons using \(\beta\)II-spectrin antibodies and readily quantifiable using autocorrelation routines1,3,11. In dendrites however, the concentration of \(\beta\)II-spectrin varies during developments3,4 and is more sparsely distributed in the dendritic lattice, compared to the axonal one4,12. We nevertheless wanted to examine whether immunolabeling the neurons with \(\beta\)II-spectrin could help our quantification. We performed two-color STED nanoscopy of F-actin (Phalloidin-STAR635) and \(\beta\)II-spectrin (STAR580), in combination with confocal imaging of MAP2 (STAR488) to identify the dendrites. Hippocampal neurons (13 DIV), incubated in high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\) to reduce neuronal activity, showed clear F-actin periodical ring patterns in dendrites, while the \(\beta\)II-spectrin pattern was less organized (Fig. 3a, green arrows). In contrast, the \(\beta\)II-spectrin periodical pattern in the axons was clearly detected (Fig. 3b, orange arrows).

We tested the strongest condition of activity-dependent remodelling of F-actin observed (Glu/Gly; Fig. 2d). While this treatment elicited a clear formation of longitudinal F-actin fibers in dendrites, the pattern of \(\beta\)II-spectrin appeared again disorganized. Meanwhile, in axons, the periodical \(\beta\)II-spectrin and F-actin patterns remained stable and clear after glutamate/glycine stimulation (Fig. 3b). Since the prevalence of the different spectrin isoforms (\(\beta\)II, \(\beta\)III, \(\beta\)IV) changes during development in dendrites and differs compared to axons3,4, it is possible that labelling only one spectrin subtype is not optimal to resolve the dendritic lattice organization. We thus elected to continue monitoring F-actin to quantify the activity-dependent remodeling of the submembrane lattice.

To characterize the prevalence of F-actin nanostructures in axons and dendrites, whole-image labelling has previously been applied2. We considered a quantitative approach, in which we manually labeled the F-actin rings or longitudinal fibers using polygonal bounding boxes to evaluate the remodelling of F-actin (Suppl. Fig. 4). However the diversity of patterns, highly variable across neurons, posed a significant challenge of time consuming manual annotation (average labeling time of 30 min per image). Furthermore, the large image sizes (\(1\times 10^6\) to \(9\times 10^6\) pixels) made this process tedious and subject to decision fatigue32, thereby limiting its application for testing several conditions. We thus decided to develop a high throughput analysis framework for the quantification of the activity-dependent F-actin reorganization in dendrites and axons.

Figure 4
figure 4

Segmentation of F-actin rings and longitudinal fibers using a fully convolutional neural network. (a) Architecture of the fully convolutional network (FCN) (\(\mathrm {h}_{\rm {d}}\)), which is a modified 2D U-Net (see Materials and Methods for specific implementation details, Conv: Convolution, Batchnorm: Batch Normalization, ReLU: Rectified Linear Unit). \(\mathrm {h}_{\rm {d}}\) is trained with images labeled for F-actin rings (green) and fibers (magenta). It generates scores between 0 and 1 for each pixel to create prediction maps for both structures. Independent thresholds are applied for rings (0.25) and fibers (0.4) to obtain two segmentation maps (see Materials and Methods and Supplementary Fig. 7). (b) Comparison between the labeling of an expert (middle) and the corresponding FCN segmented image (right) on a representative image from the testing dataset. MAP2 (yellow) and phosphorylated neurofilaments (cyan) immunostaining and corresponding confocal images are used to identify dendrites and axons, respectively. Quantification of F-actin rings and fibers was performed within a dendritic mask generated from the MAP2 channel (white line, right). (c) Representative input image analyzed with the FCN. The segmented area for F-actin rings (green) and fibers (magenta) is calculated inside the dendritic mask (white line) (right image) for each image. Scale bars (a, b) 1 \(\upmu\)m, (c) 2 \(\upmu\)m. For the raw images without overlay see Supplementary Fig. 5.

Deep learning based analysis of F-actin nanostructures in axons and dendrites

To achieve reliable and high throughput quantification of the F-actin patterns at the nanoscale, we implemented a deep learning approach for the precise segmentation of F-actin rings and longitudinal fibers on STED images (Fig. 4). We chose to use a modified version of the U-Net architecture, a fully convolutional network (FCN), as it is known to perform well for biomedical image segmentation15 (See Materials and Methods and Fig. 4a). Training such network generally requires a large amount of labeled data or the use of massive data augmentation15. However, the tediousness of the data labeling process of these complex F-actin patterns limited the amount of available data for FCN training. Meanwhile, data augmentation relies on the possibility to add new training samples by distorting or modifying existing samples in such a way that it does not alter their semantic interpretation. In the context of super-resolution microscopy, many of the usual alterations (stretching, noise addition, etc.) affect the spatial relation between fluorescent structures.

Figure 5
figure 5

Performance evaluation of the FCN \(\mathrm {h}_{\rm {d}}\) in the context of weakly supervised learning and labeling errors. (a) Comparison between manual bounding box (left), precise contour (middle) and FCN predicted (right) labeling of the dendritic F-actin ring pattern (For the raw image without overlay see Supplementary Fig. 8). (b) Precision-recall curves for F-actin rings (green) and longitudinal fibers (magenta). The area under the curve, or average precision (AP), was calculated for both patterns. The network achieved an AP score of 0.53 and 0.67 for F-actin rings and fibers, respectively, compared to 0.38 and 0.5 for the manual bounding box labeling (using the precise contour labeling as the ground truth). The higher performance observed for the predictions compared to the bounding box labeling shows that the network is able to infer precise segmentation rules using only coarse examples. (c) Generation of a training dataset to characterize the impact of coarse labeling on the precision of \(\mathrm {h}_{\rm {d}}\) by stepwise dilation (original labels—blue, 100 nm—orange, 240 nm—green, 500 nm—red, 1 \(\upmu\)m—violet) of the training labels for F-actin rings (left) and fibers (right). (d) The AP scores were calculated for 5 different instances of the network for each dilation step. For F-actin fibers (right) dilation up to 1 \(\upmu\)m still resulted in network predictions with significantly higher precision than manual bounding box labeling (post-hoc t test, \(p_{\mathrm{original}} = 1.8210 \times 10^{-6}\), \(p_{{100\,\mathrm{nm}}} = 2.4291 \times 10^{-7}\), \(p_{240\,\mathrm{nm}} = 1.8530 \times 10^{-5}\), \(p_{500\,\mathrm{nm}} = 2.7931 \times 10^{-4}\), \(p_{1\,\upmu \mathrm{m}} = 9.7314 \times 10^{-3}\)). For the F-actin ring patterns, a dilation of 1 \(\upmu\)m led to an AP score comparable to the expert labeling (post-hoc t test, \(p_{1\,\upmu \mathrm{m}} = 0.3309\)), while smaller dilation steps led to significantly higher AP scores compared to bounding box labeling (post-hoc t test, \(p_{\mathrm{original}} = 1.9383 \times 10^{-5}\), \(p_{100\,\mathrm{nm}} = 4.1884 \times 10^{-5}\), \(p_{240\,\mathrm{nm}} = 2.2539 \times 10^{-7}\), \(p_{{500\,\mathrm{nm}}} = 2.3219 \times 10^{-4}\)). Black lines represent the 95% confidence interval calculated from the t-statistics distribution. Scale bars \(1\,\upmu \text {m}\).

Considering these constraints, we formulated the segmentation task as a weak supervision problem to generate a sufficiently large dataset20. The expert had to label the F-actin patterns using polygonal bounding boxes instead of carefully drawing contours of each pattern (Fig. 4b, Supplementary Fig. 4), thereby reducing considerably the required labeling time to generate the necessary dataset. We trained a first FCN (see Materials and Methods) for the detection of F-actin rings and longitudinal fibers in dendrites (\(\mathrm {h}_{\rm {d}}\), Fig. 4, Supplementary Fig. 5). A second one, \(\mathrm {h}_{\rm {a}}\), was trained to detect solely F-actin rings in axons since we did not observe longitudinal fibers in axons regardless of the experimental condition (\(\mathrm {h}_{\rm {a}}\), Supplementary Fig. 6a). We characterized the performance of both FCNs using standard metrics such as F1-score, specificity, sensitivity and precision (see subsection on Performance Metrics in the Material and Methods, Supplementary Figs. 67). To assess the suitability of this method for the quantitative analysis of the ratios between F-actin rings and longitudinal fibers in dendrites (Fig. 4c), we compared detected areas obtained by expert or \(\mathrm {h}_{\rm {d}}\) labeling (Supplementary Fig. 7c). The results show no significant difference in the F-actin rings and fibers ratio detected by \(\mathrm {h}_{\rm {d}}\) and an expert (Supplementary Fig. 7c).

Figure 5a, b demonstrate that \(\mathrm {h}_{\rm {d}}\) can use these labels to learn identifying the structures of interest, while generating more accurate segmentation compared to the coarse labels it was provided with. The precision-recall curves (Fig. 5b) were obtained from the comparison of the FCN predictions and bounding box annotations with a precisely annotated dataset, which is considered as the ground truth (P, see Materials and Methods). We observe a higher precision for \(\mathrm {h}_{\rm {d}}\) segmentation over all range of recall compared to polygonal bounding box annotations, implying that the labels generated by the network are closer to the ground truth than the manual bounding box annotations. Without learning precise segmentation rules, the system performance would be upper-bounded by the quality of the segmentation provided by a polygonal bounding box on P. This ability to cope with less precise and missing information is a key element in the application of deep learning methods for high throughput bio-imaging segmentation tasks, where the acquisition of more or better labeled images can be impracticable. To better characterize this ability, we designed two experiments. We first tested the sensitivity of \(\mathrm {h}_{\rm {d}}\) to omission of ground truth labels in the training dataset (polygonal bounding boxes), since we observed that manual labeling of large microscopy images was prone to this type of labeling errors. To this extent, we removed up to 70% of the expert labels in the training dataset, while keeping the number of training crops constant (See Materials and Methods and Supplementary Fig. 9). We observed that the performance of \(\mathrm {h}_{\rm {d}}\) is only slightly affected by sparse expert labeling and that even removing one out of two labels on the F-actin patterns resulted in a precision comparable to the original one (Supplementary Fig. 9a, b).

We also characterized how coarse labeling would influence the precision of the network. To this extent, we carefully labeled a small dataset of 70 images to calculate the average precision (AP) score of manual bounding box labeling (Fig. 5d, gray dotted line). We next compared the AP score of manual bounding box labeling to the performance of \(\mathrm {h}_{\rm {d}}\) trained with increasing label size (obtained by stepwise uniform dilation of the bounding box labels, see Materials and Methods, Fig. 5c, d). Our results show that even 1 \(\upmu\)m dilation of the training labels for the F-actin fibers and 500 nm dilation for the F-actin rings still lead to a significantly higher AP score compared to manual bounding box labeling (Fig. 5d). We thus concluded that our weakly supervised deep learning approach was reliable to analyse quantitatively the remodeling of F-actin patterns at the nanoscale in neurons.

Figure 6
figure 6

Increasing neuronal activity induces the reorganization of F-actin rings into longitudinal fibers in dendrites but not in axons. (a) Representative images of the periodical F-actin rings in axons of neurons exposed to 4 different treatments modulating neuronal activity. The area of F-actin rings segmented by the FCN \(\mathrm {h}_{\rm {a}}\) is shown in green. (b) The detected area for axonal rings in 13 DIV neurons remains unchanged upon stimulation (one-sided ANOVA, \(p = 0.2525\), numbers above each boxes indicate the number of neurons from 4 independent cultures). (c) Representative images of the periodical F-actin lattice and the longitudinal fibers in dendrites of 13 DIV neurons for four different treatments modulating neuronal activity: Top STED Images of F-actin stained with Phalloidin-STAR635 overlayed with the confocal images of the dendritic (MAP2, yellow) and axonal (phosphorylated neurofilaments, cyan) makers. Bottom: Predictions of the FCN for F-actin rings (green) and fibers (magenta) inside the dendritic mask (white line). (d) Bivariate kernel density estimate of the raw data (grey cross) for 8 DIV and 13 DIV neurons treated with (i) high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\) for 10 min (blue), (ii) 0\(\text {Mg}^{2+}\)/Gly/Bic for 10 min (green), (iii) high \(\text {K}^{+}\) for 2 min (orange) and iv) Glu/Gly for 2 min (violet). (e) Mean distributions using bootstrapping. The formation of F-actin fibers is enhanced for 13 DIV neurons compared to 8 DIV neurons for the synaptic stimulation 0\(\text {Mg}^{2+}\)/Gly/Bic or Glu/Gly, but not for high \(\text {K}^{+}\) stimulations. Shown are the regions comprising 95%, 99% and 99.9% of the data point distribution. Scale bars 1 \(\upmu\)m. d,e) Number of independent cultures (N): high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\) \(N_{\mathrm{8 DIV}} = 6, N_{\mathrm{13 DIV}} = 9\); 0\(\text {Mg}^{2+}\)/Gly/Bic \(N_{\mathrm{8 DIV}} = 4, N_{\mathrm{13 DIV}} = 8\); high \(\text {K}^{+}\) \(N_{\mathrm{8 DIV}} = 6, N_{\mathrm{13 DIV}} = 9\); Glu/Gly \(N_{\mathrm{8 DIV}} = 5, N_{\mathrm{13 DIV}} = 6\). Note that the detected areas for dendrite and axons cannot be compared since the detection of F-actin rings was performed with two different FCNs and using different foreground masks. Only a comparison between the stimulation conditions for each experiment (dendrites or axons) is possible. Scale bars 1 \(\upmu\)m. For the raw image without overlay see Supplementary Fig. 10.

Quantification of the activity-dependent reorganization of the F-actin lattice in dendrites and axons using deep learning

We first used the FCN \(\mathrm {h}_{\rm {a}}\), trained on bounding boxes identifying axonal F-actin rings, to quantify the presence of this structure in axons for different levels of neuronal activity (Fig. 6a, b, Supplementary Fig. 10). Using this approach, we measured the area of detected F-actin rings within axons, co-stained with SMI31 to generate an axonal mask (mean total length per image of \(151 \pm 89\,\upmu\)m and maximal branch length of \(32 \pm 13\,\upmu\)m, Fig. 6a, Supplementary Fig. 11a, b). This allowed to quantify automatically the proportion of F-actin rings in axons on a large dataset and for different neuronal activity levels (150 neurons, 4 independent cultures, 4 experimental conditions). Our quantitative approach reliably detected an F-actin periodical lattice in all analysed images of axons and revealed no activity-dependent change in its prevalence (one-sided ANOVA, p = 0.2525, Fig. 6b).

By contrast, our deep-learning based approach revealed significant effects on the F-actin patterns in dendrites of 13 DIV neurons (we also observed a clear activity-dependent remodeling in the soma, but did not quantify it, Supplementary Fig. 1). Automated analysis of the F-actin patterns within a dendritic mask was performed using the MAP2 confocal signal (mean total length per image of \(71 \pm 36\,\upmu\)m and maximal branch length of \(42 \pm 10 \upmu\)m, Fig. 6c, Supplementary Fig. 11c, d). The analysis revealed a remodelling of the F-actin rings into longitudinal fibers, scaling with the strength of the activity promoting stimuli (Fig. 6c). Under reduced neuronal activity (high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\)), the dendritic F-actin rings were most prevalent, while longitudinal fibers were rarely detected (Fig. 6c–e). We used a high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\) solution to reduce neuronal activity as the variability between neurons in the prevalence of F-actin rings and fibers was reduced compared to untreated cells (see Supplementary Fig. 12). Promoting synaptic activity with 0\(\text {Mg}^{2+}\)/Gly/Bic significantly reduced the proportion of dendritic area exhibiting F-actin rings and increased the prevalence of longitudinal fibers (\(p = 2.9 \times 10^{-6}\), randomization test (RdT, see Materials and Methods)). The ring pattern was even more strongly reduced with brief (2 min) high \(\text {K}^{+}\) or Glu/Gly stimulation (RdT: \(p_{\mathrm{high K^{+}}} = 9.1 \times 10^{-15}\), \(p_{\mathrm{Glu/Gly}} = 0\), Fig. 6c–e). Meanwhile, we observed a correlative progression of the formation of F-actin longitudinal fibers with the strength of neuronal activity stimulation (Fig. 6c–e). These F-actin fibers did not colocalize with microtubules (Supplementary Fig. 13), suggesting that both structures are not directly associated. These results indicate that while neuronal activity has no impact on the stability of the F-actin submembrane lattice in axons, it causes its reorganization into longitudinal fibers in dendrites.

Since the F-actin/spectrin lattice has been reported to be regulated by neuronal development in dendrites2,4, we compared the effects of the different stimuli on 8 and 13 DIV neurons (Fig. 6d, e). The results indicated that dendritic F-actin rings were slightly more prevalent, whereas fibers were less prevalent, in young neuron compared to older ones, at low neuronal activity (high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\)). Synaptic stimulation (0\(\text {Mg}^{2+}\)/Gly/Bic) elicited a significantly stronger F-actin dendritic reorganization in mature cultures, whereas broad membrane depolarization with high \(\text {K}^{+}\) caused a similar extent of reorganization at both ages (RdT: \(p_{\mathrm{0Mg^{2+}}/Gly/Bic} = 0.01\), \(p_{\mathrm{high K^{+}}} = 0.14\)). Finally, Glu/Gly stimulation caused a strong remodeling of F-actin in young neurons and a nearly complete transition to dendritic fibers in mature cultures (RdT: \(p_{\mathrm{Glu/Gly}} = 1.1 \times 10^{-4}\), Fig. 6d, e). These results indicate that the activity-dependent remodeling of dendritic F-actin cytoskeleton is more pronounced in mature and more synaptically connected neurons.

To test whether the impact of the 0\(\text {Mg}^{2+}\)/Gly/Bic stimulation depended on action potential firing, we tested the effect of co-application of the sodium channel blocker tetrodotoxin (TTX). We observed a partial but significant reduction in F-actin remodeling by TTX (RdT: \(p = 1.4 \times 10^{-3}\), Fig. 7a, b). It was shown that miniature excitatory potentials can drive NMDA receptor (NMDAR) activity in absence of \(\text {Mg}^{2+}\)33. We thus tested the effect of NMDAR blocker (2R)-amino-5-phosphonovaleric acid (APV) on the 0\(\text {Mg}^{2+}\)/Gly/Bic stimulus and found that it reduced more strongly the F-actin remodeling (RdT: \(p = 2.5 \times 10^{-5}\), Fig. 7a–c, Supplementary Fig. 14), compared to TTX. These results indicate that synaptic NMDAR activity can trigger F-actin remodeling from a ring to fiber pattern in dendrites.

Neuronal depolarization and NMDAR activities drive \(\text {Ca}^{2+}\) influx, which activates a wide range of dendritic signaling processes. We thus assessed whether \(\text {Ca}^{2+}\) influx was mediating the high \(\text {K}^{+}\)-induced remodeling of dendritic F-actin cytoskeleton, by either i) increasing the \(\text {Ca}^{2+}\) concentration or ii) blocking \(\text {Ca}^{2+}\) entry with \(\text {Cd}^{2+}\). In comparison to regular \(\text {Ca}^{2+}\) concentration (1.2 mM), 2.4 mM caused a significantly stronger reduction in F-actin rings accompanied by an increase in F-actin fibers (RdT: \(p_{2.4mM Ca^{2+}} = 6.6 \times 10^{-5}\), Fig. 7d–f). Application of \(\text {Cd}^{2+}\) during the stimulation prevented the activity-dependent reorganization of the F-actin cytoskeleton; no significant reorganization of the F-actin cytoskeleton was observed compared to high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\) condition (RdT: \(p_{Cd^{2+}} = 0.06\), Fig. 7d–f, Supplementary Fig. 14). These results indicate a clear \(\text {Ca}^{2+}\)-dependence for the activity-dependent F-actin remodeling in dendrites.

Finally, we assessed whether the F-actin remodelling was reversible by washing the neurons with high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\) activity blocking solution for 15 min after a 2 min high \(\text {K}^{+}\) stimulation. We observed a partial recovery of the F-actin rings combined with a strong reduction in F-actin fibers following the 15 min wash. These results suggest that the activity-dependent remodeling of F-actin is at least partially reversible (\(p = 3.1 \times 10^{-4}\), Fig. 7d, e).

Discussion

Our results demonstrate that the somatodendritic F-actin-based lattice is highly dynamic compared to that of the axon. While it was known that the dendritic lattice is distributed in a more patchy fashion, we show here that this difference is likely due, at least partially, to a distinct response to neuronal activity, which destabilizes the lattice only in dendrites and somata (Fig. 8). The sporadic presence of the submembrane lattice previously reported in dendrites may thus be due to variable levels of electrical or synaptic activities in the neuronal culture preparations, which have not been specifically controlled and which also depend on the developmental stage of the preparation1,2,4,12. In our study, we specifically controlled both the neuronal activity level and the developmental stage of the preparation and found that the extent of dendritic remodeling is more pronounced in more mature and synaptically connected neurons. Another source of variability may have arisen from inconsistent use of specific axonal and dendritic markers to discriminate these processes. We found it critical to have double labeling of both axonal and dendritic markers in our cultures, as these distinct processes exhibit considerable spatial overlap, while their F-actin-based membrane lattice reacts differently to neuronal stimulation.

Figure 7
figure 7

Synaptic NMDAR activity and \(\text {Ca}^{2+}\) influx drive a reversible dendritic F-actin reorganization from a ring to fiber pattern. (a) Mean distributions of dendritic F-actin rings and fibers using bootstrapping for synaptic stimulation (0\(\text {Mg}^{2+}\)/Gly/Bic for 10 min) without (green) or with TTX (black) or APV (red) compared with the low activity high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\) condition (blue). (b) Density distribution of the raw data. TTX (1 \(\upmu\)M) partially but significantly blocks the F-actin remodeling caused by 0\(\text {Mg}^{2+}\)/Gly/Bic stimulation, while APV (25 \(\upmu\)M) blocks it further (\(p = 1.4 \times 10^{-3}\) and \(p = 2.5 \times 10^{-5}\), respectively). (c) Representative images of neurons treated with 0\(\text {Mg}^{2+}\)/Gly/Bic with (left) and without (right) APV segmented with our deep learning based approach. (d) Mean distributions of dendritic F-actin rings and fibers using bootstrapping for 2 min high \(\text {K}^{+}\) stimulation (1.2 mM \(\text {Ca}^{2+}\), orange) or with 2.4 mM \(\text {Ca}^{2+}\) (violet) or with 1.2 mM \(\text {Ca}^{2+}\) and 50 \(\upmu\)M \(\text {Cd}^{2+}\) (cyan). The red circles indicate the same high \(\text {K}^{+}\) stimulation (1.2 mM \(\text {Ca}^{2+}\)) condition followed by 15 min wash in high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\). The F-actin remodeling is \(\text {Ca}^{2+}\)-dependent and reversible, at least partially within 15 min. (e) Density distribution of the raw data. (f) Representative images of neurons treated with high \(\text {K}^{+}\) stimuli with (left) and without (right) \(\text {Cd}^{2+}\) segmented with our deep learning based approach. Statistical analysis performed with a randomization test (see Materials and Methods). Number of independent cultures (N) and number of neurons (n): high \(\text {Mg}^{2+}\)/low \(\text {Ca}^2+\) \(N = 9\), \(n = 86\), 0\(\text {Mg}^{2+}\)/Gly/Bic \(N = 8\), \(n = 70\); 0\(\text {Mg}^{2+}\)/Gly/Bic \(1\upmu\)M TTX \(N = 2\), \(n = 20\); 0\(\text {Mg}^{2+}\)/Gly/Bic + \(25\upmu\)M APV \(N = 2\), \(n = 20\); high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\) \(N = 9\); high \(\text {K}^{+}/1.2\) mM \(\text {Ca}^{2+}\) \(N = 9\), \(n = 83\); high \(\text {K}^{+}/2.4\) mM \(\text {Ca}^{2+}\) \(N = 2\), \(n = 20\); high \(\text {K}^{+}/50\,\upmu\)M \(\text {Cd}^{2+}\) \(N = 2\), \(n = 22\); high \(\text {K}^{+}/15\) min wash high \(\text {Mg}^{2+}\) \(N = 3\), \(n = 32\). For the raw images without overlay see Supplementary Fig. 14.

We demonstrated that the activity-dependent disappearance of the somatodendritic submembrane lattice coincided with the formation of F-actin longitudinal fibers. The simplest interpretation of this observation is that the F-actin underwent restructuring from a ring to fiber pattern. This putative remodeling would be demonstrated more clearly using live imaging, however, as we described and discussed above, currently available F-actin probes either do not reveal, or interfere with, the F-actin lattice dynamics. Nevertheless, the \(\text {Ca}^{2+}\)-dependence of this proposed remodeling is consistent with previous work showing that nucleation, capping, and severance of F-actin is regulated by \(\text {Ca}^{2+}\)34. Meanwhile the lattice remodeling might also be modulated by spectrin cleavage through \(\text {Ca}^{2+}\)-dependent calpain11,35. The reasons why the axonal lattice is resistant to enhanced neuronal activity remain to be determined. The elevation in axonal \(\text {Ca}^{2+}\) may be reduced compared to other domains. Alternatively, the composition of the lattice may differ in axons, making it less sensitive to \(\text {Ca}^{2+}\)-mediated destabilisation. The selective presence in axons of transmembrane and extracellular matrix-interacting proteins, such as neurofascin, which has been shown to intercalate with F-actin rings in axons2, may have a stabilizing role for the submembrane lattice.

The stability of the membrane-associated cytoskeleton was shown to be important for RTK signaling11. The activity-dependent remodeling of the F-actin based lattice into F-actin longitudinal fibers might, on the other hand, be necessary for some dendritic signaling mechanisms, such as endo/exocytosis, membrane receptor lateral movement, intracellular trafficking or spine formation. In contrast, the stable lattice in axons might limit transmembrane receptor movement36, which could support a tight location of voltage-dependent channels critical for action potential conduction. It might also serve to restrict exo/endocytosis to pre-synaptic terminals, where the lattice is less organized2,12. In contrast, the removal of the lattice in dendritic segments may release a break on membrane receptor diffusion and exo/endocytosis, or spine formation. Meanwhile, the activity-dependent formation of F-actin longitudinal fibers in dendrites may serve to promote active cargo transport5,37 and targeting of material to synapses7. As such, the activity-dependent conversion of membrane-associated rings to intracellular fibers of the dendritic F-actin cytoskeleton may be essential for synaptic plasticity. In this context, we found that NMDA receptor function, which is crucial for synaptic plasticity, was essential in supporting the remodeling of the dendritic F-actin rings to longitudinal fibers. Hence, of the numerous signaling processes downstream of NMDA receptor function and \(\text {Ca}^{2+}\) during synaptic plasticity, the remodeling of the dendritic F-actin-based lattice into longitudinal fibers may be of significance.

The quantification of these fluorescent patterns is highly difficult because of the heterogeneity and complexity of the signals, and because it is prone to biases. Our study emphasizes the potential of machine learning approaches, as an expert surrogate, for high throughput analysis of complex and highly variable neuronal structures observed with optical nanoscopy. It became essential in order to pick up subtle differences associated with developmental stages, activity levels or drug action. The segmentation task shown here presented a number of challenges related to the context of experimental biology: (1) limited number of biological samples and labeled data (keeping in mind that increasing the amount of images for the training dataset reduces the available dataset for biological analysis), (2) high variability across samples, (3) expert-dependent determination of the ground truth, (4) no direct link to other problems that could be used as a pre-training step. We demonstrated how a deep learning approach can be applied, using weak supervision and harnessing the deep network extrapolation power. We also characterized how two types of labeling problems (e.g. incomplete and decreased precision) influence the performance of the FCN in this weakly supervised learning framework. We showed that our approach was sufficiently robust to the use of coarse labeling and label omission. This should broaden the possibilities of exploiting deep learning-based analysis for high throughput biomedical image analysis, especially when the generation of a large precisely labeled training dataset is impracticable. The weakly supervised deep learning approach used in our study provided the necessary tool to investigate more effectively and accurately the activity-dependent remodeling of the dendritic F-actin cytoskeleton, and should be useful for similar types of optical imaging-based investigations of cellular signaling.

Figure 8
figure 8

Schematic representation of the nanoscale patterns of F-actin cytoskeleton in axon and dendrites in a neuron undergoing variable level of neuronal activity; the periodical lattice reorganizes into longitudinal fibers in dendrites, but not in axons, with increasing neuronal/\(\text {Ca}^{2+}\) activity.

Materials and methods

Cell culture and neuronal stimulations

Neuronal cultures were prepared from neonatal Sprague Dawley rats. We followed the guidelines of the animal care committee of Université Laval for the care and use of the rats. Before dissection of hippocampi, animals were sacrificed by decapitation, in accordance to the procedures approved by the animal care committee of Université Laval. Dissociated cells were plated on poly-d-lysine coated glass coverslips (\(\sim\) 12 mm) at a low density of 25,000 cells/ml. The growth medium consisted of Neurobasal and B27 (50:1), supplemented with penicillin/streptomycin (50 U per mL; 50 \(\upmu\)g per mL) and 0.5 mM L-GlutaMAX (Invitrogen). High density neurons (10 million cells/mL) were plated directly in poly-d-lysine coated wells to serve as a feeding layer for the low density coverslip, placed upside down above the feeding layer. To limit proliferation of non-neuronal cells, Ara-C (2.5 \(\upmu\)M,; Sigma-Aldrich) was added to the media 2 days later. Thereon, the culture was fed twice a week by replacing \(\sim\) 1/3 of the growth medium with serum- and Ara-C–free medium.

Neuronal stimulations were performed in HEPES buffered solutions at 37\(^{\circ }\)C. The following solutions were used: high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\) (in mM: NaCl 98, KCl 5, HEPES 10, \(\text {CaCl}_{{2}}\) 0.6, Glucose 10, \(\text {MgCl}_{{2}}\) 5), 0\(\text {Mg}^{2+}\)/Gly/Bic (in mM: NaCl 104, KCl 5, HEPES 10, \(\text {CaCl}_{{2}}\) 1.2, Glucose 10, \(\text {MgCl}_{{2}}\) 0, Glycine 0.2, Bicuculline 0.01), high \(\text {K}^{+}\) (in mM: NaCl 75, KCl 40, HEPES 10, \(\text {CaCl}_{{2}}\) 1.2, Glucose 7.5, \(\text {MgCl}_{{2}}\) 1), Glu/Gly (in mM: NaCl 102, KCl 5, HEPES 10, \(\text {CaCl}_{{2}}\) 1.2, Glucose 10, \(\text {MgCl}_{{2}}\) 1; Glutamate 0.1, Glycine 0.01); Osmolality: 240–250 mOsm/kg, pH: 7.35. Incubation lasted 10 min for high \(\text {Mg}^{2+}\)/low Ca2+ and 0\(\text {Mg}^{2+}\)/Gly/Bic treatments and 2 min for high \(\text {K}^{+}\) and Glu/Gly stimulation. After the treatment, the cells were directly transferred in a 4% paraformaldehyde (PFA) solution for fixation (See Fixation and Immunostaining). To characterize the impact of action potential firing or NMDAR activity on F-actin reorganization during the synaptic stimulation 0\(\text {Mg}^{2+}\)/Gly/Bic, \(1\,\upmu \text {M}\) TTX or 25 \(\upmu\) APV were added, respectively, to the stimulation solution. To assess the reversibility of the F-actin reorganization caused by high \(\text {K}^{+}\) stimulation, cells were first stimulated 2 min in high \(\text {K}^{+}\) solution and transferred into 37\(^{\circ }\)C high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\) blocking solution for 15 min prior to fixation. The effect of \(\text {Ca}^{2+}\) on the F-actin reorganization was assessed either by increasing the \(\text {Ca}^{2+}\) concentration of the high \(\text {K}^+\) solution (\(\text {CaCl}_{{2}}\) 2.4 mM) or by blocking calcium channels with \(\text {Cd}^{2+}\) (\(100\,\upmu \text {M}\) \(\text {CdCl}_{{2}}\)) during high \(\text {K}^{+}\) stimulation.

Latrunculin A was used to disrupt the F-actin lattice as reported previously4. Latrunculin A was added to the culture media for 1 h with a final concentration of \(10\,\upmu \text {M}\). Subsequently, cells were incubated 10 min in high \(\text {Mg}^{2+}\)/low \(\text {Ca}^{2+}\) solution with 10 \(\upmu\)M latrunculin A and fixed with 4% PFA solution.

Fixation and immunostaining

Cultured hippocampal neurons were fixed in 4% PFA solution, permeabilized with 0.1% Triton X-100, blocked with 2% goat serum and immunostained as described previously38. To improve the F-actin staining, phalloidin was incubated for 2h following the immunostaining steps with primary and secondary antibodies. Coverslips were mounted in Mowiol-DABCO for imaging. F-actin was stained with phalloidin-STAR635 (Abberior, cat. 2-0205-002-5, 1:50 dilution). Dendrites were identified using a staining against the microtubule-associated-protein-2 with Rabbit-anti-MAP2 PAB (Milipore Sigma, cat. AB5622, 1:1000) and GAR-STAR488 SAB (Abberior, cat. 2-0012-006-5, 1:250). Axons were identified using a staining against the phosphorylated neurofilaments (SMI31) stained with the PAB mouse-anti-SMI31 (Biolegend, cat. 801601, 1:250) and the SAB GAM-STAR580 (Abberior, cat. 2-0002-005-1, 1:250).

STED-imaging

Super-resolution imaging was executed on a 4 color Abberior Expert-Line STED system (Abberior Instruments GmbH, Germany). Imaging of F-actin stained with Phalloidin-STAR635 was performed using a 640 nm pulsed diode (40 MHz), a 775 nm depletion laser (40 MHz) and a ET685/70 (Chroma, USA) fluorescence filter. MAP2-STAR488 and SMI31-STAR580 were imaged in confocal mode using excitation diodes at 485 nm and 561 nm (40 MHz), 525/50 and 615/20 (Semrock, USA) fluorescence filters, respectively. Scanning was conducted in a line scan mode with a pixel dwell time of \(15\,\upmu \text {s}\) and pixel size of 20 nm. For the STED image of the F-actin cytoskeleton a line repetition of 5 was selected. The microscope was equipped with a 100\(\times\) 1.4NA, oil objective and fluorescence was detected on independent avalanche photodiode detectors (APD) with approximately 1 Airy unit detection pinhole. Our STED microscope was equipped with a motorized stage and auto-focus unit. Images were processed using FIJI (ImageJ) software39.

Dataset

For the training of the FCNs presented in this work, two labeled datasets (1. Dendritic F-actin rings and fibers and 2. Axonal rings) were built using a custom labeling application developed in Python.

For the segmentation of dendritic F-actin ring and fiber regions, we collected a set of large STED images (between \(500\times 500\) and \(3000\times 3000\) pixels) of the F-actin cytoskeleton. Each image contained 3 channels: (1) F-actin (phalloidin-STAR635), (2) an axonal marker (SMI31-STAR580), and (3) a dendritic marker (MAP2-STAR488). Areas exhibiting F-actin rings and fibers were labeled by an expert on the MAP2-positive regions (Fig. 4b). The labels were additionally filtered by keeping only the regions belonging to the foreground mask generated with the MAP2 channel (Otsu thresholding operation40 applied after a gaussian blur with \(\sigma = 20\) pixels). The training, validation, and testing datasets for dendritic F-actin structures consisted in, respectively, 42, 52, and 105 representative images, with neurons at different activity levels in all sets. The large testing dataset was designed to include a representative distribution of images from 8 different treatment conditions as well as sufficient number (12-15) of independent cells for each condition. We could therefore compare the performance of the FCN to the manual labelling for various activity levels, ensuring that no bias was induced by FCN labelling between different treatments.

While a FCN could be trained on large images, it is more convenient to use smaller crops for this purpose, since the model is size independent. We thus used a \(128\times 128\) sliding window with a 16 pixels overlap on the input images to generate a total of 2263 crops for the training set. To reduce class imbalance, we considered only crops comprising a label (rings or fibers) on at least 1% of their total area. The intensity in each crop was scaled in the [0, 1] range. For the scaling, the minimum and maximum values of each image in the dataset were computed. The median of all minima (m) was used as [0] and the median of all maxima plus 3 standard deviation (M) was used as [1]. This \([\texttt {m}, \texttt {M}]\) interval was multiplied by a factor of 0.8 for the normalization. The resultant crop was clipped in the [0, 1] range to ensure the proper intensity scale for any input. Data augmentation was applied at training time (flip up-down and left-right, intensity scale and gamma adaptation), with a 50% probability for each operation.

For the segmentation of the periodical F-actin lattice in axons, a training set was built with 335 small images (\(224\times 224\) pixels) of axons only stained with phalloidin-STAR635. The validation and testing set consisted in 112 and 69 images, respectively. The axonal F-actin rings were labeled by an expert as described above. Sliding window, scaling and data augmentation operations were applied similarly to the dendritic dataset. For this dataset, we did not enforce any minimum labeled area.

Fully convolutional neural network

Two FCNs were implemented (\(\mathrm {h}_{\rm {d}}\), \(\mathrm {h}_{\rm {a}}\)) based on the well-known U-Net architecture (Fig. 4a and Supplementary Fig. 6a)15 using the PyTorch library.

The first FCN (\(\mathrm {h}_{\rm {d}}\)) was designed for the detection of dendritic F-actin rings and fibers. Each resolution step in the contracting path is composed of two sets of \(3\times 3\) convolutional layers, followed by a batch normalization and a \(2\times 2\) max-pooling. The layer sizes are of \(\{16, 32, 64, 128\}\) filters, respectively. The layers in the expanding path are symmetrical to the contracting path, but with an additional \(2\times 2\) transposed convolution (stride of 2). As in the seminal implementation, skip links allow to keep and propagate information at various scales. A final \(1\times 1\) convolutional layer collapses the features into two segmentation maps, one for the F-actin rings and one for the F-actin fibers (Fig. 4a). Since a region can contain both rings and fibers, we treated each network output independently. Rectified linear unit (ReLU) activation was used throughout the network, except for the output layer, which uses a sigmoid.

The loss function was a root mean squared error (RMSE), and we used early stopping on the validation set to ultimately keep a model with good generalization properties. The Adam optimizer was used with a learning rate of 0.001, with the other parameters kept to their default values. Batch size was set at 72.

To obtain a binary segmentation map, a hard threshold had to be applied on the network predictions. To compute the optimal thresholds for the two independent channels, we generated receiver operating curves (ROC) using the validation set. We computed the euclidean distance between the false positive and true positive rate (FPR, TPR) coordinate of the thresholds to the optimal operation point (FPR = 0, TPR = 1) and took the threshold having the smallest distance (Supplementary Fig. 7). The optimal threshold (rings: 0.25, fibers: 0.4) was obtained from the median of the thresholds calculated on the ROC curves of 15 low activity and 8 high activity images. Note that these thresholds could be easily adjusted to adapt to different imaging conditions in other experiments.

We trained a total of 25 networks with the same configuration and asserted their performance using common metrics (see section Performance Metrics, Supplementary Fig. 7d). To control for the ability of \(\mathrm {h}_{\rm {d}}\) to robustly detect the reorganization of the F-actin patterns in dendrites, we compared the proportions of rings and fibers predicted by the FCN \(\mathrm {h}_{\rm {d}}\) to ones labeled by an expert. Supplementary Fig. 7c shows no significant difference between expert and FCN labeling for both low and high neuronal activity conditions, indicating that the deep learning approach can reliably detect different proportions of F-actin rings and fibers in neurons. We also performed a dimensionality reduction on the embedded central layer of the FCN \(\mathrm {h}_{\rm {d}}\) using the non-linear approach Uniform Manifold Approximation and Projection (UMAP)41. Supplementary Fig. 15 shows a clear separation in this reduced space between crops containing rings and fibers.

The \(\mathrm {h}_{\rm {a}}\) network was designed to detect the presence of the axonal F-actin rings. The resolution steps were the same as for \(\mathrm {h}_{\rm {d}}\), but the layer size were of \(\{8, 16, 32, 64\}\) filters, respectively (Supplementary Fig. 6a). The layers in the expanding path are symmetrical to the contracting path. The Adam optimizer was used with similar parameters as \(\mathrm {h}_{\rm {d}}\), with early stopping used here as well. Batch size was set at 96. Cross entropy was used as a loss function. The binary segmentation map was obtained using a hard threshold of 0.02 on the prediction of the network. This threshold was calculated using the same ROC procedure as for the \(\mathrm {h}_{\rm {d}}\) (Supplementary Fig. 6c). We evaluated the metrics on the testing dataset to obtain the performance of the network in generalization (Supplementary Fig. 6d). Examples of predictions from the testing dataset compared to the labels of the expert and the confusion matrix demonstrate the performance of \(\mathrm {h}_{\rm {a}}\) (Supplementary Fig. 6e, f).

To control for the sensitivity of \(\mathrm {h}_{\rm {a}}\) to detect changes of the axonal F-actin pattern, we tested its capacity to detect the disruption of the periodical lattice on a sample treated with Latrunculin A (Lat A). Supplementary Fig. 16 shows that the deep learning approach can successfully identify a significant reduction of the detected axonal F-actin rings on the Lat A treated cells (Supplementary Fig. 16, 5 neurons, one-sided ANOVA, \(p = 0.049\)).

Weak labels

Due to the time consuming and difficult task related to precise segmentation of numerous super-resolution microscopy images, we formulated the segmentation problem as a weakly supervised learning approach, where the network is trained on coarse labels that are faster and easier to produce. Our results demonstrate the ability of the network to go beyond the training labels and exceed the accuracy of the bounding boxes (B). In other words, the network is able to infer precise segmentation rules using only coarse examples. To assess the improvement in segmentation performance, we asked the expert to take the time to precisely label (P) 70 regions (38 for rings and 32 for fibers) randomly sampled from the testing dataset. We then compared the precision-recall curve (PR), an analysis method that is insensitive to class imbalance (e.g. number of background pixels in our images being more important than the number of foreground pixels) (Fig. 5b). The comparison of the predicted segmentation (S) and B with P as ground truths demonstrated how S exhibits a higher precision over all range of recall than B, showing that the prediction of \(\mathrm {h}_{\rm {d}}\) is closer to P than B (Fig. 5b and Supplementary Fig. 9d). This asserts that the trained FCN generated more accurate segmentation than the labels it was trained with. If the network had not gone further than the bounding box labels, its performance on precise labels would have been at most the performance of B on P.

We also set out to analyse how coarse labels can impact on the precision of the predictions. To do so, we trained 5 different instances of networks for different stepwise dilation of the labels (from 100 nm to 1 \(\upmu\)m, Fig. 9c, d). Following training, the thresholds for the prediction of rings and fibers were calculated using the ROC procedure described in the Fully Convolutional Neural Network Methods section. The precise dataset was then used with all instances of network to calculate the average precision (AP) score with the precise labels as ground truth (Fig. 5d, Supplementary Fig. 9d).

Resampling

For bivariate data analysis two resampling methods were employed: (1) bootstrapping42 for data visualization and (2) randomization test (shuffling) for statistical analysis43. The bootstrapping experiments consisted in sampling the data points for each condition with replacement to generate an estimate of the mean values distribution. For each condition (N data points per condition), a bootstrap sample consisted of randomly selecting N data points with replacement from the raw data and calculating the mean value of the distribution. The number of repetitions was set to 10,000 for all conditions. It resulted in a distribution of the bootstrapped mean values that could be used for data visualization (Figs. 6e, 7a, d). For the comparison between two different stimulation conditions, statistical analysis was performed using a randomization test. The null hypothesis for each set of two conditions (A and B) was that both conditions belonged to the same distribution. First, the difference between the mean values of A and B was calculated (\(D_{raw} =\,\mu _{A} -\,\mu _{B}\)). Data points from both conditions were randomly reassigned to two groups A’ and B’ having \(N_{A}\) and \(N_{B}\) data points, respectively. The difference between the mean values of A’ and B’ was determined (\(D_{rand} =\,\mu _{A'} - \mu _{B'}\)). The difference of mean values obtained from the raw data (\(D_{raw}\)) was compared to the distribution of the differences obtained from 10,000 randomization samples (\(D_{rand}\)) to verify the null hypothesis, assuming multivariate normal distribution of randomization samples.

Performance metrics

We define common pixel-wise metrics that were used to evaluate the performance of the architectures44. The first metric is the F1-score and measures the overlap between the segmentation map and the ground truth. The F1-score is defined as

$$\begin{aligned} {\mathrm{F1}} = \frac{{\mathrm{2TP}}}{{\mathrm{FP + 2 TP + FN}}}, \end{aligned}$$
(1)

where TP, FP and FN are true-positive, false-positive and false-negative respectively. The second metric calculates the proportion of the ground truth also present in the predicted segmentation. It is called the sensitivity and is defined as

$$\begin{aligned} {\mathrm{sensitivity}} = \frac{{\mathrm{TP}}}{{\mathrm{TP + FN}}}. \end{aligned}$$
(2)

The specificity measures the proportion of background also predicted as background in the segmentation map. It is defined as

$$\begin{aligned} {\mathrm{specificity}} = \frac{{\mathrm{TN}}}{{\mathrm{TN + FP}}}, \end{aligned}$$
(3)

where TN stands for true-negative. Precision, which measures the proportion of true features over all the true prediction, is defined as

$$\begin{aligned} {\mathrm{precision}} = \frac{{\mathrm{TP}}}{{\mathrm{TP + FP}}}. \end{aligned}$$
(4)

Analysis of axonal and dendritic branch lengths

For the morphological analysis of the dendritic and axonal processes we used two measurements that were performed on each image: (i) total length of analysed branches and (ii) maximal length of a branch. Briefly, we generated a skeleton image from the binary masks used to identify dendrites and axons. We extracted all nodes, i.e. a joint or an end point, from the skeleton image. The skeleton was subdivided in multiple segments, where each segment has a start and an end node. The total length of branches per image was calculated using the sum of each segment length in the skeleton image. To calculate the maximal branch length per image, we used the NetworkX python library to efficiently create and manipulate a complex network. The complex network (or graph) was created from an adjacency matrix. The weights of the adjacency matrix were set according to the length of the segment between two connected nodes. The weight is set to 0 if two nodes are not connected by a segment.

(5)

The \(\overline{n_1n_2}\) notation represents the length of the segment between nodes \(n_1\) and \(n_2\). While we could have reported the maximal branch length (multiple connected segments) in the graph, we found that in some cases it produced branches that were not representative of the analysed neuronal processes. For this reason, we extracted the shortest path between the two most distant and connected nodes in the graph. This method provided more linear branches and allowed us to report the maximal length of a branch for each image.