The emergence of coronavirus disease 2019 (COVID-19)—and the subsequent health policies promoted by governments across the world—has highlighted the importance of face masks in combating the spread of infectious diseases1,2,3,4. Surgical masks have long been used in healthcare, but the transition to mask wearing in the public sector has run into well-known challenges of compliance and efficacy5,6. In particular, many people report finding masks uncomfortable or stifling, which compels them to pull the mask down to improve breathing7,8,9. However, wearing a face mask is only effective when the face mask is worn properly, fully covering the face with a tight fit10.

Variations in facial features can also prevent masks from fitting properly, especially for women, younger people with smaller facial features and men with beards11,12,13. Furthermore, studies have shown that users struggle to accurately self-assess the mask fit quality9,11,14. In addition, the Centers for Disease Control and Prevention has reported that up to 60% of N95 face masks are counterfeit or defective15. Thus, behavioural and physical challenges undermine the effectiveness of mask wearing, and improving the rate of face mask usage—and the efficacy of the face mask for individual users—requires re-examining the overall design model of face masks16.

Face masks are currently designed primarily for air-conditioned hospital environments and clean-shaven male users17,18. Such controlled conditions and environments are unavailable to ordinary citizens. Designing better face masks for the wider public instead requires an improved understanding of the factors related to face mask non-compliance, gathered in the form of feedback and data from users under real-world scenarios, as well as proactive conformable decoding of this information19,20. Considering the difficulty in self-assessing the fit quality and the prevalence of counterfeits, providing real-time fit quality feedback directly to users is also of great value9.

Embedded wearable electronics could potentially be used to achieve a conformable interface with skin, decode biological signals and record the status of the face mask4,20,21,22. However, current wearable electronic devices—which include patches23, smartwatches24,25 and face-mask-compatible systems26,27—are only intended to monitor biological signals and symptoms related to infectious diseases25,26,27, including breathing patterns26,28,29,30, infection with COVID-19 (ref. 31), skin temperature27 and blood oxygenation27. Electronic devices that support the continuous measurement of both biological and environmental signals related to the status of the face mask and its user remain limited. People are, thus, currently required to use specialized devices, such as mask fit tester, to determine the mask fit quality, and these systems can be bulky, stationary and expensive, as well as only offering one-time measurements11,17.

In this Article, we report a conformable multimodal sensory face mask (cMaSK) that can be integrated with commercial face masks to monitor signals related to infectious diseases, environmental conditions and wear status of the face mask. Our design includes components and firmware to achieve low-power operation, a microprocessor with the Bluetooth low-energy functionality, and custom-designed printed circuit boards (PCBs) for integration with the face mask. A gecko-inspired thin adhesion layer allows the integrated system to be repeatedly laminated and delaminated with a variety of commercial face masks such as surgical, N95 and cotton masks. We also develop a mobile app that wirelessly connects to the cMaSK over the Bluetooth low-energy system and transmits the data to a server for data storage and analysis.

To calibrate and characterize each sensor used in the cMaSK, we conduct in vitro trials. The mechanical performance of the adhesive layer is also tested, and various analyses are used to design and optimize the conformability and robustness of the PCBs. Then, to collect data and evaluate the cMaSK during a series of tasks and physical activities, we conduct in vivo trials with an emphasis on gender variation and the associated specific features of faces for the face mask fit factor. To understand the differences in fit quality of commercialized face masks among genders, we recruited an equal number of female and male participants for the study32. The mask fit quality measured from the cMaSK is compared with the data from a conventional mask fit tester to verify the correlation between them. Using these data in conjunction with machine learning algorithms, we classify the dynamic positioning and fit of the face mask.

Design overview of cMaSK

Figure 1a,b shows the overall concept of this research. The cMaSK could be easily attached to various face masks, and environmental and biological signals can be collected. The collected data were transmitted to a custom-made mobile app via Bluetooth communication and sent to the server for data storage and management. When designing the cMaSK, we considered four requirements. (1) Appropriate sensor components should be selected and placed in the optimized position. (2) The cMaSK should not hinder breathing or affect the mask fit and protection quality. (3) The cMaSK should be reversibly adhered to and detached from the face mask multiple times. (4) The entire system must be mechanically durable.

Fig. 1: System overview.
figure 1

a, Schematic of the overall system developed in this study. Conformable electronic devices attached to the face mask collect environmental and biological data. The collected data are transmitted to mobile devices through Bluetooth communication and then the data in the mobile devices are transferred to the server for data storage and processing. b, Schematic of the conformable electronic devices attached to the face mask. c,d, Optical microscopy images of interconnect and capacitance sensor pad (c) and the microprocessor, resistors and accelerometer assembled on the flexible printed circuit board (f-PCB) (d). e, Schematic of the structure of the f-PCB. f, Photograph of the cMaSK developed in this study. The f-PCB is connected to the main PCB (m-PCB), which saves the collected data, transmits the data and supplies the power. g, Photograph of a human subject wearing a face mask with the cMaSK.

Hence, before designing the cMaSK, we accordingly defined the biological and environmental signals and sensor types (Supplementary Table 1). The cMaSK consists of two parts: (1) flexible PCB (f-PCB) with a thickness of 100 μm, which interfaces with the face mask (Fig. 1c,d); (2) main PCB (m-PCB) that controls the whole device operation. Detailed descriptions for the design of the f-PCB and m-PCB are discussed in Supplementary Notes 1 and 2, respectively. The overall system operation flow is discussed in Supplementary Note 3. Using a rechargeable lithium battery, the cMaSK was shown to run for more than 60 h on a single charge (Supplementary Figs. 4 and 5). Owing to the low power and large surface area for heat dissipation of the cMaSK, the device temperature during operation is negligible (Supplementary Fig. 6).

