

In the current pandemic of coronavirus disease (COVID-19), an effective way to prevent the transmission and infection of the virus is the proper use of face masks. However, the different types of masks provide different degrees of protection. For instance, valved masks protect the user but do not help to stop the transmission. Hence, the automatic recognition of face mask types may benefit applications that control access to facilities where a certain facepiece is required. In this paper, we propose a Twitter mining framework to gather a large-scale dataset of masked faces suitable to train deep learning-based models for face mask recognition. We employ a keyword-based selection where non-face images are discarded by an efficient face detector (Retinaface). Finally, we train a state-of-the-art CNN architecture (ConvNeXt) for recognizing the wearing mask. We also present a brief analysis of more than two million image-based tweets acquired over two years since the beginning of the pandemic. The code of the proposed framework and a preliminary dataset of more than 10K faces (manually annotated into unmasked, surgical, cloth, respirators, and valved masks) are available on github.com/GibranBenitez/FaceMask Twitter.