---
title: 'ASCModule in ASCNet: Astronomical Image Classification'
url: https://www.emergentmind.com/topics/ascmodule
type: topic
---

# ASCModule in ASCNet: Astronomical Image Classification

The ASCModule is a dedicated architectural component designed for fine-grained image classification, with specific application to astronomical all-sky camera (ASC) imagery. It forms a crucial part of ASCNet, a dual-branch neural network tailored for nighttime cloud type classification at astronomical observatories. The ASCModule processes the luminance (Y) channel of input images via parallel depthwise dilated convolutions with embedded lightweight Squeeze-and-Excitation (SE) attention. Its design enables capture of subtle luminance texture cues critical for classifying challenging phenomena in low-light and high-variability astronomical environments [2601.00563].

## 1. Architectural Placement and High-Level Workflow

ASCNet positions the ASCModule alongside a standard RGB processing branch, creating a complementary two-stream structure:
- The **RGB branch** employs a ResNet-34 backbone for extracting broad semantic features across color channels.
- The **luminance branch** processes the grayscale Y channel using the ASCModule, which is optimized for fine-scale cloud texture discrimination.

Given a batch of color images $X \in \mathbb{R}^{B \times 3 \times H \times W}$, the network computes luminance as
$$
Y = 0.299 X_R + 0.587 X_G + 0.114 X_B,\qquad Y \in \mathbb{R}^{B \times 1 \times H \times W}.
$$
The subsequent feature maps $F_{rgb}$ (from ResNet-34) and $F_{y}$ (from the ASCModule) are aligned in spatial resolution, concatenated to form $F_{cat}$, and processed by a FusionBlock before passing to pooling and the classifier.

## 2. Internal Structure of ASCModule

The ASCModule consists of $k=3$ parallel branches, each parameterized by a different dilation rate ($d_1=1$, $d_2=2$, $d_3=3$). Each branch executes the following sequence:

### a) Depthwise Dilated Convolution Block

- **Input:** $U^{(0)} = Y$, shape $(B,1,H,W)$
- **Operation:** Apply depthwise 3$\times$3 convolution, dilation $d$
  $$
  U^{(1)}_{b,c,i,j} = \sum_{u=1}^3\sum_{v=1}^3 K^{(d)}_{c,u,v} \cdot U^{(0)}_{b,c, i + d(u-2),\, j + d(v-2)}.
  $$
