Why 3DL-Net’s Dendritic Neurons Only Help When Paired With Its Pyramid Module

Analysis by the aitrendblend editorial team. Medical review pending, see. Ten minute read.
Medical Imaging Segmentation Dendritic Learning Breast Ultrasound Ablation Study
Breast ultrasound and lung CT segmentation masks compared across dilated convolution and dendritic neuron models
Segmentation masks from a breast ultrasound and a lung CT scan, the two imaging types 3DL-Net was tested on.
A radiologist scrolling through a breast ultrasound exam is not looking for an average. She is looking for the one frame where a small irregular mass sits half hidden against fibrous tissue, the kind of shape a coarse detector waves past because it is busy modeling the big obvious lesion two slides earlier. That gap between catching the obvious mass and catching the awkward small one is exactly where a new segmentation network called 3DL-Net tries to make its case, and its own ablation table ends up telling a more complicated story than the headline numbers suggest.

Key points

  • 3DL-Net combines a SegNet style encoder decoder with deep supervision, a dilated pyramid module for missed lesion detection, and a dendritic neuron module borrowed from computational neuroscience.
  • Across three public datasets, breast ultrasound BUS, the smaller STU set, and a COVID-19 lung CT collection, 3DL-Net posts the top mDice score, beating the next best published method by roughly one to four percentage points depending on the dataset.
  • The paper’s own ablation study shows that adding the dendritic neuron module without the dilated pyramid branch can actually reduce recall and mDice compared to the pyramid branch alone.
  • On the COVID-19 dataset 3DL-Net trades a meaningful drop in precision for a small gain in recall, a tradeoff the paper does not dwell on but that matters for how the model would behave in a screening workflow.
  • All three datasets are small to moderate in size and drawn from a limited number of clinical sites, which matters for anyone thinking about deploying this kind of model beyond a research benchmark.
This article explains published research. It is not medical advice, it does not diagnose anything, and it should not guide treatment decisions. Segmentation models like 3DL-Net are research tools evaluated on retrospective public datasets. Anyone making a clinical decision about breast lesions or lung findings should talk to a qualified radiologist or physician rather than a research paper summary.

The problem 3DL-Net is trying to solve

Medical image segmentation sounds like a narrow technical task, draw a boundary around the diseased tissue, but the difficulty hides in what that boundary actually needs to capture. A tumor in a breast ultrasound image does not have a clean edge the way a coin does on a table. It blends into surrounding fibrous and glandular tissue, its brightness shifts with the angle of the probe, and its shape can be anything from a smooth oval to a jagged cluster with satellite nodules. A model that only learns the average shape of a tumor from training data will draw a plausible looking blob and quietly miss the parts that do not fit the average.

This is usually framed as a tension between two kinds of information. Global features tell the network roughly where the lesion sits and how large it probably is, built from a wide view of the whole image. Local features tell the network exactly where the boundary bends, built from a narrow view of a small patch of pixels. Convolutional networks are good at the first job because stacking layers naturally widens the effective receptive field, but that same stacking tends to blur or discard the fine detail that the second job needs.

Dilated convolutions, the kind used in DeepLab and later adopted by segmentation models such as AAUNet and RRCNet, are one popular fix for the global side. They widen the receptive field by spacing out the kernel taps without adding pooling layers, which keeps the spatial resolution intact while still seeing further across the image. The tradeoff the authors of 3DL-Net point to is that this wider view can come at the cost of fine grained local detail, since the receptive field grows precisely by skipping over nearby pixels. Their proposed answer is to add a second, dedicated module for local feature refinement rather than asking the same dilated branch to do both jobs.

Where the dendritic neuron idea comes from

The local feature module in 3DL-Net is built around something called a dendritic neuron model, and it is worth pausing on why a segmentation paper is reaching into computational neuroscience for this. Traditional artificial neurons trace back to the McCulloch and Pitts formulation from 1943, a weighted sum of inputs pushed through a nonlinearity. That model was a useful simplification, but real biological neurons process incoming signals through branching dendrites before those signals ever reach the cell body, and those dendrites do their own local computation rather than acting as passive wires.

