<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Semih Yagcioglu on Medium]]></title>
        <description><![CDATA[Stories by Semih Yagcioglu on Medium]]></description>
        <link>https://medium.com/@semihyagcioglu?source=rss-5cec208db040------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EGBUKXKPa_XVO5PDTV_UsA.jpeg</url>
            <title>Stories by Semih Yagcioglu on Medium</title>
            <link>https://medium.com/@semihyagcioglu?source=rss-5cec208db040------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 12:50:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@semihyagcioglu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What’s Hot In Your Field]]></title>
            <link>https://medium.com/@semihyagcioglu/whats-hot-in-your-field-8377c7cdd54e?source=rss-5cec208db040------2</link>
            <guid isPermaLink="false">https://medium.com/p/8377c7cdd54e</guid>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Semih Yagcioglu]]></dc:creator>
            <pubDate>Tue, 12 Sep 2017 20:56:19 GMT</pubDate>
            <atom:updated>2017-09-12T21:51:18.022Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SYrivcrupFIe4AdwGfN1Pg.png" /><figcaption>From Apple Special Event. September 12, 2017.</figcaption></figure><p>Finding an interesting problem to solve is quite important in research. It is also important that you know what other researchers find interesting. Mainly to understand where your field is moving. But there are several other practical reasons why it is important to know what’s hot in your field. For example you will have more opportunity to collaborate with other researchers, more datasets and code will be released and more challenges and workshops will be organised and more funding will be available for hotter problems.</p><p>Although arXiv has become a venue itself for Computer Science, the signal to noise ratio is still quite low. So IMHO, conferences are the best places to look for quality work. But with hundreds of papers getting accepted, it is not very easy to go over the whole paper list for even one conference. Considering there might be more than one conference you follow, even a simple task such as browsing the interesting papers might take plenty of time. So I’ve decided to write a script to do that for me.</p><p>I have been using it for some time and decided to share it. It’s not perfect, or there is nothing fancy going on, but it does the job for me. Any way here’s the code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/01297cf2dddb05330fcd82e9c671d7b2/href">https://medium.com/media/01297cf2dddb05330fcd82e9c671d7b2/href</a></iframe><p>Now let’s see how it works. NIPS 2017 accepted papers are <a href="https://nips.cc/Conferences/2017/AcceptedPapersInitial">recently announced</a>. Here’s the output for NIPS 2017:</p><pre>There are 680 accepted papers<br>--------------------------------------------------<br>neural networks                         34<br>reinforcement learning                  24<br>deep learning                           12<br>variational inference                   11<br>deep neural networks                    11<br>deep neural                             11<br>generative adversarial                  10<br>gaussian processes                      10<br>gradient descent                        9<br>neural network                          9<br>large scale                             8<br>deep reinforcement                      7<br>graphical models                        7<br>deep reinforcement learning             7<br>coordinate descent                      7<br>online learning                         7<br>recurrent neural                        7<br>adversarial networks                    6<br>semi supervised                         6<br>multi agent                             6</pre><pre>There are 7 interesting papers<br>--------------------------------------------------<br>multimodal learning and reasoning for visual question answering<br>avoiding discrimination through causal reasoning<br>question asking as program generation<br>what-if reasoning using counterfactual gaussian processes<br>differentiable learning of logical rules for knowledge base reasoning<br>high-order attention models for visual question answering<br>a simple neural network module for relational reasoning</pre><p>There are a lot of <strong>neural networks</strong>, right :D That’s one way to look at it, but <strong>variational inference</strong> and <strong>gaussian processes</strong> are getting more popular, I guess.</p><p>This time let’s look at what <a href="http://emnlp2017.net/accepted-papers.html">EMNLP 2017</a> has to say. Here’s the output:</p><pre>There are 344 accepted papers<br>--------------------------------------------------<br>machine translation                     29<br>neural machine                          23<br>neural machine translation              23<br>neural networks                         11<br>reinforcement learning                  9<br>relation extraction                     9<br>word embeddings                         8<br>semantic parsing                        7<br>based neural                            7<br>question answering                      7<br>sentiment analysis                      6<br>fine grained                            6<br>dependency parsing                      5<br>cross lingual                           5<br>attention based                         5<br>natural language                        5<br>entity recognition                      4<br>language models                         4<br>sequence models                         4<br>sense disambiguation                    4</pre><pre>There are 25 interesting papers<br>--------------------------------------------------<br>machine translation, it&#39;s a question of style, innit? the case of english tag questions<br>identifying where to focus in reading comprehension for neural question generation<br>what is it? disambiguating the different readings of the pronoun ‘it’<br>learning what to read: focused machine reading<br>recovering question answering errors via query revision<br>an end-to-end deep framework for answer triggering with a novel group-level objective<br>story comprehension for predicting what happens next<br>learning to paraphrase for question answering<br>question generation for question answering<br>an analysis of eye-movements during reading for the detection of mild cognitive impairment<br>two-stage synthesis networks for transfer learning in machine comprehension<br>a question answering approach for emotion cause extraction<br>accurate supervised and semi-supervised machine reading for long documents<br>adversarial examples for evaluating reading comprehension systems<br>race: large-scale reading comprehension dataset from examinations<br>reasoning with heterogeneous knowledge for commonsense machine comprehension<br>structural embedding of syntactic trees for machine comprehension<br>world knowledge for reading comprehension: rare entity prediction with hierarchical lstms using external descriptions<br>the promise of premise: harnessing question premises in visual question answering<br>temporal information extraction for question answering using syntactic dependencies in an lstm-based architecture<br>latent space embedding for retrieval in question-answer archives<br>deeppath: a reinforcement learning method for knowledge graph reasoning<br>document-level multi-aspect sentiment classification as machine comprehension<br>asking too much? the rhetorical role of questions in political discourse<br>quint: interpretable question answering over knowledge bases</pre><p>This time a lot of <strong>machine translation</strong>, right :)</p><p>Topics to watch are <strong>relation extraction</strong>, <strong>semantic parsing</strong>, <strong>question answering</strong> and <strong>cross lingual</strong>.</p><p>You might notice that there are 344 papers accepted, my n-gram match script filtered the whole list for me down to 25, which is somewhat more manageable. Also EMNLP people seems to prefer longer titles :D</p><p>Finally, let’s look at what <a href="http://cvpr2017.thecvf.com/">CVPR 2017</a> has to say:</p><pre>There are 784 accepted papers<br>--------------------------------------------------<br>neural networks                         31<br>convolutional neural                    24<br>weakly supervised                       19<br>action recognition                      17<br>semantic segmentation                   16<br>pose estimation                         16<br>convolutional neural networks           15<br>object detection                        15<br>neural network                          15<br>deep learning                           14<br>zero shot                               13<br>person identification                   12<br>deep neural                             11<br>spatio temporal                         11<br>question answering                      10<br>representation learning                 10<br>convolutional networks                  9<br>shot learning                           9<br>optical flow                            9<br>image classification                    9</pre><pre>There are 18 interesting papers<br>--------------------------------------------------<br>tgif-qa: toward spatio-temporal reasoning in visual question answering<br>clevr: a diagnostic dataset for compositional language and elementary visual reasoning<br>dual attention networks for multimodal reasoning and matching<br>comprehension-guided referring expressions<br>graph-structured representations for visual question answering<br>end-to-end concept word detection for video captioning, retrieval, and question answering<br>lip reading sentences in the wild<br>mining object parts from cnns via active question-answering<br>the vqa-machine: learning how to use existing vision algorithms to answer new questions<br>multi-level attention networks for visual question answering<br>the surfacing of multiview 3d drawings via lofting and occlusion reasoning<br>are you smarter than a sixth grader? textbook question answering for multimodal machine comprehension<br>creativity: generating diverse questions using variational autoencoders<br>knowledge acquisition for visual question answering via iterative querying<br>making the v in vqa matter: elevating the role of image understanding in visual question answering<br>what&#39;s in a question: using visual questions as a form of supervision<br>an empirical evaluation of visual question answering for novel objects<br>a dataset and exploration of models for understanding video data through fill-in-the-blank question-answering</pre><p>This time, as one might expect we have a lot of <strong>convolutional</strong>. But we also have plenty of <strong>weakly supervised</strong>, <strong>pose estimation</strong>, <strong>zero shot</strong>, <strong>person identification</strong> and finally <strong>question answering</strong>.</p><h3>Conclusion</h3><p>I thought I could do a word embedding based retrieval instead of simple a word match to find the relevant papers but then I wanted to keep it simple and didn’t want to postpone this post any more.</p><p>You can find the code and the sample files <a href="https://github.com/semihyagcioglu/what-is-hot-in-your-field">here</a>. Hope it helps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8377c7cdd54e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up a Machine for Deep Learning]]></title>
            <link>https://medium.com/hucvl-stories/setting-up-a-machine-for-deep-learning-f9a222bc457b?source=rss-5cec208db040------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9a222bc457b</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Semih Yagcioglu]]></dc:creator>
            <pubDate>Sat, 29 Apr 2017 05:49:15 GMT</pubDate>
            <atom:updated>2017-04-29T05:49:15.983Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EeVjbqLeu4nK_OEio2BoJw.jpeg" /></figure><p>Hi there! Here is a simple tutorial to get you started with developing Deep Learning projects. Working on deep learning might be quite intimidating — especially, where to start. I have spent plenty of my time building and setting up machines for Deep Learning. But each time I felt like I needed a simple reference that I could follow. I tried to create that simple reference and share it with you.</p><blockquote>What one fool can do, another can. — Ancient Simian Proverb</blockquote><p>Getting your hands dirty is the best way to learn, as is also the case for Deep Learning. So, I always disliked the things that get in the way. Such as making configurations, and setting things up. There is a great barrier for getting started with working on Deep Learning projects. Besides, we should be <strong>focusing on the ideas</strong>, not the environment. This is very important especially for research.</p><p>Having an idea is some thing, but you have to prove it and you need solid results for that. We should be able to go from the idea to results as easy as possible. We may fail but we will be able to re-evaluate our idea and finally see whether it works or not.</p><p>Now, let’s get started. We will configure a machine from the ground up for Deep Learning, and in the end run a simple neural network on it.</p><h3><strong>The Machine</strong></h3><p>I had a SuperMicro computer which had 3 Nvidia GTX 1080 GPUs with Pascal architecture. This workstation came with all the hardware installed such as GPUs and hard disks. So, there was no need for extra installation. Yet, there was one free slot so I installed another GTX 1080 GPU on it, but it doesn’t matter how many GPUs you have. As long as you have at least one GPU, this tutorial will get you to the end. We will be using Ubuntu 16.04. But I won’t go into detail how to install it as we will focus more on building our first deep neural network from scratch.</p><h3><strong>The Basics</strong></h3><p>Matrix multiplication is important. Especially if you are working on deep learning, almost everything relies on matrix multiplications.</p><p>So, let’s start with the basics, and build on top of it. BLAS substantially improves matrix multiplications. Here, we will use OpenBLAS and make some tests with NumPy. Now open the terminal (you can do this by pressing Ctrl + Alt + T at the same time) and paste the following lines one at a time (without copying the $) by pressing Ctrl + Shift + V into the terminal.</p><pre>$ sudo apt-get update<br>$ sudo apt-get upgrade<br>$ sudo apt-get install build-essential cmake cmake g++ gfortran unzip wget pkg-config openjdk-8-jdk git python-dev python3-dev python-pip python3-pip swig python-wheel libcurl3-dev<br>$ sudo apt-get install libopenblas-dev liblapack-dev<br>$ sudo apt-get install python-numpy python3-numpy</pre><p>We installed a few packages and NumPy with OpenBLAS support, which would make things a bit faster when we run our network. Now let’s see if we did everything right.</p><p>Here is a <a href="https://gist.github.com/semihyagcioglu/d1cabf7e284841460beb27bb4efd2428">simple script</a> to run some tests. You can as well copy it from below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c1c07a1695f3856a8f2891c4357e57fb/href">https://medium.com/media/c1c07a1695f3856a8f2891c4357e57fb/href</a></iframe><p>You need to save it to your computer, in your working directory. Run the following command to see where your working directory is.</p><pre>$ pwd</pre><p>This should print the path you are currently working on. Once you save the test script in this directory, we can start running simple tests.</p><pre>$ OMP_NUM_THREADS=1 python test_numpy_so_bad.py</pre><p>The above command should print a few results like the following. But we are not looking for exact numbers.</p><pre>NumPy Version: 1.11.0<br>Max int: 9223372036854775807</pre><pre>BLAS info:<br> * libraries [‘openblas’, ‘openblas’]<br> * library_dirs [‘/usr/lib’]<br> * define_macros [(‘HAVE_CBLAS’, None)]<br> * language c</pre><pre>Dot product of two (1000,1000) matrices took 82.5 ms<br>Dot product of two (2000) dimensional vectors took 2.62 us<br>SVD of (1000,2000) matrix took 1.194 s<br>Eigen decomposion of (1000,1000) matrix took 1.370 s</pre><p>Let’s run the same experiment, this time with more threads.</p><pre>$ OMP_NUM_THREADS=8 python test_numpy_so_bad.py</pre><p>So far so good. The results should take less time compared to our previous test.</p><pre>NumPy Version: 1.11.0<br>Max int: 9223372036854775807</pre><pre>BLAS info:<br> * libraries [‘openblas’, ‘openblas’]<br> * library_dirs [‘/usr/lib’]<br> * define_macros [(‘HAVE_CBLAS’, None)]<br> * language c</pre><pre>Dot product of two (1000,1000) matrices took 28.4 ms<br>Dot product of two (2000) dimensional vectors took 2.59 us<br>SVD of (1000,2000) matrix took 0.698 s<br>Eigen decomposion of (1000,1000) matrix took 1.219 s</pre><p>Now that we have the basic setup, we can move forward to making use of our GPU(s). We haven’t talked much about it before but GPUs are a lot more powerful compared to CPUs as they have many cores. Thus, it is very important to configure your GPUs to get the full performance.</p><h3><strong>Nvidia Drivers</strong></h3><p>We must have the latest Nvidia drivers installed. But before that let’s first find our graphic card model(s).</p><pre>$ lspci | grep -i nvidia</pre><p>This should list the model(s) of your graphic card(s). Go to the <a href="http://www.geforce.com/drivers">Nvidia driver website</a> and find the<strong> latest stable drivers</strong> for your graphics card model(s) based on your OS. Next step is to add the “Proprietary GPU Drivers” PPA repository. At the time of this writing, the latest stable driver version for my GPU(s) was 378. But, for you it might be different from this version. If this is the case, you should replace the <strong>378</strong> in the following commands with the newer version.</p><pre>$ sudo add-apt-repository ppa:graphics-drivers/ppa<br>$ sudo apt-get update<br>$ sudo apt-get install nvidia-<strong>378</strong></pre><p>We should now restart our computer. If we did everything right, the computer should boot up fine.</p><pre>$ sudo shutdown -r now</pre><p>We are almost there, but let’s make sure if we set up our Nvidia Drivers right. Now let’s run the following command in the terminal.</p><pre>$ cat /proc/driver/nvidia/version</pre><p>Here we should see the correct version of the driver we intended to install.</p><h3><strong>CUDA</strong></h3><p>CUDA enables running our models on the GPUs, so we need to install it. Otherwise, we would restrict our models to run only on CPUs. Now go to <a href="https://developer.nvidia.com/cuda-toolkit">CUDA web site</a> and download the correct version of CUDA based on your system. But don’t forget to come back here, we are not finished yet.</p><p>Now, the name of the file should look like the following. But feel free to change it based on your settings, which I marked as <strong>bold</strong>.</p><pre>$ sudo dpkg -i <strong>cuda-repo-ubuntu1604*amd64.deb</strong><br>$ sudo apt-get update<br>$ sudo apt-get install cuda</pre><p>If we could install CUDA right, there should be a directory in the following path:</p><pre>/usr/local/cuda</pre><p>We should now add CUDA to the environment variables.</p><pre>$ echo &#39;export PATH=/usr/local/cuda/bin:$PATH&#39; &gt;&gt; ~/.bashrc<br>$ echo &#39;export LD_LIBRARY_PATH=&quot;$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64&quot;&#39; &gt;&gt; ~/.bashrc<br>$ echo &#39;export CUDA_HOME=/usr/local/cuda&#39; &gt;&gt; ~/.bashrc<br>$ source ~/.bashrc</pre><p>Let’s make sure that everything is correct before we move forward.</p><pre>$ nvcc -V</pre><p>This should print out the CUDA compiler driver information and its version. Let’s restart our machine one more time.</p><pre>$ sudo shutdown -r now</pre><h3><strong>cuDNN</strong></h3><p>So far we finished installing CUDA. Now we are going to install cuDNN. Which is a library to speed up Deep Learning frameworks, such as Theano and Tensorflow. Thus, if you skip this step it is not the end of the world. But it will help us a lot once we get to train very deep networks, so let’s stick for a while and complete the following steps. Besides, we don’t have much left to do.</p><p>First, we should register for <a href="https://developer.nvidia.com/rdp/cudnn-download">Nvidia’s Accelerated Computing Developer Program</a>. Once you register, you should login and download the latest cuDNN. Current version v5.1 but you can change it to a newer version which I marked as <strong>bold</strong> in the following line. Next step is to extract the cuDNN contents into /usr/local/cuda and for this to happen we execute the following commands.</p><pre>$ sudo tar -xzvf <strong>cudnn-8.0-linux-x64-v5.1.tgz</strong><br>$ sudo cp -P cuda/include/cudnn.h /usr/local/cuda/include<br>$ sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda/lib64<br>$ sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*</pre><p>We are now done. Let’s see how we did.</p><pre>$ nvidia-smi</pre><p>You should now be able to see all your GPUs here. If not, then something might have gone wrong. By the way, this command is very handy incase you want to check the performance metrics of your GPU(s).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*nGmDxUS7bc5v4U73mzSgkg.png" /></figure><p>Here, I can see all my GPUs which means we can now move forward.</p><h3><strong>virtualenv</strong></h3><p><a href="http://www.virtualenv.org/">virtualenv</a> is a tool which we will use to create isolated Python environments. It allows many Python projects to coexist in the same machine.</p><pre>$ sudo pip install virtualenv</pre><h3><strong>virtualenvwrapper</strong></h3><p><a href="https://virtualenvwrapper.readthedocs.io/">virtualenvwrapper</a> is a set of extensions to the virtualenv tool. It makes working with virtual environments very easy.</p><pre>$ sudo pip install virtualenvwrapper</pre><p>Now lets create a directory for our virtual environments.</p><pre>$ cd ~/<br>$ mkdir Envs</pre><p>We are now going to update our bash file again.</p><pre>$ echo &#39;export WORKON_HOME=$HOME/.virtualenvs&#39; &gt;&gt; ~/.bashrc<br>$ echo &#39;export PROJECT_HOME=$HOME/Envs&#39; &gt;&gt; ~/.bashrc<br>$ source /usr/local/bin/virtualenvwrapper.sh</pre><p>Let’s create a virtual environment and name it <strong>playground</strong>. As it will be our playground :D You can create more environments and name them as you wish.</p><pre>$ mkvirtualenv playground</pre><p>Anytime you want to work on an environment, type the below command in the terminal. Of course if the name of the environment is different, then you should be using it.</p><pre>$ workon <strong>playground</strong></pre><h3><strong>Tensorflow</strong></h3><p>It is easy to install Tensorflow. Let’s first try to install it via pip.</p><pre>$ pip install --upgrade tensorflow-gpu</pre><p>If this fails, you can go to <a href="https://www.tensorflow.org/install/">Tensorflow website</a> and select the correct binary for your system. In this case we select the GPU enabled Ubuntu version. For my configuration it is Ubuntu/Linux 64-bit, GPU enabled, Python 2.7 but yours might be different. Make sure you select the latest version from the Tensorflow website.</p><pre>$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.1.0-cp27-none-linux_x86_64.whl</pre><p>After the installation, let’s make sure everything is OK.</p><pre>$ python<br>&gt;&gt;&gt; import tensorflow<br>&gt;&gt;&gt; tf.__version__<br>&gt;&gt;&gt; exit()</pre><p>You can also test it with <a href="https://gist.github.com/semihyagcioglu/7bba93a225909dd9939925c48f581a45">this script</a> or copy it from below as well to see the tasks run on GPU(s).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e7932f23ddf30eb8c89984681b714d4/href">https://medium.com/media/3e7932f23ddf30eb8c89984681b714d4/href</a></iframe><h3><strong>Keras</strong></h3><p>Keras is a high-level neural networks library written in Python. You can run your code in Keras on top of either <a href="https://github.com/tensorflow/tensorflow">TensorFlow</a> or <a href="https://github.com/Theano/Theano">Theano</a>. Which makes Keras a a good choice for Deep Learning models. So let’s install a few dependencies first.</p><pre>$ pip install numpy scipy<br>$ pip install scikit-learn<br>$ pip install pillow<br>$ pip install h5py</pre><p>Now let’s install Keras via pip.</p><pre>$ pip install keras</pre><p>That’s actually it. But let’s make sure everything is OK. This time for Keras.</p><pre>$ python<br>&gt;&gt;&gt; import keras<br>&gt;&gt;&gt; keras.__version__<br>&gt;&gt;&gt; exit()</pre><p>This should print the Keras version and the backend Keras uses. We can change the backend from the configuration file of Keras incase it is not set to Tensorflow by default.</p><pre>$ gedit ~/.keras/keras.json</pre><p>The contents of this file should look something like this for Tensorflow. If this is not the case you can change it based on the configuration below and save the file.</p><pre>{<br>    &quot;image_dim_ordering&quot;: &quot;tf&quot;, <br>    &quot;epsilon&quot;: 1e-07, <br>    &quot;floatx&quot;: &quot;float32&quot;, <br>    &quot;backend&quot;: &quot;tensorflow&quot;<br>}</pre><h3><strong>The Network</strong></h3><p>Now that we set up our machine for deep learning let’s build a simple neural network to solve the famous XOR problem. You can <a href="https://gist.github.com/semihyagcioglu/ba151a3781b401eee0a6a41d4c343cd3">download the script from here</a> or copy it from below as well.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb510c5961307b73cdd1432dfd4e2021/href">https://medium.com/media/eb510c5961307b73cdd1432dfd4e2021/href</a></iframe><pre>$ python keras_xor.py</pre><p>This will create a neural network to solve the XOR problem and start training it for 1000 epochs. You can track the performance of the GPU(s) with the following command. But make sure to do this in another terminal window, which will refresh the screen for every second.</p><pre>$ watch -n1 nvidia-smi</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*LACsZROd8pNwOKAd0hcphw.png" /></figure><h3><strong>Conclusion</strong></h3><p>This is the end of our tutorial. You can now build more complex networks and start experimenting with them using this set up. Take care!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9a222bc457b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hucvl-stories/setting-up-a-machine-for-deep-learning-f9a222bc457b">Setting Up a Machine for Deep Learning</a> was originally published in <a href="https://medium.com/hucvl-stories">HUCVL Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Image Captioning: A Retrospect on Our Latest Study]]></title>
            <link>https://medium.com/hucvl-stories/image-captioning-a-retrospect-on-our-latest-study-4e54a864159e?source=rss-5cec208db040------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e54a864159e</guid>
            <category><![CDATA[research]]></category>
            <category><![CDATA[image-captioning]]></category>
            <dc:creator><![CDATA[Semih Yagcioglu]]></dc:creator>
            <pubDate>Tue, 26 Apr 2016 10:14:35 GMT</pubDate>
            <atom:updated>2016-04-26T11:37:55.345Z</atom:updated>
            <content:encoded><![CDATA[<p>The amount of data generated each day is tremendous. With more data comes more information. By extracting the precious information hidden in the piles of big data and employing new paradigms, researchers can now solve quite challenging problems such as describing what is out there in a scene.</p><p>Recently, this particular problem have garnered a lot of attraction from both computer vision and natural language processing communities. Obviously it is at the intersection of two active research areas and the challenges of this problem seems to grasp the attention of several researchers.</p><p>But, what makes this problem uniquely interesting? The answer is hidden in its goal, which probably explains why it is very important to Artificial Intelligence in general. The basic goal in image captioning is to describe a scene like a human would describe it. Although we are not there yet, with the recent progress we can say that we not too far from there either.</p><p>It’s a challenging problem, one needs to admit, to start with there are several things to consider if you want to pass the <a href="https://en.wikipedia.org/wiki/Turing_test">Turing test</a>. For example, people do not always mention all image contents to describe it and tend to mention things that are of importance to them. Moreover, people often provide quite different descriptions for the same scene as they often do not agree on what is important about that scene. These are just a few things to keep in mind. But the real challenge is the quality of the descriptions the algorithms produce, considering we want to convince people that these descriptions come from humans not machines. Yet it is not as easy as it may sound, humans are quite good at separating things that are non-human, in other words robotic. See for yourself, and try to guess which caption is authored by a human and which by a machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*rZm3cpjmDsuABWYy." /></figure><ol><li>There are one cow and one sky. The golden cow is by the blue sky.</li><li>A young highlander cow stands in a pasture.</li></ol><p>The above image was taken from <a href="http://vision.cs.uiuc.edu/pascal-sentences/">UIUC Pascal Sentence dataset</a> and the first caption was generated by <a href="http://tamaraberg.com/papers/generation_cvpr11.pdf">BabyTalk</a> of Berg et al. (CVPR, 2011), the second however was written by humans.</p><p>Image captioning studies fall into two broad categories. In the first category the main idea is to retrieve a relevant description from a set of descriptions. In the second category the main idea is to generate a description from scratch. We recently did a study on the former, which we presented at <a href="http://semihyagcioglu.com/projects/image-captioning">ACL 2015</a>.</p><p>In our study we proposed a query expansion scheme to improve the quality of retrieval based image captioning approaches. The main idea of our work is to improve the retrieval based image captioning by synthesizing a new query with the captions of visually similar images and re-ranking candidate captions based on this synthesized query.</p><p>Now let’s repeat the same test and try to find which caption is provided by a human and which caption by a machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*wUNo8hOKJ-jVqfRo." /></figure><ol><li>A construction crew in orange vests working near train tracks</li><li>A man in an orange vest and yellow hard hat looks on as a yellow vehicle lays track</li></ol><p>It is getting harder right? The main reason is the approach we used here. Actually both captions are written by humans, but the first caption was chosen by our algorithm among several captions. Our algorithm believes that this caption should be describing the scene. Apparently, it does so.</p><p>It is hard to make a fair comparison between generative and retrieval models, as they do quite different things. Generative models aim to create a caption from scratch whereas retrieval models aim to find the most suitable caption for the scene. They do have their own challenges, which I believe would be off topic for this short blog post. So, we follow a retrieval based approach in our image captioning study, therefore the above description is selected among several image captions.</p><p>At this point, you might wonder how we selected this description for that image. You should check <a href="http://www.aclweb.org/anthology/P15-2018">the original paper</a> for the details but for the conciseness of this blog post, I will try to explain how we did that in very simple terms :)</p><p><strong>Retrieving Visually Similar Images</strong></p><p>Let’s rephrase our problem here once more. We want to describe a scene, and we want to do it good. In order to come up with a good description for that scene we first need to visually understand that scene. This is at least what humans do when they want to describe a scene. Our vision system starts working unconsciously and determines the contents of the scene. For a machine, it is not that easy. But we might at least follow a simple strategy to find out the contents of an image without heavily relying on parsing the image contents. Here we assume that visually similar images contain similar contents and attributes, such as illumination, weather, objects etc.</p><p>In order to represent images, we use the output of a deep learning model, <a href="http://www.robots.ox.ac.uk/~vgg/research/very_deep/">16-layer VGG</a> trained on <a href="http://image-net.org/challenges/LSVRC/2014/">ImageNet</a>, and use fc7 activations of <a href="https://en.wikipedia.org/wiki/Convolutional_neural_network">ConvNet</a> with 4096 dimensional vectors. After employing an Euclidean distance measurement against the query scene, followed by an adaptive neighborhood selection we find the top <em>N</em> images in our dataset that are visually similar to the query scene. Note that <em>N</em> is subject to change based on the density of candidates. At this moment we have a set of images that look very much like the scene we want to describe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lbigAP2pnXKXYGu1." /></figure><p>Visual retrieval and adaptive neighborhood selection. The algorithm determines the number of candidates to be selected adaptively based on the density as seen in A and B</p><p>Close enough, but we still need some work to do. Now that we find the visually similar images to our own query image, we can reduce the problem to, what to do with those images. The short answer is, we don’t deal with images from now on but change our focus to textual domain by using the captions of visually similar images, as we assume that they contain the information we need to describe the query scene.</p><p><strong>Distributed Representation via Word Vectors</strong></p><p>Word vectors are very popular these days, but their popularity has some solid ground. They can accurately capture the meaning of words in higher dimensions where each word is associated with a real valued vector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PM0xK8EnKmjLT-EB." /></figure><p>Vectors encoding gender relation between words on the left, singular/plural relation between two words on the right. (<a href="https://www.aclweb.org/anthology/N/N13/N13-1090.pdf">Mikolov et al., 2013</a>)</p><p>What makes word vectors so popular and powerful is, their simplicity and accuracy. With simple arithmetics it is possible to extract syntactic and semantic regularities between words singular/plural, gender, tense etc. In other words we can make analogies by using the vector differences and sums.</p><p>W(‘uncle) − W(‘man’) + W(‘woman’) ≃ W(‘aunt’)</p><p>W(‘king’) − W(‘man’) + W(‘woman’) ≃ W(‘queen’)</p><p>In the above example we see that we can make a nearest neighbor search around the result of vector operation “king — man + woman” and obtain “queen”. Replacing “king” with “uncle” results with “aunt” (<a href="https://www.aclweb.org/anthology/N/N13/N13-1090.pdf">Mikolov et al, 2013</a>). This is very powerful especially if you want to encode/decode such regularities in a language.</p><p>We used 500 dimensional word embeddings to represent words and employed simple vector arithmetics to synthesize a new query using the captions of visually similar images. Primarily what we do here is to shift our focus to language domain from the visual domain and make a query expansion that is based on distributional representations.</p><p>Representing words with word vectors seems quite simple as it works like a lookup table where each word has a mapping in a higher dimensional space. But, how do we represent captions? We have mentioned that we can apply algebraic operations on a vector, and use the difference or sum vectors to encode some regularities. Using this rationale, we assume that a caption might be represented as the sum of its constituents. Therefore, we simply sum vectors for each word in a caption. In our case, each image had 5 different captions. Subsequently, we averaged these caption vectors.</p><p>At this step, we have a vector which we presume to represent an image. Considering we have plenty of captions in our pool we need to draw the best caption from that pool that describes the query image. Here we make another assumption, that is, the query image could be represented with a query vector. But we don’t have such a query vector. So, we synthesize one by averaging the caption vectors in the pool. The resulting vector is to represent the query image but in the language domain. What we do here is to expand the original image query by synthesizing a new query vector in language domain and changing modalities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1ZdkiwmdufV2-_QH." /></figure><p>A system overview of the proposed query expansion approach for image captioning</p><p>Now that we have a query vector, we can do something cool with it. So, we simply re-rank all the caption vectors in the pool against this synthesized query vector. This re-ranking scheme considers the angular cosine distance between caption vectors and ranks them based on their distance. Finally, we return the top caption as the output of our algorithm for describing the query image.</p><p><strong>Datasets</strong></p><p>Choosing which dataset to work with is a very important part of a study. There are a few established datasets that have been used in various vision and NLP related tasks such as <a href="http://vision.cs.uiuc.edu/pascal-sentences/">UIUC Pascal Sentence</a>, <a href="http://nlp.cs.illinois.edu/HockenmaierGroup/8k-pictures.html">Flickr8K</a>, <a href="http://shannon.cs.illinois.edu/DenotationGraph/">Flickr30K</a>, <a href="http://mscoco.org/">MS COCO</a>, <a href="http://tlberg.cs.unc.edu/vicente/sbucaptions/">SBU Captioned Photo</a> datasets, which have 1K, 8K and 30K, 300K and 1M captioned images respectively. Each dataset has been criticized from different aspects, such as size, noise, object distribution etc. In the recent studies MS COCO dataset has been used as the standard captioned image dataset, as it quite big in size, has diverse categories of objects with very structured tokenized captions as well as object segmentations.</p><p>In order to provide benchmark for future studies we used Flickr8K, Flick30K and MSCOCO datasets and conducted our evaluation tasks on these datasets separately.</p><p><strong>Evaluation</strong></p><p>So, what makes an image description good? How can we determine the quality of our descriptions? There are two common approaches in the literature. The first one is evaluating the provided descriptions against the ground-truth descriptions using machine translation and summarization metrics such as BLEU, TER, METEOR, ROUGE, CIDEr, etc. Second approach is designing human evaluation tasks to determine the quality of the descriptions, such as relevancy, descriptiveness etc. Both approaches have some advantages and disadvantages of their own. For example, it is easier to evaluate descriptions with automated metrics, but these metrics often have their quirks (see <a href="http://acl2014.org/acl2014/P14-2/pdf/P14-2074.pdf">Elliott and Keller (ACL, 2014)</a> for an extended review). Human evaluation tasks are good to determine the overall description quality, but these tasks are hard to replicate, costly, and often subject to bias based on the design of the tasks.</p><p>In our evaluation task we used smoothed BLEU, METEOR and CIDEr and compared our approach with some of the related works in the literature as well as the human baseline. Moreover, we conducted a human evaluation task with a similar setting as described in (<a href="http://www.tamaraberg.com/papers/acl_12.pdf">Kuznetsova et al., 2012</a>; <a href="https://cs.brown.edu/people/rebecca/364_Paper.pdf">Mason and Charniak, 2014</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/0*1ZQQUXFerSGpMpha." /></figure><p>A few results obtained with our method along with ground-truth captions.</p><p>The human evaluation task suggested that our results are quite relevant to the query scenes as shown above for a few scenes, and the machine translation metrics supported these findings but we believe that there are a few things we can do to improve our results in other words other pooling strategies such as <a href="http://arxiv.org/abs/1411.7399">Fisher Vectors</a> and incorporating word order, etc. Hopefully, we will be addressing these in our upcoming studies.</p><p><strong>Final Remarks</strong></p><p>Before we presented our work at ACL 2015, we submitted our results to the <a href="http://mscoco.org/dataset/#captions-challenge2015">MS COCO 2015 Captioning Challenge</a>. We noticed that the competing methods were performing very well with the automatic machine translation metrics. Most methods were even performing better than humans, in terms of these metrics. I must note that we missed the human judgment and could not partake in the original challenge, and submitted our results afterwards.</p><p><a href="http://mscoco.org/dataset/#captions-leaderboard">Human judgment scores</a> showed that there is still quite a big margin between the best performing methods compared to ground-truth image captions. This simply tells us that there still room for progress both in machine translation metrics and image captioning methods. We’ll probably see quite interesting studies trying to fill this gap in the very near future.</p><p>This is a joint work by <a href="http://semihyagcioglu.com/">Semih Yagcioglu</a>(1), <a href="http://web.cs.hacettepe.edu.tr/~erkut/">Erkut Erdem</a>(1), <a href="http://web.cs.hacettepe.edu.tr/~aykut/">Aykut Erdem</a>(1) ve <a href="https://www.ceng.metu.edu.tr/~ruken/">Ruket Cakici</a>(2).</p><p>1: <a href="http://vision.cs.hacettepe.edu.tr/">Hacettepe University Computer Vision Lab (HUCVL)</a></p><p>2: <a href="https://www.ceng.metu.edu.tr/">Middle East Technical University Department of Computer Engineering</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e54a864159e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hucvl-stories/image-captioning-a-retrospect-on-our-latest-study-4e54a864159e">Image Captioning: A Retrospect on Our Latest Study</a> was originally published in <a href="https://medium.com/hucvl-stories">HUCVL Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>