Machine studying enabled orthogonal digicam goniometry for correct and sturdy contact angle measurements

Affect of room lighting situation

Wettability measurements can be each correct and reproducible if the situation of the sunshine supply and the lighting situation of the environment are correctly chosen41, 42. Evaluation of back-lit drops is a broadly accepted apply for higher distinguishing the boundaries of a drop profile43, 44 (Fig. 1b, left columns: surfaces with specular or diffuse reflections). Nevertheless, coupling a secondary digicam system to the back-lit drop is just not achievable as it will probably change the obvious boundary of drops. In different phrases, back-lit illumination can solely work if a drop is analyzed in a single course (Fig. S1a); nonetheless, false boundaries would seem on the perimeters of the drop if one other mild supply is added perpendicularly to the unique course (Fig. S1b). Determine S1c,d additionally clarify the mechanisms of backlit illumination for single and double mild sources and justify how the illumination rays may be probably mirrored from the drop floor and detected by the adjoining digicam. In truth, the dual-camera system for evaluation of the back-lit drop has been reported to be efficient solely when CA measurements usually are not concurrently taken from numerous angles45. Subsequently, the proposed setup offers an efficient resolution for simultaneous measurements of CAs at numerous angles (Fig. 1a).

Determine 1 CA measurements through sessile drop methodology utilizing an orthogonal digicam setup. (a) A 3D schematic of the proposed setup that contains two front-lit USB microscope cameras and a single XYZ mechanical stage positioned in a darkish room, (b) estimating CA on hydrophobic (high row) and hydrophilic (second and third rows) surfaces by back-lit (left column), regular lighting (center column), and front-lit (proper column) setups for drops sitting on substrates with specular (i.e., nonporous ceramic) or diffuse (i.e., porous ceramic) reflections. Full dimension picture

Adopted by making certain the right location of the illumination supply, it’s equally necessary to specify the proper room lighting situation that surrounds the drop. Determine 1b (center columns) reveals CA measurements on substrates with both specular or diffuse reflections in a standard lighting room situation. On this situation, nonetheless, the sunshine transition between the drop and the background is just not sharp sufficient to delineate the boundaries of the drops. Consequently, the front-lit method (in a darkish room) is used on this research for all CA measurements because it offers clearer boundaries (see Fig. 1b, proper columns). Moreover, Fig. 2b proves the applicability of the developed front-lit setup for wettability evaluation of various porous or nonporous substrates, e.g., spruce wooden, silicon wafer, and 6061 HT6 aluminum alloy surfaces, as a result of distinguishable boundary of the drops. As proven in Fig. 2b (first row, i.e., Spruce Wooden), there’s a important distinction between the CA values taken from C1 (digicam 1) and C2 (digicam 2) views. Subsequently, no less than two orthogonally aligned cameras needs to be used to seize the floor heterogeneity by masking a considerably giant portion of the drop. It’s price noting that on this dual-camera system, the presence of a 3rd digicam can be redundant and doesn’t present extra measurements. Furthermore, the proposed method can be confirmed to be relevant to all liquids no matter their chemistries and colours, see Fig. 2a.

Determine 2 Applicability of front-lit illuminations for CA measurements: (a) liquids of various compositions and colours, the place particularly 1 is WD-40 lubricant, 2 is alcohol, 3 is a business siloxane, 4 and 5 are sprucing oils, 6 and seven are buffer options with pH of 4.0 and seven.0, respectively, and eight is deionized water on glass slides, (b) CA measurements on porous and nonporous surfaces, i.e., spruce wooden, silicon wafer, and 6061 HT6 aluminum, exhibiting a transparent recognition of the front-lit drops. Full dimension picture

Automated CA measurements utilizing CNN

