\section{Data and Experiment}
\label{sec:details}

\subsection{Data}
\label{subsec:data}

Our model leverages an 8-class, partially labelled dataset spanning various biological scales, from regions to cells. The dataset's structure is detailed in \Cref{tab:dataset}. We sourced the human kidney dataset from three distinct resources:

\noindent\textbf{Regions:} Whole slide images of wedge kidney sections stained with periodic acid-Schiff (PAS, n=138) were obtained from from non-cancerous regions of nephrectomy samples. The samples were categorized into several groups based on clinical data, including normal adults (n=27), patients  with hypertension (HTN, n=31), patients with diabetes (DM, n=4), patients with both hypertension and diabetes (n=14), normal aging individuals (age$>$65y, n=10), individuals with aging and hypertension (n=36), and individuals with aging, hypertension, and diabetes (n=16). These tissues were scanned at 20$\times$ magnification and manually annotated in QuPath~\cite{bankhead2017qupath}, delineating medulla and cortex contours. The WSIs were downsampled to 5$\times$ magnification and segmented into 1024$\times$1024 pixel patches. Corresponding binary masks were derived from the contours.

\noindent\textbf{Functional Units:} Using 459 WSIs from NEPTUNE study~\cite{barisoni2013digital}, encompassing 125 patients with minimal change disease, we extracted 1,751 Regions of Interest (ROIs). These ROIs were manually segmented to identify four kinds of morphology objects with normal structure and methodology outlined in~\cite{jayapandian2021development}. Each image, at a resolution of 3000$\times$3000 pixels (40$\times$ magnification, 0.25 $\mu m$ per pixel), represented one of four tissue types stained with Hematoxylin and Eosin Stain(H\&E), PAS, Silver Stain (SIL), and Trichrome Stain (TRI). We treated these four staining methods as color augmentations and resized the images to 256$\times$256 pixels, maintaining the original data splits from~\cite{jayapandian2021development}.

\noindent\textbf{Cells:} We acquired 11 PAS-stained WSIs from nephrectomy specimens with normal kidney function and morphology, scanned at 20$\times$ magnification. These pathological images were cropped into 512$\times$512 pixel segments to facilitate cell labeling, following the annotation process described in~\cite{deng2023democratizing}.

The dataset was partitioned into training, validation, and testing sets at a 6:1:3 ratio across all classes, with splits conducted at the patient level to prevent data leakage.

\subsection{Experiment Details}
\label{subsec:experiment}

\begin{table}
% \begin{tabular}{llllllll}
%\centering
\begin{center}
\caption{Data collection}

% \scriptsize
% \setlength{\tabcolsep}{3mm}
% \renewcommand\arraystretch{1}

\begin{tabular}{l|cccc}
\toprule
Class  & Patch \#  & Size & Scale & Stain\\
\midrule
Medulla & 1619 &  1024$^{2}$ & 5 $\times$ & P \\
Cortex & 3055 & 1024$^{2}$ & 5 $\times$ & P\\
\midrule
DT & 4615 & 256$^{2}$ & 10 $\times$ & H,P,S,T \\
PT & 4588 &  256$^{2}$ & 10 $\times$ & H,P,S,T \\
Cap. & 4559  &  256$^{2}$ & 5 $\times$ & H,P,S,T  \\
Tuft &  4536 &  256$^{2}$ & 5 $\times$ & H,P,S,T \\
\midrule
Pod. & 1147  & 512$^{2}$ & 20 $\times$ & P \\
Mes. & 789  & 512$^{2}$ & 20 $\times$ & P \\
\bottomrule
\end{tabular}
\label{tab:dataset} 
\end{center}
\text{*DT is distal tubular; PT is proximal tubular; }\\
\text{*Cap. is glomerular capsule; Tuft is glomerular tuft;}\\
\text{*Pod. is podocyte cell; Mes. is mesangial cell.}\\
\text{*H is H$\&$E; P is PAS; S is SIL; T is TRI.}
\vspace{-4mm}
\end{table}


\begin{table*}
% \begin{tabular}{llllllll}
%\centering
\begin{center}
\caption{
Performance of deep learning based multi-class panoramic segmentation. Dice similarity coefficient scores (\%) are reported.}
\begin{adjustbox}{width=1.0\textwidth}
\begin{tabular}{l|l|ccccccccc}
\toprule
\multirow{2}{0.8in}{Method} & \multirow{2}{0.8in}{Backbone} & \multicolumn{2}{c}{Regions} & \multicolumn{4}{c}{Functional units} & \multicolumn{2}{c}{Cells} & \multirow{2}{0.8in}{Average} \\
\cmidrule(lr){3-4}
\cmidrule(lr){5-8}
\cmidrule(lr){9-10}
 & & Medulla & Cortex & DT & PT  & Cap. & Tufts & Pod. & Mes. & \\
