DLDNN: Deterministic Lateral Displacement Design Automation by Neural Networks

Farzad Vatandoust
Department of Mechanical Engineering
Iran University of Science and Technology
vatandoustf@gmail.com
&Hoseyn A. Amiri
Department of Biomechanics
Iran University of Science and Technology
aamirihoseyn@gmail.com
&Sima Mas-hafi
Department of Mechanical Engineering
Kharazmi University
sima.mashafi@gmail.com
Abstract

Size-based separation of bioparticles/cells is crucial to a variety of biomedical processing steps for applications such as exosomes and DNA isolation. Design and improvement of such microfluidic devices is a challenge to best answer the demand for producing homogeneous end-result for study and use. Deterministic lateral displacement (DLD) exploits a similar principle that has drawn extensive attention over years. However, the lack of predictive understanding of the particle trajectory and its induced mode makes designing a DLD device an iterative procedure. Therefore, this paper investigates a fast versatile design automation platform to address this issue. To do so, convolutional and artificial neural networks were employed to learn velocity fields and critical diameters of a wide range of DLD configurations. Later, these networks were combined with a multi-objective evolutionary algorithm to construct the automation tool. After ensuring the accuracy of the neural networks, the developed tool was tested for 12 critical conditions. Reaching the imposed conditions, the automation components performed reliably with errors of less than 4%. Moreover, this tool is generalizable to other field-based problems and since the neural network is an integral part of this method, it enables transfer learning for similar physics. All the codes generated and used in this study alongside the pre-trained neural network models are available on https://github.com/HoseynAAmiri/DLDNN.

\addbibresource

references.bib

\keywords

Microfluidics Deterministic Lateral Displacement Convolutional Neural Network Design Automation Multi-objective Optimization Particle Separation

1 Introduction

The need for biomolecular analysis was the primary incentive for microfluidics development, In recent years, cell separation studies have drawn significant attention to microfluidic devices [C4LC00939H] which could be categorized based on particle properties such as size and other attributes [tang2022geometric]. Deterministic lateral displacement (DLD), a size-based particle/cell separation method, is a crucial technique in the fields of medical science and biology for rapid diagnosis and testing. Its low cost and easy operation has created a growing interest in developing DLD devices.

In 2004, the first DLD device sample was proposed by Huang et al. [huang2004continuous]. They used bifurcation of laminar flow around arrays of obstacles to induce different lateral displacements to the particles. Interestingly, it was shown that particles larger than a certain critical diameter () follow a continuous lateral displacement path (bumped mode) while smaller particles continue to move along their entry point towards the end of the channel (zigzag mode). Later in 2006, Inglis et al. [inglis2006critical] derived an analytical approximation of the parameter to facilitate the design of DLD and Davis et al. [davis2006deterministic] modified the formula for improving its accuracy.

Further advancement of DLD devices aimed at increasing the throughput, enhancing the separation quality, and reducing clogging. Zeming et al. [zeming2016asymmetrical] and Kim et al. [kim2017broken] investigated the effect of the gap size parameter on separation quality and throughput. In addition to array arrangements, researchers also employed different pillar shapes. Wang et al. [wang2021automatic] evaluated the influence of triangular pillar shapes while Zeming et al. [zeming2013rotational, zeming2020microfluidic] discussed various shapes like rectangular, L-shaped, and I-shaped. Furthermore, Hyun et al. [hyun2017improved] performed topology optimization on the shape of the pillars in the DLD device, and their method allowed to increase the gap between particles, thus reducing the clogging. Finally, Dincau et al. [dincau2018deterministic] tested the performance of DLD devices in various Reynolds numbers (). The results suggested that the decreases with an increase in Reynolds number due to the changes in the flow field and wakes behind pillars. Therefore, the performance of the DLD device can be tuned by adjusting the flow rate parameter. Overall, these works thoroughly established the direct impact of the geometrical parameters and Reynolds number on , throughput, and separation quality. Various effective parameters make the engineering of a DLD device highly iterative and resource-intensive; hence, a design automation platform is required to alleviate this problem.

