Back to previous page

Project developed during my M.Sc. studies

Wafer Defect Patterns Hidden in Binary Rows

Python · PyTorch · SimCLR · scikit-learn · SciPy · Winter semester 2025/2026

For a course homework at the Faculty of Information Technology of CTU in Prague, part of my PRG.AI Minor, we received an industrial dataset with no labels: 20,064 training rows and 80 test rows, each with 2,898 binary columns. We could use the 80 test rows, but not their labels; the task was to classify them into categories without knowing what the categories were or how many there were, and the score was the number of correct answers divided by 80. Nobody said the rows were images. I noticed that the column names, from D1_16 to D68_36, were row and column coordinates, so I reshaped every row into a 68 × 53 wafer map with one cell per die. Of the 3,604 grid positions, 706 have no column: 632 lie outside the wafer and 74 are holes inside it.

The video covers the rules of the homework, the reshape of binary rows into wafer maps and their holes, a sparse view of the table, self-supervised training with SimCLR and its NT-Xent loss, the central finding of the SimCLR paper and a comparison with it, K-Means clustering with 2-D and 3-D PCA views and their explained variance, a visual reading of the clusters with the wafers per class, and the anonymized leaderboard. Music and sound effects: original, synthesized for this video. Visuals include wafer maps drawn from the homework data, the loss of the real training run and a public-domain photo of a silicon wafer (Ploum's, Wikimedia Commons).

Only 1.7 % of the training values are 1; to explore the table, I checked that it was strictly binary and built sparse CSR and CSC versions of it. Then, on my own initiative and with what I had learned in other courses of my master's, I trained SimCLR, a self-supervised method, on the 20,064 training maps: a small CNN encoder f(·) and a projection head g(·), trained together from scratch with the NT-Xent contrastive loss, with random crops and flips as augmentations. After training, g(·) is dropped and the frozen encoder gives each wafer a 128-dimensional feature h. Following the central finding of the SimCLR paper (T. Chen, S. Kornblith, M. Norouzi and G. Hinton, ICML 2020), K-Means runs on h rather than on the projection z, and I chose 5 clusters because the number of categories was never given. That submission scored 0.813 (65 of the 80 test wafers right), the highest score in the class and 0.063 above second place.

The test wafers were far more defective than the training ones (11.4 % of the dies against 1.7 %), and K-Means put 73 of the 80 in one cluster. To read the clusters, I inspected the 80 test maps by eye and found five visual families (radial, edge and mixed, horizontal streaks, local block and random scatter); they agree with K-Means on 58 of the 80 wafers. Since the number of categories was never given, the official labels may group some of these families together.