{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "slideshow": { "slide_type": "skip" }, "tags": [ "hide-input" ] }, "outputs": [], "source": [ "%%html\n", "\n", "\n", "\n", "" ] }, { "cell_type": "markdown", "metadata": { "tags": [ "remove-cell" ] }, "source": [ "---\n", "license:\n", " code: MIT\n", " content: CC-BY-4.0\n", "github: https://github.com/ocademy-ai/machine-learning\n", "venue: By Ocademy\n", "open_access: true\n", "bibliography:\n", " - https://raw.githubusercontent.com/ocademy-ai/machine-learning/main/open-machine-learning-jupyter-book/references.bib\n", "---" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": { "colab_type": "text", "id": "0MRC0e0KhQ0S", "slideshow": { "slide_type": "slide" } }, "source": [ "# Convolutional Neural Network" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## The Brain\n", "\n", "- When we see something, we label every object based on what we have learned in the past\n", "- While vision starts in the eyes, the actual interpretation of what we see happens in the brain, in the primary visual cortex\n", "- The deeply complex hierarchical structure of neurons and connections in the brain play a major role in this process of remembering and labelling objects\n", "\n", "![](../images/cnn/brain.png)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## From Brain to Convolutional Neural Networks\n", "- Convolutional Neural Networks are inspired by the brain\n", "- The simple cells activate, for example, when they identify basic shapes as lines in a fixed area and a specific angle. The complex cells have larger receptive fields and their output is not sensitive to the specific position in the field\n", "- The concept of hierarchy plays a significant role in the brain\n", "- In 1998, Convolutional Neural Networks were introduced in a paper by Bengio, Le Cun, Bottou and Haffner" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## How a computer sees an image\n", "\n", "![](../images/cnn/cat.png)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Kernel (image processing)\n", "\n", "- [Wikipedia](https://en.wikipedia.org/wiki/Kernel_(image_processing))\n", "\n", "![](../images/cnn/kernel.png)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## CNN architecture (1/3)\n", "\n", "![](../images/cnn/cnn-a1.png)\n" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## CNN architecture (2/3)\n", "\n", "![](../images/cnn/cnn-a2.png)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## CNN architecture (3/3)\n", "\n", "![](../images/cnn/cnn-a3.png)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Time to play!\n", "\n", "- https://poloclub.github.io/cnn-explainer/\n", "- https://adamharley.com/nn_vis/" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Feature extraction \n", "\n", "- https://ocademy-ai.github.io/machine-learning/deep-learning/CNN.html\n", "\n", "![](../images/cnn/cnn-k1.gif)\n", "\n", "[source](https://medium.com/@muhammadshoaibali/flattening-cnn-layers-for-neural-network-694a232eda6a)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Padding\n", "\n", "![](../images/cnn/padding.gif)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Pooling\n", "\n", "![](../images/cnn/pooling.png)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Flattening\n", "\n", "![](../images/cnn/cnn-flattening-1.webp)\n", "\n", "[source](https://medium.com/@muhammadshoaibali/flattening-cnn-layers-for-neural-network-694a232eda6a)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Full Connection\n", "\n", "![](../images/cnn/cnn-fc-1.gif)\n", "\n", "[source](https://www.linkedin.com/pulse/intro-convolutional-neural-networks-cnn-lamiae-hana/)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Acknowledgement\n", "\n", "https://www.freecodecamp.org/news/an-intuitive-guide-to-convolutional-neural-networks-260c2de0a050/" ] } ], "metadata": { "celltoolbar": "Slideshow", "colab": { "authorship_tag": "ABX9TyOsvB/iqEjYj3VN6C/JbvkE", "collapsed_sections": [], "machine_shape": "hm", "name": "logistic_regression.ipynb", "provenance": [], "toc_visible": true }, "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" } }, "nbformat": 4, "nbformat_minor": 1 }