## 3 Methodology
### D U-Net Model for Classification  
3D U-Net models are a type of DL model which are commonly employed for medical picture segmentation and classification applications. They are developed from the well-known 2D U-Net structure and then further developed to deal with 3D data. Frequently, 3D CNN models are composed of two separate pathways. The first one is the contracting path which consists of convolutional and max pooling layers. The other one is the expanding path that includes transposed convolutional and up-sampling layers. The missed links between the contracting and expanding paths in the network allow the spatial information to be preserved from the contracting path. The 3D U-Net model produces a segmentation map or a label for categorizing the data when a 3D data volume is given to it. The model is trained on a larger annotated dataset with the parameters being tuned to minimize a loss function. The model is put through its paces by feeding it an unseen 3D volume and seeing what comes out the other end, a segmentation map and/or a classification label. A 3D U-Net model can have its architecture tailored to the needs of a particular application. The size and capacity of a CNN can be adjusted by tweaking various parameters, such as the number of layers, the number of filters assigned to each layer, the stride value, and the kernel size utilized in each layer. For ductal carcinoma classification, a 3D U-Net model undergoes a training process to distinguish between IDC-positive and IDC-negative regions in histopathological images. The entire model is trained using a supervised learning strategy by employing cross-entropy as the loss function. Figure 8 shows the 3D U-Net classifier architecture.  
The main mathematical operations for the 3D U-Net classification model are convolution, max pooling, up-sampling, and transposed convolution.  
Convolution:  
Given an input feature map \(X\) with dimensions batch size, depth, height, width, and channels, and a kernel \(W\) with dimensions depth, height, width, input channels, and output channels, the convolution operation is given as  
\[Y=Conv3D(X,W)=sum_{i}^{n}(X[i,j,k,l,m]*W[i,j,k,m,n]) \tag{12}\]  
where \(m\) and \(n\) are the indices of input and output channels, respectively.  
Max Pooling:  
Given an input feature map \(X\) with dimensions batch size, depth, height, width, and channels, the following relationship gives the max pooling operation:  
\[Y=MaxPool3D(X)=max(X[i:i+stride,j:j+stride,k:k+stride,l:l:channels]) \tag{13}\]  
Figure 7: IDC patches with state labels as training samples after preprocessing.  
where _stride_ is the pooling stride and the max pooling operation selects the maximum value in a _stride_3 region.  
Up-sampling:  
Given an input feature map \(X\) with dimensions batch size, depth, height, width, and channels, and a scaling factor \(s\), the up-sampling operation is given as  
\[Y=Upsample3D(X,s)=X[i,j,k,l,m] \tag{14}\]  
where \(i,j,k\) are in \([0,s)\), \(l\) is in \([0,channels)\), \(m\) is in \([0,batchsize)\), and the up-sampling operation expands the feature map spatial dimensions by factor \(s\).  
Transposed Convolution:  
Given an input feature map \(X\) with dimensions batch size, depth, height, width, and channels, and a kernel \(W\) with dimensions depth, height, width, output channels, and input channels, the transposed convolution process is described as follows:  
\[Y=ConvTranspose3D(X,W)=sum_{i}^{n}(X[i,j,k,l,m]*W[i,j,k,n,m]) \tag{15}\]  
where \(m\) and \(n\) are the indices of input and output channels, respectively. The transposed convolution operation can be considered as a convolution operation followed by an up-sampling operation, where the up-sampling is achieved by inserting zeros between the input pixels and then convolving the resulting matrix with a filter kernel. These operations form the building blocks of a 3D U-Net model for ductal carcinoma classification and are repeated multiple times to form the contracting and expanding paths of the model.  
Figure 8: Design of the 3D U-Net classification model.