Artificial Intelligence Applications in Engineering (MUH-920), week 11 of 14: interactive lab
Prof. Dr. Utku Kose, Süleyman Demirel University
Part A lets a greyscale image be drawn or generated, applies a chosen or hand-edited 3 by 3 filter, and shows the feature map, its ReLU and a 2 by 2 max pooling, which are the three steps of a convolutional block [1]. Part B computes such a block product by product, and Part C computes output sizes, parameter counts and receptive fields for a stack of convolution and pooling layers. Part D produces the eight mirrored and rotated versions of an image, and Part E computes the softmax, the cross-entropy and the gradients of a new classifier head [2]. Part F measures boxes, suppression and segmentation masks [3, 4], Part G computes a Grad-CAM heatmap by hand [5], and Part H shows how a perturbation too small to see flips a linear detector [6].
The default input is the 4 by 4 patch of the worked example with the filter for dark vertical lines and the bias −0.5. Every value of the input and of the filter can be edited. Clicking a value of the feature map writes out the nine products of its window, the bias, the ReLU and the pooling window that contains it, and padding or a stride of 2 shows how the output size changes [1].
Click a value of the feature map to see its sum.
An image is rotated by quarter turns, with and without mirroring, which gives the eight versions used for augmentation in the notebook. A clicked pixel is followed through all versions with the formula for its new position, and a ninth panel changes contrast and brightness with clipping [7].
Click a pixel of the original to follow it through the eight versions.
A new head of two classes receives three features. The panel computes the scores, the exponentials, the softmax probabilities and the cross-entropy, then the gradients of the scores, weights and biases, and applies a gradient step; the defaults reproduce the scores 0.4 and 1.9 of the worked example. The second panel counts the parameters of a frozen network with a new head [2, 8].
The first panel computes the intersection over union of a true and a predicted box, the second runs non-maximum suppression on a list of boxes with confidences, and the third compares a predicted mask with the true mask and measures the area, length and mean width of a crack; the length is taken as the number of rows the crack spans, which suits cracks that run from top to bottom [3, 4].
Click a cell to cycle through background, true crack only, predicted crack only, and both.
The maps and gradients of the worked example are the default. The panel averages the gradients of every map into its weight, sums the weighted maps, applies ReLU and normalises, and lays the enlarged heatmap over an image of a crack. The second preset adds a map that fires on a timestamp in the corner and receives a large gradient, so the heatmap reveals a classifier that is right for the wrong reason [5].
A linear detector scores an image of a crack with weights of equal size, negative on the band where it expects the crack and positive elsewhere. Each pixel changes by ε against the sign of its weight. The perturbation is invisible in the perturbed image, yet the score falls by ε times the sum of the weight sizes, as in the worked example [6].
Six questions with instant feedback. Rate your confidence before checking each answer.
Answers are saved in this browser only. The export creates a Markdown learning log for your portfolio.
After the export, continue with the discipline challenge and the weekly task in the week overview.
[1] LeCun, Y., Bottou, L., Bengio, Y., & Haffner, P. (1998). Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11), 2278-2324. https://doi.org/10.1109/5.726791
[2] Yosinski, J., Clune, J., Bengio, Y., & Lipson, H. (2014). How transferable are features in deep neural networks?. In Advances in Neural Information Processing Systems 27 (pp. 3320-3328). https://arxiv.org/abs/1411.1792
[3] Redmon, J., Divvala, S., Girshick, R., & Farhadi, A. (2016). You only look once: Unified, real-time object detection. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (pp. 779-788). https://doi.org/10.1109/CVPR.2016.91
[4] Ronneberger, O., Fischer, P., & Brox, T. (2015). U-Net: Convolutional networks for biomedical image segmentation. In Medical Image Computing and Computer-Assisted Intervention (MICCAI 2015), LNCS 9351 (pp. 234-241). Springer. https://doi.org/10.1007/978-3-319-24574-4_28
[5] Selvaraju, R. R., Cogswell, M., Das, A., Vedantam, R., Parikh, D., & Batra, D. (2017). Grad-CAM: Visual explanations from deep networks via gradient-based localization. In 2017 IEEE International Conference on Computer Vision (ICCV) (pp. 618-626). https://doi.org/10.1109/ICCV.2017.74
[6] Kose, U. (2019). Techniques for adversarial examples threatening the safety of artificial intelligence based systems. In I. International Science and Innovation Congress (INSI Congress 2019). Pamukkale, Denizli, Türkiye. https://arxiv.org/abs/1910.06907
[7] Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2017). ImageNet classification with deep convolutional neural networks. Communications of the ACM, 60(6), 84-90. https://doi.org/10.1145/3065386
[8] He, K., Zhang, X., Ren, S., & Sun, J. (2016). Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (pp. 770-778). https://doi.org/10.1109/CVPR.2016.90