Tao
Lin
a,
Zhen
Wang
b,
Wen
Wang
a and
Yi
Sui
*a
aSchool of Engineering and Materials Science, Queen Mary University of London, London E1 4NS, UK. E-mail: y.sui@qmul.ac.uk
bDepartment of Mechanical Engineering, University College London, London WC1E 6BT, UK
First published on 19th January 2021
Microcapsules, consisting of a liquid droplet enclosed by a viscoelastic membrane, have a wide range of biomedical and pharmaceutical applications and also serve as a popular mechanical model for biological cells. In this study, we develop a novel high throughput approach, by combining a machine learning method with a high-fidelity mechanistic capsule model, to accurately predict the membrane elasticity and viscosity of microcapsules from their dynamic deformation when flowing in a branched microchannel. The machine learning method consists of a deep convolutional neural network (DCNN) connected by a long short-term memory (LSTM) network. We demonstrate that with a superior prediction accuracy the present hybrid DCNN-LSTM network can still be faster than a conventional inverse method by five orders of magnitude, and can process thousands of capsules per second. We also show that the hybrid network has fewer restrictions compared with a simple DCNN.
It has been very difficult to characterise mechanical properties of microcapsules or biological cells due to their fragility and tiny size. A number of methods have been proposed, such as atomic force microscopy,9 micropipette aspiration,10 parallel-plate rheometry,11 optical stretcher,12 magnetic twisting cytometry13(see a recent review14). In these methods, a common practice is to measure the deformation of particles under a well-defined stress. Note that fluid forces generated in shear,15–17 centrifugal,18,19 and extensional20,21 flows have also been used to deform suspended capsules. The throughput rates of these methods are typically limited to 10–1000 capsules or cells per hour, which are inadequate to the measurement of a large population of heterogeneous particles. For biomedical applications such as cell sorting or cancer diagnosis based on mechanical properties of cells, many thousands to millions of cells need to be measured in minutes to hours. Those applications therefore require high-throughput approaches that can process at least hundreds of cells per second.5
To address the unmet need of the high processing throughput rate, novel hydrodynamic approaches have been proposed in recent years,4,22–32 where microcapsules or living biological cells are flowed through microfluidic channels. The particles are deformed by the fluid stresses inside the narrow channels. By fitting the steady or dynamic deformed particle profiles to theoretical predictions, mechanical properties such as viscosity and elastic modulus, of the particle can be obtained inversely. The current state-of-the-art systems can conduct real-time measurement of the deformation of hundreds of cells per second.
A current limitation of the transformative hydrodynamic approaches is that it still cannot conduct real-time measurement of the viscosity and elastic modulus of microcapsules or cells at a high throughput rate. The mechanical properties need to be obtained by post-processing the experimental data using inverse methods, with hours to days of processing time depending on the size of the sample. This is because that existing inverse methods often need to compare a test sample with a large number of samples (obtained by theoretical predictions) stored in a data bank to find the best fit, which is a very time-consuming process. Inferring viscosity of a particle is particularly slow, since it is necessary to consider the time evolution of the particle deformation.
In recent years, machine learning has attracted much attention from different communities including soft matter physics and engineering, for it provides a versatile tool which can infer the relationship between data and their corresponding measurements. Machine learning approaches, such as the supported vector machines, have been applied to glassy systems to identify flow defects,33 analyze atomic structures,34 and predict plasticity.35 Deep convolutional neural networks (DCNN) have significant merits in processing data that come in the form of images,36 and have led to exciting applications such as classification of cells,37 characterization of amorphous materials,38 prediction of emulsion stability,39 and geometrical optimization of aerofoils.40 The long short-term memory (LSTM) neural networks41 are superior in processing time-series data and building the temporal connections, and have been broadly used in applications such as weather forecasting,42 clinical diagnosis,43 and prediction of chemical reactions.44
In the present study we develop a novel high throughput approach, by combining a hybrid DCNN-LSTM neural network with a high-fidelity mechanistic capsule model, to accurately predict the membrane elasticity and viscosity of microcapsules from their dynamic deformation when flowing in a branched microchannel. Unlike conventional inverse methods which have to conduct a time-consuming process to find the best fit, the present neural network is trained offline, and its predicting process only involves a limited number of algebraic calculations. It is therefore much faster and can predict the membrane elasticity and viscosity of thousands of capsules per second. We also demonstrate that the present method can deal with capsules with large deformation in fast flows. Furthermore, the present DCNN-LSTM neural network has fewer restrictions compared with a simple DCNN approach.
In the branched channel, the fluids inside and outside the capsule are both incompressible and Newtonian with density ρ and viscosity μ. No-slip boundary condition is imposed on the channel wall. At the upstream inlet and the two downstream outlets, the velocity profiles are set to be fully developed laminar channel flow profiles corresponding to flow rates Q0, Q1 and Q2 respectively, with Q0 = Q1 + Q2.
The length of the parent channel allows the capsule to develop into a steady shape before arriving at the bifurcation of the channel. We define a region of interest (RoI) covering the entire bifurcation area of the channel with −3.5l ≤ x ≤ 4.5l and −l ≤ z ≤ 1.5l (shown in Fig. 1(a)). When the capsule is flowing in the RoI, its instantaneous deformed profiles at different times are captured. These profiles are then employed by a trained DCNN-LSTM neural network to predict the membrane viscosity and elasticity of the capsule. The first capsule profile is captured when the capsule's front point touches the plane Sc at x = −2l. At this instance, the capsule is at its steady shape of flowing in the straight parent channel. The time interval ΔT between two adjacent capsule profiles is 1.34l/V, where V is the mean fluid velocity in the parent channel. With such a choice of time interval, five instantaneous profiles can be captured when the capsule is flowing through the RoI. This enables the DCNN-LSTM neural network to accurately predict the capsule membrane properties.
The current microchannel geometry with a bifurcation provides a versatile platform where the trajectory and transient deformation of the capsule can be controlled conveniently by adjusting the flow strength and flow split ratio between two downstream channels, without the necessity of changing the geometry of the channel. In experiments, the channel can be fabricated using polydimethylsiloxane with standard soft lithography, and the flow can be controlled by multiple syringe pumps at the channel inlet and outlets.
(1) |
The viscous stress of the membrane τν is split into the shear viscous stress τνs and the dilatational viscous stress τνd:48
τν = τνs + τνd = μs[2D − tr(D)P] + μdtr(D)P, | (2) |
We employ the Kelvin–Voigt (KV) viscoelastic model49 to describe the viscoelastic behaviour of the membrane. The total stress tensor is assumed to be the sum of the elastic and the viscous stresses. It should be noticed that the KV model has been widely used to describe the mechanics of capsules and biological cells.50–52
Apart from the elastic and viscous stresses, the out-of-plane bending force is calculated as:53
fb = kc[(2H + c0)(2H2 − 2κg − c0H) + ΔLB(2H − c0)]n, | (3) |
The dimensionless parameters governing capsule deformation in the bifurcation region are:
(i) the dimensionless membrane viscosity η = μs/(μa);
(ii) the capillary number Ca = μV/Gs, which measures the ratio between the viscous fluid force and the membrane elastic force;
(iii) the size ratio β = a/l which compares the size of the capsule to the hydraulic radius of the square channel;
(iv) the flow Reynolds number Re = ρV(2l)/μ;
(v) the flow split ratio q = Q2/Q0, which is the ratio of flow rates in the side branch and the parent channel.
Details of the immersed-boundary lattice Boltzmann method can be found in our previous works,55–57 and only a brief summary of the method is provided here. The fluid flow is solved by a three-dimensional nineteen-velocity (D3Q19) lattice Boltzmann method (LBM). At channel walls, the no-slip boundary condition is applied using a second-order bounce-back scheme.58 A second-order non-equilibrium extrapolation method59 has been employed to impose the velocity boundary conditions at the inlet and two outlets. The interaction between the fluid and the capsule is solved using the immersed boundary method of Peskin.60 The three-dimensional capsule membrane is discretised into flat triangular elements, and a finite element membrane model is employed to calculate the deformation gradient tensor, the principal extension ratios λ1 and λ2 and the stress tensor. To integrate the viscoelastic stress, we follow the same approach of Yazdani and Bagchi.49
The present numerical scheme for capsule deformation in fluid had been validated extensively against previous theoretical and computational results of capsules in linear shear flow55,56,61 and channel flows.57,62 In the present study, uniform Cartesian grids are used in the flow domain with Δx = Δy = Δz = 0.04l. The capsule membrane is discretised into 8192 flat triangular elements connecting 4098 nodes. We find further reducing flow grid size or increasing membrane elements does not lead to any visible change in capsule trajectory and deformed shapes in the branched channel.
The architecture of the DCNN is shown in Fig. 1(b), where there are four convolutional blocks, within each a convolutional and a pooling layers are in sequence. These are followed by a flattening operation. The convolutional layer consists of a few filters, which are much smaller in spatial dimensions than the input image. During the convolution operation between each filter and the input image, the filter slides through the entire image and the filter weights make an elementwise scalar product with each small region of the input image (see Fig. 2(a)), following:40
(4) |
oij = σ(dij + b), | (5) |
σ(z) = max(0, z). | (6) |
Fig. 2 (a) Convolution, (b) maximum pooling, and (c) flattening operations in the convolutional, pooling and flattening layers, respectively, of the DCNN. |
The pooling layer usually follows the convolutional layer and reduce the dimension of the output of the convolutional layer. In the present study, we have used the maximum pooling operation that gives the maximum of the numbers in the pooling kernel (see Fig. 2(b)). After the last maximum pooling, a flattening operation is conducted on the pooled feature maps. The flattening operation converts the two-dimensional digital feature maps into single-column feature vectors (illustrated in Fig. 2(c)), so that the outputs of the DCNN can be processed by the connected LSTM neural network (Fig. 1(c)).
The LSTM neural network builds up the temporal connections between sequential feature vectors using memory cells (shown in Fig. 1(c)). Each memory cell contains three gates: the forget gate (FG), the input gate (IG) and the output gate (OG), which regulate the flow of information by selectively adding information (IG), removing information (FG), or letting it through to the next cell (OG). A memory cell of the time instance Tt takes the cell state, cell output of the previous memory cell (i.e., ct−1 and ht−1, respectively, which carry historical information), and the current feature vector xt as inputs, and generates its current cell state ct and output ht, that can be fed to the next memory cell, or be used to make predictions.
The equations of a memory cell to compute its gates and states are as shown in the following equations:66
(7) |
σ(ε) = 1/(1 + e−ε). | (8) |
The hyperbolic tangent function denoted by tanh is given by
tanh(ε) = (1 − e−2ε)/(1 + e−2ε). | (9) |
At the final memory cell, the cell output hs (s = 5 in the present study) is fed into two output layers, which conduct regression tasks and predict the capsule membrane viscosity and shear elasticity. The equation of output vector ys is given by
ys = δ(Wyhs) + by, | (10) |
The present DCNN-LSTM neural network is trained on a set of examples. Each example contains a few binary images of the instantaneous profiles of a capsule when it is flowing in the channel bifurcation region (see the binary images of Fig. 1(b)), and the corresponding parameters such as the capsule membrane viscosity and shear elasticity. The examples are obtained from computational simulations using the immersed boundary lattice Boltzmann method.
During training, the internal parameters of the network are adjusted to minimize a loss function that describes how close the predictions are to the ground truth. The total loss consists of the losses from each regression tasks. We use the square loss function for a regression task:
Lregi = ‖yregi − yi‖2, | (11) |
(12) |
To optimize the trainable internal parameters, we derive the gradients of the loss function Ltotal with respect to these parameters using a backpropagation algorithm,67 and then an optimizer, which employs a stochastic gradient descent algorithm called ADAM,68 is used to update the values of these parameters. Mini-batch mode training is applied, and exposing all training samples to the DCNN-LSTM neural network once is called an epoch. At the end of each epoch, the DCNN-LSTM neural network is validated with a small portion of the training samples (i.e., 10% in the present study) which have not been used in the training process. With the process iterating, the total loss decreases and converges towards small values. To avoid overfitting, a batch-normalization69 has been applied in the present model. The training process is terminated with a predefined early stopping criteria, when the total loss of validation shows no further improvement over several iterations even after reducing the learning rate. After training and validation, the DCNN-LSTM neural network can be used to predict the membrane viscosity and shear elasticity of flowing microcapsule from its transient profiles in the channel bifurcation region.
The performance of the present DCNN-LSTM neural network is affected by its certain hyperparameters. Our extensive validations and tests suggest that the following choices of hyperparameters lead to the optimum prediction accuracy of the present: the DCNN has four blocks, each of which has one convolutional layer and one max-pooling layer in sequence. For each convolutional layer, the filter size is 3 × 3 with a stride of one and the same padding operation. The number of filters in each of the four convolutional layers is 16, 32, 64, and 128, respectively. For each max-pooling layer, the kernel size is 2 × 2 with a stride of two and the same padding operation. In each memory cell of the LSTM network, the number of neurons in the FG, IG and OG is 128. During training, the size of the mini-batch is chosen to be 32. An initial learning rate of 0.001 is applied with a learning rate scheduler, which gradually reduces the learning rate when the total loss of validation shows no improvement over epochs.
(13) |
In the present study, training samples distribute evenly in the parametric space considered. We find that the size of training samples (i.e., the number of samples used in training) has a significant effect on the prediction accuracy of the DCNN-LSTM network. With the same network of Fig. 3(b) for capsules at Ca = 0.6, we reduce the training sample size from 52 to 26, and then to 13. We find that the MAPE of predicted η from the corresponding ground truth increases sharply from 3.47% to 12.48%, and then to 26.24%.
The effect of membrane viscosity on capsule deformation in the branch channel can be seen from Fig. 3(c and d). It has no effect on the first profile of the capsule, which is still at its steady-state in the feeding channel. However, membrane viscosity can significantly limit the deformation of a capsule during its transient motion in the channel bifurcation. We also notice that when η ≤ 3.5, its effect on capsule deformation is weak, in particular for a capsule with moderate deformation (e.g., at Ca = 0.1). Capsule instantaneous profiles are visually identical at membrane viscosity η = 0.17 and 3.5. However, the present DCNN-LSTM neural network seems to be able to learn the subtle differences between capsule profiles and give an accurate prediction of the capsule membrane viscosity.
It is worth mentioning that the present mechanical models for both fluid flow and capsule dynamics can conveniently take into account the inertial effect,57 which is relevant to inertial microfluidics where the average flow speed can reach meters per second.24 We conduct studies similar to those in Fig. 3 and consider the same capsule at a much higher flow Reynolds number Re = 40 in the inertial flow regime. We find that the prediction accuracy of membrane viscosity η by the present DCNN-LSTM neural network is similar to that of Fig. 3 (not shown). In practical experiments, for a microcapsule with a radius of 50 mm suspended in water at room temperature, a flow Reynolds number of Re = 40 can be achieved with an average flow speed of 0.24 m s−1. This corresponds to a pressure drop of 2.77 kPa per centimetre channel length in a microchannel with a half cross-sectional width of 83 mm (β = 0.6).
Note that the present DCNN-LSTM neural network can be conveniently extended to predictions of multiple mechanical properties of the capsule membrane. This is done by adding more parallel output layers. In the present study, we demonstrate its extension to the prediction of capsule capillary number Ca, besides the membrane viscosity η. The membrane shear elasticity Gs is calculated from the capillary number by Gs = μV/Ca. The additional prediction task involves an increase in the training sample size. Here the training data have been extended from those used in Fig. 3, to include additional 260 samples, with Ca ranging from 0.1 to 0.6, in the same range of membrane viscosity η. The testing data consist of 36 samples at six values of η and six values of Ca (see Fig. 4(b and c)). Fig. 4(b and c) compare the predicted Ca and η with their corresponding ground truth. The MAPEs of Ca and η from their ground truth are 3.65% and 3.42%, respectively, which suggest excellent prediction accuracy of the present model.
In the present branched channel geometry, the dynamic deformation of the capsule in the bifurcation region is complicated and cannot be captured by simply considering the capsule length, we therefore use the second type of inverse method. We compare all the five instantaneous capsule profiles of a testing sample with those corresponding profiles of each sample image stored in a data bank. The geometrical difference between capsule profiles is quantified by the mean Hausdorff distance (MHD)71 in the present study. To explain the MHD, let us consider a set of m′ points, R = {r1, r2, r3,…rm′} from the ith instantaneous capsule profile of a testing image, and another set of n′ points, S = {s1, s2, s3,…sn′} from the ith instantaneous capsule profile of an image of the data bank. Assuming that the two sets of points have the same centre of mass, the MHD i(R,S) of the two capsule profiles is defined as:
(14) |
(15) |
We first compare the accuracy of the DCNN-LSTM neural network and the inverse method in predicting the capsule membrane viscosity η and capillary number Ca. The same training and testing samples of Fig. 4(b and c) have been used here. In the inverse method, the training samples are used as the data bank, which provides images that a testing image can be compared with. We find both methods can accurately predict Ca with a comparable MAPE that is around 3%. However, the present DCNN-LSTM neural network is considerably more accurate than the inverse method in predicting the capsule membrane viscosity η. The MAPE by the DCNN-LSTM neural network is 3.42%, which is significantly lower than 16.29% by the inverse method. We notice that the DCNN-LSTM neural network significantly outperforms the inverse method when the capsule membrane viscosity is low and therefore only weakly affects the capsule deformation (see capsule profiles in Fig. 3). This result is actually not surprising. In the inverse method, the cross-sectional profile of a capsule membrane has been discretised into 128 elements. While in the present DCNN-LSTM neural network, each binary image has an area of 2l × 2l that is covered by 80 × 80 pixels. The cross-sectional profile of a capsule membrane is covered by more than 150 pixels, which are considerably more than the membrane elements used in the inverse method. The higher resolution may have resulted in a better prediction accuracy.
Next, we compare the throughput rate of the present DCNN-LSTM neural network and the inverse method. There are mainly two steps in the prediction process. The first step is image processing where the original image of a deformed capsule is converted into a form that can be used as an input by a prediction method. In the second step a prediction method calculates the membrane shear elasticity and viscosity based on the transient capsule profiles in the channel bifurcation. For the inverse method, image processing involves edge detection and segmentation of the five cross-sectional profiles of a capsule membrane, with each profile discretised into 128 equal-sized elements. This can be done conveniently using Matlab and 1351 samples can be processed within a single second using a desktop personal computer (Intel Core i7, 4 GHz). Image processing in the present DCNN-LSTM neural network is mainly a binarization process where the five instantaneous capsule profiles of a sample are converted into five binary images with value 1 inside the capsule and 0 outside (see Fig. 1(b)). A Matlab subroutine can process 3975 samples per second with the same desktop computer.
Regarding the second step of processing, from Table 1 it can be seen that the prediction throughput rate of the present DCNN-LSTM neural network is higher than that of the inverse method by five orders of magnitude. The high throughput rate of the DCNN-LSTM neural network is not surprising and is mainly due to two reasons. Firstly, compared with the inverse method which needs to conduct a time-consuming process to find the best fit, the present DCNN-LSTM neural network has completed training offline before making a prediction, and the prediction process only involves a limited number of algebraic calculations. Secondly, computations of the DCNN-LSTM neural network are GPU based and utilize parallel computing, which is the case for the present prediction (GPU model: Tesla V100-16GB, 1.38 GHz).
Throughput rate/method | Inverse method | Present method |
---|---|---|
Image processing (sample/s) | 1351 | 3975 |
Prediction (sample/s) | 0.01 | 2470 |
It is very interesting to compare the prediction accuracy and throughput rate of the two neural networks. Here we consider the performance of both networks with different numbers of instantaneous capsule profiles within the same RoI, using the same cases of Fig. 3. As illustrated in Fig. 6(a), we double the image capturing frequency in each test so that the number of capsule profiles in the RoI increases from two, which is the minimum for analysing time evolution of capsule deformation, to three, five and finally to nine, where capsule profiles have overlapped (see the column of sample images used by the DCNN) due to the small time interval between two adjacent profiles.
Fig. 6 (a) Increasing the number of capsule profiles in the RoI by doubling the image capturing frequency. The term mΔT_n is the label of a sample where there are n capsule profiles in the RoI and the time interval between two adjacent capsule profiles is mΔT, where ΔT = 1.34l/V. The corresponding binary images used as inputs of the DCNN and DCNN-LSTM neural network are shown in the middle and right columns, respectively. Comparison of (b) the MAPE of the predicted membrane viscosity η from the corresponding ground truth, and (c) the prediction throughput rate, of the two networks. The same cases used in Fig. 3 have been employed in the tests here. |
The comparisons of MAPE of the predicted membrane viscosity η from the corresponding ground truth and the prediction throughput rate of the two networks are presented in Fig. 6(b and c). From Fig. 6(b), it can be seen that when the number of capsule profiles is small and there is no overlap between capsule profiles, the prediction accuracy of the two networks are comparable. With the number of capsule instantaneous profiles in the RoI increases, the time evolution of capsule deformation is better resolved which has led to higher prediction accuracy for both networks. However, we notice that with nine instantaneous capsule profiles in the RoI, the overlap of capsule profiles of sample images used by the DCNN causes loss of local geometrical information, which has resulted in a reduced prediction accuracy. The DCNN-LSTM neural network, however, does not have such a limitation because it processes individual instantaneous capsule images.
It can be seen from Fig. 6(c) that the prediction throughput rate of the DCNN does not depend on the number of capsule images in the RoI. This is due to the fact that the DCNN processes sample images covering the same RoI with the size of 8l × 2.5l represented by 320 × 100 pixels. For the DCNN-LSTM neural network, the amount of data that need to be processed is proportional to the number of capsule profiles, and therefore the prediction throughput rate decreases with the number of capsule profiles in a sample. Note that the two networks have similar prediction throughput rates when there are five capsule profiles in the samples. In such a situation, the total number of pixels of a DCNN-LSTM sample is 80 × 80 × 5 = 32000, which is the same to that of a DCNN sample. With the same amount of data contained in the samples, we notice that the DCNN-LSTM neural network has a slightly higher prediction throughout rate than the DCNN, possibly due to the fact that there are fewer neurons in the LSTM network compared with the FC layer of the DCNN.
Note that the present study has its limitations. Firstly, we have only considered capsules with a KV membrane in a narrow range of associated parameters. For practical unknown microcapsules, there may be a range of possibilities in membrane constitutive laws and the measurement of the membrane elasticity and viscosity will depend on the choice of the constitutive models in the regime of large deformation.21 In principle our method can be extended to cover additional membrane constitutive laws (e.g., power law models75,76) and a much wider parametric space, to avoid extrapolation. However, this may involve a significant expansion of the size of training samples and possibly also the architecture of the network. Secondly, the present branched channel is a flow-through device which can facilitate high-throughput measurement, however, there is a broad scope to optimize the geometry to promote tank-treading motion of the capsule17 at the channel bifurcation, so that the capsule dynamics is more sensitive to the membrane viscosity. Finally, the present approach has only been tested using simulation results. Validation with experiments will be an important step in our future research. The present work, as a preliminary study, suggests that the DCNN-LSTM neural network may serve as a promising tool for high throughput mechanical characterisation of flowing microcapsules or biological cells.
This journal is © The Royal Society of Chemistry 2021 |