1. Introduction
Lensless imaging employs an optical modulator to record intensity patterns from incoming light. Unlike lenses in traditional imaging systems, which directly focus incoming light onto an image sensor to form interpretable images, optical modulators encode the incident light into patterns that do not directly represent the object of interest. To visualize the object of interest in its actual, meaningful form, the recorded intensity patterns must be processed using computational algorithms to reconstruct a high-resolution image of the sample [
1]. Even without reconstruction, which is often time-consuming and computationally intensive, the modulated intensity patterns still contain sufficient information to support tasks such as object recognition [
2], classification [
3], and computer vision [
4].
By removing the lens, the bulkiest and most expensive component of the imaging system, this approach significantly reduces the size, weight, and cost of the imaging device, making it more accessible, even in resource-limited regions. This approach also addresses the trade-off between Field of View (FoV) and resolution [
5] and minimizes noise and spatial frequency bandwidth limitations inherent to conventional microscopy [
3,
6].
Automated cell identification represents a key biomedical application of phase-modulated lensless imaging, offering efficient, label-free analysis of cellular morphology [
3,
7,
8]. In regions with limited medical infrastructure, access to reliable diagnostic tools remains a major challenge due to the scarcity of trained personnel, high cost of test kits, and lack of specialized facilities [
9]. By integrating artificial intelligence (AI) for automated analysis, the lensless imaging systems can perform diagnostic tasks, such as cell identification, without the need for expert interpretation, making them especially well-suited for point-of-care use in underserved areas [
10].
Sickle cell disease (SCD) is one of the most common blood disorders that can be identified automatically using phase-modulated lensless imaging systems [
8]. Affecting nearly 100 million people worldwide [
11], SCD is an inherited red blood cell (RBC) disorder characterized by rigid, crescent-shaped cells that disrupt normal blood flow and can lead to serious health complications. The structural and mechanical abnormalities of RBC serve as key indicators of disease presence (
Figure 1).
Lensless imaging systems, enhanced by artificial intelligence, can detect these abnormal morphologies without the need for staining or expert interpretation. By capturing the opto-biological signature (OBS) of blood samples and classifying the modulated patterns recorded by lensless microscopes without reconstructing them into human-interpretable images, these systems provide a low-cost, rapid, and scalable solution for screening SCD, particularly in regions where conventional diagnostics are inaccessible [
3,
8].
Diffusers provide a low-cost solution for implementing phase modulation in lensless imaging systems [
1,
3]. They feature continuous yet random surface height variations, enabling continuous phase modulation. However, phase modulating masks are not limited to diffusers [
5]; they also include phase gratings [
15,
16] and other types of phase masks [
17], each offering distinct modulation characteristics [
1,
18].
Microlens arrays, while serving a similar role to diffusers as phase modulators in lensless imaging systems, generate sparser sensor-level patterns, facilitating more robust and efficient classification by machine learning algorithms. Beyond improving classification, the sparsity of these patterns can also simplify the reconstruction process by reducing computational complexity and enhancing stability, making it possible to use a precise image formation model for high-resolution imaging [
19].
Simulating the setup in a virtual environment provides a cost-effective and efficient means of optimizing system parameters (distance, phase modulator type) before physical implementation in the lab. Two primary simulation approaches are commonly used for this purpose: (1) ray tracing and (2) wave optics.
Ray tracing models light as rays that travel in straight lines and interact with optical components according to the laws of reflection and refraction. Ray tracing is an approximation where the wavelength is negligible compared to the object size; therefore, it does not deal with diffraction. This approach is effective for systems where diffraction and wave effects are negligible, typically when the optical elements are much larger than the wavelength of light. In this context, the pattern recorded on the sensor is a scattering pattern formed by the geometric deflection of rays as they pass through or reflect off different parts of the sample and optical modulator. However, since this model does not account for wave phenomena such as interference and diffraction, the resulting pattern from the lensless imager cannot be computationally reconstructed to visualize the sample’s form or morphology accurately. Therefore, to form a meaningful image of the sample in a lensless imaging simulator, it is necessary to use a wave optics simulation environment.
Wave optics, also known as Fourier optics, models light as a wave characterized by both amplitude and phase. This approach simulates how wavefronts propagate and interfere, making it well-suited for accurately capturing diffraction effects, which are critical in lensless imaging systems. Wave optics gives a much more complete and realistic description of how light behaves, especially when dealing with diffraction, interference, and small-scale structures comparable to the wavelength of light. The wave-based model enables the generation of realistic intensity patterns on the sensor and allows for the computational reconstruction of the sample’s spatial structure.
So if wave optic simulations are more accurate, why should we use ray optics? The main reason is that wave optics is computationally demanding. In dedicated wave optics software, extremely fine spatial meshing is necessary to accurately capture the rapid variations in phase and amplitude of light waves over small distances. This results in high memory usage and long computation times. When using programming tools such as MATLAB or Python, simulating wave propagation typically involves implementing physical diffraction models such as the Fresnel or Kirchhoff formulations, the scalar angular-spectrum method, or the Fraunhofer approximation. These methods rely on Fourier transforms, propagation kernels, and the manipulation of complex-valued fields that encode both amplitude and phase. These requirements make wave optics simulations slow and often impractical for large-scale or multi-component optical systems. Therefore, if the conditions of a simulation allow it, ray tracing becomes a more efficient and practical alternative, as it relies on simpler geometric principles and requires significantly less computational effort [
20].
In this project, our goal is to demonstrate that even though phase-modulated lensless imaging involves diffraction effects, ray tracing simulations can still be effective. This is because, instead of reconstructing the phase, we bypass that step and directly classify the samples based on the opto-biological signature recorded at the sensor. More broadly, we aim to show how optical design can enhance the performance of lensless imaging systems. Ultimately, our objective is to establish a foundation for future advancements in lensless imaging, enabling optimal results for classification tasks.
3. Results
We evaluated the effectiveness of the lensless microscopy system using two simulation approaches: ray tracing (Zemax) and wave optics numerical simulation (MATLAB R2023a). The opto-biological signatures (OBSs) generated by each simulation method were used to train and test a machine learning model for distinguishing healthy and sickled RBC samples.
To optimize the distances between the sample and the diffuser (), and between the diffuser and the detector (), we tested all combinations of three values for and three values for , repeating the simulation for each pair. The three values selected for and were chosen based on preliminary simulations and were identified as those yielding the highest classification accuracy.
We used two simple feature types, raw pixel intensities and gradient information from the Sobel filter, to perform classification on the dataset generated with the diffuser as the phase mask modulator. Since our objective is not to optimize the classification algorithm itself, we deliberately limited the number of features used. Instead, our focus is on optimizing the optical setup parameters. The comparison of the classification results (accuracy) for this configuration, obtained using ray tracing in Zemax and wave optics simulations across different
and
, is presented in
Figure 7. It is worth noting that we do not claim that ray tracing always yields higher accuracy than wave optics. Rather, our intention is to show that the trend between the two propagation models is consistent: both wave optics and ray tracing exhibit similar behavior across different distances, supporting the validity of using ray tracing to predict system response. The higher accuracy observed in the ray tracing results may be due to differences in signal strength and SNR between the two simulations. In Zemax, the ray tracing model computes geometric power distribution without diffraction effects or numerical sampling limitations. In contrast, the MATLAB wave optics simulation involves discrete sampling and propagation on a finite grid, which may introduce numerical attenuation or truncation effects, slightly lowering the effective SNR. We also acknowledge the availability of efficient and freely accessible wave optics simulation tools. MATLAB was chosen here because it integrates directly with our classification pipeline, though exploring additional wave optics tools is a useful direction for future work.
Accuracy was calculated based on the ratio of correct predictions to total number of predictions. The dataset consisted of 90 patterns for training and 10 for testing. For both MATLAB and Zemax, the system with mm and mm achieved the highest accuracy, with 80% for Zemax and 65% for MATLAB.
4. Discussion
An important outcome of this study is the validation of ray tracing simulations as an efficient and reliable tool for optimizing lensless imaging systems. Although ray tracing does not explicitly model diffraction, the classification results obtained using Zemax closely matched those from the MATLAB wave optics simulations. This agreement demonstrates that, for applications focused on direct classification of opto-biological signatures without image reconstruction, ray tracing provides sufficient accuracy for determining the optimal and distances. Consequently, ray tracing can serve as a computationally efficient alternative to wave optics simulations during the optical design phase, significantly reducing computation time while still providing reliable predictions for system optimization.
One key advantage of ray tracing lies in the efficiency of commercial software, which readily models refractive, diffractive, reflective, freeform, and multi-element systems. While wave optics offers a more complete physical description, its simulations are computationally demanding. In this work, we demonstrate the convenience of ray tracing by replacing the diffuser with another modulator, such as a microlens array (MLA), to explore the effect on the classification task. MLA is an alternative way of encoding or decoding information, similar to a diffuser, and is often used in lensless imaging architectures [
22]. We chose a microlens array (MLA) as a phase modulator for two main reasons. First, like a traditional diffuser, the MLA is compact, lightweight, and inexpensive, making it suitable for lensless systems. Second, unlike a diffuser, the MLA produces a sparser speckle pattern due to focusing by each lenslet, which increases the signal-to-noise ratio and can improve classification results. Additionally, transmittance losses are mainly due to Fresnel reflections, which can be reduced using an anti-reflection coating on the MLA. The MLA was modeled in Zemax using a CAD file provided by Thorlabs, corresponding to a microlens array made of polymethyl methacrylate (PMMA) (
Figure 8). Compared to diffusers, MLAs can produce sparser optical patterns at the sensor plane, which may offer improved feature separability for machine learning based classification. In this setup, nine detectors were placed at different axial (
z) distances without interfering with one another, in order to investigate the optimal distance between the MLA and the detector. The distance between the cell samples and the MLA (
) was fixed at 5 mm throughout the simulations.
Replacing the random phase diffuser with an MLA as the phase modulator results in sparser recorded patterns compared to those obtained with the diffuser, as shown in
Figure 9.
We recorded patterns at a fixed distance
and nine different
distances ranging from 1 mm (D1) to 10 mm (D9). The value
was selected based on preliminary tests, where multiple
values were tried, and 5 mm consistently provided the best classification performance. As
approaches the effective focal length (EFL) of the microlens array, which is 5.3 mm at 633 nm, the recorded OBS becomes progressively sparser, reaching its sparsest state near D5 (at the EFL). In the plane of D5, the signals are very small because the pattern has reached its maximum focus at the EFL. At this plane, the light from each microlens is concentrated into a very small spot at the center of the lenslet. As a result, the sensor records only tiny, isolated spots, producing the sparsest recorded pattern that appears almost like no signal, so the figure needed to be zoomed in to clearly show these small signals. Beyond this point, as
increases further (from D5 to D9), the patterns become denser again, as shown in
Figure 10.
To evaluate the classification performance, three metrics were employed: accuracy, specificity, and the Matthews correlation coefficient (MCC). Accuracy measures the overall proportion of correctly classified samples, while specificity quantifies the proportion of true negative instances correctly identified. The MCC provides a balanced assessment of binary classification performance by incorporating all four components of the confusion matrix (TP, TN, FP, FN), and is calculated as:
The classification results are shown in
Table 1. As shown in the
Table 1, the best accuracy is 1.0 at D5, which corresponds to the sensor located at the effective focal length of the diffuser. The minimum accuracy is 0.75, and the maximum is 1.0, resulting in a range of 0.25. In addition, the specificity for all detectors is 1.0. This indicates that for every detector, the number of true negatives (TNs) is 10 and the number of false positives (FPs) is 0, meaning that the model correctly classified all negative samples without any false positive predictions.
To compare the performance of the setup using the MLA as a phase modulator with the same setup using a diffuser, we repeated the simulations with the diffuser at three different
values (5 mm, 3 mm, and 2 mm) to determine the optimal configuration. The corresponding results are presented in
Table 2,
Table 3 and
Table 4.
A comparison of
Table 2,
Table 3 and
Table 4 indicates that the configuration with
yields the highest classification performance. Consequently, this configuration is selected for direct comparison with the corresponding MLA-based setup and is regarded as the representative configuration for the diffuser-based system. As shown in
Table 2, the minimum and maximum accuracies for the diffuser setup are 0.55 and 0.9, respectively, resulting in a range of 0.35. In contrast, the MLA-based setup exhibits a smaller accuracy range of 0.25, indicating that its performance is less sensitive to changes in
. Furthermore, the maximum accuracy achieved with the MLA setup is 1.0, compared to 0.9 for the diffuser. These results demonstrate that the MLA-based configuration not only provides higher peak accuracy but also exhibits greater robustness to variations in the distances between system elements. For both setups, the specificity remains 1.0 across all detector positions, indicating perfect identification of negative samples (
,
).
Beyond the validation of ray tracing for optimizing the lensless microscopy setup, the results clearly show that the choice of phase modulator has a major impact on the performance of lensless microscopy for red blood cell (RBC) classification. Replacing the random phase diffuser with an MLA, produced sparser OBS, particularly near the MLA’s effective focal length. These sparser patterns likely enhance the separability of extracted features, leading to improved classification performance.
The MLA-based configuration achieved a higher maximum accuracy (1.0) compared with the diffuser-based setup (0.9) and exhibited a smaller accuracy range (0.25 versus 0.35). This reduced variation indicates that the MLA provides more consistent optical modulation, making the system less sensitive to changes in the detector distance . Such robustness is advantageous for point-of-care applications in resource-limited environments, where precise positioning of optical components may be difficult to achieve.
Specificity remained 1.0 across all detector positions for both configurations, confirming that all true negatives were correctly identified and that no false positives occurred. However, the improved accuracy of the MLA-based setup highlights its superior ability to correctly identify sickled cells without compromising specificity.
Future work will focus on experimental validation of the system in a laboratory setting. Even if the setup is not complicated, having a good signal-to-noise ratio is always a problem. Moreover, as it is difficult to use biological samples such as red blood cells, it could be more convenient to do a validation using glass beads as the object to be recovered.