## 3 Method  
### Data Preprocessing  
In this study, we use pre-operative MRI sequences of 912 patients with rectal cancer after nCRT. To split the samples into train and test sets, we partition them into two disjoint cohorts based on surgery date. In this way, we want to predict the prognosis of future patients by using the data of past patients before a specific point in time. This data partitioning scheme is frequently used in medical research because it naturally reflects the actual disease incidence and prevents random selection bias. The training set consists of MRI sequences of 592 patients, 114 pCR patients, and 478 non-pCR patients, and the test set contains the MRI sequences of 320 patients, of which 78 are pCR, and 242 are non-pCR patients. We excluded the MRI sequences of 13 patients because it was impossible to evaluate their MRI reliably due to metal artifacts caused by metal stents for rectal obstruction. The disease stage information is summarized in Table 1. During the MRI examination, we followed the MRI protocol described in Appendix A. A board-certified abdominal radiologist with 6 years of experience registered multi-parametric MRI sequences. Fully automated co-registration was performed, and then the radiologist validated the co-registered MRI sequences. Automated co-registration of rectal MRI is known to be effective because rectum is in the pelvic cavity and, thus, moves much less during respiration. No manual correction was performed. Then, the radiologist drew the volume of interest (VOI) to include the whole tumor volume on T2 images semi-automatically using a 3D Slicer tool [28]. All VOIs were confirmed by a senior abdominal radiologist with 19 years of experience to ensure the quality of tumor annotations. \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Train (n = 592)** & **Validation (n = 320)** \\ \hline Age (mean \(\pm\) SD years) & 58.8 \(\pm\) 12.1 & 59.5 \(\pm\) 11.8 \\ Male (n (\%))/Female (n (\%)) & 388 (65.5)/204 (34.5) & 199 (62.2)/121 (37.8) \\ pCR (n (\%)) & 114 (19.3) & 78 (24.4) \\ \hline \hline \multicolumn{3}{c}{ypT stage (n (\%))} \\ T0 & 114 (19.3) & 78 (24.4) \\ Tis & 6 (1.0) & 8 (2.5) \\ T1 & 36 (6.1) & 14 (4.4) \\ T2 & 145 (24.5) & 60 (18.8) \\ T3 & 285 (48.1) & 156 (48.8) \\ T4 & 6 (1.0) & 4 (1.3) \\ \hline \hline \multicolumn{3}{c}{ypN stage (n (\%))} \\ N0 & 409 (69.1) & 231 (72.2) \\ N1 & 139 (23.5) & 76 (23.8) \\ N2 & 44 (7.4) & 13 (4.1) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Disease stages of rectal cancer patients (total = 912). Disagreements on annotations were resolved by consensus-based discussion. The radiologists were blinded to the clinical and histopathologic data, except for information on the diagnosis of rectal cancer. During training, we oversampled pCR MRI images in the training set to alleviate the class imbalance between pCR and non-pCR [29]. Figure 1 shows snapshots of MRI sequences, {T2, DWI/ADC, and CE}, of a pCR patient (upper) and those of a non-pCR patient (lower). Yellow masks depict rectal tumor areas segmented and validated by radiologists. As the resolution or the number of slices may differ across MRI sequences, we executed MRI alignment and z-normalization as preprocessing steps. To equalize the resolution of different MRI sequences, images were resampled to an isovoxel size of 1 mm\({}^{3}\) using the B-Spline method [30]. Then, the signal intensities of the images were converted to values in the range (\(-\)3, 3) using z-score normalization. These values were multiplied by 100 and converted to a value between (\(-\)300, 300). Radiomic features were extracted by assigning a bin size of 5 for grayscale discretization. Due to the lack of a standardized signal intensity scale of MRI, signal intensity normalization is recommended before comparing MRI images [31]. Grayscale normalization improves the robustness of radiomics features [32; 33]. As with T2, we applied z-score normalization to the post contrast enhanced MRI during the preprocessing stage.