The repeatability and reproducibility of the CAs estimated by commercially accessible goniometers may be largely influenced by the abilities and expertise of the operator and therefore may be subjective. Particularly, the way in which an operator aligns the baselines and focuses the digicam on the ROI controls the general accuracy of the measured tangent strains on the stable–liquid interface46, 47. Because of this, adopted by specifying the right illumination situations, it’s now essential to develop a totally automated image-based method that may analyze the drops from picture knowledge. For this goal, this part particulars a novel process (utilizing function extraction and coaching phases) that may be leveraged to autonomously measure the CA of drops on hydrophobic and hydrophilic surfaces. Throughout the function extraction stage, pictures of front-lit drops are imported (Fig. 3a), and their reflections are eliminated utilizing a noise discount filter imported from OpenCV library48, see Fig. 3b. This enhancement filter minimizes the artifacts from the uncooked pictures and maximizes the signal-to-noise (SNR) ratio, i.e., expressed in decibel (dB) and is outlined as SNR = 20 log 10 (A sign /A noise ), the place A is the basis imply sq. amplitude of the sign. Particularly, this step is important through the early phases (first 10 s) of stable–liquid interplay (Fig. S2).

Determine 3 Workflow for function extraction and coaching the CNN mannequin: (a) buying pure front-lit drop pictures in a darkish room, (b) denoising the photographs utilizing a filter in Python, (c) changing the multi-tone to bi-tonal (binary) pictures to higher distinguish the general geometry of drops, (d) estimating the left and proper CAs of every drop utilizing the Level Picker plugin in ImageJ to create the bottom reality dataset, and (e) designing an nth layer CNN framework to estimate the left and proper CAs, (f) matching the CNN with the ImageJ CA estimations on hydrophobic, and (g) hydrophilic surfaces. (h) High row: noise discount filter on pure pictures to create floor reality binary pictures previous to the coaching step, backside row: three completely different examples of noise injection filter on binary pictures through the knowledge augmentation step, (i) accuracy of the CNN mannequin as a operate of the variety of distinctive coaching pictures (stable black line) for hydrophobic (left subplot) and hydrophilic (proper subplot) take a look at units, during which the 9 variations within the lighting situations (crimson dashed line) has confirmed to enhance the accuracy and stability of outcomes, and (j) estimating the efficiency of the CNN mannequin on pure (left column) or binarized (proper column) pictures proving that binarizing the enter knowledge would cut back the coaching time and enhance the accuracy/stability of the CA estimations. Full dimension picture

As proven in Fig. 3c, the noise-reduced pictures are then binarized utilizing a bi-color firming filter49 such that the general geometry of every drop may be totally acknowledged. Then, utilizing the “Level Picker” plugin within the ImageJ software50, the factors alongside the sting of the drops are manually chosen to determine the best-fit tangent line for CA estimation of uneven drops. It needs to be famous that the mixture of noise discount and binarization filters doesn’t change the tangent angles on the ternary section contact line, see Fig. S3. Within the subsequent step, 375 completely different binary pictures are chosen, and previous to binarization, their brightness is modified from 80% darker to 80% brighter (i.e., 375 × 9 = 3375 pictures in complete), see Fig. S4a. Particularly, as proven in Fig. S4c, the binarized map of every picture at completely different lighting situations doesn’t completely match leading to a small variation within the manually estimated left and proper CAs (Fig. S4b). This could additional generalize the mannequin in opposition to the variation within the front-lit (LED) illumination situations. Because of this, within the final step of the function extraction stage (Fig. 3d), 3375 pictures are manually measured and labeled as floor reality enter knowledge to coach the CNN mannequin. The expertise of the one who is coaching the dataset performs a major position within the accuracy of outcomes. Though, in actuality, it isn’t potential to create pure goal floor reality knowledge, this set may be adequate to create a nonfatal and purposeful mannequin that gives sufficiently correct estimates for the take a look at set. For this goal, an skilled consumer used Picture J to manually (or artificially) measure the binary pictures to be able to create a extremely correct, unbiased, consultant, and goal floor reality/ coaching set. As proven in Fig. S5b, if the bottom reality knowledge is ready by inexperienced customers (i.e., customers 1 and a pair of), the outcomes can be much less dependable (with a bigger normal deviation, see Fig. S5d) than these estimated by skilled customers (i.e., customers 3 and 4). In different phrases, the coefficient of variation, i.e., the ratio of normal deviation to imply, of the estimates supplied by the inexperienced group can be ~ 3 occasions bigger than that of the skilled group. Nevertheless, as quickly because the CNN algorithm turns into totally educated (Fig. S5a), the outcomes can be much more correct.