For encapsulating the integrated circuits (ICs), we used epoxy on the m-PCB and f-PCB where the ICs were placed. This epoxy not only protects the ICs from moisture but also protects the ICs on the f-PCB from solder joint failure due to mechanical bending. We designed a three-dimensional printed case to protect the m-PCB. To enable the cMaSK to be attached to the various commercial face masks multiple times, we applied a thin adhesion layer on the f-PCB and the case for the m-PCB (Fig. 1e). The whole device mounted on a surgical face mask is shown in Fig. 1f, and a subject wearing the face mask with the cMaSK is shown in Fig. 1g.

Mechanical characterization of the components in cMaSK

We tested the mechanical properties of serpentine interconnect, epoxy encapsulation and adhesion layers used in the cMaSK. A detailed description of the serpentine interconnect is discussed in Supplementary Note 4. To characterize the mechanical properties of the interconnect, we performed uniaxial tensile tests (Supplementary Fig. 8). As shown in Fig. 2a, the failure strain of the entire serpentine interconnect used in the cMaSK is about 90%, which is much higher than the deformability of the commercial face mask. As shown in Fig. 2b, the centre part of the interconnect is highly deformed since there are no capacitance sensor pads there, which is also verified by finite element analysis results (Fig. 2c). Further analysis of the centre part of the interconnect is discussed in Supplementary Note 5. The mechanical properties of the epoxy encapsulation were analysed using tensile stress and numerical simulation (Supplementary Note 6). Owing to the high deformability of f-PCB and stiffness in the encapsulated regions with ICs, the cMaSK remained functional during bending, stretching and even folding into a pocket (Fig. 2d and Supplementary Video 1).

Fig. 2: In vitro characterization results for f-PCB.
figure 2

a, Stress–strain curve of the whole serpentine interconnect used in this study. b, Photograph of the serpentine interconnect under mechanical stretching with various strains. c, Numerical simulation results of uniaxial stretching of the whole serpentine interconnect at 0.3 N. d, Photographs of the cMaSK under various mechanical deformations including twisting and crumpling. e, Optical microscopy image of the adhesion layer used in the cMaSK. f, Measured lap shear strength value between the adhesion layer and various face masks. The data are presented as mean values ± standard deviation (s.d.) (n = 3 different face mask specimens examined in independent measurements). g, Photograph of the cMaSK detached from the surgical face mask. h, Photograph of the mask fit test setup. The device compares with the particle concentration of the environment and inside the face mask. i, Mask fit quantity values of various types of face mask with and without the attached cMaSK. The data are presented as mean values ± s.d. (n = 60 from continuous mask fit quantity measurement; Supplementary Fig. 12). j, Fit factor (FF) value calculated from the capacitance sensor pads as a function of distance between the sensor pad and conductive plate. The data are presented as mean values ± s.d. (n = 6 from independent measurements).

The microstructure of the adhesion layer used in the cMaSK is shown in Fig. 2e and Supplementary Fig. 10a. The optical microscopy image shows that the adhesion layer has gecko-inspired mushroom-shaped pillars. However, due to the relatively large size of the micropillars and low pillar density (about 4.7 pillars mm−2; Supplementary Fig. 10b), this adhesion layer did not show gecko-inspired adhesion behaviour33,34. Instead, this layer showed good adhesion properties with fabrics due to hook (adhesion layer) and loop (fabrics in face mask) mechanisms35,36. Since the height of the adhesion layer is very small, we expected that the adhesion layer does not affect the fit quality of the face mask, as addressed in later sections.

The shear strength of the interface was measured to characterize the adhesion force between the adhesion layer and various face masks35. Supplementary Fig. 10c shows a schematic and photograph of the measurement setup. Figure 2f shows the shear strength of the adhesion layer with three different face masks (cotton, surgical and N95), and the force–displacement curves are shown in Supplementary Fig. 10. As shown, the adhesion layer has an adhesion strength of 6.7, 36.7 and 22.0 kPa for cotton, surgical and N95 face masks, respectively, and maintained an adhesion strength of 20.0 kPa with N95 face masks after 100 cycles of continuous attaching and detaching. This good reliability is attributed to the low aspect ratio of the pillar (0.7) in the adhesion layer, which makes it less likely to collapse during the attaching and detaching cycles33. The adhesion test results indicate that the adhesion layer is highly suitable for the cMaSK, which requires universal adhesion with various types of face mask with good repeatability. Figure 2g shows the cMaSK with the adhesion layer attached to the surgical face mask, and Supplementary Video 2 shows the attaching and detaching cMaSK from the surgical face mask. To analyse the effect of sweat on the adhesion layer, the same lap shear stress tests were performed with wet face mask specimens and showed high adhesion strength (Supplementary Note 7).

Mask fit quantity test of face mask with the cMaSK

To investigate the effect of cMaSK on the performance of the face mask, we used mask fit tests. Figure 2h shows a device and test setup. The device measures particle concentration by using the light scattering of particles37. Figure 2i shows the mask fit quantity (ratio between the particle concentration in the environment and inside the face mask) values of the face masks with or without the cMaSK, as well as particle concentration during the measurement (Supplementary Fig. 12). Evidently, the mask fit quantity showed almost the same value even when measured with the cMaSK. These results also showed comparable mask fit quantity values reported by other researchers11,38. These data indicate that due to the thin and conformable geometry of the cMaSK, it can be applied to various types of face mask without concerns of deterioration in face mask performance.

In vitro characterization of sensors

The performance of the capacitance sensor pad and temperature/humidity sensor were characterized before being applied to a human subject. A single electrode-type capacitor was used as a capacitive sensor pad to determine the close physical contact between the cMaSK and human skin. When a conductive object such as a metal plate or human skin approaches the sensor pad, the capacitance in the sensor pad increases due to the introduction of an additional parallel capacitance (Supplementary Fig. 13)39. The method for controlling the capacitance sensor pads is discussed in Supplementary Note 8.