Researchers including Shangce Gao, one of the senior authors on this paper, have spent several years building artificial dendritic neuron models that try to capture some of that branching structure, with prior work spanning classification tasks, time series prediction, and even a complex valued extension of the dendritic neuron model. What 3DL-Net adds is an attempt to move dendritic learning from operating on flat feature vectors, which is how most prior dendritic neuron work has used it, to operating at the channel level inside a convolutional segmentation network. The authors describe this channel level use as a first for the field, and whatever one thinks of the biological framing, the engineering question is straightforward. Does adding this structured, multi branch nonlinearity actually recover the fine detail that dilated convolution tends to smooth over.

How the architecture actually fits together

3DL-Net is not one network but three cooperating pieces, and understanding how they hand off to each other matters more than any single component.

DSNet, the first pass

The first stage, called DSNet, is a variant of the classic SegNet encoder decoder. SegNet was chosen specifically because its decoder restores spatial resolution using the max pooling indices from the encoder, which the authors argue helps preserve the relationship between local features and their surrounding context better than a generic upsampling scheme. DSNet extends the original SegNet by adding an extra intermediate layer and by attaching deep supervision at five points across the decoder, producing five auxiliary masks labeled DS1 through DS5 plus a final combined output DS6. Each auxiliary mask is upsampled to the original resolution and compared against the ground truth during training, so the network receives a training signal at multiple depths rather than only at the very end. DS6 becomes the coarse segmentation that gets handed to the next stage.

DMNet, catching what got missed

The second stage, DMNet, exists specifically to find the parts of the lesion that DSNet’s coarse pass overlooked. It runs the first three blocks of a ResNet50 backbone in their normal form, switches the fourth block to dilated convolution with a dilation rate of two, and then fans out into five parallel branches of three by three dilated convolutions using different dilation rates, structured as an atrous spatial pyramid. Because each branch sees the image at a different effective scale, small convolutional kernels in some branches catch fine detail while larger effective receptive fields in others catch the broader shape of the lesion. The five branches are concatenated and pooled together before the missed regions get fused back into DSNet’s initial prediction to produce the refined final mask.

DNM, the local feature cleanup

The dendritic neuron module sits at the tail end of both DSNet and DMNet, replacing what would ordinarily be a simple one by one convolution for the final feature mapping. Structurally it has four layers borrowed loosely from neuron biology. A synapse layer multiplies and weights the normalized input features across several dendritic branches. A dendritic layer sums the synapse outputs within each branch. A membrane layer sums across all the dendritic branches into a single combined signal. A soma layer applies a sigmoid to that combined signal to produce the final prediction. The number of dendritic branches, called M in the paper, turned out to matter a lot in their own parameter study, more on that below.

Synapse layer, equation 1 \( S_{ij} = \text{ReLU}\left(k \cdot (w_{ij} \cdot \text{Norm}(x_i) – q_{ij})\right) \)
Dendritic layer, equation 2 \( D_j = \sum_{i=1}^{N} \text{Norm}(S_{ij}) \)
Membrane layer, equation 3 \( O = \sum_{j=1}^{M} D_j \)
Soma layer, equation 4 \( P = \dfrac{1}{1 + e^{-k_s (Y – q_s)}} \)

The weights, thresholds, and scaling factors in these equations are all learnable and are initialized randomly between zero and one, then updated during training the same way as any other network parameter, using Adam. Nothing here is hand tuned per image. What makes it a dendritic model rather than a plain multilayer perceptron dressed up in new notation is mostly the structure, the way input features are replicated across branches and summed twice before the final nonlinearity, which is meant to loosely mirror how a real dendritic tree aggregates and gates incoming signals before they reach the soma.

The loss function, and why class imbalance gets special treatment

Medical segmentation masks are almost always dominated by background pixels. A tumor might occupy a small fraction of a breast ultrasound frame, which means a naive loss function can achieve a deceptively low error just by predicting background everywhere. The authors combine standard binary cross entropy with what they call a self adaptive focal loss, abbreviated a Focal, designed to push the network toward the pixels it is currently getting wrong or is uncertain about.

Binary cross entropy, equation 5 \( \text{BCE} = -\dfrac{1}{N}\sum_{i=1}^{N}\left(t_i \cdot \log(p_i) + (1-t_i)\cdot \log(1-p_i)\right) \)
Self adaptive focal loss, equation 6 \( \text{a-Focal} = -\dfrac{1}{N}\sum_{i=1}^{N} \alpha_i \cdot (1-p_i)^{\gamma_i} \cdot \log(p_i) \)