The automation platforms typically include a surrogate model of the actual physics for fast prediction and an algorithm for finding the best device setup [lashkaripour2021machine, mcintyre2022machine]. Optimization algorithms are well-established in various problems for myriad applications [bai2010analysis, arun2021spacing, liu2013application, huang2020efficient, yusoff2011overview]. Thus, the main challenge of automation is constructing a reliable surrogate model. Recently, machine learning methods have displayed great potential in detecting patterns and learning PDE equations [jordan2015machine, raissi2018hidden, sirignano2018dgm, han2018solving] as well as extracting or reconstructing flow field features [li2021recent]. Jin et al. [jin2018prediction] utilized a fusion convolutional neural network (CNN) to predict the velocity field around a cylinder by setting the pressure around the cylinder as an input. Lee et al. [lee2019data] used CNN and generative adversarial neural networks (GANs) with and without imposing conservation of mass and momentum to generate a flow field around a cylinder. The conclusions state that all networks are able to predict flow in near future. However, in the aspect of long-term generalization and prediction, the network with imposed physical law have better performance. In the field of the physics-informed neural network (PINN), Raissi et al. [raissi2019physics, raissi2019deep, cuomo2022scientific] have dedicated many studies to encoding the governing equations into a neural network. In 2019, they introduced the concept of PINN and applied Navier-Stokes equations to a standard neural network to predict flow over a cylinder [raissi2019physics]. More information about these types of neural networks can be found in Raissi’s review paper [cuomo2022scientific]. Saker et al. [sekar2019fast] combined CNN and ANN to generate flow over the airfoil. They used CNN to extract geometrical features from the image of an airfoil and then fed it into an ANN to predict the flow past a cylinder. In addition to the flow field, there are other studies involving the prediction of fields of any kind such as heat flux [kim2020prediction]. As seen from the literature, machine learning methods are capable of imitating the behavior of underlying fluid flow physics. However, to the best of our knowledge, there are not many studies investigating the DLD flow field prediction, and the use of machine learning was limited to the area of particle detection by CNN to facilitate the experimental process [gioe2022deterministic].

Therefore, this study explores the application of deep learning methods for surrogate modeling of DLD devices and combines them with a multi-objective algorithm creating a design automation platform. To do so, circular pillars were chosen as a base for the design, thereafter the data-set consisting of x and y components of velocity field was generated by numerical simulation for a wide range of DLD device conditions. Followed by that, a CNN was developed and trained to reconstruct these fields around the pillars. The network demonstrated good accuracy in predicting the field and later was used as a data augmentation tool for training a fully-connected neural network (FCNN) to directly predict . These components alongside non-dominant sorting genetic algorithm type 3 (NSGA3) constructed the design automation platform. The developed tool provides many features from achieving the particular design parameters for a user-specified desired performance, predicting the device working range after fabrication, and modeling the particle behaviors for any given device length. Overall, this approach can facilitate the design process while saving time and resources by avoiding repetitive trial and error processes to reach the desired design.

2 Methodology

2.1 Data preparation

A DLD array of circular posts was built in the CFD solver to generate a comprehensive data-set for neural network training. To do so, the incompressible Navier-Stokes and continuity equations were solved since the Reynolds number lies within the laminar flow regime. Figure 1a illustrates a general schematic of the DLD design and the role of critical diameter in the separation of green () and red () particles. The dashed segment demonstrates the excerpt used for solving the periodic flow model which holds all the geometrical parameters that influence the critical diameter. These geometrical parameters consist of R, N, , and . Where, R is pillars radius, N is the pillars arrays period number () defining their periodic repetition, and are the identical horizontal and vertical gaps between pillars. Then, in order to feed the velocity fields to the proposed CNN, the decomposed fields in the Cartesian coordinate system were mapped to squared fields of 128128 structured data as drawn in Figure 1b. To achieve this mapping, the domain was normalized by , followed by a shear mapping in the y direction as,

(1)

2.2 Field generative CNN

Field-generative neural networks provide a great alternative for CFD solvers with lower computational costs and the capacity of transfer learning for similar applications. Here, a convolutional network was used for reconstructing velocity fields as illustrated in Figure 1c. The neural network architecture used in this work, inspired by Dosovitskiy et al. [dosovitskiy2016learning], generates data as a great asset in DLD cases since the existing methods can be time-consuming and resource intensive. To capture a wide range of operational conditions, three inputs were defined namely, Re, N, and f where,