Shifting on to the coaching stage, the developed CNN mannequin contains a number of layers of nonlinear transformation (Fig. 3e), which may iteratively discover ways to do CA measurements utilizing the general geometry of the acknowledged drops from the binarized pictures. This transformation contains 5 predominant parts: totally related layers, convolutional layers, activation capabilities, pooling layers, and regularization such that the expected values can be shut sufficient to the anticipated target51. Particularly, the totally related layers join each layer to every activation unit of the following layer, whereas not preserving the spatial construction of the enter worth. In distinction, the convolutional layers act as a filter that preserves the spatial relationship between enter and have map and allows weight sharing to enhance the training convergence52, 53. It’s price noting that each the noise discount (previous to mannequin coaching) and noise injection (throughout knowledge augmentation) filters are vital for maximizing the mannequin accuracy. Particularly, the noise discount filter on pure pictures makes the boundary of binarized drop pictures clearer on the ternary section contact line for correct guide CA estimations, whereas noise injection could make the mannequin sturdy in opposition to optical distortions see Fig. 3h. Adopted by coaching the CNN mannequin, Fig. 3f,g matches 70 CA estimations (take a look at set) from the CNN and ImageJ, implying a comparatively excessive R-squared of 0.93 and 0.87 for hydrophobic and hydrophilic surfaces, respectively. In addition to, Video 1 reveals an automatic CNN-based CA measurement of a water drop on a porous hydrophilic floor utilizing the developed setup, which proves the effectivity of the developed algorithm. As proven in Fig. S6 (which is a snapshot of Video 1), the utmost distinction in CA estimated by the 2 strategies, i.e., CNN and ImageJ, is rarely greater than ~ 4° for symmetrical drops. Equally, the excessive accuracy of the proposed methodology for the evaluation of non-symmetrical drops is proven in Video 2 and Fig. S7 (which is a snapshot of Video 2). Mainly, Fig. S7 reveals that non-symmetrical back-lit drops rolling down a sloped stage (Fig. S7a) or vertical wall (Fig. S7b) had been precisely analyzed. In truth, comparisons of Picture J and CNN-based estimations present a small discrepancy of < 3° proving the robustness of the proposed model for analysis of both symmetrical and non-symmetrical drops. However, the differences between these two techniques (Image J and CNN) cannot be zero since the established R-squared values (between the CNN and ImageJ algorithms) are smaller than unity (Fig. 3g). Moreover, the CNN model is augmented with the random crop technique meaning that it can make predictions of the cropped drop images as long as the baseline, i.e., the contact between the drop and solid, is fully visible to the camera view. As a result, as shown in the new Fig. S8, the model can analyze drops that are not fully captured by the microscopy camera if the baseline, which is marked with a green line, is entirely visible. It should be noted that the implemented ResNet 50 architecture demands a high number of training datasets if the images are fairly complex. In machine learning, this can refer to Kolmogorov complexity denoting the length of the shortest computer program that produces the image as output54. Therefore, in this study, the natural images (shown in the right column of Fig. 1b) have higher complexities as they have nonuniform grayscale colors and hues within the drops. However, binarized (i.e., only black and white) images are stored in few bytes, i.e., orders of magnitude less than the natural images, hence they contain a fewer number of variables that can be better correlated with the simpler geometry of binarized drops. As a result, the dimensionality reduction of the natural images through binarization would make it easier for the network to deal with simpler images and subsequently help the model converge faster if trained by a smaller number of images55,56,57. Also, considering Fig. 3j, binarizing the natural images would reduce the training time from 67 to 4 min if performed by NVIDIA Tesla T4 GPU. This explains why in Fig. 3j, the CNN model provides more accurate, stable, and rapid estimates if trained on binarized images (without using transfer learning) when compared to natural images. Besides, Fig. 3i shows that at least 200–250 unique images (shown in solid black lines) are required to sufficiently train the model and the 9 variations in the lighting condition (shown in red dashed lines) would further enhance the accuracy of the model. In other words, increasing the number of training images from 200 (200 × 9 = 1800, i.e., incorporating light variations) to 375 (375 × 9 = 3375, i.e., incorporating light variations), would not significantly increase the model accuracy, which remains at ~ 0.87 and ~ 0.93 for hydrophilic and hydrophobic test sets, respectively. It is worth noting that an accuracy measure of ~ 90% on the test set is not only realistic and ideal but conforms well to industry standards. Consequently, this figure ensures the user that the model is fully trained. Moreover, Table S1 details more optimization parameters, including the accuracy and loss values, for both the train and test datasets, in which the loss function is defined as the mean squared error between the estimated and true angles. Accuracy of the developed CNN algorithm To determine the accuracy of the developed setup, comparisons are made between the CNN-based setup (proposed approach) and the traditional goniometer (existing approach) for wettability measurements on hydrophobic and hydrophilic surfaces at 0 and 30 s from the onset of solid–liquid interaction. Considering Fig. 4, it is determined that the mean CA measurements estimated by both algorithms are almost similar; however, statistically speaking, the mean value is not a sufficient parameter to determine the accuracy of measurements. Consequently, a comprehensive Bayesian statistical analysis is leveraged to compare the accuracy of both goniometers. Considering the normality of the CNN-based CA measurements, i.e., the second column of Fig. 4 (Fig.4b,e,h,k), it is believed that the results of the proposed approach, called Vague Prior, match the CA measurements estimated by the traditional approach, named Posterior58. However, this assumption, i.e., the statistical matching of both approaches, needs to be established and verified. Accordingly, the Bayesian statistics are leveraged to calculate posterior interval estimators, i.e., mean, and standard deviation, assuming that the prior values are normally distributed. A detailed explanation of how to estimate the interval estimators is detailed in the "Methods" of this paper. Figure 4 CA estimations by the existing and proposed approaches: surface wettability estimates on (a–f) hydrophobic (θ > 90°), and (g to l) hydrophilic (θ < 90°) surfaces at 0 and 30 s from solid–liquid interaction, and their corresponding statistical parameters including (m, o) standard deviation (σ), and (n, p) coefficient of variation (COV = µ/σ (times) 100). Specifically, in column 1 (a,d,g,j) the fitting method (existing approach), and in column 2 (b,e,h,k), the CNN model (proposed approach) is used to evaluate the CAs. Furthermore, column 3 (c,f,i,l) performs a comparison of CAs estimated by the two approaches (on each row) using the Bayesian statistics. Analysis of surface wettability on hydrophilic surfaces (third and fourth subplots of the third column) reveals a disagreement between the two approaches. Also, the COV of the CAs measured by the existing approach (at 30 s) exceeds 30% and consequently is not considered accurate, while the proposed approach presents more accurate estimates on hydrophilic surfaces. Full size image Calculating the posterior interval estimators, the corresponding PDF of the posterior values, and subsequently, the CDF envelope (shaded in blue), are estimated at different tangent angles for a 95% confidence level, see the third column of Fig. 4 (Fig. 4c,f,i,l). As shown in Fig. 4c,f, for hydrophobic surfaces, the CAs estimated by the existing approach are placed inside the blue shaded CDF envelope predicted by the Bayesian analysis, denoting that both methods can match with a 95% confidence level. However, for hydrophilic surfaces, the CAs estimated by the existing approach did not place within the corresponding CDF envelope (Fig. 4i,l). Therefore, it is required to specify which method is more accurate for surface wettability measurements. For this purpose, Fig. 4m,o compare the standard deviation (σ) of CAs estimated by the existing and proposed approaches at 0 and 30 s on hydrophobic and hydrophilic surfaces, respectively. Specifically, for hydrophobic surfaces, the average standard deviation of both approaches is 9.7° and 9.4°, respectively. However, for hydrophilic surfaces, these values change to 14.6° and 6.7°, respectively, suggesting that the results are almost twice more spread out if estimated by the existing approach. It is worth noting that although all the tested specimens are similar, the surfaces are heterogeneous and the average standard variation of > 9° is anticipated if comparisons are made between 35 comparable however heterogeneous surfaces (Fig. S9a). Nevertheless, if 35 measurements are finished on a single heterogeneous floor, the usual deviation is diminished to ~ 6° (see Fig. S9b). Moreover, if a single metallic homogeneous floor is analyzed 35 occasions, the usual deviation is even smaller, i.e., ~ 3°, see Fig. S9c. Because of this, the extra homogeneous the floor, the smaller the variations in CA measurements will probably be. As beforehand mentioned, the R-squared worth between the ImageJ and CNN measurements is lower than unity (Fig. 3f,g) denoting that the CNN estimations usually are not 100% correct. Subsequently, it’s anticipated to have a ~ 3° normal variation primarily based on 35 measurements on a single homogeneous specimen. Determine 4n,p present the coefficient of variation (COV) of the present and proposed approaches. Typically, the efficiency of any strategy is taken into account unacceptable if the COV of the dataset exceeds 30percent59, 60. Contemplating Fig. 4, it’s discovered that on hydrophobic surfaces, the common COV of the CAs estimated by the present and proposed approaches are largely comparable, that’s, 9% and eight.9%, respectively. Nevertheless, for hydrophilic surfaces, these values are elevated to 14.9% and 29.2%. Particularly, on hydrophilic surfaces, the COV of the CAs estimated by the present strategy is considerably larger (38.2%) at 30 s, exceeding the 30% restrict in comparison with 22.6% at 30 s by the proposed strategy (Fig. 4p).