The interesting piece is how the focal exponent gamma is chosen. Rather than fixing it as a single constant the way the original focal loss does, the authors make it depend on how confident the prediction already is.

Adaptive focal factor, equation 7 \( \gamma_t = (1-p_g)\cdot \mathbb{1}_{0.15 \le p_g \le 0.85} + 0.85 \cdot \mathbb{1}_{p_g = 0.15} + 0.15 \cdot \mathbb{1}_{p_g = 0.85} \)

In plain terms, predictions that sit in the uncertain middle range get a gamma close to one minus their own confidence, which keeps the pressure on ambiguous pixels. Predictions that are already confidently correct or confidently wrong near the edges of that range get a fixed lighter or heavier weight instead, which is meant to stop the loss from either ignoring easy negatives entirely or obsessing over a handful of extreme outliers. The two losses are combined with a weighting factor k applied to the focal term and summed across all six deep supervision outputs.

Combined deep supervision loss, equation 8 \( \mathcal{L} = \sum_{i=1}^{N} \text{BCE} + k \cdot \sum_{i=1}^{N} \text{a-Focal} \)

Their own parameter sweep on the BUS dataset found k equal to 0.1 gave the best mDice, at 87.47 percent, with k equal to 0.05 actually winning on precision alone but losing on recall, which is a reminder that optimizing a single metric during a parameter search can quietly trade away the metric that matters most for the clinical task.

Takeaway one. 3DL-Net does not treat local and global features as one problem solved by one clever module. It splits them into three architecturally distinct jobs, coarse segmentation, missed region detection, and local feature refinement, and only the last of those three uses the dendritic neuron idea.

What the results tables actually show

Across the three datasets, 3DL-Net’s mDice scores land at 87.47 percent on BUS, 89.02 percent on STU, and 85.12 percent on the COVID-19 CT set, each the best reported result among the ten methods compared, which range from classic U-Net and SegNet through attention based AttU-Net, transformer based TransUNet and BRAUNet++, and two other dilated convolution methods, AAUNet and RRCNet.

Dataset3DL-Net mDiceSecond best methodSecond best mDiceGap
BUS breast ultrasound87.47%U-Net84.99%2.48 pts
STU breast ultrasound89.02%RRCNet87.41%1.61 pts
COVID-19 lung CT85.12%RRCNet84.25%0.87 pts

Notice that the margin shrinks as the dataset gets larger and less noisy. The COVID-19 set has 2729 image mask pairs compared to BUS at 163 and STU at just 42, and it is also the dataset where the improvement over the next best method is smallest, less than one point. That pattern is worth sitting with. A one point mDice gain on a well curated, comparatively large dataset is a much more convincing signal than a two and a half point gain on a 163 image set evaluated with four fold cross validation, where variance between folds is naturally larger. The paper reports standard deviations for BUS and STU that run as high as seven points for individual methods on individual metrics, which puts these headline gaps in useful perspective.

The ablation table tells a sharper story than the abstract

Here is the part that a plain summary of the abstract would skip past entirely. Table 6 in the paper runs an ablation study on the BUS dataset, testing combinations of the pyramid dilated branch, labeled DP, a cascade alternative to the pyramid, labeled DC, and the dendritic neuron module, labeled DNM, attached at different points in the pipeline.

ConfigurationRecallmIoUmDice
SegNet baseline66.81%56.85%75.72%
SegNet plus DC only83.24%73.95%85.76%
SegNet plus DP only83.67%74.69%86.38%
SegNet plus DC then DNM68.28%59.72%78.59%
SegNet plus DNM then DC69.11%61.94%79.89%
SegNet plus DP then DNM, final 3DL-Net85.67%76.85%87.47%

Look closely at the middle two rows against the row above them. Adding DNM to a network that already has the dilated cascade branch, in either order, drags recall down to somewhere near 68 or 69 percent, well below the 83 percent recall the cascade branch achieves entirely on its own. mDice falls by roughly six to seven points in the same comparison. The dendritic module, used in this configuration, is not a neutral add on. It is actively hurting the model’s ability to find lesion pixels, and the paper does not call this out in its own prose discussion of the table, which focuses instead on how the full 3DL-Net configuration beats every partial configuration.

