Skip to content
Graphviz (DOT) templates

CNN Architecture

Convolutional layers, pooling and dense head.

Template previewGraphviz (DOT)
cnn In Input 224 × 224 × 3 C1 Conv 3×3, 64 +ReLU In->C1 P1 MaxPool 2×2 C1->P1 C2 Conv 3×3, 128 +ReLU P1->C2 P2 MaxPool 2×2 C2->P2 C3 Conv 3×3, 256 +ReLU P2->C3 P3 MaxPool 2×2 C3->P3 GAP Global avg pool P3->GAP F1 Dense 512 GAP->F1 Out Softmax 1000 classes F1->Out

What this template contains

Graph
Directed
Edges
9
Source
16 lines

Make it your own.

digraph cnn {
  rankdir=LR;
  graph [bgcolor=transparent];
  node [shape=box, style="rounded,filled", fontname=Inter, fontsize=10];

  In [label="Input\n224 × 224 × 3", fillcolor="#dbeafe"];
  C1 [label="Conv 3×3, 64\n+ReLU", fillcolor="#fef3c7"];
  P1 [label="MaxPool 2×2", fillcolor="#ede9fe"];
  C2 [label="Conv 3×3, 128\n+ReLU", fillcolor="#fef3c7"];
  P2 [label="MaxPool 2×2", fillcolor="#ede9fe"];
  C3 [label="Conv 3×3, 256\n+ReLU", fillcolor="#fef3c7"];
  P3 [label="MaxPool 2×2", fillcolor="#ede9fe"];
  GAP [label="Global avg pool"];
  F1 [label="Dense 512", fillcolor="#fce7f3"];
  Out [label="Softmax\n1000 classes", fillcolor="#dcfce7"];

  In -> C1 -> P1 -> C2 -> P2 -> C3 -> P3 -> GAP -> F1 -> Out;
}