5 Procedural design pattern

 

This chapter covers

  • Introducing a procedural design pattern for a convolutional neural network
  • Decomposing the architecture of the procedural design pattern into macro- and micro-components
  • Coding former SOTA models with the procedural design pattern

Prior to 2017, the majority of renditions of neural network models were coded in a batch scripting style. As AI researchers and experienced software engineers became increasingly involved in research and design, we started to see a shift in the coding of models that reflected software engineering principles for reuse and design patterns.

One of the earliest versions of using design patterns for neural network models was the use of a procedural style for reuse. A design pattern implies that there is a current best practice for constructing and coding a model that can be reapplied across a wide range of cases, such as image classification, object detection and tracking, facial recognition, image segmentation, super resolution, and style transfer.

So how did the introduction of design patterns aid in the advancement of CNNs (as well as in other architectures, such as transformers for NLP)? First, it aided other researchers in understanding and reproducing a model’s architecture. Decomposing a model into its reusable components, or patterns, provided a means for other practitioners to observe, understand, and then perform efficient device experiments.

5.1 Basic neural network architecture

5.2 Stem component

5.2.1 VGG

5.2.2 ResNet

5.2.3 ResNeXt

5.2.4 Xception

5.3 Pre-stem

5.4 Learner component

5.4.1 ResNet

5.4.2 DenseNet

5.5 Task component

5.5.1 ResNet

5.5.2 Multilayer output

5.5.3 SqueezeNet