(2)

It is important to take the ratio of G and R instead of their values because the latter does not necessarily represent a unique shape. The inputs were fed into a separate set of dense layers for higher dimensional representation and after concatenation, they went through two sequential dense layers. Next, they were connected to four upsampling layers combined with convolutional. It should be noted that since both the x and y components of the velocity field are required, the mentioned sub-structure is used in parallel in order to reconstruct both fields.

a) DLD device principle, b) data preparations, and c) CNN architecture.
Figure 1: a) DLD device principle, b) data preparations, and c) CNN architecture.

2.3 Particle tracing and critical diameter extraction

Particle tracing and critical diameter extraction are crucial parts of the performance evaluation of DLD devices. Consequently, particles’ behavior in the flow field and their interaction with obstacles were simulated based on the following models. First, the massless particle tracing scheme was utilized, because the particles and the flow have negligible inertia. Then, particles positions were approximated from velocity fields with Runge-Kutta method. Finally, for simulating the particle-pillar interaction, the wall distance function was numerically calculated to measure the minimum spatial distance from pillars. In case of contact (when the distance between particle and pillar is equal to the particle radius), the reflect function modifies the particle velocity () as,

(3)
(4)

where the and are the unit vectors in the normal and tangential directions of particle and pillar contact point, respectively (see Appendix A). Once the particle’s accurate pathlines are obtained, the critical diameter was extracted via the Newtonian root finding method. In this approach, first, two particles with the highest and lowest diameters possible are simulated. The particle with the bumped mode receives a positive value and the particle with the zigzag mode is assigned a negative value. Thus, the Newtonian method can narrow the diameter interval to detect the root which is the critical diameter (see Appendix B).

2.4 Design automation

The design automation algorithms convert the user-defined specification to geometry properties and flow rate to readily meet the desired criteria. To boost the function evaluation speed, one can utilize neural networks as the surrogate model instead of the whole physics/experimentation. This alternative facilitates the design process of a DLD device to reach the best possible configuration, especially when combined with an evolutionary algorithm.

As presented in Figure 2, design automation inputs are the diameters of particles to be separated ( and ), desired constraints to be applied on f, N, Re (, , and ), and finally the trade-off between flexibility and stability of the design (). Flexibility indicates the ability of the proposed design to cover a wide range of critical diameters while stability specifies its immunity to change due to minor flow rate fluctuations (see Appendix C). These two terms were included to consider the possible device behavior after fabrication since it can be altered by adjusting the Reynolds number.

After defining the inputs, a multi-objective optimization algorithm coupled with a pre-trained FCNN tunes the f, N, Re, and G to reach the optimized design. In this design automation tool, an NSGA3 with five reference directions and population size of 260 was chosen and implemented in Pymoo library [pymoo] in Python 3. The pre-trained FCNN was used for direct critical diameter prediction (direct neural network) since extracting critical diameter from CNN outputs slows down the optimization process. Finally, the tuned parameters in addition to bandwidth (BW) are extracted and presented in the outputs. BW is the difference between the maximum and the minimum critical diameter for that design serving as an index of flexibility. Note that the parameter G is used in optimization to nondimensionalize the critical diameter matching the developed neural network’s .

Furthermore, the pre-trained CNN was attached to the end of the automation process to provide the ability to simulate the particle trajectory in the optimum design for a given number of periods. This feature helps visualize the particle behavior at the full length of the device.

The scheme of design automation platform.
Figure 2: The scheme of design automation platform.

3 Results and discussion

3.1 CNN training and data generation