Within the subsequent step, for the present goniometer, it’s of curiosity to find out whether or not the error stems from {hardware} or software program limitations. For this goal, the picture knowledge captured by the present goniometer is analyzed by both the present (becoming) or the proposed (CNN) algorithms, and cross-comparisons are reported in Fig. S10. A comparability of Fig. 4 versus Fig. S10 confirms the upper accuracy of the proposed over the present algorithm for a extra correct floor wettability evaluation. Thus, the numerous enchancment noticed within the accuracy of CA measurements through our proposed system is primarily stemming from utilizing higher software program versus the {hardware}, the place the CNN outperforms the becoming goniometer.

To pinpoint the supply of systematic error for the becoming algorithm, Fig. 5c reveals the picture knowledge of front- and back-lit drops on a porous hydrophilic floor analyzed at 0 and 10 s. Contemplating this picture, it’s realized that at 0 s, the picture is completely centered, and the boundary of the drop (marked with a crimson line) is appropriately established by the becoming algorithm. Nevertheless, after 10 s, as a result of fast motion of the drop on the porous hydrophilic floor, the focal size of the digicam is barely modified, leading to an out-of-focus picture. Subsequently, for unfocused drop pictures, the fitted polynomial couldn’t be appropriately established to estimate the CAs on the ternary section contact line. Particularly, the orange arrows in Fig. 5c present unsure areas for edge detection as a result of considerably low SNR. Equally, Fig. 5e and Video 3 estimate the SNR of drop pictures primarily based on the variations within the pixel grayscale values alongside the crimson dashed strains proving that the boundary of the drop turns into unfocused from 0 (SNR = −21.15 dB) to 18 s (SNR = −15.56 dB). Which means that though the digicam focus is initially adjusted on each side of the drop, the transferring drop on porous hydrophilic surfaces leads to an unfocused picture, which is a generic challenge and can’t be precisely resolved with conventional becoming algorithms. Subsequently, within the subsequent part, we evaluate the soundness of each methods in opposition to the variations within the digicam focus to determine which strategy is extra sturdy for wettability assessments.