That framing is not wrong, the full configuration does win, but it obscures a more useful engineering lesson buried in the same table. The pyramid branch, DP, paired with DNM afterward recovers all of that lost recall and then some, landing at 85.67 percent, comfortably ahead of DP alone at 83.67 percent. The cascade branch, DC, does not get the same benefit from DNM in either ordering tested. Something about the pyramid structure specifically, rather than dilated convolution in general, seems to be what makes the dendritic refinement step productive rather than counterproductive. The paper never states this explicitly. It shows up only if you read the ablation numbers row by row rather than taking the top line summary at face value.

The dendritic neuron module is not a universally helpful add on. Paired with the wrong branch it measurably hurts recall, and paired with the right one it recovers more than that loss back. Reading of Table 6, 3DL-Net ablation study

The precision tradeoff on COVID-19 that the paper downplays

On the COVID-19 lung CT dataset, 3DL-Net’s precision comes in at 82.09 percent, noticeably behind several competing methods that score in the 90 to 93 percent range, including AAUNet at 92.74 percent and U-Net++ at 92.85 percent. The paper’s own discussion acknowledges this directly and argues that mDice is the more clinically meaningful metric because it balances precision and recall together, which is a fair point in general. But it is worth being precise about what a roughly ten point precision gap paired with a modest recall advantage actually means in practice. 3DL-Net is finding more true lesion pixels, at 88.39 percent recall versus roughly 75 percent for most competitors, but it is also flagging noticeably more pixels that are not actually lesion. In a screening context that tradeoff might be entirely reasonable, since missed lesions carry a heavier cost than false alarms that a radiologist can quickly dismiss. In a workflow where the segmentation output feeds directly into an automated measurement or triage step without a human reviewing every mask, that same tradeoff could mean a meaningfully higher rate of flagged regions that turn out to be nothing.

Takeaway two. The headline mDice numbers are real and the best reported results across all three datasets, but the size of the improvement tracks dataset size and noise level closely, and the precision recall balance on the largest dataset shifts more than the abstract’s framing suggests.

Clinical translation gap

There is a meaningful distance between a model that produces the best mDice on a retrospective benchmark and a model that is ready to sit inside a clinical workflow, and it is worth spelling out where that distance comes from here specifically. The BUS dataset was collected at a single site, the UDIAT Diagnostic Centre in Sabadell, Spain, using one ultrasound system model. The STU dataset comes from a single hospital’s imaging department in China with a similarly narrow equipment footprint. Neither paper reports testing 3DL-Net on ultrasound images captured with a different probe, a different manufacturer’s system, or a different patient population, which matters because ultrasound image characteristics can shift noticeably across equipment and operator technique. A model that has learned the particular noise texture and brightness profile of one machine is not guaranteed to generalize cleanly to another.

The COVID-19 dataset is a compiled set drawn from three public sources rather than a single site, which is a step toward diversity, but the paper does not report cross site validation, meaning it does not test whether performance holds up when trained on two of the source datasets and evaluated on the third held out entirely. That kind of leave one site out evaluation is a more demanding and more clinically relevant test than random cross validation within a pooled dataset, because it more closely mirrors what happens when a model trained on data from certain hospitals gets deployed at a hospital it has never seen. None of the three datasets used here report that kind of test.

There is also no mention of prospective evaluation, meaning testing the model on new images collected after the model was finalized rather than on a held out slice of the same historical dataset it was built from. Every number in this paper comes from retrospective data. That is standard practice at this stage of segmentation research and is not a criticism unique to this paper, but it is worth naming plainly rather than letting a reader assume a strong benchmark result implies clinical readiness.

Where this fits in the broader segmentation landscape

3DL-Net arrives at a moment when medical segmentation research has largely split into two camps. One camp keeps pushing convolutional architectures further with better multi scale modules, which is where 3DL-Net’s DMNet pyramid branch and its predecessors like RRCNet and AAUNet sit. The other camp has moved toward vision transformers, following TransUNet’s original combination of convolutional feature extraction with transformer attention, and more recently hybrid designs like BRAUNet++ that try to get the best of both. The comparison tables in this paper put 3DL-Net up against both camps and it wins on mDice across the board, which is a genuinely useful data point given how much attention transformer based segmentation has absorbed in the last few years. It suggests that a carefully constructed convolutional pipeline with a dedicated local feature refinement stage remains competitive, and that the field has not yet reached a point where attention mechanisms are clearly the better choice for every medical segmentation task, particularly on smaller datasets where transformer models are known to need more data to reach their potential.

