<?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 Shahar Guigui on Medium]]></title>
        <description><![CDATA[Stories by Shahar Guigui on Medium]]></description>
        <link>https://medium.com/@shaharguigui?source=rss-60beede956b1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wbJwnnPO9swqK7MAiYE_dg.png</url>
            <title>Stories by Shahar Guigui on Medium</title>
            <link>https://medium.com/@shaharguigui?source=rss-60beede956b1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 08:41:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shaharguigui/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[Zero Shot Super Resolution Part 3: Training the Model -]]></title>
            <link>https://medium.com/missinglink-deep-learning-platform/zero-shot-super-resolution-part-3-training-the-model-a3bf5cdcf52c?source=rss-60beede956b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3bf5cdcf52c</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[super-resolution]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[keras]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[Shahar Guigui]]></dc:creator>
            <pubDate>Wed, 12 Jun 2019 20:19:21 GMT</pubDate>
            <atom:updated>2019-06-18T17:46:43.680Z</atom:updated>
            <content:encoded><![CDATA[<h3>Zero Shot Super Resolution Part 3: Training the Model</h3><p>In <a href="https://missinglink.ai/blog/computer-vision/zero-shot-super-resolution-part-1/">part 1</a>, we reviewed <strong>Single Image Super Resolution</strong> (SISR) methods and <strong>Zero-Shot Super Resolution</strong> in particular. In <a href="https://missinglink.ai/blog/computer-vision/zero-shot-super-resolution-part-2-implementing-zssr-with-keras-and-missinglink-ai/">part 2</a>, we discussed how to run the <a href="https://github.com/missinglinkai/ZSSR">code example</a> with <a href="https://keras.io/">Keras</a>, a <a href="https://www.tensorflow.org/">TensorFlow</a> backend, <a href="https://opencv.org/">OpenCV</a> and a free account on <a href="http://missinglink.ai/">MissingLink.ai</a>. The applications for this technique range from medical imaging, working with compressed images, agriculture analysis, autonomous driving, satellite imagery, reconnaissance and more. Now, it’s time for us to go through the code, discuss how it works and highlight ways to modify it for future experiments.</p><p>By this point, you should have already been able to run the project. If you have not set it up, please review <a href="https://missinglink.ai/blog/computer-vision/zero-shot-super-resolution-part-2-implementing-zssr-with-keras-and-missinglink-ai/">part 2</a> or the <a href="https://github.com/missinglinkai/ZSSR/blob/master/readme.md">ReadMe file</a>. We’ll be highlighting specific blocks of code from the main.py file to better explain what is going on under the hood. As a quick recap, you’ll need to <a href="https://github.com/missinglinkai/ZSSR">clone the project</a>, install the dependencies, connect the <a href="https://missinglink.ai/">MissingLink.ai</a> account to the project and preview the experiment in real-time on the dashboard.</p><p>When you open the main.py file, you’ll see a collection of Python Libraries we’ll be using. These will include NumPy, cv2, Keras, and MissingLink:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ra35VEjQo-AQxqFB" /></figure><p>From part I and II, you should be familiar with most of these but if this is your first time working with the MissingLink.ai SDK it’s a platform for deep learning workflow automation. The SDK enables fast and efficient development of complex deep learning models by taking away the pain of managing numerous experiments, large datasets, local and off-premise machines, and code versioning. We’ll be leveraging it to track real-time values of our experiment and later on, for more advanced users, we’ll be digging into MissingLink’s data management features.</p><p>Inside of the main program, we set an argument parser for configuring parameters from the CLI, get the paths for the output directory and for the target image and then load it. We also define TensorFlow as our backend and the image dimension ordering as channels last. Different Keras backend libraries (TensorFlow, Theano) have these set in opposing ways, i.e channels last vs. channels first respectively. By making sure the setting is as such we can dodge bugs from feeding our neural network with the wrong data shape.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PgP1Ju55XMU-ZDtw" /></figure><p>We first define the MissingLink callback. Then we use it to set properties of the experiment such as display_name and its description.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r2G_NXlksBKiaiYJ" /></figure><p>These will be displayed on the dashboard and help us to tell experiments apart as well as keep track of useful data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VzqUbALJHoajqnih" /></figure><p>We can change the description from the UI post-training as well. It allows us to add important data and run an “experiment notebook” type of research.</p><p>We call the build_model() function and get the returned model to the ZSSR variable.</p><p>lrate inherits from the Keras LearningRateScheduler callback which gets the step_decay function and updates its value by it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IgvghtG27MCxeL_A" /></figure><p>We start training by calling zssr.fit_generator() which is fed by data from the custom image_generator. We save the model to the Data Management artifact utility. We then call the predict_func() and accumulated_result() function to get our super-resolution outputs.</p><p>In the cases where we have a Ground-Truth High-Resolution image, we check our results in respect to it by using the metrics we previously defined: PSNR and SSIM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*92or8T7itFpeu3lD" /></figure><p>We can use the SAVE_AUG flag to save some examples of our training samples:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5y0-2qEHk_jSMkFB" /></figure><p>These are two pairs of hr-father and lr-son samples. We can see they were rotated 90 degrees left and a considerable amount of noise was added to the lr-son.</p><p>As mentioned before this is done to make the net learn how to fix noise and to augment (enlarge) the dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/96/0*Xzr9ACxjjIuqQnKi" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/96/0*01iu29I2tOsMgyad" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/96/0*Jg30P6fdrHE2FhzD" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/96/0*Yd1owx67TWGiInZD" /></figure><p>Results:</p><p>The low-resolution input (subdir 034):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/0*HVdUG4EwFotFG_Kg" /></figure><p>This is a simple interpolation with an SR_Factor of 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*Ldx1KK38pkpqsMQN" /></figure><p>This is our super resolution output (1000 epochs w. Noise standard deviation set to 30):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*jnFKZQaV0p4Xkoax" /></figure><p>*Notice the considerable reduction in noise and grain.</p><p>Here is the ground-truth image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*NzrMcADKE3gjZOVr" /></figure><p>Training examples for subdir 067 (no noise was added):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/96/0*U0UYzPz4whndfX3s" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/96/0*u9isvymPwInRV-2s" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/96/0*TRtSZK2uO_hYtzlp" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/96/0*hO8q6cIbpfuN8T1I" /></figure><p>The low-resolution input (subdir 067):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/0*7-M7uEXY5CwTlocU" /></figure><p>This is a simple interpolation with an SR_Factor of 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*VWGyQDfc_dSZD6l8" /></figure><p>This is our super resolution output (1000 epochs w.o noise):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*CgFD2W2ItAlE6Y7Y" /></figure><p>* The improvement is gentle but when taking to effect the considerably shorter training time and the much smaller size of the neural network it is quite impressive.</p><p>Lets try to run it again but with Noise standard deviation set to 30:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*hrAaA8uAIf_kK_0u" /></figure><p>And with the noise std set to 70:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*fnzoJ-HmDN5iUevr" /></figure><p>We see some improvement but what might really help is not adding Gaussian noise to the lr-sons but stronger <a href="https://en.wikipedia.org/wiki/Compression_artifact">JPEG artifact</a>.</p><p>The ground-truth image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*kyc7uij0oCraDCPV" /></figure><p>Let’s set some useful parameters. These are global parameters we set up outside of main(). By tweaking with their values we can change the behavior of our architecture and algorithm dramatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/0*XqnG5ax8tgM0Zt-T" /></figure><p>For instance: SR_FACTOR determines the increase in resolution for our target image, While NOISE_FLAG is responsible for adding or not adding noise to our low-resolution samples. Finally, as we tune and change these parameters for different configurations, we can use MissingLink&#39;s dashboard to compare the outcomes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DGaNJSFC-One5lYm" /></figure><p>The image specificity of the model requires tuning per image to achieve optimal results. This can be done quickly by hand or automatically by a short script. All the most important hyperparameters such as epochs, filters and noise are configurable by a parser on the command line. The model achieves higher results than the state of the art EDSR model on many samples (try subdir 067 with 1000 epochs). This can be seen by the ZSSR vs. EDSR ratio on the PSNR qualitative test (metrics_ratio=1.03108).</p><p>*Notice we receive lower metric scores on psnr than in the original article, even on the EDSR bench-mark examples. This must be due to differences in the implementation of psnr in sklearn versus matlab (which the writers used).</p><p>In the next part we will dive into the code implementation and explain the functions further.</p><p><em>Originally published at </em><a href="https://missinglink.ai/blog/computer-vision/zero-shot-super-resolution-part-3-training-the-model"><em>https://missinglink.ai</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3bf5cdcf52c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/missinglink-deep-learning-platform/zero-shot-super-resolution-part-3-training-the-model-a3bf5cdcf52c">Zero Shot Super Resolution Part 3: Training the Model -</a> was originally published in <a href="https://medium.com/missinglink-deep-learning-platform">MissingLink Deep Learning Platform</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zero Shot Super Resolution Part 2: Implementing ZSSR with Keras and MissingLink.ai -]]></title>
            <link>https://medium.com/missinglink-deep-learning-platform/zero-shot-super-resolution-part-2-implementing-zssr-with-keras-and-missinglink-ai-fe6b9f361671?source=rss-60beede956b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe6b9f361671</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[super-resolution]]></category>
            <category><![CDATA[keras]]></category>
            <dc:creator><![CDATA[Shahar Guigui]]></dc:creator>
            <pubDate>Wed, 12 Jun 2019 08:30:06 GMT</pubDate>
            <atom:updated>2019-06-13T20:35:55.982Z</atom:updated>
            <content:encoded><![CDATA[<h3>Zero Shot Super Resolution Part 2: Implementing ZSSR with Keras and MissingLink.ai</h3><p>In <a href="https://missinglink.ai/blog/computer-vision/zero-shot-super-resolution-part-1/">part 1</a>, we reviewed <strong>Single Image Super Resolution</strong> (SISR) methods and <strong>Zero-Shot Super Resolution</strong> in particular. These methods aim to obtain a high resolution (HR) output from a low-resolution (LR) version. As a quick recap, the applications for this range from medical imaging, working with compressed images, agriculture analysis, autonomous driving, satellite imagery, reconnaissance and more. In part two, we are going to set up our environment for running the code and in Part 3 we’ll take a deep dive into implementing it with Keras and MissingLink.ai.</p><p>Super Resolution is the act of creating a high-resolution image from a low-resolution image. Most Deep Learning methods tackle this problem by using a large neural network which is trained on big sets of data for long periods of time. Zero Shot Super Resolution tries instead to train a small ‘image-specific’ neural network on the single target image and its augmentations.</p><p>Here is an example of what we hope to achieve using this technique:</p><p>Original image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/205/0*uT7feFEAqSJHRnVk" /></figure><p>Super-resolution image from ZSSR:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/0*VW8M8-wfZWn6R2Xa" /></figure><p>Our goal for this project is to create a model that can take different low-resolution images and upscale them as a proof of concept that illustrates how this technique works in practice.</p><p>In order for us to get started, we will need to run the example implementation I’ve created based on <a href="https://keras.io/">Keras</a> with <a href="https://www.tensorflow.org/">TensorFlow</a> backend. <br>We’ll also be using <a href="https://opencv.org/">OpenCV</a> and <a href="http://missinglink.ai/">MissingLink.ai</a>. Sign up now for a demo of MissingLink.ai</p><p><strong>Keras</strong> is a high-level deep learning library in python. It’s an abstraction of <strong>TensorFlow</strong> that enables us to speed up the process of writing working deep learning code. Likewise, <strong>OpenCV</strong> is a library of programming functions mainly aimed at real-time computer vision. We will need to run our code example with <a href="https://www.python.org/">Python 3</a>.</p><p>The final component of this project is <strong>MissingLink</strong> which is a deep learning workflow automation platform. It allows us to train various versions of our model and utilizing cloud services with ease, compare experiments and analyze them even as they run, create data queries and version and much more!</p><p>You’ll want to set up a free account before you start by doing the following steps:</p><ol><li>Visit MissingLink.ai and click on the “Start Now” button</li><li>Enter your email and follow up the new account wizard.</li><li>Once you have an account you can create a new project called ZSSR Test and configure it for Keras.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_HjTd7RJfVjMJUB6" /></figure><p>Once you have an account and new project set up, you’ll be able to use MissingLink’s <a href="https://missinglink.ai/docs/integrating-our-sdk/keras/">Experiment Management</a> page to track the progress of each experiment you run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i3eXeCs3Zis5qgK-" /></figure><p>When you have everything you need, you’ll be ready to move onto downloading and setting up the actual code itself.</p><p>I’ve published a <a href="https://github.com/missinglinkai/ZSSR">ZSSR Project</a> in the<a href="https://github.com/missinglinkai"> MissingLink.ai GitHub repo</a> which you can clone or download to run through the code example. You can find the source code on GitHub <a href="https://github.com/missinglinkai/ZSSR">here</a>. The project I created contains everything you need to get up and running quickly inside of the <a href="https://github.com/missinglinkai/ZSSR/blob/master/readme.md">ReadMe file</a>. Here is a high-level overview of what you’ll need to do:</p><p><strong>Step 1.</strong> Clone this repo:</p><p><strong>Step 2. </strong>You are strongly recommended to use <a href="https://virtualenv.pypa.io/en/stable/">virtualenv</a> to create a sandboxed environment for individual Python projects:</p><p><strong>Step 3.</strong> Create and activate the virtual environment:</p><p><strong>Step 4.</strong> Install dependency libraries:</p><p><strong>Step 5.</strong> Authenticate your username from the CLI:</p><p><strong>Step 6.</strong> Run the code</p><p>At this point, you may need to also select the project you’d like to link to:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/0*Z0wDAl7cJQpNw242" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qfPyrCi6SY5DxpLd" /></figure><p>Once the project is running, you’ll be able to monitor its progress in the log file and in real-time on your MissingLink.ai dashboard.</p><p>Here you can see the loss and learning rate of our model over 2000 epochs. When the experiment is done, you’ll have a folder called “output” with the original image and the super-resolution image examples.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/0*oKzHpu0WggumwJrl" /></figure><p>At this point, you can experiment with the different input images by adding --subdir DIRNAME to the run command with any of the following optional directory names:</p><p>Here is an example to run this with 2000 epochs in subdirectory 1:</p><p>At this point you should have everything you need to download the code, run the project and make changes. In the next part, we’ll go through the code and dig deeper into what is going on under the hood.</p><p><em>Originally published at </em><a href="https://missinglink.ai/blog/computer-vision/zero-shot-super-resolution-part-2-implementing-zssr-with-keras-and-missinglink-ai"><em>https://missinglink.ai</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe6b9f361671" width="1" height="1" alt=""><hr><p><a href="https://medium.com/missinglink-deep-learning-platform/zero-shot-super-resolution-part-2-implementing-zssr-with-keras-and-missinglink-ai-fe6b9f361671">Zero Shot Super Resolution Part 2: Implementing ZSSR with Keras and MissingLink.ai -</a> was originally published in <a href="https://medium.com/missinglink-deep-learning-platform">MissingLink Deep Learning Platform</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>