The CNN was developed for fast velocity field generation which accelerates particle tracing. In this section, the network architecture, performance, and utility for data augmentation were analyzed. For this purpose, a sufficient amount of data was selected to cover a wide range of DLD device configurations. In order to choose the domain limits, a combination of reported working conditions from the literature was used [tang2022geometric]. The range for parameters f, N, and Re are as follows. f was chosen from 0.25 to 0.75 with step size of 0.02 which resulted in 26 data points. N was chosen to be {3, 4, 5, 6, 7, 8, 9, 10} and the Reynolds number was selected to be {0.01, 0.1, 1, 2.5, 5, 7.5, 10, 15, 20, 25}. In total, 2288 data points were created and split 80%-20% for train-development sets. Furthermore, another data-set was created to test the network, consisting of data points that were not given to the network in the development process. This data-set was build from a combination of f between 0.25 and 0.75 with a step size of 0.06, N of {3, 4, 5, 6}, and Re of {0.05, 1.5, 6.5, 8.5, 12.5, 18.5}, which resulted in a data-set with 239 data points.

Next, a network architecture was designed to effectively understand the relationship between the data. As can be seen in Table 1, nine architectures were tested starting with a base architecture (CNN1). At first, the width of the dense layers was increased (CNN1-3) which caused no significant improvement despite increasing the network trainable parameters dramatically. Then, the width and depth of convolutional layers were examined (CNN4-9) where CNN9 exhibited the best performance and its detailed structure is presented in Table 2. Moreover, other hyper-parameters were set to constant as follows, batch size of 64, a learning rate of for the first 100 epochs, and for the other 100 epochs. The chosen network was also gone through another 100 epochs with a learning rate of and reached the validation loss of .

Type Architecture Loss Val-Loss #Params
CNN1 2Dense256, 3Conv32 8,764,162
CNN2 2Dense512, 3Conv32 17,571,586
CNN3 2Dense1024, 3Conv32 35,972,866
CNN4 2Dense256, 3Conv64 8,948,674
CNN5 2Dense256, 3Conv128 9,538,882
CNN6 2Dense256, 4Conv64 9,022,530
CNN7 2Dense256, 2Conv64 8,874,818
CNN8 2Dense256, 2Conv128 9,243,714
CNN9 2Dense256, 2Conv256 10,423,874
Table 1: CNN architectures study. The number of convolutional layers reported do not include the two constant layers with 64 filters in the architecture.
Layer Kernel/Stride/Pad Output size
Dense 1-1 16
Dense 1-2 16
Dense 1-3 16
Concate 1-4 48
Dense 2 256
Dense 3 256
Dense 4 16384
Reshape 5-1
Conv2D 5-2 /1/same
UpSampling 6-1
Conv2D 6-2 /1/same
UpSampling 7-1
Conv2D 7-2 /1/same
UpSampling 8-1
Conv2D 8-3 /1/same
Conv2D 8-4 /1/same
Table 2: The detailed architecture of the nominated CNN9.

Finally, Figure 3 depicts the performance evaluation of the chosen CNN structure to predict the critical diameter. The accuracy of the network in development and test set is illustrated in Figure 3a, where its mean squared errors () were and , respectively. Furthermore, The network predictions’ and standard deviation () are also demonstrated based on Re, N, and f on the development set to detect any trends in the errors (Figure 3b). In sum, and are less than 3% and 5%, respectively, which is an indication of the satisfactory performance of the network. However, the error trends convey that it will be intensified with the increase in N and f. Yet, there is no strong correlation between the error and Re. Additionally, Figure 3c, depicts the velocity fields with the most critical diameter prediction error from the test set (, , and ). By comparing the original field from the numerical study (Ground Truth) and the neural network-generated field (Prediction), it is clear that these fields match well. Moreover, the discrepancies between the x and y components of velocity fields (Difference) quantitatively prove the latter observation. The results reveal that the nominated CNN has a high accuracy () in the field generation leaving most of the critical diameter prediction errors in the process of critical diameter computation.

The nominated CNN performance evaluation. a) Critical diameter prediction accuracy in the development and test sets. b) Critical diameter prediction errors based on
Figure 3: The nominated CNN performance evaluation. a) Critical diameter prediction accuracy in the development and test sets. b) Critical diameter prediction errors based on , , and . c) CNN fields analysis at the highest predicted error.

Then, the trained CNN was used to generate new data (data augmentation) to facilitate the training of the direct neural network. This network helped with the augmentation of 2288 to 10400 data points by enhancing the resolution of Re in the new data-set by decreasing the step size to 0.499.

3.2 Direct neural network training