Determine 5 Affect of digicam give attention to the robustness of CA measurements: pinpointing the efficiency of the present (becoming) and proposed (CNN) algorithms for floor wettability measurements of (a) back-lit and (b) front-lit pictures captured by the present goniometer, and synthetically convoluted at completely different GB values. (c) Recognizing the boundary of front- and back-lit drops positioned on a porous hydrophilic floor at 0 and 10 s from stable–liquid interplay utilizing the becoming methodology. The ternary section contact line is magnified, and the fitted (crimson) line is sketched by the algorithm alongside the sting of the drop. (d) Estimating the CAs as a operate of the GB values. If the GB values exceed 12, the present methodology turns into unstable and couldn’t be used for dependable CA measurements. Nevertheless, the proposed CNN mannequin stays steady for exact evaluation of extra distorted pictures, i.e., GBs ≤ 22. (e) Calculating the SNR primarily based on the variations within the grayscale values of the pixels positioned on the crimson dashed strains, proving that the drop picture turns into unfocused with time. Full dimension picture

Robustness of the developed CNN algorithm

Assessing the tangent angles on the surfaces of various wettability must be finished by a sturdy CA goniometer that’s much less delicate to optical limitations42. In truth, on hydrophilic surfaces, the variation within the geometry of drops is so dramatic that the optical distance of the digicam modifications with time, affecting the digicam focus. Thus, it’s mandatory to determine the impression of digicam give attention to the reliability of measurements. Accordingly, Fig. 5a,b,d evaluates the modifications within the CA of synthetically blurred pictures estimated by each the present and proposed approaches. The Gaussian Blurring (GB) is a library in OpenCV that optically convolutes the picture knowledge with a low-pass filter kernel, GB = 0 denotes an unconvoluted picture, whereas the perimeters of a picture are softened by rising the GB61. Contemplating Fig. 5a,b,d, it’s discovered that the soundness of the present (becoming) algorithm is considerably affected by the digicam focus, particularly for GBs exceeding 12. In distinction, the CAs estimated by the proposed (CNN) algorithm usually are not subjected to dramatic change so long as the GB is restricted to 22, denoting the upper stability of the proposed algorithm for the evaluation of optically distorted pictures.