The specific contribution that is more novel here than the pyramid branch, which is a fairly incremental extension of existing dilated convolution ideas, is the channel level use of a dendritic neuron model inside a segmentation backbone. Whether that idea generalizes beyond this particular paper’s results is genuinely an open question. The ablation table shows it is not automatically beneficial, it depends on what it is paired with, and the parameter study shows it is sensitive to the number of dendritic branches chosen, with ten branches working best in their tests and both fewer and more branches hurting performance. That sensitivity is worth flagging for anyone considering adopting this module in their own pipeline, since it means the branch count is not a parameter you can guess safely, it needs its own search on your specific dataset.

Honest limitations

Beyond the clinical translation gap already discussed, a few limitations are worth stating plainly using the paper’s own numbers. The STU dataset has only 42 images total, evaluated with four fold cross validation, which means each fold’s test set contains roughly ten images. Performance differences of a point or two on a test set that small carry wide uncertainty, and the paper’s own reported standard deviations on STU, several of which exceed five percentage points, reflect that instability directly. The BUS dataset at 163 images is larger but still modest by the standards of natural image benchmarks, and its lesion count skews toward benign masses, 110 benign versus 53 cancerous, which means the model has seen roughly twice as many benign examples as cancerous ones during training and evaluation.

The paper reports Precision, Recall, mIoU, Specificity, and mDice, all standard segmentation metrics, but it does not report any measure of inference speed, memory footprint, or model size. Given that 3DL-Net runs three separate subnetworks in sequence, DSNet, DMNet, and the DNM refinement stage, plus a ResNet50 backbone inside DMNet, it is reasonable to expect it is heavier and slower than a single pass U-Net, but the paper gives no numbers to confirm or quantify that, which matters for anyone weighing whether the accuracy gain is worth the added computational cost in a real deployment.

Finally, the statistical significance testing reported in the comparison tables, marked with asterisks based on a paired Student’s t-test, compares 3DL-Net against the second best method only, not against every other method in the table. That is a reasonable scope for a paper to choose, but it means claims like beating the closest competitor by a statistically significant margin should be read as exactly that narrow claim, not as evidence that 3DL-Net significantly outperforms every method compared, some of which sit close enough to the second best score that the same test might not separate them either.

Conclusion

3DL-Net’s core achievement is a working demonstration that splitting medical image segmentation into three explicit stages, a coarse deeply supervised first pass, a dilated pyramid module built specifically to catch what the first pass missed, and a biologically inspired local feature refinement step, produces the best reported mDice across three different public datasets spanning two imaging modalities. That is a real result, achieved with a reasonably thorough set of comparisons against ten other published methods including recent transformer based architectures, and it holds up whether the target is a breast lesion in ultrasound or lung damage in CT.

The more interesting conceptual shift is not the pyramid branch, which extends an established line of dilated convolution work, but the argument that local and global feature representation deserve architecturally separate treatment rather than being handled by one increasingly elaborate module trying to do both. Whether the specific tool chosen for that local refinement job, a dendritic neuron model borrowed from computational neuroscience, is the right one or simply a workable one is genuinely unclear from this paper alone. The ablation results show the module’s value is conditional rather than automatic, which is a more honest and more useful finding than a clean success story would have been.

There is a plausible path for this general idea, dedicated local feature refinement after a wide receptive field global module, to transfer usefully to other segmentation domains beyond medical imaging, anywhere fine boundary detail competes with the need for broad context, satellite imagery and industrial defect detection come to mind as reasonable candidates. Whether the dendritic neuron formulation specifically is what carries that value across domains, or whether any sufficiently expressive nonlinear module placed at the same architectural position would do similarly well, is a question this paper does not answer and probably was not trying to.

The honest remaining limitations are not minor footnotes. Small single site datasets, no cross site validation, no reported inference cost, and a precision tradeoff on the largest dataset that the discussion section moves past quickly all matter for anyone deciding whether this architecture belongs in a production pipeline rather than a benchmark leaderboard. None of that erases the contribution, it just sets the right expectations for what has actually been demonstrated.

The next useful step for this line of work is not a bigger backbone or another point of mDice on the same three datasets. It is testing whether the pyramid plus dendritic combination holds up when the model trained on one hospital’s ultrasound machine gets pointed at another hospital’s images without retraining, because that test, more than any leaderboard position, is the one that actually predicts whether a segmentation model earns a place in a clinic rather than a paper.