\midrule
U-Nets~\cite{gonzalez2018multi} & CNN & 23.86 & 66.42 & 47.61 & 51.04 & 45.36 & 46.62 & 49.92 & 49.87 & 47.58 \\
DeepLabV3~\cite{lutnick2019integrated}& CNN & 41.70 & 61.26 & 63.92 & 65.31 & 72.82 & 81.93 & 49.92 & 49.87 & 60.84 \\
Residual-U-Net~\cite{salvi2021automated} & CNN& 13.21 & 69.97 & 67.03 & 76.59 & 70.58 & 82.37 & 63.99 & 64.54 & 63.54 \\
Multi-kidney~\cite{bouteldja2021deep}& CNN & 13.13 & 69.77 & 61.58 & 62.13 & 82.27 & 62.03 & \textbf{71.82} & 65.13 & 60.98 \\
Omni-Seg~\cite{deng2023omni} & CNN & \textbf{72.96} & 71.84 & 69.76 & 81.48 & 92.31 & 92.36 & 67.28 & 65.31 & 76.66 \\
\midrule
Segmenter~\cite{strudel2021segmenter}& Transformer & 56.38 & 67.34 & 54.81 & 69.14 & 67.16 & 66.78 & 49.92 & 49.87 & 60.18 \\
SegFormer~\cite{xie2021segformer} & Transformer & 54.82 &  67.68 &  62.65 & 75.87 &  77.46 &  60.42 & 62.43 & 60.21 & 65.19 \\
Unetr~\cite{hatamizadeh2022unetr} & Transformer & 16.22 & 69.70 &  61.99 & 69.35 & 72.48 & 58.10 & 58.14 & 56.32 & 57.79 \\
Swin-Unetr~\cite{hatamizadeh2021swin} & Transformer & 13.81 & 68.92 & 70.76 & 76.93 & 81.28 & 72.92 & 49.92 & 64.46 & 62.38 \\
\midrule
PrPSeg (Ours) & CNN &  72.38 &  \textbf{72.64} & \textbf{72.45} &  \textbf{85.27} &  \textbf{94.23} &  \textbf{94.40} & 70.98 & \textbf{66.96} & \textbf{78.66} \\
\bottomrule

\end{tabular}
\end{adjustbox}
\end{center}
\text{*DT is distal tubular; PT is proximal tubular; Cap. is glomerular capsule}\\
\text{*Pod. is glomerular podocyte cell; Mes. is glomerular mesangial cell}\\
\vspace{-4mm}
\label{tab:Qualitative}
\end{table*}


\begin{figure*}[t]
\centering 
\includegraphics[width=1\linewidth]{{fig/QualitativeResults.pdf}}
\caption{
\textbf{Validation qualitative results -- } This figure shows the qualitative results of different approaches. The proposed method achieved superior panoramic renal pathology segmentation on 8 classes range regions to cells with fewer false positives, false negatives, and morphological errors.} 

\label{Fig.Qualitative} 
\end{figure*}

The training process of our model was divided into two distinct phases. In the initial phase, spanning the first 50 epochs, we employed a supervised learning strategy focused on minimizing binary dice loss and cross-entropy loss. Subsequently, for the remaining epochs, both supervised and semi-supervised learning strategies were utilized, incorporating anatomy loss to explore the spatial correlation among multiple objects. In our experiments, $\lambda_{\text{upl}}$ is 0.1.

All images were either randomly cropped or padded to a uniform size of \( 512 \times 512 \) pixels prior to being fed into the model in the training stage. We established 8 separate image pools, each designated for different tissue types, to organize training batches. This approach follows the image pooling strategy from Cycle-GAN~\cite{zhu2017unpaired}. The batch size was set to 4, while each image pool could accommodate up to 8 images. Once an image pool accumulated more than the batch size, the images were retrieved from the pool and input into the network for processing. During each backpropagation step, Binary Dice Loss and Cross-entropy Loss were combined as the loss function in the supervised learning phase.

For weight optimization, we employed the Adam optimizer with an initial learning rate of 0.001 and a decay factor of 0.99. We also implemented general data augmentation techniques, including Affine transformations, Flip, Contrast adjustment, Brightness adjustment, Coarse Dropout, Gaussian Blur, and Gaussian Noise. These augmentations, sourced from the imgaug package~\cite{imgaug}, were applied to the entire training dataset with a probability of 0.5.

Model selection was based on the mean Dice coefficient score across 8 classes, evaluated on the validation dataset. The best-performing models within the first 100 epochs were then assessed on the testing dataset. Testing images were initially processed using either center-cropping or non-overlapping tiling to attain the same uniform size \( 512 \times 512 \) pixels. For evaluation, these images were subsequently either center-cropped or re-aggregated to their original dimensions. All experiments were conducted on a uniform platform, specifically a workstation equipped with an NVIDIA RTX A6000 GPU.
