Convolutional Neural Networks

Convolutional neural networks use local filters with shared weights. They are useful when neighboring positions carry repeated local patterns, such as images, grids, sequences, or voxelized structures.

For a 1D signal, a convolution can be written as:

The same weights are reused at every position , which gives parameter sharing and locality.

For images or grids with channels, a 2D convolution is:

Convolution is translation equivariant before boundary effects and pooling:

where shifts the input by offset .

Key Ideas

  • Convolutions reuse the same filter across positions, giving parameter sharing and local pattern detection.
  • Kernel size, stride, dilation, and padding define the receptive field and output resolution.
  • Stacking layers grows the effective context while preserving a useful locality bias.
  • Pooling or strided convolution trades spatial detail for larger context and cheaper computation.
  • CNNs can process sequences, contact maps, grids, images, and voxelized molecular structures when the input has a stable neighborhood layout.

Receptive Field

The receptive field is the part of the input that can affect one output position. For stride 1 convolutions with kernel size and layers, a simple receptive field approximation is:

With dilation at layer , the effective kernel span grows:

where is the stride before layer . This matters because many CNN claims are really claims about whether the relevant dependency is local enough for the chosen receptive field.

CNN vs Transformer vs GNN

QuestionCNNTransformerGNN
Input layoutdense grid or regular sequencetoken sequence or set with positional informationexplicit graph with nodes and edges
Main biaslocality and translation sharingglobal content-based interactionneighborhood message passing
Long-range relationgrows through depth, dilation, poolingdirect attention pathgrows through message-passing depth or graph edges
Cost driverresolution, channels, kernel sizetoken count and attention patternnodes, edges, message functions
Common failuretoo-small receptive field or grid artifactquadratic cost or positional shortcutbad graph construction or over-smoothing

For molecular or protein work, the choice often depends on the representation:

RepresentationCNN fit
image, contact map, distance mapstrong fit if local grid patterns matter
voxelized 3D structurepossible, but resolution and rotation handling matter
molecular graphusually prefer GNN or graph transformer
raw sequence1D CNN can be a baseline, but long-range dependency may need attention or SSM

Design Knobs

KnobEffectRisk
kernel sizelocal context per layerlarge kernels increase cost and may blur locality
stridedownsampling and cheaper later layerscan discard small features
dilationlarger context without poolinggridding artifacts if poorly chosen
paddingoutput shape and edge behaviorboundary positions may get artificial context
channel widthfeature capacitymemory and overfitting
poolinginvariance and lower resolutionloses exact position information

Paper Reading Checks

ClaimCheck
better local feature extractorkernel size, depth, receptive field, and augmentation
better image or grid modelresolution, preprocessing, and boundary handling
efficient modelwall time, memory, resolution, and batch size
structure-aware CNNwhether rotation, translation, and coordinate frame issues are handled
better than GNNwhether graph construction or voxelization changes the information available

Canonical Papers

PaperWhy It Matters
Deep Residual Learningresidual CNN backbone design and deep optimization
EfficientNetcompound scaling for CNN families
CoAtNetstaged hybrid of convolutional bias and attention capacity
ConvNeXtmodernized pure ConvNet after Transformer-era design lessons

Practical Checks

  • Verify the input layout: channel-first, channel-last, 1D, 2D, or 3D.
  • Check whether boundary padding changes the meaning of edge positions.
  • For structural biology inputs, ask what information was lost when coordinates became grids or voxels.
  • Compare CNNs against GNNs when the object is naturally a graph rather than a dense grid.