To characterize the performance of the single capacitor pad, we measured the capacitance value of the pads as they approached a large steel plate from various distances. As shown in Supplementary Fig. 13, the sensor pad value was inversely proportional to the distance from the conductive object. To unify the data from capacitance pads with different areas and clearly show their degree of proximity, we defined a mask fit factor (FF) as below:

$${\mathrm{FF}} = \frac{\rm{Cap}_{\rm{measure}} - {\rm{Cap}}_{\rm{min}}}{{\rm{Cap}}_{\rm{max}} - {\rm{Cap}}_{\rm{min}}},$$

where Capmeasure, Capmin and Capmax refer to the values measured from individual capacitance sensor pads during measurement, hanging in the air (not making any contact) and fully contacting a conductive object, respectively. The FF values from pads with different areas (Fig. 2j) indicates that the degree of proximity is independent of the pad area and becomes highly sensitive when the distance is lower than 1 mm. To calibrate the temperature and humidity sensor, a medical-grade temperature sensor and saturated salt solutions were used (Supplementary Note 9).

Sensing performance characterization of the cMaSK

Figure 3a describes the location and name of all the sensors, and the four positions of the cMaSK to be tested are shown in Fig. 3b. When analysing the capacitance sensor pads’ data, we averaged the FF values from all the 17 sensor pads (defined as FF_All). As shown in Fig. 3c, FF_All was the highest (~0.7) when the face mask fully covered the face, which indicates that the largest number of capacitance pads were in contact with the skin when the cMaSK was fully covering the nose and mouth. The cMaSK can detect small changes such as a loose fit around the nose, which is critical for personal protection, by dividing the capacitance sensor pads into four different regions (Supplementary Note 10)40.

Fig. 3: In vivo characterization of cMaSK under different positions with respect to face and various verbal activities.
figure 3

a, Schematic of the f-PCB with each sensor location. b, Schematic of the tested face mask positions. c. Averaged FF values from all the capacitance sensor pads (FF_All), df, Air pressure (d), accelerometer (e) and temperature and humidity sensor (f) values (left, sensor located at the edge (SHT40_1); right, sensor located at the centre (SHT40_2)) for different positions of the cMaSK (shown in b). The data in c are presented as mean values ± s.d. (n = 10 from independent measurements). g, Temperature and humidity values measured from SHT40_2 under different breathing rates. h, Air pressure values measured from the air pressure sensors under various verbal activities. The red arrows indicate the points where coughing occurred.

Figure 3d shows the air pressure values measured from the air pressure sensor with different cMaSK positions. When the cMaSK was fully covered, there were fluctuations in air pressure values in the orders of tens of pascals, which can be attributed to inhaling and exhaling activities induced by breathing41. However, when the face mask was not worn properly, the pressure sensor could not detect such breathing patterns due to increased distance between the sensor and face. As shown in Fig. 3e, the acceleration values at each axis show differences due to orientation changes of the face mask. As shown in Fig. 3f, the cMaSK could measure the skin temperature from SHT40_1 and detect temperature and humidity changes from breathing using SHT40_2 (ref. 42). The temperature and relative humidity of the exhaled air are in the range of 31.4 to 35.4 °C and 41.9% to 91.0%, respectively, comparable with the measurement values from SHT40_2 (ref. 43). Furthermore, the environmental temperature and humidity inside the face mask were determined by assessing the baseline temperature and humidity values from SHT40_2. These environmental data are highly valuable since users could get various insights into thermal discomfort44, breathing difficulty15, immunity enhancement45 and even the health status of lungs46.

However, when the cMaSK was not worn properly, fluctuations due to breathing became much weaker and even vanished (Fig. 3f and Supplementary Fig. 17). Sensor characterization results verified that the cMaSK could classify the wearing position of the face mask based on these multimodal signals. Furthermore, by counting the number of fluctuations in temperature, humidity and air pressure (Fig. 3g and Supplementary Fig. 19), we could identify the breathing rate with high accuracy even under an elevated breathing rate of 47 breaths per minute (bpm). As shown in Fig. 3h, a large positive spike of around 50 Pa occurred when the subject coughed when the cMaSK was properly worn. Interestingly, when the subject was speaking, only negative fluctuations around 50 Pa in air pressure were observed. Such different trends during speaking are due to outlet airflow modulation by the glottal (Supplementary Note 11)47,48. Due to such differences, we can monitor coughing even during speaking (Fig. 3h). Hence, we verified that cMaSK could monitor critical biological signals such as breathing rate, coughing and skin temperature related to infectious diseases49,50.

To verify the fast response and reliability of the cMaSK, we recorded signals as the face mask’s position was continuously changed for a short period of time (Supplementary Fig. 22a). From Supplementary Fig. 22, all the sensors show consistent trends with the results discussed in Fig. 3, which indicate good reliability of the cMaSK. Supplementary Figs. 2530 show the results from using cotton and N95 face masks, respectively. Furthermore, cotton face masks showed lower FF values due to a loose fit (Supplementary Note 10). These results display a clear difference in sensor values on multiple face mask positions and reinforce the high repeatability, which thereby indicate the universality of the cMaSK. Supplementary Figs. 3136 show similar test results with a short interval period between each face mask’s position (10 s), demonstrating the fast response time of the cMaSK.

While wearing the cMaSK, skin (sweat, skin humidity and cosmetics) and environmental conditions (temperature, humidity and wind) could affect the sensing performance of the cMaSK. Hence, we analysed the effect of skin and environmental conditions (Supplementary Notes 13 and 14) and verified that the cMaSK is highly robust in the skin and environmental condition changes.

Operation in recording environmental and biological data in vivo

Next, we performed an in vivo human trial using cMaSK to verify the applicability and reliability in recording both biological and environmental data as various activities were performed. We used a custom-designed mobile app to interface with the cMaSK and transfer data to a web-based server (Methods). Supplementary Video 3 shows the whole system operation developed in this work. Figure 4a shows a human subject (Subject_1) sitting on a chair and running on a treadmill while wearing the cMaSK. Supplementary Video 4 shows the entire trial performed on Subject_1, and Fig. 4b shows the timeline of the trial for Subject_1.