Here, the process of finding the best architecture of the FCNN for direct prediction of critical diameter alongside its training procedure is presented. For this particular problem, a systematic search was carried out where networks with a maximum of 10 hidden layers (HL) and nodes (N) of up to 128 were tested. The results are given in Table 3 after training with 1000 epochs and a learning rate of . The results imply that the 8 HL and 128 N architecture display superior performance. Therefore, this structure was used in the optimization algorithm.

\diagbox[width=4em]HLN 10 16 32 64 128
4
5
6
8
10
Table 3: FCNN architectural study. The numbers reported here are values of the network’s prediction on the set.

The convergence process and performance of the chosen network are depicted in Figure 4. It is shown that the network’s on the training set (training loss) and the development set (validation loss) decreased per episode, Figure 4a. Considering the proximity and low values of training and validation losses ( and , respectively), it can be concluded that there were no avoidable bias and over-fitting problems. In addition, the network predictions of critical diameter and the actual critical diameter were compared on the entire original and generated data-sets. The network prediction has satisfying performance in both data-sets with the of on the 2288 data-set and on the 10400 data-set, Figure 4b.

Direct neural network performance evaluation. a) The convergence process of training and validation losses. b) The prediction accuracy in the 2288 and 10400 data-sets.
Figure 4: Direct neural network performance evaluation. a) The convergence process of training and validation losses. b) The prediction accuracy in the 2288 and 10400 data-sets.

3.3 Design automation

After ensuring the accuracy of the direct neural network, the next step was examining the robustness and versatility of the design automation platform consisting of the network and evolutionary algorithm. In order to do this, a set of conditions were used as shown in Table 4. In this table, two conditions of the maximum stability () and the maximum flexibility () were used in each of which f, N, or Re were set to either maximum or minimum. In addition, for all the test subjects and were kept at 5 and 8 , respectively. The output of these tests indicates that the proposed NSGA3 could apply the constraints and find the design parameters efficiently. For example, in case 1, the f reached its minimum value with BW of 2.27 , while its corresponding case with the maximum flexibility (case 7) increased the BW up to 2.61 . This trend for BW occurred similarly where the cases with always had bigger BWs. Moreover, as the last stage of checking the method’s accuracy, the proposed configurations were also simulated in the original software for comparison with the direct neural network’s prediction. The relative differences are shown in Table 4 as errors (E) being acceptably less than 4%.

Furthermore, to visually elaborate the automation outputs, Figure 5a depicts the range of based on . The results presented in these plots are aligned with the finding from Table 4 and it can be seen that the cases of maximum flexibility have a higher slope than the cases of maximum stability. In addition, the post-processing of case with minimum and maximum flexibility (case 9) is demonstrated in Figure 5b for 10 periods. In this figure, the particle trajectory plots illustrate how particle with bumped and zigzag modes would behave within the full length of the device and the recurrence maps provide the exact lateral positions of the particles at the input and output of each period.

Inputs Outputs
No. f N Re f N Re G BW E%
1 0 Min - - 0.25 9.00 1.28 15.79 6.51 2.27 3.20
2 0 Max - - 0.75 10.00 21.91 19.07 6.49 3.41 2.37
3 0 - Min - 0.51 3.00 0.13 8.80 6.49 3.41 0.82
4 0 - Max - 0.46 10.00 5.56 19.03 6.50 0.90 1.13
5 0 - - Min 0.41 10.00 0.01 21.62 6.50 1.63 1.73
6 0 - - Max 0.47 8.00 25.00 17.55 6.50 1.38 0.54
7 1 Min - - 0.25 10.00 18.75 20.45 6.49 2.61 0.56
8 1 Max - - 0.75 4.00 0.02 16.94 6.50 10.44 3.98
9 1 - Min - 0.75 4.00 4.29 14.28 6.50 8.81 2.20
10 1 - Max - 0.75 10.00 18.99 21.51 6.50 3.85 1.24
11 1 - - Min 0.75 4.00 0.03 16.93 6.50 10.44 3.89
12 1 - - Max 0.74 5.00 21.66 8.85 6.50 4.50 2.40
Table 4: Design automation results for chosen samples.
Design automation results. a) Optimized devices’ performance plots showing the relationship between
Figure 5: Design automation results. a) Optimized devices’ performance plots showing the relationship between and . b) An example of and particle trajectories and their corresponding recurrence maps.

