Applying Convolutional Neural Networks
摘要
Convolutional neural networks (CNNs) have become the cornerstone of modern computer vision, enabling end-to-end learning of complex visual patterns directly from raw image data. In this chapter, we first unpack the core operations of a convolutional layer—discrete convolutions over multi-channel inputs, the roles of padding and stride in controlling output dimensions, and the importance of using multiple learnable filters to capture diverse feature maps. We then look at pooling layers (max- and average-pooling) as a means of spatial down-sampling that reduces parameter counts and improves translational invariance. A general formula for computing the output size of convolutional and pooling operations is derived and illustrated with the VGG-style architecture. Next, we explore how to initialize CNN parameters (filters and biases) using He-normal schemes, and walk through the forward-propagation pipeline—from stacked convolution + ReLU + pooling blocks through flattening to fully connected and softmax output layers. Finally, we apply these principles in a hands-on case study: building a CNN from scratch to classify citrus leaf diseases. We step through data loading and preprocessing, network construction, training via backpropagation with Adam optimization, and evaluation using precision, recall, and F1-score. Upon completion, readers will be equipped to implement and train CNNs for image classification tasks from scratch.