Back to paper library
Paper notesarXiv 2020CVPR 2020

SCN

A Miracle Cure?

Original paper

Suppressing Uncertainties for Large-Scale Facial Expression Recognition

Paper authors

Kai Wang · Xiaojiang Peng · Jianfei Yang · Shijian Lu · Yu Qiao

Publication
CVPR 2020Conference
First submitted to arXiv
arXiv:2002.10392
Cite this paper · BibTeX

The citation identifies the linked source version. It cites the original paper and its authors.

@misc{faceanalysisscn2020,
  title = {{Suppressing Uncertainties for Large-Scale Facial Expression Recognition}},
  author = {Kai Wang and Xiaojiang Peng and Jianfei Yang and Shijian Lu and Yu Qiao},
  year = {2020},
  eprint = {2002.10392},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.10392}
}
On this page

A man with wide eyes and an open mouth. RAF-DB labels this face "sadness."

The SCN paper uses this image as a demonstration. The authors deliberately changed its label to "neutral," and partway through training, the network changed the label on its own, to "surprise." Of the three labels, "neutral" is the wrong one planted by hand; as for which of the remaining two, sadness or surprise, is right, ten people looking at it might give several answers.

Expression datasets are full of faces like this. Expressions are ambiguous in themselves, photos may be blurry or occluded, and every annotator judges in their own way. Scrape hundreds of thousands of faces from the web to label, and inconsistent or even wrong labels are close to inevitable. Deep networks, meanwhile, have enough capacity to memorize every wrong one.

SCN (Self-Cure Network) wants the network to deal with this itself. The authors are Kai Wang and Xiaojiang Peng (co-first authors) and Yu Qiao of the Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences, along with Jianfei Yang and Shijian Lu of Nanyang Technological University in Singapore; the same group had built RAN the year before, which used facial-region attention to handle occlusion and pose. SCN has the network give every training image a "trustworthiness" score, uses it to suppress the influence of suspicious samples, and then relabels the samples the network is confident about within the most suspicious group. All three happen only during training; at inference it's just an ordinary ResNet-18.

Defining the Problem

The expression recognition exam

Facial expression recognition (FER) takes a cropped face and outputs an expression class. The most common setup has seven classes, the six basic expressions (surprise, fear, disgust, happiness, sadness, anger) plus neutral; some datasets add contempt, for eight.

This paper uses three datasets.

  • RAF-DB: about thirty thousand faces collected from the web, each voted on by about 40 trained annotators. Only the subset of basic expressions plus neutral is used, 12,271 training and 3,068 test images, reporting overall accuracy, the fraction of the test set answered correctly.
  • FERPlus: FER2013's 48×48 grayscale faces, revoted by 10 crowdsourced annotators, eight classes. 28,709 training images and 3,589 each for validation and test, reporting overall accuracy. SCN takes the top-voted class as the label.
  • AffectNet: over a million images gathered with search engines, of which about 450,000 were labeled by 12 trained annotators, the vast majority by only one person. Eight classes. The official validation set has 500 images per class and everyone uses it as the test set; since every class has the same count, "mean per-class accuracy" and overall accuracy are the same number.

The three datasets were annotated in different ways, so their labels differ in how far they can be trusted, which comes back when we read the experiments.

Where uncertainty comes from

The authors split the sources of uncertainty into four kinds. The expression itself is ambiguous, somewhere between surprise and fear, say; the image quality is poor, low-resolution, blurry, or blocked by a hand or glasses; the annotations are inconsistent, with different people giving the same face different answers; and the label is simply wrong.

These samples hurt training in three ways. The network overfits to these possibly wrong labels; memorizing them distorts the features it learns; and when the error rate is high, training may not even converge in the early stage.

Noisy labels already have plenty of approaches in general image classification. Some need a small set of known-clean data to evaluate the other labels; some estimate a transition matrix for "which class the true class gets flipped to"; MentorNet trains a separate teacher network to decide which samples the student should look at. On the expression side, IPA2LT deals with annotation inconsistency across datasets.