It’s price noting that primarily based on Fig. 5d if GB > 30 the CA reaches 0° which is dictated by how the bottom reality is outlined by the consumer. Mainly, in Fig. S11a, the absorption of a front-lit drop on a porous hydrophilic floor is analyzed each 10 s and the corresponding common grayscale worth throughout the picture width is proven within the center column. Subsequent, the first spinoff of the center plot (proven in blue) is calculated and proven within the rightmost column of this subplot (proven in inexperienced). Lastly, the SNR of the first spinoff of the grayscale values is calculated at every time interval. Particularly, Fig. S11a reveals that the SNR values of the absorbing front-lit drops are diminished from −17.74 (dB) to −12.19 (dB) inside 40 s from the onset of stable–liquid interactions. Because of this, the drop is just not detectable by the digicam at 40 s and the corresponding SNR worth exceeds −13 dB. It’s price noting that on this step (the place the drop is just not detectable or totally absorbed by the porous floor), the CA is manually set to 0° as a floor reality. Because of this, for back-lit (Fig. S11b) or front-lit (Fig. S11c) drops, if a drop picture (captured at an arbitrary time interval) is subjected to a Gaussian Blurring filter with a dimension of 30 or extra, the corresponding SNR values would exceed −13 dB that means that the algorithm seemingly assigns a CA of 0° to those pictures. In abstract, the proposed algorithm is much less delicate to the perimeters of the drops and the outcomes are primarily managed by the general geometry of the ROI. Which means that the wettability measurements estimated by the proposed algorithm are extra dependable, reproducible, and sturdy than the present strategy.

Simultaneous CA measurements at completely different angles

One of many predominant benefits of the proposed goniometer is its capacity to concurrently decide the tangent angles of a drop at numerous angles. In truth, the measured CAs might differ from level to level alongside the ternary section contact line as a result of variations within the native floor heterogeneity. Subsequently, the current setup will increase the variety of wettability measurements for a extra dependable evaluation of the drop in comparison with the standard goniometers, that are sometimes outfitted with a single digicam. Contemplating Fig. S12, and Video 4, it’s seen that the imply distinction between the left and proper CA estimated by every digicam (shaded in inexperienced) is far smaller than the imply distinction between the mixed common CA of the person cameras (Fig. S12e). This explains why a single side-view of ROI is just not enough to reliably estimate the wettability of non-spherical drops on heterogeneous surfaces. Furthermore, as proven in Fig. S13 (which is a snapshot of Video 4), the utmost distinction in CA estimated by the 2 strategies, i.e., CNN and ImageJ, is rarely greater than ~ 5°.