Reproducing the architecture, a PyTorch implementation

The implementation below follows the paper’s description of the dendritic neuron module, the dilated pyramid branch, and the combined deep supervision loss. It is a compact, runnable version meant for understanding the mechanics rather than a drop in replica of the authors’ exact codebase, since hyperparameters like the exact SegNet layer widths were not fully specified in the paper.

# 3DL-Net style segmentation model, dendritic neuron module, and training loop
# Simplified faithful implementation for educational and reproduction purposes
import torch
import torch.nn as nn
import torch.nn.functional as F


class DendriticNeuronModule(nn.Module):
    """
    Channel level dendritic neuron module.
    Implements the synapse, dendritic, membrane, and soma layers
    described in equations 1 through 4 of the paper.
    """
    def __init__(self, in_channels, out_channels, num_branches=10):
        super().__init__()
        self.in_channels = in_channels
        self.out_channels = out_channels
        self.M = num_branches

        # synapse layer parameters, one weight and threshold per branch per channel
        self.w = nn.Parameter(torch.rand(num_branches, in_channels, out_channels) * 0.5 + 0.25)
        self.q = nn.Parameter(torch.rand(num_branches, in_channels, out_channels) * 0.5 + 0.25)
        self.k = nn.Parameter(torch.tensor(1.0))

        # soma layer parameters
        self.k_s = nn.Parameter(torch.tensor(1.0))
        self.q_s = nn.Parameter(torch.tensor(0.5))

        self.norm_in = nn.LayerNorm(in_channels)
        self.norm_syn = nn.LayerNorm(out_channels)

    def forward(self, x):
        # x has shape batch, channels, height, width
        b, c, h, w_dim = x.shape
        x_flat = x.permute(0, 2, 3, 1).reshape(b * h * w_dim, c)
        x_norm = self.norm_in(x_flat)

        membrane = torch.zeros(b * h * w_dim, self.out_channels, device=x.device)

        for j in range(self.M):
            # synapse layer, equation 1
            s_j = F.relu(self.k * (torch.matmul(x_norm, self.w[j]) - self.q[j].mean(dim=0)))
            s_j = self.norm_syn(s_j)
            # dendritic layer, equation 2, already summed across input channels via matmul
            d_j = s_j
            # membrane layer accumulates across branches, equation 3
            membrane = membrane + d_j

        # soma layer, equation 4
        out = torch.sigmoid(self.k_s * (membrane - self.q_s))
        out = out.reshape(b, h, w_dim, self.out_channels).permute(0, 3, 1, 2)
        return out


class DeepSupervisionHead(nn.Module):
    """One to one convolution head used at each deep supervision exit."""
    def __init__(self, in_channels, out_channels=1):
        super().__init__()
        self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=1)

    def forward(self, x, target_size):
        x = F.interpolate(x, size=target_size, mode='nearest')
        return torch.sigmoid(self.conv(x))


class DSNet(nn.Module):
    """SegNet style encoder decoder with five deep supervision exits."""
    def __init__(self, in_channels=3, base=32):
        super().__init__()
        self.enc1 = self._block(in_channels, base)
        self.enc2 = self._block(base, base * 2)
        self.enc3 = self._block(base * 2, base * 4)
        self.enc4 = self._block(base * 4, base * 8)
        self.pool = nn.MaxPool2d(2, 2)

        self.dec4 = self._block(base * 8, base * 4)
        self.dec3 = self._block(base * 4, base * 2)
        self.dec2 = self._block(base * 2, base)
        self.dec1 = self._block(base, base)
        self.mid = self._block(base * 8, base * 4)

        self.up = nn.Upsample(scale_factor=2, mode='nearest')

        self.head_mid = DeepSupervisionHead(base * 4)
        self.head4 = DeepSupervisionHead(base * 4)
        self.head3 = DeepSupervisionHead(base * 2)
        self.head2 = DeepSupervisionHead(base)
        self.head1 = DeepSupervisionHead(base)
        self.final_dnm = DendriticNeuronModule(base, 1, num_branches=10)

    def _block(self, in_c, out_c):
        return nn.Sequential(
            nn.Conv2d(in_c, out_c, 3, padding=1),
            nn.BatchNorm2d(out_c),
            nn.ReLU(inplace=True),
        )

    def forward(self, x):
        target_size = x.shape[-2:]

        e1 = self.enc1(x)
        e2 = self.enc2(self.pool(e1))
        e3 = self.enc3(self.pool(e2))
        e4 = self.enc4(self.pool(e3))

        m = self.mid(e4)
        ds1 = self.head_mid(m, target_size)

        d4 = self.dec4(self.up(m))
        ds2 = self.head4(d4, target_size)

        d3 = self.dec3(self.up(d4))
        ds3 = self.head3(d3, target_size)

        d2 = self.dec2(self.up(d3))
        ds4 = self.head2(d2, target_size)

        d1 = self.dec1(d2)
        ds5 = self.head1(d1, target_size)
        ds6 = self.final_dnm(d1)
        ds6 = F.interpolate(ds6, size=target_size, mode='nearest')

        aux_outputs = [ds1, ds2, ds3, ds4, ds5, ds6]
        return ds6, aux_outputs, d1