Fig. 4: In vivo physical activities analysis.
figure 4

a, Photographs of a subject (Subject_1) sitting (left) and running (right) during the in vivo trial. b, Timelines of three phases during the trial. Letters A, B, C, D and E indicate the position of the cMaSK when fully covered, nose exposed, nose and mouth exposed, taken off, and fully covered while speaking, respectively. cg, Recorded data from capacitance sensor pads (c), air pressure sensor (d), SHT40_1 (e), SHT40_2 (f) and accelerometer (g) during the trial. The red arrows in d (at 20, 40, 270 and 300 s) indicate when the subject was coughing. These results indicate that the cMaSK could get biological information and position of the face mask during various activities.

Figure 4c–g shows the recorded data for Subject_1 during the trial. The FF_All values show apparent differences between the position of the cMaSK as the subject was sitting, walking and running (Fig. 4c). When Subject_1 wore the cMaSK fully covering the nose and mouth, the FF_All value was higher than 0.65, indicating that the average mask–face gap was less than 0.5 mm (Fig. 2j). As shown in Fig. 4d,f,g, each sensor value shows apparent differences depending on the position of the cMaSK regardless of activity type. The temperature and humidity values from SHT40_1 show that the cMaSK could measure skin temperature during dynamic activities (Fig. 4e). When the subject was running or walking, there were large fluctuations in the acceleration values due to vigorous motion, indicating that human activities can be monitored using the accelerometer.

Based on SHT40_2 and air pressure sensor data, we could determine verbal activities (breathing rate, coughing and speaking) even if subjects are doing various physical activities (Fig. 4d,f and Supplementary Fig. 46). There was a notable spike in air pressure when the subject was coughing (20, 40, 270 and 300 s; Fig. 4d). We could get similar results from Subject_2 during in vivo activity monitoring (Supplementary Note 15 and Supplementary Figs. 4952).

Interesting data were obtained from Subject_3 (Supplementary Fig. 53): although the subject wore the face mask fully covering the nose and mouth, the FF_All value was only around 0.3, which is much lower than the data from Subject_1 (approximately 0.7) and Subject_2 (above 0.5). We could confirm the cMaSK was worn properly during the trial based on the measurement values from other sensors (Supplementary Figs. 53d,f,g and 54). Such results indicate that the cMaSK did not form conformal contact with the skin. Based on further FF analysis and photographs of the subject’s face (Supplementary Figs. 55, 56 and 69), we verified that such low FF values were due to the beard on Subject_3’s face. From the results for Subject_3, we showed that the cMaSK could determine the reduced mask fit quality if the subject had facial hair, which will be more quantitatively addressed in later sections.

When we applied the cMaSK to female subjects (Subject_4, Subject_5 and Subject_6), the FF_All values were only around 0.2 for all of them, which is lower than the male subjects (Subject_1 and Subject_2) (Supplementary Table 2 and Supplementary Figs. 5760, 6164 and 6568 for Subject_4, Subject_5 and Subject_6, respectively). We investigated the origin of the differences in FF values among genders by measuring the facial parameters from the photographs of the subjects (Supplementary Fig. 69). The parameters are listed in Supplementary Table 3. Based on this analysis, we concluded that such low FF values for female subjects were due to the general facial shape and size differences among genders. The results from female subjects agreed well with previous works, showing that there could be a more substantial air gap between the face mask and skin if the subject had a smaller and thinner face dimension13. A detailed discussion of this result is provided in Supplementary Notes 15 and 16.

Based on human trials, the cMaSK could monitor environmental and biological signals during various activities. We determined that the fit quality of the surgical face mask was deficient for female subjects, especially at the bottom and side region of the mask due to their face size and shape; the fit quality was 80% and 70% lower than male subjects, respectively. We also correlated these results with the facial analysis performed on the subjects and found that surgical face masks made notable air gaps larger than a few millimetres for female subjects. Such information could help individuals select a face mask with good fit quality based on their facial dimensions.

Validation of mask fit quality improvement using the cMaSK

In the previous section, it was shown that the beard for male subjects and face masks’ size mismatch on female subjects resulted in a poor mask fit, and this significantly affects the efficacy of the face mask. Hence, mask fit improvement was analysed on a female subject with different sizes of surgical face masks, as well as a male subject before and after shaving their beard. For the female subjects, face masks with the same material and geometry (non-woven polypropylene-fabric-based surgical-type face mask) but different sizes (Supplementary Fig. 72) were used.

As shown in Fig. 5a and Supplementary Fig. 73, the fit quantity measured from the mask fit tester increased in female subjects when the size of the surgical face masks decreased. Such results strongly indicate that smaller face masks are preferable for people with smaller facial features such as females and children. Similar trends were observed in FF_All values from the cMaSK (Fig. 5a), which indicates a correlation between the mask fit measured by the cMaSK and by a conventional mask fit tester. Based on FF value analysis, the largest gaps (the smallest FF values) were measured at the bottom region of the face mask (FF_Bottom) when using larger face masks, and the FF_Bottom values substantially increased from 0.02 to 0.26 when using smaller face masks (Fig. 5c,d and Supplementary Figs. 7476). It was also verified by experimental photographs of the subject that the gaps at the bottom and side regions were reduced (Fig. 5b).

Fig. 5: Mask fit improvement on female and male subjects.
figure 5