The most direct idea is to give each sample a weight αi\alpha_i, multiply it into the sample's loss, and let the network learn the weights. That fails, because the network only has to push every αi\alpha_i to 0 to make the loss 0. Methods like MentorNet get around this with alternating optimization, training the network with the weights fixed, then updating the weights with the network fixed.

SCN wants end-to-end training, no clean subset, and no extra computation at inference. How do you learn the weights so they don't all collapse to 0?

Solving the Problem

The big picture

Original Figure 2: the SCN flowchart. A column of faces on the left (some marked with red boxes as wrongly labeled, some with green dashed boxes as ambiguous expressions) goes into a blue trapezoid CNN backbone, producing features F1 to Fn. Below, the Self-Attention Importance Weighting Module uses one FC layer and a sigmoid to compute a weight for each face, such as 0.93, 0.46, 0.68, 0.87, 0.56, 0.64. Above, the Rank Regularization Module sorts the weights from high to low, splits them into a high group and a low group, and computes the two groups' means αH and αL, with RRLoss = max{0, margin − (αH − αL)} written underneath. On the right, the Relabeling Module takes a face labeled Happy and compares the maximum probability Pmax with the probability of the original label; if Pmax > PgtInd + δ, the label becomes Neutral. The weights also go back onto the FC logits for Re-Weighting, and finally a Softmax feeds the CE Loss.
Original Figure 2, Wang et al., from PDF page 4, arXiv license, scholarly quotation.

A batch of faces is first detected and aligned by MTCNN, resized to 224×224224\times224 and fed into ResNet-18, which yields one 512-dimensional feature per face from the last pooling layer. From there, three paths.

  1. Importance weighting: one fully connected layer plus a sigmoid computes a weight αi\alpha_i between 0 and 1 for each face, which multiplies the classifier's logits.
  2. Rank regularization: sort the batch's weights from high to low, split them into a high group and a low group, and require the two groups' means to differ by at least a margin.
  3. Relabeling: within the low group, if the network's most confident class beats the original label's probability by a clear margin, swap the label.

Weights on the logits

The feature of face ii is xi\mathbf x_i. The importance weight is equation (1) of the paper:

αi=σ(Wa⊤xi)\alpha_i=\sigma\left(\mathbf W_a^\top\mathbf x_i\right)

Wa\mathbf W_a is a fully connected layer from 512 dimensions to 1, and σ\sigma is the sigmoid. The paper calls it self-attention, but really each image computes a scalar from its own features; the samples in a batch don't exchange any information.

SCN multiplies this αi\alpha_i onto the logits. With Wj\mathbf W_j the classifier weights of class jj, the Logit-Weighted Cross-Entropy (WCE) of equation (2) in the paper is

LWCE=−1N∑i=1Nlog⁡eαiWyi⊤xi∑j=1CeαiWj⊤xi\mathcal L_{WCE}=-\frac1N\sum_{i=1}^{N}\log\frac{e^{\alpha_i\mathbf W_{y_i}^\top\mathbf x_i}}{\sum_{j=1}^{C}e^{\alpha_i\mathbf W_j^\top\mathbf x_i}}

yiy_i is the original label, CC the number of classes and NN the batch size. The formulation is borrowed from a paper on noise in face recognition (Hu et al.).

Why doesn't this collapse to 0? Break one image's loss apart. Write zj=Wj⊤xiz_j=\mathbf W_j^\top\mathbf x_i for class jj's original logit and pjp_j for the softmax probability after multiplying by α\alpha, dropping the subscript ii:

L=−αzy+log⁡∑j=1Ceαzj\mathcal L=-\alpha z_{y}+\log\sum_{j=1}^{C}e^{\alpha z_j}

As α\alpha approaches 0, every class's probability becomes 1/C1/C and the loss becomes ln⁡C\ln C; with seven classes that's ln⁡7≈1.95\ln7\approx1.95. Pushing it to 0 leaves the loss stuck at 1.95, not at 0.

Now differentiate with respect to α\alpha:

∂L∂α=∑j=1Cpjzj−zy\frac{\partial\mathcal L}{\partial\alpha}=\sum_{j=1}^{C}p_j z_j-z_{y}

