## 3 Methodology  
CNN is a subclass of deep neural network which has gained popularity in computer vision applications. It is intended to automatically and adaptively learn spatial hierarchies of image features using the backpropagation algorithm. CNN accomplishes this task by utilizing a multilayered hierarchical arrangement of various layers such as convolutional, activation, subsampling, and fully connected. The features are recognized in a hierarchical order by these layers, beginning with simple edges and progressing to complex objects. This research proposes a novel approach to assess the meat quality using an ensemble of suggested CNN models. Two compact CNN models (ConvNet-18 and ConvNet-24) are proposed for meat quality assessment. These models are meticulously designed, taking various hyperparameters into account. A brief description of the various layers employed in the compact CNNs follows:  
Convolution layer: Convolution is the fundamental linear mathematical operation performed in the convolutional layer. The usage of convolutional layers in CNN mimics the organization of the human visual cortex, where a sequence of layers evaluate an input image and recognize increasingly complex information. The convolutional layer is composed of a set of kernels that work by dividing the image into small patches, termed as receptive fields. The breaking down of an image into small blocks facilitates the extraction of feature motifs. The earlier convolutional layers extract low-level features, which are then processed by later convolutional layers to retrieve higher-level patterns. The convolved output is represented in Equation (1) as follows:  
\[Z(i,j)=\sum_{i=-m}^{m}\sum_{j=-m}^{m}\ I(m-i,n-j).k(i,j)+b, \tag{1}\]  
where \(I(m,n)\) is the RGB image, \(k(i,j)\) is the filter, \(Z(i,j)\) is the convolved output, and \(b\) is the bias term. Rectified linear unit layer: Non-linearities are introduced into the CNN to learn the complex features in the image. This is accomplished through the use of activation functions. The ReLU activation function, defined as \(R(Z)=max(0,Z)\) is used commonly for non-linearity. It never saturates, and the gradient is always high. This significantly improves the training speed. Batch normalization layer: During training, the distribution of each layer's inputs changes as the parameters of the previous layers change. Hence, each layer needs to continuously adapt to the new distribution obtained from the previous one, and this slows down the convergence. Batch normalization overcomes this and makes the training more efficient at the same time by reducing the covariance shift within the internal layers during training. This is accomplished by a normalization of the inputs to a layer for each mini-batch. The first step of batch normalization is to subtract the batch mean from every output value and divide it by the batch standard deviation. Let B denote a mini-batch of size m of the entire training, then the normalized activation \(X_{i}\) is described in Equation (2) as  
\[X_{i}=\frac{x_{i}-\mu_{B}}{\sqrt{\sigma_{B}^{2}+\epsilon}}, \tag{2}\]  
where \(\epsilon\) is a numeric constant. \(\mu_{B}\) and \(\sigma_{B}^{2}\) represent the mini-batch mean and variance denoted in Equations (3) and (4), respectively. \[\mu_{B}=\frac{1}{m}\sum_{i=1}^{m}\ x_{i} \tag{3}\]  
\[\sigma_{B}^{2}=\frac{1}{m}\sum_{i=1}^{m}\ (x_{i}-\mu_{B})^{2} \tag{4}\]  
The second step uses scaling (\(\gamma\)) and shifting (\(\beta\)) parameters as mentioned in Equation (5) to allow the variables to have any mean and standard deviation,  
\[y_{i}=\gamma X_{i}+\beta. \tag{5}\]  
These scaling and shifting parameters are trainable and learned during training. Thus, batch normalization parameterizes the mean and standard deviation as trainable parameters, which makes the distribution shifts manageable during training. This results in faster convergence. Max pooling layer: CNN achieves dimension reduction through the use of subsampling layers.