a, Mask fit quality of Subject_5 with various sizes of surgical face masks measured by a mask fit tester (mask fit quantity) and cMaSK (FF_All). b, Photograph of the female subject wearing larger (left) and smaller (right) surgical face masks taken from the backside. c, FF_Bottom (averaged values from Cap_12, Cap_13, Cap_14, Cap_15 and Cap_16; Fig. 3a) values of the female subject with a larger (left) and smaller (right) surgical face mask as the positions of the cMaSK were continuously changed. d, Averaged FF values from four regions of the cMaSK attached to various sizes of the surgical face masks. e, Mask fit quality of Subject_3 with an N95 face mask before and after shaving the beard measured by a mask fit tester (mask fit quantity) and cMaSK (FF_All). f, Photograph of the male subject wearing an N95 face mask before (left) and after (right) shaving the beard taken from the backside. g, FF_Bottom values of the male subject with an N95 face mask before (left) and after (right) shaving the beard. h, Averaged FF values from four regions of the cMaSK attached to the N95 before and after shaving the beard. Letters A, B, C and D indicate the position of the face mask with fully covered, nose exposed, nose and mouth exposed, and taken off, respectively. The data in a, d, e and h are presented as mean values ± s.d. (n = 4 for mask fit quantity values in a and e from individual measurements; n = 10 for FF_All values in a and e and FF values in d and h from individual measurements).

To validate the effect of having a beard on mask fit, the mask fit quality was measured using the cMaSK and mask fit tester, both before and after Subject_3 shaved their beard. The length of the beard was 5.0 mm at the chin and 4.3 mm at the cheek. As shown in Fig. 5e and Supplementary Figs. 77, 80 and 81, the mask fit quantity of both surgical and N95 face masks measured from the mask fit tester increased once the subject shaved their beard (from 2.4 to 3.6 for the surgical face mask and 48.5 to 119.2 for the N95 face mask). The mask fit measured from the cMaSK (FF_All) increased in both surgical and N95 face masks after the subject shaved their beard (from 0.10 to 0.20 for surgical face mask (Supplementary Fig. 80a) and 0.33 to 0.61 for the N95 face mask (Fig. 5e)). These measurements indicate a strong correlation between the mask fit measured by the cMaSK and by the conventional mask fit tester. Such results were also consistent with previous studies that face masks with higher filtration efficiency were more vulnerable to the mask–face separation effects of beards17.

Moreover, from the analysis using FF values, the mask fit was increased in all the regions around the N95 face mask (FF_Top_edge, FF_Top_centre, FF_Bottom and FF_Side; Fig. 5h). There was an especially large increase at the bottom region (FF_Bottom) from 0.13 to 0.62 after shaving (Fig. 5g,h). Such measurements were highly reasonable since the capacitance sensor pads at the bottom region would be the most affected by the beard (Fig. 5f). The results from the mask fit measurement of the bearded subject showed one of the strong benefits of the cMaSK compared with a conventional mask fit tester: it could quantitatively show the mask fit in each region of the face mask. Hence, users could easily realize where the leakages are most likely to occur. Thus, based on the literature and reported measurements in this work, it was verified that facial hair including beards affect the mask fit, and that the cMaSK can accurately record such fit differences, which is critical for public health.

From the analysis of mask fit improvement on both male and female subjects, it was verified that the cMaSK could evaluate the fit quality and air mask leakage for each person with similar trends as those yielded from a conventional mask fit tester device. Such results indicate that the public could easily measure the mask fit without using bulky, heavy, stationary conventional mask fit tester devices as well as monitor the mask fit in real time during various activities. In addition to the mask fit analysis, the cMaSK can classify the face masks’ positions from the FF_All values measured as the face masks’ position was continuously changed (Supplementary Figs. 73b,d,g and 77b,e).

Classification of face mask position using machine learning

Using the collected data, we leveraged machine learning to classify the position of the face mask. We used k-means clustering on the sensor data, an unsupervised learning algorithm that classifies the points into k clusters based on minimizing the distance between the data points and clusters’ centroids51. As shown in the schematic in Fig. 6a, we processed the stored data in the server to train and test the algorithm. The accuracy of the developed model was calculated using the F1 score, which is the harmonic mean of two parameters, namely, precision and recall52. In this work, data from capacitance sensor pads and accelerometer were used for training based on the classification results for each sensor (Supplementary Note 17).

Fig. 6: Machine learning algorithm for position classification.
figure 6

a, Schematic of the development of the machine learning model. Data for training the model were loaded from the server and then processed before applying to the training model. The classification model was based on k-means clustering. For the testing, the test dataset was applied to the model and the predicted position was compared with the true values. b,c, Confusion matrices tested on female (b) and male (c) subjects’ dataset. The confusion matrix results were obtained using trained models based on unified models. Left, centre and right columns show the confusion matrices from classification models trained using capacitance sensor pads, accelerometer and both, respectively.

To prepare the dataset, we recorded data from ten subjects (five male and five female) (Supplementary Figs. 8493). The protocols for these trials are described in Methods. As shown in Supplementary Fig. 94, when we separately developed the clustering models for each gender, the classification accuracy became very low for the female model (Supplementary Note 18). In particular, female models could not distinguish the case when the cMaSK was worn with the nose exposed compared with when the cMaSK was worn with fully covered or nose and mouth exposed (Supplementary Fig. 94a).

To increase the accuracy for females, we developed a unified model using the data collected from a total of ten male and female subjects. For the female subjects, the F1 score improved in the unified model from 72.5% to 77.5% when both sensors were used together (Fig. 6b and Supplementary Table 4). The unified model can also be leveraged to classify the nose-exposed position for female subjects. As shown in Fig. 6c and Supplementary Table 4, the unified model showed a similar F1 score for male subjects. Both capacitance sensor pads and accelerometer showed 91.5% and 70.7%, respectively, and 92.8% when both sensors were used together. The classification accuracy of the bearded subject was lower than the unbearded subject (Supplementary Note 19).

The strength of this modelling approach is that it demonstrates that regardless of the user, the same position of the cMaSK falls into the same cluster, and a single unified gender model could predict the mask position of unknown users. We expect that if female subjects wore smaller face masks to improve the fit quality, the classification accuracy could also be improved. By continuously streaming the data from the cMaSK in the future, we expect that the real-time decoding of various user behaviours could be realized21.