The first term is the average of the logits under the current predicted distribution, and the second is the logit of the labeled class. If the labeled class's logit is above this average, the derivative is negative and a larger α\alpha lowers the loss; if it's below, the derivative is positive and the network will want to shrink α\alpha. So what α\alpha learns is, roughly, "whether the network currently agrees with this label."

Work it through for one face. Suppose the classifier gives some face seven logits (surprise 0.2, fear −0.5, disgust 0.1, happiness −1.0, sadness 2.0, anger 0.3, neutral 1.0), so the network thinks it looks most like sadness, then neutral. Keep these logits and try three labels:

A line chart drawn for this note. The horizontal axis is the importance weight α, from 0 to 1; the vertical axis is the WCE loss of this image, from 0 to 4. All three lines start from ln 7 ≈ 1.95 at α = 0. The blue line (labeled sadness, the network's top pick) falls all the way, reaching 0.69 at α = 1. The orange line (labeled neutral, the network's second pick) falls and then rises, with its minimum at α ≈ 0.78 and loss 1.67, and 1.69 at α = 1. The purple line (labeled happiness, the network's last pick) rises all the way, reaching 3.69 at α = 1. The seven logit values are listed at the top.
Drawn for this note from equation (2) of the paper; the logits are illustrative.
  • Labeled sadness: it agrees with the network's judgment, and the loss falls from 1.95 all the way to 0.69 at α=1\alpha=1; the larger α\alpha, the better.
  • Labeled neutral: the network's second choice, and the loss falls and then rises, with its minimum at α≈0.78\alpha\approx0.78.
  • Labeled happiness: the network disagrees most, and the loss rises from 1.95 all the way to 3.69; the network is best off pushing α\alpha to 0.

α\alpha also decides how hard this image pulls on the network. The gradient of WCE with respect to the logits is α(pj−1[j=y])\alpha(p_j-\mathbb 1[j=y]), with an extra factor of α\alpha in front. For the neutral label, the gradient's length is 0.97 at α=1\alpha=1 and only 0.27 at α=0.3\alpha=0.3. Low-weight samples naturally have less influence on the backbone and the classifier.

The paper states that WCE "has a positive correlation with" α\alpha. By the derivation above, the loss rises with α\alpha only when the label's logit is below the weighted average; when the label is the network's top pick, the two move in opposite directions all the way.

α\alpha is still there at inference, but it's positive, and multiplying every class's logit by it doesn't change which class is largest, so the predictions are the same as without this branch; the paper also says SCN adds no inference cost.

There's a loop here. The size of α\alpha depends on whether the classifier agrees with the label, and the classifier is trained on these very labels. Early in training the classifier is still weak, so neither its agreement nor its disagreement means much; and once the classifier memorizes a wrong label, α\alpha follows along and gives it a high score too.

Rank regularization

With WCE alone, the α\alpha values can land anywhere between 0 and 1, or all bunch together. The authors add a rule that forces them apart.

Sort a batch's NN weights from high to low; the top M=βNM=\beta N are the high group and the rest the low group, with means

αH=1M∑i=1MαiαL=1N−M∑i=M+1Nαi\begin{aligned} \alpha_H&=\frac1M\sum_{i=1}^{M}\alpha_i\\ \alpha_L&=\frac1{N-M}\sum_{i=M+1}^{N}\alpha_i \end{aligned}

The rank regularization loss (RR-Loss) is equation (3) of the paper:

LRR=max⁡{0, δ1−(αH−αL)}\mathcal L_{RR}=\max\{0,\ \delta_1-(\alpha_H-\alpha_L)\}

If the two means differ by less than δ1\delta_1, the shortfall is the penalty. The total loss is Lall=γLRR+(1−γ)LWCE\mathcal L_{all}=\gamma\mathcal L_{RR}+(1-\gamma)\mathcal L_{WCE}, with defaults γ=0.5\gamma=0.5, β=0.7\beta=0.7, δ1=0.15\delta_1=0.15.

Run it on the weights of the six faces in the flowchart: 0.93, 0.87, 0.68, 0.64, 0.56, 0.46. With β=0.7\beta=0.7, the official code takes ⌊6×0.7⌋=4\lfloor6\times0.7\rfloor=4 images as the high group:

αH=0.93+0.87+0.68+0.644=0.78αL=0.56+0.462=0.51\begin{aligned} \alpha_H&=\frac{0.93+0.87+0.68+0.64}{4}=0.78\\ \alpha_L&=\frac{0.56+0.46}{2}=0.51 \end{aligned}

The gap is 0.27, above 0.15, so LRR=0\mathcal L_{RR}=0 and this term does nothing at all for training.

Now take a batch whose weights are bunched together, 0.80, 0.78, 0.76, 0.75, 0.72, 0.70. αH=0.7725\alpha_H=0.7725 and αL=0.71\alpha_L=0.71, a gap of 0.0625, so the loss is 0.15−0.0625=0.08750.15-0.0625=0.0875. Here the gradient pushes each weight in the high group up with a force of 1/M1/M and pulls each in the low group down with a force of 1/(N−M)1/(N-M), prying the two groups apart. The paper's batch is 1,024, so the high group has about 716 images and the low group about 308.

This constraint looks only at the two groups' means and backs off as soon as the gap is big enough. In the official repo's issue #3 (March 2020), someone reported that RR-Loss is almost always 0, and the author replied "because of the constraint is so weak," adding that stronger ones would be explored later.

Relabeling

The low group holds two kinds of samples. One is genuinely ambiguous, where any label could be defended; the other is mislabeled, where the network is actually quite sure it's some other class. Relabeling handles the second kind, with equation (5) of the paper:

y′={lmax,Pmax−PgtInd>δ2lorg,otherwisey'=\begin{cases} l_{max}, & P_{max}-P_{gtInd}>\delta_2\\ l_{org}, & \text{otherwise} \end{cases}

PmaxP_{max} is the probability of the class with the highest softmax probability, and lmaxl_{max} is that class; PgtIndP_{gtInd} is the probability of the original label's class, and lorgl_{org} is the original label. δ2\delta_2 defaults to 0.2, starting from epoch 10. Changed labels are written back to the dataset and used for training from the next epoch on; if the change is right, the image's α\alpha recovers and it leaves the low group. The network cures its own illness, which is where the name "Self-Cure" comes from.

Back to the logits from before, with the label neutral. The probabilities here are computed by weighting with α\alpha and then applying softmax, which is how both the paper's flowchart and the official code do it.

  • α=1\alpha=1: sadness 0.501, neutral 0.184, a gap of 0.316, above 0.2, so the label changes to sadness.
  • α=0.5\alpha=0.5: sadness 0.300, neutral 0.182, a gap of 0.118, no change.
  • α=0.3\alpha=0.3: sadness 0.229, neutral 0.170, a gap of 0.059, no change.

The smaller α\alpha, the flatter the softmax and the more the gap between the two probabilities gets squeezed. Following this equation (this note's derivation), the samples pushed lowest are in fact the hardest to get past δ2\delta_2; the ones that get relabeled are mostly those that land in the low group without their α\alpha having been pushed too low.

Original Figure 3: three rows of eight RAF-DB faces each, with a weight in the upper left of each and a label underneath. The first row, trained with the original labels: weights 0.8019 (Sad), 0.7873 (Neutral), 0.7722 (Sad), 0.9855 (Fear), 0.9970 (Happy), 0.7708 (Surprise), 0.9876 (Happy), 0.9882 (Happy). The second row, with artificial noise and no relabeling: the same eight faces are changed to Neutral, Anger, Surprise, Disgust, Fear, Neutral, Sad, Neutral, with weights dropping to 0.3126 to 0.6686. The third row, with relabeling: the labels become Surprise, Neutral, Sad, Surprise, Happy, Sad, Happy, Happy, with weights back up to 0.6846 to 0.9968. The first face is the man with wide eyes and an open mouth.
Original Figure 3, Wang et al., from PDF page 6, arXiv license, scholarly quotation.

The face from the opening is in the first column of this figure. The first row is the result of training with RAF-DB's original labels, and all eight faces are weighted above 0.77. The second row randomly swaps labels for wrong ones (RAF-DB with 10% noise) without relabeling, and the weights drop to 0.31 to 0.67. The third row turns relabeling on, the labels get changed, and the weights return to above 0.68.

Five of the eight were changed back to their original labels. Columns one, four and six were changed to a different class, which the paper admits, saying the new labels are "also reasonable in visualization." The first column was originally labeled sadness and became surprise; the fourth column's fear became surprise; the sixth, a child's surprise, became sadness. Wide-eyed, open-mouthed faces are hard to sort between surprise and fear to begin with, and in the first column it's hard to say whether sadness or surprise is right.

The official code is written as follows, excerpted from src/train.py, with variable names as in the original file, a few lines merged, and comments added by this note:

Python
attention_weights, outputs = res18(imgs)  # alpha in (0, 1); outputs = alpha * fc(x)

# Rank Regularization
tops = int(batch_sz * beta)                                   # beta = 0.7
_, top_idx = torch.topk(attention_weights.squeeze(), tops)
_, down_idx = torch.topk(attention_weights.squeeze(), batch_sz - tops, largest=False)
high_mean = torch.mean(attention_weights[top_idx])
low_mean = torch.mean(attention_weights[down_idx])
diff = low_mean - high_mean + margin_1                        # delta_1 - (alpha_H - alpha_L)
RR_loss = diff if diff > 0 else 0.0
loss = criterion(outputs, targets) + RR_loss                  # CE on the alpha-weighted logits

# Relabel samples (from epoch relabel_epoch = 10)
sm = torch.softmax(outputs, dim=1)
Pmax, predicted_labels = torch.max(sm, 1)
Pgt = torch.gather(sm, 1, targets.view(-1, 1)).squeeze()
update_idx = (Pmax - Pgt > margin_2).nonzero().squeeze()      # every sample in the batch
label_idx = indexes[update_idx]
train_loader.dataset.label[label_idx.cpu().numpy()] = predicted_labels[update_idx].cpu().numpy()

criterion is ordinary cross-entropy, fed logits already multiplied by α\alpha, and the sum of the two terms is twice the paper's loss at γ=0.5\gamma=0.5, so the ratio is the same. The relabeling part checks every image in the whole batch, not only those in down_idx. In December 2020 someone pointed this out in issue #33, and the author replied in a comment with a one-line fix that takes the intersection with np.intersect1d(down_idx, update_idx), but never committed it to the repo. In March 2024 it was asked again in issue #83, and the author replied "Indeed... it's been a while," asking whether the asker had tried both versions. The asker's experience was that relabeling only the low group was actually worse, and relabeling everything was better but unstable.

Training setup

  • MTCNN detection and alignment, resized to 224×224224\times224.
  • ResNet-18, pretrained on the MS-Celeb-1M face recognition data, with features from the last pooling layer.
  • Eight 2080 Ti GPUs, batch 1,024, learning rate 0.1, divided by 10 at epochs 15 and 30, 40 epochs in total. The paper doesn't name the optimizer.
  • β=0.7\beta=0.7, δ1=0.15\delta_1=0.15, γ=0.5\gamma=0.5, δ2=0.2\delta_2=0.2, with relabeling starting at epoch 10.

There's also WebEmotion, collected by the authors themselves. They searched YouTube with 40 emotion-related keywords paired with 45 country names and 6 age words (baby, lady, elderly and so on), took the first 20 videos under 4 minutes for each combination, 41,339 videos in all, then cut them into 200,149 clips, each with at least 5 seconds of a face MTCNN can detect. The classes are the same eight as FERPlus, and the labels are simply the classes the search keywords map to; "happy," "funny" and "kawaii," for example, all count as happiness. Labels like these are extremely noisy, and the authors use the data only for pretraining.

Discussion

Artificial noise

Of the four kinds of uncertainty, only "mislabeled" can be quantified, so the authors manufactured wrong labels on the three datasets. They randomly picked 10%, 20% and 30% of each class's training images, swapped their labels for another class, and compared two settings: training from scratch, and fine-tuning from weights pretrained on MS-Celeb-1M.

Trained from scratch, the baseline is quickly dragged down by the noise. On RAF-DB with 30% noise the baseline falls to 46.81% while SCN gets 60.61%, a gap of 13.80 percentage points; under the same conditions, the curriculum-learning CurriculumNet gets 57.52% and MetaCleaner 58.89%. The gaps on AffectNet and FERPlus are much smaller, only 1.07 and 1.91 points respectively.

With pretraining, every number goes up a notch and the gaps shrink:

DatasetNoiseBaselineSCN
RAF-DB10%80.8182.18
RAF-DB20%78.1880.10
RAF-DB30%75.2677.46
AffectNet10%57.1858.58
AffectNet20%56.1557.25
AffectNet30%52.5855.05
FERPlus10%83.3984.28
FERPlus20%82.2483.17
FERPlus30%79.3482.47

Compiled from Table 2 of the paper, ResNet-18 pretrained on MS-Celeb-1M, accuracy % (mean per-class for AffectNet).

The gains run from 0.9 to 3.1 percentage points, and broadly, the more noise, the more SCN helps.

The authors explain the especially large gain on RAF-DB from scratch by RAF-DB having compound expressions and crowdsourced annotation from 40 people, which makes it less consistent to begin with. As listed earlier, FERPlus is crowdsourced too, with 10 people per image, and AffectNet uses trained annotators, but only one per image. Explaining the gaps among the three by annotation method still lacks a control.

How the numbers in this table were picked, the paper doesn't say. In April 2022 someone asked in issue #69, and the author confirmed that what's reported is the epoch with the highest test accuracy during training. Two years later, EAC (ECCV 2022, Beijing University of Posts and Telecommunications) generated its own noise, reran SCN, and took the average of the last 5 epochs instead. On RAF-DB at the three noise levels, EAC's rerun of SCN gives 82.15, 79.79 and 77.45, almost identical to the SCN paper's 82.18, 80.10 and 77.46, and the baselines match too. On the same table, RUL (NeurIPS 2021) gets 86.17 at 10% noise and EAC itself 88.02, both 4 to 6 percentage points above SCN.

EAC also explains why SCN didn't help more. It files SCN under "sample selection" methods, which rely on the assumption that samples with large losses are the noisy ones and can't tell hard samples from mislabeled ones. In EAC's visualization, a surprised face mislabeled as sadness gets memorized by SCN through a small patch of furrowed-brow features; after 60 epochs of training, many mislabeled samples under SCN still have losses close to 0, meaning the model has memorized these wrong labels, and they haven't been relabeled either.

Original data

Artificial noise only simulates "mislabeled." The authors then ran on the original datasets to see whether SCN can handle real uncertainty:

DatasetSettingBaselineSCN
RAF-DBScratch72.0078.31
RAF-DBPretrained84.2087.03
AffectNetScratch46.5847.28
AffectNetPretrained58.560.23
FERPlusScratch82.483.42
FERPlusPretrained86.8088.01

Compiled from Table 4 of the paper, accuracy %.

Trained from scratch, RAF-DB gains 6.31 percentage points, far more than the other two; with pretraining the gains are 2.83, 1.73 and 1.21. The authors picked out the ten RAF-DB images with the lowest weights; most are poor quality or occluded, and their original labels are mostly surprise and neutral.

The effect of WebEmotion pretraining was also tested on the original data. From scratch the results are 72.00, 46.58 and 82.4 (RAF-DB, AffectNet, FERPlus); pretrained on WebEmotion first and fine-tuned without SCN, they become 78.97, 56.43 and 84.20; fine-tuning with SCN gives 80.42, 57.23 and 85.13; and using SCN in pretraining as well reaches 82.45, 58.45 and 85.97. This keyword-labeled video data brings nearly 10 percentage points on AffectNet, and turning SCN on during pretraining adds another 0.8 to 2 points.

Ablations

What each of the three modules does, measured on the original RAF-DB data:

WeightRankRelabelScratchPretrained
–––72.0084.20
––✓71.2583.78
–✓–74.1585.14
✓––76.2686.09
✓✓–76.5786.63
✓✓✓78.3187.03

Compiled from Table 5 of the paper, accuracy %.

  1. Weighting does the heavy lifting. WCE alone takes training from scratch from 72.00 to 76.26, and pretrained from 84.20 to 86.09.
  2. Relabeling alone hurts. Turning relabeling on directly over the baseline drops both settings a little. The authors explain that many of the baseline model's relabelings are wrong, and weighting and ranking are needed first to gather the suspicious samples into the low group.
  3. Ranking on top of weighting adds only 0.3 to 0.5 percentage points. Ranking alone adds 2.15 from scratch and 0.94 pretrained, but without weighting, α\alpha appears only in RR-Loss, and the paper doesn't explain how it affects classification in that case.

The ratio γ\gamma between the two losses was tried too. 0.5 is best (78.31); raising RR-Loss's share to 0.8 drops it to 71.75, below the baseline.

Original Figure 5: three line charts on RAF-DB, all with accuracy on the vertical axis. The left chart's horizontal axis is the margin δ1, from 0 to 0.3, plus a Learned point: the blue line (no noise) peaks at 78.31% at 0.15, with about 76.6% to 77.8% on either side, and a learnable δ1 gives 77.76%; the red line (10% noise) peaks at 70.26% at 0.15, and the learnable one gives 69.45%. The middle chart's horizontal axis is δ2, from 0 to 0.5: about 69.6% at δ2 = 0, about 76% at 0.1, a peak of 78.31% at 0.2, then flat at about 77%. The right chart's horizontal axis is β, from 0.9 to 0.5: the blue line peaks at 78.31% at 0.7 and drops to about 74.6% at 0.5; the red line peaks at 70.26% at 0.7, with about 68% on either side.
Original Figure 5, Wang et al., from PDF page 8, arXiv license, scholarly quotation.

All three hyperparameters were swept in the from-scratch setting, and the numbers correspond to the earlier 78.31 (original data) and 70.26 (10% noise).

The left chart is the ranking margin δ1\delta_1. Between 0 and 0.3 the spread is under 2 percentage points without noise and about 2.7 with 10% noise, and both lines are best at 0.15; made a learnable parameter, it converges to about 0.142, with an accuracy of 77.76%, slightly below the hand-tuned value.

The middle chart is the relabeling threshold δ2\delta_2, which matters most. δ2=0\delta_2=0 means relabeling whenever the network's top pick differs from the original label, and accuracy drops below 70%, worse than the 76.57 with no relabeling at all; 0.2 is best, and beyond that, relabeling happens less and less and the result approaches no relabeling.

The right chart is the high group's share β\beta. 0.7 is best, and lowering it to 0.5 (treating half the data as suspicious) falls to about 74.6%. The authors' explanation is that with β\beta too large almost no samples count as uncertain, and with it too small, too many normal samples are treated as suspicious.

Against the methods of the time

MethodRAF-DBAffectNetFERPlus
RAN86.9059.589.16
SCN87.0360.2388.01
SCN†88.14––
SCN‡––89.35

Excerpted from Table 7 of the paper, accuracy %. SCN† is trained on RAF-DB and AffectNet combined, and SCN‡ switches the backbone to IR50. Both rows in the AffectNet column use oversampling; RAN's FERPlus entry is the version with a VGG16 backbone trained on label distributions.

The three numbers in the abstract are 88.14%, 60.23% and 89.35%, and each comes with a condition. RAF-DB's 88.14 is from training on RAF-DB and AffectNet combined; RAF-DB alone gives 87.03. AffectNet's 60.23 uses oversampling to handle the class imbalance. FERPlus's 89.35 switches the backbone to IR50, the one ArcFace uses; ResNet-18 gives 88.01, below RAN's VGG16 version on the same table (89.16). RAN is the same authors' method from the year before, which needs several facial regions cropped at inference; SCN's argument is comparable accuracy with no extra computation at inference.

Official code and community reports

The official code is at kaiwang960112/Self-Cure-Network, with no license file; the author said in an issue that it may be used for academic purposes.

The training code in the official repo was rewritten after the fact. In March 2020 someone said in issue #7 that they couldn't reproduce the results, and the author replied that the lab had switched clusters at the end of the year, the original code sat on a hard drive in Shenzhen that couldn't be reached, and they had rewritten a version themselves. The train.py released in July was written by the author's friend nzhq, and the README says "open the SCN code and reproduce the experiments result." So the differences seen above go beyond the scope of relabeling; there are also these:

  • Training recipe. Defaults of batch 64, Adam, the learning rate multiplied by 0.9 every epoch, and 70 epochs of training; the README suggests changing δ1\delta_1 to 0.07 for batch 64. The paper uses batch 1,024, learning rate 0.1 and 40 epochs.
  • Data augmentation. The code has random erasing, then with probability one half either a horizontal flip or added Gaussian noise. The paper doesn't mention any of it, and in issue #5 (March 2020) the author answered "We don't use data augmentation in the training stage."
  • The pretrained weights never load. The code uses an ImageNet-pretrained ResNet-18 by default; when --pretrained points to the MS-Celeb-1M weights the author provides, the parameter names in the weight file are module.conv1… while the model's are features.0…, so load_state_dict(strict=False) raises no error and loads nothing at all. The code prints "Loaded params num," but that counter is written after the assignment and always equals the total (marking its own homework). issue #49, #51 and #56 ran into it one after another, and the author's reply every time was that the names "differ by one module."; it took the asker in issue #81, at the end of 2022, printing the parameters before and after loading to confirm that nothing had changed at all.

How strong the baseline is has been questioned as well. In issue #58, someone trained a plain ResNet-18 with only the MS-Celeb-1M weights the author provides and reached 88% on RAF-DB; another added flips, color jitter, rotation and random erasing and reached 89.3%. The paper's pretrained baseline is 84.20% and SCN 87.03%; the author's reply was "Impressive~". issue #68 also found that switching to a different set of MS-Celeb-1M weights moves the baseline from 85% to over 88%; the asker in issue #81 later guessed that the 85% case was exactly because the weights hadn't loaded. The author's reply in July 2022 was candid. Using face pretraining or not, and which weights, really does change performance; not every group releases its weights, so SOTA comparisons "really do get messy," and the author suggested everyone compare with ImageNet-1K pretraining instead.

α\alpha itself isn't easy to control either. In issue #37, training AffectNet with ResNet-50 left every α\alpha near 0 and the gap between the two groups near 0 too; issue #77 went the other way, with every α\alpha heading toward 1 after one epoch. As derived earlier, the direction of α\alpha depends on whether the classifier agrees with the label; when the classifier's state shifts, α\alpha can drift the same way en masse.

What's left are a few things that never came out. The paper said WebEmotion would be made public; in November 2020 the author said in issue #30 that, because of YouTube's policy, they'd release a download script instead, and in March 2021 replied "The code will be coming soon" (it's been coming ever since). Of the artificial-noise label files, only 10% and 20% were released; for the 30% one, the author said in November 2021 that they had moved to the National University of Singapore, no longer had the original file, and asked the requester to generate it themselves.

Conclusion

SCN takes on an old problem of expression data, annotations that can't be trusted in the first place. It learns a weight for each training image, splits them into high and low groups with rank regularization, and relabels the samples in the low group that the network is confident about; at inference it's still a ResNet-18. On RAF-DB the pretrained version goes from 84.20% to 87.03%; with 30% wrong labels added artificially, from 75.26% to 77.46%.

Reproducing it calls for extra care. The official code is a rewrite done after the fact, the MS-Celeb-1M weights never actually load, and relabeling applies to the whole batch; in December 2025 the author replied that those weights were "probably gone."

Two years later EAC reran it at 10% noise and SCN's numbers held up; RUL and EAC, which later took on noisy labels, both put it in their comparison tables.