- **Batch normalization:** $U^{(2)} = \mathrm{BN}(U^{(1)})$
- **Pointwise (1$\times$1) convolution:** $U^{(3)} = \mathrm{Conv}_{1 \times 1}(U^{(2)})$, expands to $(B,C',H',W')$

### b) Squeeze-and-Excitation Attention Block

- **Squeeze:** Global average pooling per channel,
  $$
  z_c = \frac{1}{H'W'} \sum_{i=1}^{H'} \sum_{j=1}^{W'} U^{(3)}_{c,i,j}
  $$
- **Excitation:** Two fully-connected layers,
  $$
  s = \sigma\!\left(W_2\,\delta(W_1z)\right)
  $$
  where $W_1 \in \mathbb{R}^{C'/r \times C'}$, $W_2 \in \mathbb{R}^{C' \times C'/r}$, $r$ is SE reduction ratio, $\sigma$ is sigmoid, $\delta$ is ReLU.
- **Channel-wise scaling:** $F = s \odot U^{(3)}$

Each branch outputs $F_i \in \mathbb{R}^{B \times C' \times H' \times W'}$; the final ASCModule output is
$$
F_{y} = \mathrm{Concat}(F_1, F_2, F_3)\;\in\; \mathbb{R}^{B \times (3C') \times H' \times W'}.
$$

## 3. Channel Dimensions and Feature Fusion

The design selects $C'$ such that the combined channel dimension from all luminance branches ($C_{y} = 3C'$) approximates the channel count in the ResNet RGB branch ($C_{rgb}=512$), enabling direct concatenation. For $C'=170$, $C_{y} \approx 510$.

Fusion is implemented as follows:
1. **Spatial alignment:** ResNet feature map and $F_{y}$ are reshaped to equal $(H', W')$.
2. **Channel concatenation:** $F_{cat} = \mathrm{Concat}(F_{rgb}, F_{y}) \in \mathbb{R}^{B\times (C_{rgb}+C_y)\times H'\times W'}$.
3. **FusionBlock:** 1$\times$1 channel reduction, depthwise separable convolution with residual connection, Efficient Channel Attention (ECA), and dropout for regularization.

## 4. Computational Complexity

Parameter and FLOP cost is minimal relative to standard multi-channel convolutions:

- **Per branch:** $9$ weights (depthwise 3$\times$3), $C'$ (pointwise), $2C'^2/r$ (SE FC layers).
- For $C'=170$, $r=16$: $9+170+2\times 170^2/16 \approx 3791$ weights per branch; total for three branches: $\approx 11$K.
- **FLOPs:** Depthwise conv: $3\times 3\times 1 \times H'W'$; pointwise: $1\times C'\times H'W'$ per branch.
- *A plausible implication is that the ASCModule can be integrated into deep CNNs with negligible overhead relative to standard residual blocks.*

Relative to a standard ResNet-34 residual block with $C=512$, which has $\sim4.7$M parameters, the ASCModule increases model capacity and representational richness at small cost.

## 5. Ablation Results and Performance Gains

Empirical studies show a substantial increase in classification metrics when the ASCModule is combined with the FusionBlock and ResNet-34 backbone. The following table summarizes the ablation study ([2601.00563], Table 4):

| Scheme                      | Accuracy (%) | Precision (%) | Recall (%) | F1 Score (%) |
|-----------------------------|--------------|---------------|------------|--------------|
| ResNet34 (baseline)         | 77.82        | 50.76         | 55.53      | 51.89        |
| + FusionBlock               | 89.94        | 77.86         | 78.09      | 74.25        |
| + ASCModule (ASCNet)        | 92.66        | 83.26         | 84.25      | 83.67        |

This demonstrates a relative gain of approximately 15 percentage points in accuracy when employing both the ASCModule and FusionBlock above the ResNet-34-only baseline.

## 6. Implementation Details and Pseudocode

The primary logic of the ASCModule and its role in ASCNet is as follows:

```python
# Y: (B,1,H,W) luminance input
# returns Fy: (B,3*C',H',W')
def ASCModule(Y, C_prime=170, reduction=16):
    branch_outputs = []
    for d in [1,2,3]:
        U = depthwise_conv2d(Y, kernel_size=3, dilation=d, padding=d)  # (B,1,H',W')
        U = BatchNorm(U)
        U = conv2d(U, out_channels=C_prime, kernel_size=1)             # (B,C',H',W')
        z = global_avg_pool(U)                                         # (B,C')
        e = relu( dense(z, out_features=C_prime//reduction) )          # (B, C'/r)
        s = sigmoid( dense(e, out_features=C_prime) )                  # (B, C')
        s = s.view(B, C_prime, 1,1)
        Fi = s * U                                                     # (B,C',H',W')
        branch_outputs.append(Fi)
    Fy = concatenate(branch_outputs, dim=1)                            # (B,3*C',H',W')
    return Fy 

def ASCNet_forward(X):
    Y = 0.299*X[:,0] + 0.587*X[:,1] + 0.114*X[:,2]      # (B,H,W)
    Y = Y.unsqueeze(1)                                  # (B,1,H,W)
    Frgb = ResNet34_backbone(X)                         # (B,512,H',W')
    Fy   = ASCModule(Y, C_prime=170)                    # (B,510,H',W')
    Fcat = concatenate([Frgb, Fy], dim=1)               # (B,1022,H',W')
    Ffus = FusionBlock(Fcat)
    out = global_avg_pool(Ffus)
    out = Flatten(out)
    out = BatchNorm1d(out)
    logits = Linear(out, out_features=5)
    return softmax(logits)
```

## 7. Significance and Application Context

Integration of the ASCModule into ASCNet results in significantly improved performance on the classification of nighttime all-sky camera images, as measured on data from the Muztagh-ata site. The approach leverages the luminance channel to extract discriminative features not directly accessible in the RGB data pathway. Emphasis on fine-grained texture via multiscale dilation and SE recalibration yields high accuracy (92.66%), precision (83.26%), recall (84.25%), and F1 score (83.67%) as validated against human-labeled standards. The modularity and computational parsimony of the ASCModule suggests potential for broader application in other domains requiring luminance-focused, texture-sensitive analysis [2601.00563].

Source: https://www.emergentmind.com/topics/ascmodule