We have reported the development of deformable electronics that can be used with a commercial face mask and can decode human behaviours, vital signs and status of the face mask. We designed the f-PCB of the system to maintain breathability and mask fit quality when attached to the face mask, and the m-PCB was designed to control the sensors and wireless data operation. The cMaSK can endure mechanical deformation such as twisting and crumpling, and can be attached to various types of commercial face mask multiple times due to its gecko-inspired adhesion layer. We also developed an additional software system to wirelessly transmit the data from the cMaSK to the server.

We showed that the cMaSK can simultaneously monitor multiple signals related to biological and environmental conditions, including the position of the face mask, skin temperature, humidity, verbal activity and breathing pattern. The fit quality of the face mask can be determined (with values showing strong correlation with those gathered by conventional bulky and stationary mask fit testers) using data from capacitance sensor pads, and differences in fit quality were observed between male and female subjects due to face size and shape variation. Such results emphasize the importance of including an equal number of subjects of different genders in scientific research. We also showed that the position of the face mask could be classified using machine learning algorithms with high accuracy of 92.8% and 77.5% for male and female subjects, respectively.

The cMaSK provides a platform for the development of smart face mask systems that can provide real-time feedback and can actively assist users in optimizing the face mask fit. More broadly, our work offers a modular, customizable research tool for studying environmental and health technologies in real-world settings where human behaviour may affect performance, broadening our understanding of the key factors that influence mask-wearing behaviours and the implications for human health and well-being. Further device modifications are possible with the system including enhancing the battery lifetime, designing a lighter m-PCB and enabling real-time decoding of face masks’ status and other vital signs, as well as broader deployment of the cMaSK into studies that focus on populations such as children, elderly people and societies with high levels of air pollution. The framework that we have developed can also be implemented in designing conformable, customizable electronics for other textile-oriented garments including bras and T-shirts.


Fabrication and encapsulation of the cMaSK