4 Conclusion

This work presents a design automation platform for DLD devices by incorporating the deep neural network’s ability to understand their underlying physics. To achieve this goal, first, the DLD physics was numerically simulated whereafter extracting the data, they were modified for a CNN architecture. Furthermore, using a CNN enabled the fast prediction of the flow fields to be readily used for particle trajectory simulation and data augmentation; however, they were not utilized directly for critical diameter prediction. Instead, a fully-connected neural network was trained to understand the direct relationship between the device properties and its critical diameter. Finally, the neural network’s fast predictability was embedded into an NSGA3 multi-objective optimization to create the design automation tool. The main purpose of the automation platform was to take the particle diameters and suggest a design and working condition for their separation. Later, more features were allowed to be entered by the user to have more control over the suggested design and the behavior of the device after the fabrication.

Overall, each design automation component exhibits an acceptable level of accuracy ensuring the reliability of the tool to suggest suitable design parameters. The convolutional neural network which was trained on a small data-set reached the validation loss of and the critical diameter extracted from this predicted field had the mean squared error of . Moreover, the fully connected neural network that was used for the direct prediction of critical diameter achieved . Knowing the desirable performance of each component, the automation platform was tested for 12 critical cases. In the last stage, the predicted critical diameters of each case were revalidated by the original software as their maximum error did not exceed 4%. This method presents itself as highly accurate where the stem of the errors is likely due to the simplifying particle trajectory simulation that is used for critical diameter extraction. Moreover, this approach is functional and generalizable to other physics and applications that require field prediction and particle trajectory simulations. In the case of DLD devices, there is a possibility of transferring learning to other cases with different pillar shapes and patterns. Future work can be enhancing the simulation technique, employing experimental data, and including other prominent shapes in DLD devices.

Appendix

A Particle-pillar contact simulation

Wall function was used to simulate particle interactions with obstacles. It stores the shortest distance from any position to pillars in a discretized periodic domain. Then, this information serves as an efficient mapping between the spatial positions of particles to their distance from pillars, since it is only calculated once for each geometry. Moreover, the normal and tangential unit vector fields for velocity modification in the contact point can be calculated by extracting the wall function gradient and its perpendicular direction, respectively. Figure A.1 shows an example of the wall distance function and the normal vector field.

a) Wall distance function contour and b) wall normal vector field.
Figure A.1: a) Wall distance function contour and b) wall normal vector field.

B Critical diameter extraction with Newtonian root finding method

The Newtonian root finding method was used for extracting the critical diameter from particle trajectory simulation. Here, the detailed explanation of this method is provided in the Algorithm 1 where it gets the desired tolerance as input and derives the critical diameter.

Input
      Output

Calculate
Lowest diameter
Highest diameter
Particle Tracing Perform particle tracing with
Particle Tracing Perform particle tracing with
if  then
     while  do
          Halve the diameter difference
         Particle Tracing Perform particle tracing with
         if  then
               Update
         else
               Update
         end if
          Obtain critical diameter
     end while
else
      No critical diameter was found for separation
end if
Algorithm 1 Finding critical diameter with Newtonian method.

C Critical diameter trends in the original data-set

Figure C.1 depicts the relationship between all the effective parameters and critical diameter in the original data-set in four f values to provide a better understanding of the DLD physics and criteria that should be used in automation step. The overall trends of the critical diameter changes with an increase of f: at low f values, in almost all N values there is a peak around Re=5, followed by the critical diameter value decreases. Nevertheless, for N=3 there are no critical diameters at all. However, the peak vanishes as the f value grows and it only shows a positive slope. Moreover, at N=3 some area appears to have a critical diameter around a low Reynolds number and this area expands as f value increases. Furthermore, the area with a slope near zero offers the best stability since the critical diameter would not change much, and separation will occur regardless of the fluctuation in Re. On the other hand, it appears that higher f and lower N have a steeper slope and provide a better chance of flexible design.

The effect of all influential parameters on critical diameter.
Figure C.1: The effect of all influential parameters on critical diameter.
\printbibliography