## 2 Materials and Methods  
Figure 1a shows an example of a two-dimensional disordered waveguide considered for this study. The disordered waveguides are assumed to be fabricated out of a high refractive index dielectric medium with effective refractive index \(n_{e}=2.85\). The disorder was introduced by randomly positioning air holes of radius (\(R=150\) nm) within the waveguide. To study disordered structures with different degrees of disorder, we changed the number (\(N_{s}\)) of the air holes within the waveguide; structures with \(N_{s}=300\), \(400\), and \(500\) were simulated. In these calculations, the values of refractive indices were chosen to emulate two-dimensional disordered silicon waveguides with air holes, which were investigated in recent experimental studies [23; 24; 25; 26; 27]. The vacuum optical wavelength (\(\lambda\)) was chosen to be \(1.55\)\(\mu\)m, as silicon is lossless at this wavelength. The width (\(W\)) of the waveguides was fixed to be \(10\)\(\mu\)m, such that the disordered waveguides supported \(N=36\) propagating modes, where \(N\) is given by \(2W/(\lambda/n_{e})\). The length (\(L\)) of the disordered region was fixed to be \(20\)\(\mu\)m. The length (\(L\)) was chosen such that the \(L>>l_{t}\) for all the studied disordered waveguides, where \(l_{t}\) is the transport mean free path of the disordered system. This ensured that the wave propagation within the disordered medium was diffusive. Two empty buffer regions of \(3\)\(\mu\)m (\(-2\lambda\)), one at the beginning and one at the end of the disordered regions, were included in the simulation. These buffer regions were effectively silicon waveguides without scatterers and allowed us to also record the speckle-like intensity patterns of the transmitted and reflected light along with the intensity distributions of the transmission eigenchannels for our machine learning-based classification task. To calculate the transmission eigenchannels of the disordered waveguides, we used the recursive Green's function method, as described in Refs. [28; 29; 30]. First, we constructed the field transmission matrix \(t\) of the disordered waveguides, where \(t\) is a \(N\times N\) complex matrix. The transmission matrix of the disordered waveguide gives the output field for any arbitrary input (Figure 1b). The transmission eigenchannels are eigenvectors of the matrix \(t^{\dagger}t\) and the eigenvalues are the transmittance of the corresponding eigenchannels (Figure 1c). In the lossless diffusive regime, the density of the eigenvalues follows a bimodal distribution where some channels, called \"open channels\", have a transmittance/transmission eigenvalue -1 and other channels have lower transmittance. The transmittance of the eigenchannels decreases exponentially with the index of the eigenchannel (Figure 1c). In the  
Figure 1: Schematic of the device and numerical simulations. (**a**) Schematic of the disordered waveguide studied in this paper. The grey region corresponds to the silicon waveguide and black circles correspond to air holes; (**b**) Absolute value of a transmission matrix calculated for a single random configuration with \(N_{s}=300\); (**c**) Transmission eigenvalues of disordered waveguides with three different scattering strengths (\(N_{s}=300\), \(400\), and \(500\) respectively). As \(N_{s}\) increases, due to enhanced backscattering, the values of the transmission eigenvalues decrease. diffusive regime, the diffusion process is dominated by the open channels, and the average transmittance is the mean of all the transmission eigenvalues, which is proportional to the ratio of the number of open channels to the total number of propagating channels [31]. As the number of scatterers, \(N_{s}\), is increased, due to enhanced backscattering, the transmission eigenvalues decrease in magnitude, which results in an overall decrease in the average transmittance (Figure 1c). To calculate the intensity distributions of the transmission eigenchannels, we again used the recursive [PERSON]'s function method [28; 29; 30].