A commercialized PCB manufacturer (PCBWay) fabricated both m-PCB and f-PCB for the devices based on the designs formed using Altium v.21.5.1 software. The device includes passive components (resistors, inductors and capacitors; footprint from 0402 to 1206 in inches), devices for power management (AP2210K-3.0TRG1 (Diodes), TCR3UF18B,LM(CT (Toshiba), NCP302HSN18T1G and NL7SZ98DBVT1G (onsemi) and RZM001P02T2L (ROHM Semiconductor)), microcontrollers (DA14585, Dialog Semiconductor; ATtiny806, Microchip), memory (AT25XE021A-MAHN-T for loading the firmware, Adesto Technologies; MX25U6432FZNI02 for data saving, Mouser), pressure sensor unit (ICP-10110, Invensense), temperature and humidity measurement unit (SHT40-AD1B-R2, Sensirion), accelerometer unit (LIS3DHTR, STMicroelectronics), electrostatic discharge protection unit (DF5A6.2LJE,LM from Toshiba Semiconductor and Storage), connector pin (101R014FB110 and 101P014FB110, Amphenol ICC) for connecting m-PCB with f-PCB, and battery (ML-2020/F1AN, Panasonic).

The case of the device was designed through Fusion 360 v.2.0.10811 (Autodesk) and printed using a three-dimensional printer (Formlabs Form 3, Formlabs). An epoxy (1,500-psi-strength epoxy, Devcon) prepared by mixing two parts with the weight ratio of 1:1 was bar coated for encapsulating the ICs assembled on the f-PCBs and m-PCB. A gecko-inspired adhesion layer from 3M (3M Hook|CHK-05636) was cut into two rectangular strips 140 mm in length and 13 mm in width, one rectangular strip 70 mm in length and 6 mm in width and one square strip 35 mm in length. These rectangular strips were attached to the top, bottom and centre side of the f-PCB, respectively, and the square strip was attached to the plastic case. The adhesion layers have mushroom-shaped micropillars 185 μm of height, 160 μm of base width and 270 μm of spatula tip width (Fig. 2e).

The total weight of the m-PCB, including the three-dimensional printed case, is 12.8 g, which is comparable to the weight of the N95 mask (9.0 g). The total weight of the f-PCB, including all the components, encapsulation layer and adhesion layer, is 1.7 g. Hence, the cMaSK does not induce notable discomfort to people wearing it.

Software system development

We developed the firmware for two microcontrollers (DA14585 and ATtiny806) for the cMaSK, a mobile app and a web-based server for interfacing with the cMaSK. Programming the microcontroller was done using Keil µVision v.5 for DA14585 and Microchip Studio v.7.0 for ATtiny806. The web server was written in Python (v.3.8) using the Flask microframework, and a PostgreSQL server was used to store data from the face mask. The code was run through a Gunicorn worker running behind an NGINX proxy server on an MIT Media Lab Ubuntu virtual machine. The web server handles HTTP GET requests from the browser to display data to a logged-in user or POST requests to add data to the SQL database, among other requests such as authentication.

The mobile app was developed with the React Native framework, which allows concurrent development for both iOS and Android devices with one codebase and minimal changes between the two platforms. The mobile app was responsible for directly communicating with the cMaSK through the Bluetooth low-energy functionality, and stores data from the mask to the local memory, periodically pushing the data to the PostgreSQL database through the web server. The app also supports authentication with user credentials to associate data with users and protect their information.

Mechanical characterization of interconnect in f-PCB

For the mechanical characterization of the interconnect, static and cyclic stretching tests were performed. Supplementary Fig. 8a shows the entire mechanical characterization setup; we used Instron 5943 universal mechanical tester with a 500 N load cell. Supplementary Fig. 8b shows the photographs of the two types of specimen used for the characterization. For the static and cyclic stretching tests of the interconnects, the stretching speed was set to 1 and 10 mm s−1, respectively. Data from Instron 5943 were recorded using Bluehill v.3.11 software. For the electrical resistance measurement during stretching, open traces in both ends were soldered with copper wires and connected to the digital multimeter (Keysight 34461A). The data from the digital multimeter were collected using LabVIEW 2021 software.

Mechanical characteristics of the encapsulation layer for f-PCB

The mechanical properties of epoxy encapsulation were analysed using an uniaxial tension test. For specimen preparation, the epoxy was bar coated on the hydrophobic silicone substrate. The thickness of the coated epoxy was 500 µm. When the epoxy was partially cured, the epoxy was cut into a rectangular shape 5 mm wide and 50 mm long. The silicone substrate was prepared by mixing Ecoflex (Ecoflex 0030, Smooth-On) part A and part B at a 1:1 weight ratio, mixing thoroughly for 2 min, degassing in a vacuum chamber for 10 min and pouring on a plastic Petri dish (VWR International). Silicone was cured at room temperature for 24 h. A uniaxial tensile test was performed using an Instron 5943 universal mechanical tester with a 500 N load cell with a stretching speed of 1 mm s−1. The data from the Instron 5943 device were recorded using the Bluehill software.

Adhesion force measurement for the adhesion layer

To measure the adhesion force between the face mask and adhesion layer, the lap shear stress test was used. For the specimen, three types of face mask (surgical, N95 and cotton) were cut into a rectangular shape 95 mm long and 20 mm wide. To prevent the deformation of the face mask specimen during the measurement, a thick paper (manila folder) is attached to the specimen using double-sided tape. The adhesion layer (3M) was cut into a rectangular shape 70 mm long and 20 mm wide. The adhesive layer was attached to the rigid steel plate with a thickness of 1 mm. For the measurement, an Instron 5943 universal mechanical tester with a 500 N load cell was used. The adhesion layer and face mask were gently attached to each other with an adhesion area of 140 mm2. The displacement rate of the measurement was 0.5 mm s−1. The whole experimental setup is shown in Supplementary Fig. 10c.

Mechanical simulation of interconnects and encapsulated f-PCB

The mechanical simulation of the serpentine interconnect and f-PCB with encapsulation were conducted using COMSOL Multiphysics (v.5.4), a commercial finite element analysis software. The objectives of the analysis were to (1) find out the part where the highest strain was applied throughout the whole serpentine interconnect used in this study and (2) verify that the epoxy encapsulation can prevent the deformation of the f-PCB where the ICs were assembled. The serpentine interconnect was designed and imported from Fusion 360 v.2.0.10811 software, and the f-PCB with encapsulation was modelled as a laminated structure. The f-PCB was modelled as a polyimide (PI) film 10 mm in width, 20 mm in length and 100 µm in thickness, and the epoxy film was modelled as 10 mm in width, 10 mm in length and 1 mm in thickness. The elastic modulus (E) and Poisson’s ratio (ν) were EPI = 2.5 GPa and νPI = 0.34 for PI and Eepoxy = 700.0 MPa and νepoxy = 0.30 for epoxy, respectively. For the mechanical simulation of the serpentine interconnect, we used a two-dimensional plane strain model, suppressing the out-of-plane (z-axis) buckling deformation.

Mask fit quantity test

The mask fit test was performed on various types of face mask (N95, surgical and cotton) to verify that the cMaSK does not deteriorate the filtering function of the face masks. We used a Model 8038 PortaCount Pro+ respirator fit tester (TSI Instruments). The overall photograph of the device is shown in Fig. 2h. The device has two air tubes: one is connected to the face mask to measure the air particle concentration inside the mask while wearing and the other measures the air particle concentration of the environment. For the test, a tube connector was attached to the various types of commercial face mask to connect one of the air tubes. Before starting the measurement, a Model 8026 aerosol generator (TSI Instruments) was used to increase the particle concentration in the atmosphere. This device generates non-toxic salt (sodium chloride) particles. For the measurement, the subjects wear the face mask with the air tube connected and fully covering the nose and mouth. The cMaSK attached to various types of face mask were tested to quantitatively measure the effect of the cMaSK on the performances of the face masks. The mask fit tester measures the particle concentration inside the face mask and from the atmosphere with an acquisition rate of 1 Hz.

Calibration for temperature and humidity measurement unit and capacitance sensor pad

To calibrate the temperature value from SHT40, we used a medical-grade temperature sensor (TMP117, Texas Instruments) as the gold standard. For calibration, both sensors were contacted with each other using thermally conductive paste (Thermal Joint, Wakefield-Vette). Then, these two sensors were mounted on the hot plate and the temperature was increased up to 70 °C. Both sensors were controlled by a microcontroller (DA14585) using I2C communication with a data acquisition rate of 5 Hz. The entire environment was sealed using a plastic container.

For humidity data calibration, SHT40 was put in a sealed chamber with a saturated salt solution (sodium chloride (VWR International) and magnesium chloride hexahydrate (VWR International)). The salts were added to deionized water with a concentration of 500 and 5 g ml−1 for sodium chloride and magnesium chloride hexahydrate, respectively. SHT40 was controlled by a microcontroller (DA14585) using I2C communication with data acquisition every 5 s. For the measurement, SHT40 was kept sealed in a container with a saturated solution for over 24 h to reach a saturation point.

For capacitor sensor calibration, the capacitance sensor pads placed on the f-PCB with an area of 25 and 50 mm2 were tested. When measuring the voltage difference induced by the proximity effect, a voltage signal from the capacitance sensor pad was recorded with various distances from a relatively large metal plate with an area of 85 × 95 mm2. The capacitance sensor pad was controlled by a microcontroller (ATtiny806). The recording frequency was 2 Hz. To characterize the effect of water on the FF values of the capacitance sensor pads, various volumes of water (from 20 to 140 μl) were dripped onto the pad using a micropipette (Acura 826, Socorex).

Characterization of all sensor components

To characterize the performance of all the sensors in the cMaSK as it was worn by the subject, all the data from the cMaSK with different positions of the cMaSK were recorded. The data were collected through the I2C communication protocol, and transmitted to the computer via the universal asynchronous receiver and transmitter communication protocol. The received data were converted to a text file via a custom-made software using Python (v.3.8). All the experiments were conducted in compliance with the guidelines of the Institutional Review Board and were reviewed and approved by the Massachusetts Institute of Technology Committee on the Use of Human as Experimental Subject (COUHES protocol 2101000301). To characterize the sensor’s output depending on various positions of the cMaSK, the data were recorded for 1 min on each position of the cMaSK. For monitoring the breathing rate, the subject wore the cMaSK, fully covering the nose and mouth. The data were recorded for 2 min and the subject manually changed the breathing rate after 30 s and maintained for 1 min. The breathing rate was manually counted for validation. When monitoring the verbal activity, the subject wore the cMaSK with a fully covered or exposed nose. For cough monitoring, the data were recorded for 1 min, and the subject manually coughed during the measurement at 5, 25 and 45 s, respectively. For speech monitoring, the data were recorded for 1 min, and the subject kept speaking during the measurement. When simultaneously monitoring coughing and speaking, the data were recorded for 1 min, and the subject coughed at 5, 25 and 45 s and continued to speak during the measurement. While continuously monitoring the position change of the face mask, the data were recorded over 6 min. The subject manually changed the position of the mask based on the protocol (schematic shown in Supplementary Figs. 22, 25, 28, 31 and 34).

To analyse the effect of skin condition on the capacitance sensor pad values, water, facial cream, sunscreen and sanitizing ethyl alcohol (75% ethyl alcohol) were each applied to the subject’s face before wearing the cMaSK. To characterize the effect of wind on the cMaSK, the subject wore the cMaSK and faced wind from a fan (WSA350, Weller). To characterize the effect of environmental temperature and humidity changes on the cMaSK, the subject first stayed inside the building (temperature of 22 °C and humidity of 56% measured by the cMaSK) for 100 s. Then, the subject moved to the outside of the building (temperature of 30 °C and humidity of 38% measured by the cMaSK) and stayed there for 460 s. Finally, the subject moved back into the building.

Clinical study design

We performed an in vivo trial on multiple subjects, and all the experiments were conducted in compliance with the guidelines of the Institutional Review Board and were reviewed and approved by the Massachusetts Institute of Technology Committee on the Use of Human as Experimental Subject (COUHES protocol 2101000301). Male and female subjects with no prior medical history of chronic cardiovascular, respiratory and mental disability were recruited for participation in this test. Before the trial, the subjects were properly informed and signed a consent including the consent of photography during the trial. We did two types of protocol: (1) trials for monitoring various activities and (2) trials for dataset collection for machine learning. For monitoring various activities, the subject was asked to sit on a chair for 5 min and walk and run on a treadmill for 5 min and 3 min, respectively. During the measurement, the subjects were asked to do various activities including changing the position of the face mask, coughing and speaking. The speed of the treadmill is 2 miles per hour for walking and 6 miles per hour for running. For dataset collection for machine learning, subjects sit on a chair and change the positions of the cMaSK from fully covering the nose and mouth, exposing the nose, exposing the nose and mouth, and taking off in 20 s steps. The subjects repeated this cycle ten times. During the entire measurement, data from all the sensors were recorded with 2 Hz frequency. The collected data were transmitted to a mobile device (iPad, Apple) every 5 min. In the mobile device, the data were processed and transmitted to the server (MIT Media Lab server).

Classification of face mask position

To develop models for the position of face mask classification, we used the k-means clustering method. This algorithm was written using the Python scikit-learn library. For training, an unlabelled dataset from five male and five female subjects were extracted from the server and fed into the model. For the training, we varied the number of clusters (k) to optimize the model and iterated the updates to find the most optimal centroids in the cluster that has the minimum distance between the centroids and data points. During training, k was varied from 1 to 10 for optimization. After training, each cluster was assigned to the position of the face mask by comparing with one labelled subject from the dataset. Two separately labelled subjects from each gender were then used as the testing set. The predicted cluster and its corresponding mask position classification were then compared with the labels using the F1 score. The F1 score was calculated as52

$${\mathrm{F}}1\;{\mathrm{score}} = \frac{{2 \times {\mathrm{Precision}} \times {\mathrm{Recall}}}}{{\mathrm{Precision}} + {\mathrm{Recall}}}.$$

Precision and recall were defined as follows53:

$$\begin{array}{l}{\mathrm{Precision}}\,({\mathrm{for}}\;{\mathrm{class}}\;{\mathrm{a}}) = \\\frac{{\left( {\mathrm{True}}\;{\mathrm{for}}\;{\mathrm{predicted}}\;{\mathrm{as}}\;{\mathrm{a}} \right)}}{{\left( {\mathrm{True}}\;{\mathrm{for}}\;{\mathrm{predicted}}\;{\mathrm{as}}\;{\mathrm{a}} \right) + \left( {\mathrm{False}}\;{\mathrm{for}}\;{\mathrm{predicted}}\;{\mathrm{as}}\;{\mathrm{a}} \right)}},\end{array}$$
$$\begin{array}{l}{\mathrm{Recall}}\left({\mathrm{for}}\;{\mathrm{class}}\;{\mathrm{a}} \right) =\\ \frac{{\left( {\mathrm{Ture}}\;{\mathrm{for}}\;{\mathrm{predicted}}\;{\mathrm{as}}\;{\mathrm{a}}\right)}}{{\left( {\mathrm{True}}\;{\mathrm{for}}\;{\mathrm{predicted}}\;{\mathrm{as}}\;{\mathrm{a}} \right) + \left( {\mathrm{False}}\;{\mathrm{for}}\;{\mathrm{not}}\;{\mathrm{predicted}}\;{\mathrm{as}}\;{\mathrm{a}} \right)}}.\end{array}$$

Reporting summary

Further information on research design is available in the Nature Research Reporting Summary linked to this article.