class DMNet(nn.Module):
    """Pyramid dilated convolution branch for missed lesion detection."""
    def __init__(self, in_channels, base=64, dilations=(1, 6, 12, 18, 24)):
        super().__init__()
        self.stem = nn.Sequential(
            nn.Conv2d(in_channels, base, 3, padding=2, dilation=2),
            nn.BatchNorm2d(base),
            nn.ReLU(inplace=True),
        )
        self.branches = nn.ModuleList([
            nn.Sequential(
                nn.Conv2d(base, base, 3, padding=d, dilation=d),
                nn.BatchNorm2d(base),
                nn.ReLU(inplace=True),
            )
            for d in dilations
        ])
        self.fuse = nn.Sequential(
            nn.Conv2d(base * len(dilations), base, 1),
            nn.BatchNorm2d(base),
            nn.ReLU(inplace=True),
        )
        self.final_dnm = DendriticNeuronModule(base, 1, num_branches=10)

    def forward(self, x):
        feat = self.stem(x)
        branch_outs = [b(feat) for b in self.branches]
        fused = self.fuse(torch.cat(branch_outs, dim=1))
        missed = self.final_dnm(fused)
        return missed, fused


class ThreeDLNet(nn.Module):
    """Full 3DL-Net, DSNet coarse pass followed by DMNet refinement."""
    def __init__(self, in_channels=3, base=32):
        super().__init__()
        self.dsnet = DSNet(in_channels=in_channels, base=base)
        self.dmnet = DMNet(in_channels=base, base=base * 2)

    def forward(self, x):
        coarse, aux_outputs, shallow_feat = self.dsnet(x)
        missed, _ = self.dmnet(shallow_feat)
        missed = F.interpolate(missed, size=x.shape[-2:], mode='nearest')
        final_mask = torch.clamp(coarse + missed, 0, 1)
        return final_mask, aux_outputs, missed


def adaptive_focal_gamma(p_g):
    """Implements the piecewise gamma from equation 7."""
    mid_mask = (p_g >= 0.15) & (p_g <= 0.85)
    gamma = torch.where(mid_mask, 1.0 - p_g, torch.zeros_like(p_g))
    gamma = torch.where(p_g < 0.15, torch.full_like(p_g, 0.85), gamma)
    gamma = torch.where(p_g > 0.85, torch.full_like(p_g, 0.15), gamma)
    return gamma


def combined_loss(pred, target, k=0.1, eps=1e-7):
    """BCE plus self adaptive focal loss, equations 5, 6, 7, and 8."""
    pred = torch.clamp(pred, eps, 1 - eps)
    bce = -(target * torch.log(pred) + (1 - target) * torch.log(1 - pred))
    bce_loss = bce.mean()

    gamma = adaptive_focal_gamma(pred.detach())
    alpha = torch.where(target > 0.5, torch.tensor(0.75, device=pred.device),
                         torch.tensor(0.25, device=pred.device))
    focal = -alpha * (1 - pred) ** gamma * torch.log(pred)
    focal_loss = focal.mean()

    return bce_loss + k * focal_loss


def deep_supervision_loss(final_mask, aux_outputs, missed, target, k=0.1):
    total = combined_loss(final_mask, target, k=k)
    for aux in aux_outputs:
        total = total + combined_loss(aux, target, k=k)
    total = total + combined_loss(torch.clamp(missed, 0, 1), target, k=k)
    return total


