Face Mask computer-vision training dataset

Source Notebook

Images of people's faces with a face mask and without a face mask

Details

This dataset contains 440 images of people's faces.
The images are divided into two equaly distributed classes: with_mask and without_mask.
The images have a high variability of the resolution.

(440 elements)

Examples

Basic Examples

In[1]:=
Thread[Image[Keys@#, "ImageSize" -> 50] -> Values@#] &@
   RandomSample[#, 5] &@ResourceData[\!\(\*
TagBox["\"\<Face Mask computer-vision training dataset\>\"",
#& ,
BoxID -> "ResourceTag-Face Mask computer-vision training dataset-Input",
AutoDelete->True]\)]
Out[1]=

Visualizations (1) 

Distribution of classes:

In[2]:=
ResourceData[\!\(\*
TagBox["\"\<Face Mask computer-vision training dataset\>\"",
#& ,
BoxID -> "ResourceTag-Face Mask computer-vision training dataset-Input",
AutoDelete->True]\)] // Counts[Values[#]] & // BarChart[#, LabelingFunction -> Above, "PlotLabel" -> "Distribution of classes", ChartStyle -> "DarkRainbow", ChartLabels -> {"with mask", "without mask"}, BarSpacing -> Large] &
Out[2]=

Analysis (6) 

Obtain a random sample of training and testing data:

In[3]:=
{train, test} = ResourceFunction["TrainTestSplit"][ResourceData[\!\(\*
TagBox["\"\<Face Mask computer-vision training dataset\>\"",
#& ,
BoxID -> "ResourceTag-Face Mask computer-vision training dataset-Input",
AutoDelete->True]\)]];

Make BarChart for training and test data:

In[4]:=
Counts[Values[#]] & /@ {train, test} // BarChart[#, LabelingFunction -> Above, "PlotLabel" -> "Distribution of training and testing data", ChartStyle -> "DarkRainbow", ChartLabels -> {Placed[{"train", "test"}, Above], Placed[{"with mask", "without mask"}, Below]}, BarSpacing -> Large] &
Out[4]=

Train a classifier:

In[5]:=
c = Classify[train]
Out[5]=

Obtain general information about the classifier:

In[6]:=
Information[c]
Out[6]=

Generate a ClassifierMeasurementsObject of the classifier with the test set:

In[7]:=
cm = ClassifierMeasurements[c, test]
Out[7]=

Visualize the accuracy of the classifier:

In[8]:=
cm["ConfusionMatrixPlot"]
Out[8]=

WolframSpecialProjects, "Face Mask computer-vision training dataset" from the Wolfram Data Repository (2022)  

License Information

Public

Data Resource History

Source Metadata

Publisher Information