<?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 Alvin Jin on Medium]]></title>
        <description><![CDATA[Stories by Alvin Jin on Medium]]></description>
        <link>https://medium.com/@alvincjin?source=rss-ba6f6c406f1a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*daifS0db6FI3ZwGb_xegGw.jpeg</url>
            <title>Stories by Alvin Jin on Medium</title>
            <link>https://medium.com/@alvincjin?source=rss-ba6f6c406f1a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 18:38:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alvincjin/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[Applying Deep Learning for Receipt Processing — Part III: Post-OCR]]></title>
            <link>https://medium.com/@alvincjin/applying-deep-learning-for-receipt-processing-part-iii-post-ocr-55abcd5db336?source=rss-ba6f6c406f1a------2</link>
            <guid isPermaLink="false">https://medium.com/p/55abcd5db336</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[ocr]]></category>
            <dc:creator><![CDATA[Alvin Jin]]></dc:creator>
            <pubDate>Fri, 09 Mar 2018 14:31:58 GMT</pubDate>
            <atom:updated>2018-03-09T14:32:36.760Z</atom:updated>
            <content:encoded><![CDATA[<p>After the OCR engine recognizes and extracts text from the receipt image, the next challenges are: 1) Improve the accuracy of OCR results by fixing missed character and errors; 2) Convert unstructured text to semi-structured Json format.</p><p>To understand the content of a receipt, it’s important to know the receipt schema. The receipt layout is more or less the same in high level as following.</p><p>Store Brand Block:</p><p>Most receipts have brand logo or name on the top middle of the paper. Under it, there might be store location, website, phone number information.</p><p>Purchase Item Block:</p><p>The product item symbols are most likely on the left most column, followed by spaces, with price on the right column.</p><p>Total Block:</p><p>This block contains some critical information for our receipt processing. There are some key words used in receipts, such as subtotal, tax, total, card number,</p><p>Unfortunately, there is no standard on the receipt schema,</p><p>Step 1 Vendor Brand Classification<br>Text Logo</p><p>Most receipts have a Text logo, which is the vendor name. This type of logo can be recognized by OCR engine with the other text block. Due to artistic font used in logo, some characters may not be correctly recognized. However, we can do the fuzzy matching on the vendor name in our knowledge base.</p><p>2. Symbol Logo<br>Some receipt logos are either pure symbols without text or in fancy font, which can’t be extracted to text by OCR engine. In this case, we use deep learning based image classification to classify the receipt to the corresponding vendor in our knowledge base. <br>Once we can classify the vendors of receipts, we can apply the receipt format schema to parse the corresponding receipt text</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55abcd5db336" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Applying Deep Learning for Receipt Processing — Part I: Pre-OCR]]></title>
            <link>https://medium.com/@alvincjin/applying-deep-learning-for-receipt-processing-part-i-pre-ocr-11021b4e760d?source=rss-ba6f6c406f1a------2</link>
            <guid isPermaLink="false">https://medium.com/p/11021b4e760d</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[ocr]]></category>
            <dc:creator><![CDATA[Alvin Jin]]></dc:creator>
            <pubDate>Fri, 09 Mar 2018 14:31:44 GMT</pubDate>
            <atom:updated>2018-03-09T14:33:14.183Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pre-Processing:</h3><p>The quality of receipt images is uncontrolled when captured by smartphone. The life of a receipt is highly subject to degradation such as crumples, tears and other physical damages. Therefore, a single optimal OCR(optical character recognition) step cannot solve such complex problem. A well designed pre-processing pipeline is needed to prepare perfect input receipt image for the OCR engine.</p><p><strong>Step 1 Receipt Object Detection</strong></p><p>First of all, we have to make sure the images sent to our platform contains receipts(at least one receipt can be recognized). Since the receipt processing is pretty expensive, we don’t want to waste our computing resources on some other images, e.g. selfies(intended or not). Hence, it’s necessary in the beginning of the pipeline, we want to make sure at least one clear receipt can be recognized in the uploaded image.</p><p>Options:</p><ol><li>Deep Learning based classification.<br>Basically, we can rely on deep neural network to figure out the features of a receipt image, then use binary regression classifier to predict whether an image contains receipt or not.</li><li>Rule based classification.<br>We can manually select some common features on receipts. For example, the shape of a receipt is mostly like a rectangle with length larger than width. The left column is text, while right column is digital number.</li><li>Text Analysis based calssification<br>Applying OCR on the image, if there are some key words(e.g. Total, HST, etc) or line structure specific for receipt detected, we believe this image contains a receipt. For example, a product item line contains product symbol, spaces, and a price.</li></ol><p><strong>Step 2 Receipt Localization and Crop</strong></p><p>In this step, we are going to localize the boundary of receipt object in the image.Then, crop it from the background to a new image without background noise. We apply OpenCV to detect the contour and find the four edges of the receipt. Then, crop the receipt as a new input image to our OCR engine.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11021b4e760d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup Deep Learning Environment with GPU support by Anaconda in Ubuntu 16.04]]></title>
            <link>https://medium.com/@alvincjin/setup-deep-learning-env-with-anaconda-in-ubuntu-14-3a621bdee8ac?source=rss-ba6f6c406f1a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a621bdee8ac</guid>
            <category><![CDATA[jupyter]]></category>
            <category><![CDATA[keras]]></category>
            <category><![CDATA[cuda]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[pytorch]]></category>
            <dc:creator><![CDATA[Alvin Jin]]></dc:creator>
            <pubDate>Mon, 22 Jan 2018 02:24:19 GMT</pubDate>
            <atom:updated>2018-02-19T03:34:20.515Z</atom:updated>
            <content:encoded><![CDATA[<p>Since Python 2 is going to be deprecated in 2020, we will install Python 3.6 with Anaconda3 in this exercise. We choose Ubuntu 16.04 with GPU instance type: p2.xlarge in AWS as our DL environment.</p><p><strong>Step 1: Install Anaconda 3</strong></p><p>$ wget <a href="https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh">https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh</a></p><p>$ bash Anaconda3-5.1.0-Linux-x86_64.sh -b -p ~/anaconda</p><p>$ echo ‘export PATH=”~/anaconda/bin:$PATH”’ &gt;&gt; ~/.bashrc</p><p>$ source ~/.bashrc</p><p>$ conda update conda</p><p><strong>Uninstall Anaconda</strong></p><p>$ rm -rf ~/anaconda. <br>$ vi ~/.bashrc # remove the anaconda directory from your `PATH` env var</p><p><strong>Step 2: Create Virtual Environment</strong></p><p>$ conda create -n py36-venv python=3.6 anaconda</p><p>To activate this environment, use:<br>$ source activate py36-venv</p><p>To deactivate an active environment, use:<br>$ source deactivate</p><p><strong>Step 3: Install </strong>Tensorflow with GPU support</p><ol><li>Install Nvidia Driver<br>$ curl -O <a href="http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb">http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb</a><br>$ dpkg -i ./cuda-repo-ubuntu1604_8.0.61–1_amd64.deb<br>$ apt-get install cuda=8.0.61–1 -y</li><li>Reboot and Check GPU info<br>$ sudo reboot<br>$ nvidia-smi</li><li>Install Cuda toolkit<br>$ wget <a href="https://s3.amazonaws.com/personal-waf/cuda_8.0.61_375.26_linux.run">https://s3.amazonaws.com/personal-waf/cuda_8.0.61_375.26_linux.run</a> <br>$ sudo sh cuda_8.0.61_375.26_linux.run<br>Choose ’N’ to skip the nvidia driver install</li><li>Install cudnn<br>$ wget <a href="https://s3.amazonaws.com/open-source-william-falcon/cudnn-8.0-linux-x64-v6.0.tgz">https://s3.amazonaws.com/open-source-william-falcon/cudnn-8.0-linux-x64-v6.0.tgz</a> <br>$ sudo tar -xzvf cudnn-8.0-linux-x64-v6.0.tgz <br>$ sudo cp cuda/include/cudnn.h /usr/local/cuda/include<br>$ sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64<br>$ sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*</li><li>Add below in ~/.bashrc<br>export LD_LIBRARY_PATH=”/usr/local/cuda-8.0/lib64/”<br>export LD_LIBRARY_PATH=”$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64&quot;<br>export CUDA_HOME=”/usr/local/cuda<br># reload bashrc<br>$ source ~/.bashrc</li><li>Install Tensorflow-gpu<br>$ conda install -c anaconda tensorflow-gpu<br>Or<br>$ pip install tensorflow-gpu==1.4.0</li></ol><p>7. Test Tensorflow using GPU</p><p>from tensorflow.python.client import device_lib<br>print(device_lib.list_local_devices())</p><p><strong>Step 4: Install the other Deep Learning Frameworks/Libs</strong></p><p>Install Keras</p><p>$ sudo apt install python3-pip</p><p>$ pip install — upgrade keras</p><p>Install PyTorch</p><p>$ conda install pytorch torchvision -c pytorch</p><p>Install OpenCV</p><p>$ pip install opencv-python</p><p>Install lmdb</p><p>$ sudo apt-get install libffi-dev python-dev build-essential</p><p>$ pip install lmdb</p><p>Install Graphviz and Pydot to visualize neural network</p><p>$ sudo apt-get install graphviz</p><p>$ pip install pydot</p><p><strong>Step 5. Start Jupyter server in AWS</strong></p><p>$ jupyter notebook — no-browser — port=8888</p><p>SSH to Jupyter Notebook remotely from your local</p><p>$ ssh -i .ssh/key.pem -L 8080:localhost:8888 ubuntu@aws-node-ip</p><p>Open notebook UI in your local browser via <a href="http://localhost:8080/">http://localhost:8080/</a></p><p>You are all set to start a new adventure in Deep Learning and AI:)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a621bdee8ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI and Big Data Reading List]]></title>
            <link>https://medium.com/@alvincjin/reading-list-26f14ffbe865?source=rss-ba6f6c406f1a------2</link>
            <guid isPermaLink="false">https://medium.com/p/26f14ffbe865</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Alvin Jin]]></dc:creator>
            <pubDate>Tue, 02 Jan 2018 01:48:08 GMT</pubDate>
            <atom:updated>2018-05-06T14:57:01.380Z</atom:updated>
            <content:encoded><![CDATA[<p>Recent few years, I kept a habit to study a couple of topics and read 5 to 10 technical books in my spare time per year. Below are the books, I have read or plan to read. Hopefully, they are helpful to you.</p><p>2018: Deep Learning, Computer Vision, NLP</p><p>|No.| Book Name | Start Month | End Month |</p><p>|1| Deep Learning with Python | Jan | Jun|</p><p>|2| OpenCV 3.x with Python By Example |July|Aug|</p><p>|3| Deep Learning (Ian &amp; Yoshua ch 7–11) | Aug| Oct|</p><p>|4| Fast.ai: Practical Deep Learning For Coders, Part I| Oct| Dec|</p><p>|5| Natural Language Processing with PyTorch | | |</p><p>2017: Docker, NLP, Deep Learning</p><p>|No.| Book Name | Start Month | End Month |</p><p>|1| Blockchain Specs: Ethereum, Hyperledger | Jan | Feb |</p><p>|2| Java 8 in Action | Mar | Apr |</p><p>|3| Docker in Action | May | May |</p><p>|4| Natural Language Processing with Python | Jun | Jun |</p><p>|5| Advanced Analytics with Spark, 2nd | Jul | Jul |</p><p>|6| Flask Web Development, 2nd | Aug | Aug |</p><p>|7| Deep Learning Specialization (Andrew Ng) | Sept | Oct |</p><p>|8| Deep Learning (Ian &amp; Yoshua Ch 1–6) | Oct | Nov |</p><p>|9| Hands-On Machine Learning with Scikit-Learn and TensorFlow | Nov | Dec |</p><p>2016: Scala, Spark, Kafka, Akka</p><p>|No.| Book Name | Start Month | End Month |</p><p>|1| Programming Scala, 2nd | Jan | Feb |</p><p>|2| Scala Functional Programming Patterns | Apr | Jun |</p><p>|3| Machine Learning with Spark | July | Aug |</p><p>|4| Kafka the Definitive Guide | Sep | Oct |</p><p>|5| Akka in Action | Nov | Dec |</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26f14ffbe865" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>