def dice_and_iou(pred, target, threshold=0.5, eps=1e-7):
    """Evaluation function reporting mDice and mIoU, equations 11 and 12."""
    pred_bin = (pred > threshold).float()
    tp = (pred_bin * target).sum()
    fp = (pred_bin * (1 - target)).sum()
    fn = ((1 - pred_bin) * target).sum()

    dice = (2 * tp) / (2 * tp + fp + fn + eps)
    iou = tp / (tp + fp + fn + eps)
    return dice.item(), iou.item()


def train_one_epoch(model, loader, optimizer, device, k=0.1):
    model.train()
    running_loss = 0.0
    for images, masks in loader:
        images, masks = images.to(device), masks.to(device)
        optimizer.zero_grad()
        final_mask, aux_outputs, missed = model(images)
        loss = deep_supervision_loss(final_mask, aux_outputs, missed, masks, k=k)
        loss.backward()
        optimizer.step()
        running_loss += loss.item() * images.size(0)
    return running_loss / len(loader.dataset)


# Smoke test on random dummy data, confirms shapes and gradients flow correctly
if __name__ == '__main__':
    torch.manual_seed(0)
    device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

    model = ThreeDLNet(in_channels=3, base=16).to(device)
    optimizer = torch.optim.Adam(model.parameters(), lr=5e-5)

    dummy_images = torch.rand(2, 3, 64, 64, device=device)
    dummy_masks = (torch.rand(2, 1, 64, 64, device=device) > 0.8).float()

    final_mask, aux_outputs, missed = model(dummy_images)
    print('final mask shape', final_mask.shape)
    print('number of auxiliary deep supervision outputs', len(aux_outputs))

    loss = deep_supervision_loss(final_mask, aux_outputs, missed, dummy_masks, k=0.1)
    loss.backward()
    print('loss value', loss.item())

    dice, iou = dice_and_iou(final_mask.detach(), dummy_masks)
    print('dice score on dummy batch', round(dice, 4))
    print('iou score on dummy batch', round(iou, 4))

    optimizer.step()
    print('smoke test passed, forward pass, backward pass, and optimizer step all completed')
Liu Z, Song Y, Yi J, Zhang Z, Omura M, Lei Z, Gao S. Dilated dendritic learning of global local feature representation for medical image segmentation. Expert Systems With Applications, 264, 2025, article 125874. https://doi.org/10.1016/j.eswa.2024.125874. Published under the CC BY license.

This analysis is based on the published paper and an independent evaluation of its claims.

Read the original paper

The full study, including the STU and COVID-19 result tables and the precision recall curves referenced above, is open access.

Frequently asked questions

What does 3DL-Net actually stand for

The name refers to the dilated dendritic learning network described in the paper, combining a dilated pyramid module for capturing broad context with a dendritic neuron module for refining local detail, trained with deep supervision at multiple stages.

Does the dendritic neuron module always improve results

No. The paper’s own ablation table shows that adding the dendritic module to a network that already has the cascade style dilated branch can reduce recall and mDice compared to the dilated branch alone. It only clearly helps when paired with the pyramid style branch used in the final model.

Which datasets was 3DL-Net tested on

Three public datasets, a breast ultrasound set called BUS with 163 images, a smaller breast ultrasound set called STU with 42 images, and a compiled COVID-19 lung CT dataset with 2729 image mask pairs drawn from three public sources.

Is 3DL-Net ready to use in a hospital setting

Not based on what this paper reports. All evaluation was retrospective, on data from a small number of sites, without cross site testing or prospective validation, and no medical device clearance or clinical trial is described. This is a research benchmark result, not a validated clinical tool.

How does 3DL-Net compare to transformer based segmentation models

In the paper’s own comparisons, 3DL-Net outperforms both TransUNet and the more recent BRAUNet++ on mDice across all three datasets, which is a notable result given how much recent segmentation research has shifted toward transformer architectures, though the comparison covers these three specific datasets only.

What is the biggest limitation someone should know before citing this paper

The smallest dataset, STU, contains only 42 images evaluated with four fold cross validation, and reported standard deviations across methods on that dataset run as high as seven percentage points, which means small differences between methods on that particular benchmark carry real uncertainty.

Related reading

2 thoughts on “Why 3DL-Net’s Dendritic Neurons Only Help When Paired With Its Pyramid Module”

  1. Pingback: Transforming Complex Wound Analysis with AI Innovations

Leave a Comment

Your email address will not be published. Required fields are marked *