<?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 Nir Barazida on Medium]]></title>
        <description><![CDATA[Stories by Nir Barazida on Medium]]></description>
        <link>https://medium.com/@nirbarazida?source=rss-c2f8d5541f2a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*z1JYSRJpQZx6x68GvBbGCw.jpeg</url>
            <title>Stories by Nir Barazida on Medium</title>
            <link>https://medium.com/@nirbarazida?source=rss-c2f8d5541f2a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 00:19:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nirbarazida/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[Stable Diffusion: Best Open Source Version of DALL·E 2]]></title>
            <link>https://medium.com/data-science/stable-diffusion-best-open-source-version-of-dall-e-2-ebcdf1cb64bc?source=rss-c2f8d5541f2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebcdf1cb64bc</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[diffusers]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Nir Barazida]]></dc:creator>
            <pubDate>Tue, 30 Aug 2022 16:11:00 GMT</pubDate>
            <atom:updated>2022-08-30T16:11:00.736Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*fccPSTl6GRJGxEmx.png" /><figcaption>Image from <a href="https://unsplash.com/photos/-fRAIQHKcc0">Unsplash</a></figcaption></figure><p>Created by the researchers and engineers from <a href="https://stability.ai/">Stability AI</a>, <a href="https://github.com/CompVis">CompVis</a>, and <a href="https://laion.ai/">LAION</a>, “Stable Diffusion” claims the crown from <a href="https://www.craiyon.com/">Craiyon</a>, formerly known as DALL·E-Mini, to be the new state-of-the-art, text-to-image, open-source model.</p><p>Although generating images from text already feels like ancient technology, Stable Diffusion manages to bring innovation to the table, which is even more surprising given that it’s an open-source project.</p><p>Let’s dive into the details, and check what Stable Diffusion has in store for the data science community!</p><h3>Introducing Stable Diffusion</h3><p>Stable Diffusion is an open source implementation of the <a href="https://arxiv.org/abs/2112.10752">Latent Diffusion</a> architecture, trained to denoise random Gaussian noise, in a lower dimensional latent space, to get a sample of interest.</p><p>Diffusion models are trained to predict a way to slightly denoise a sample in each step, and after a few iterations, a result is obtained. Diffusion models have already been applied to a variety of generation tasks, such as image, speech, 3D shape, and graph synthesis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v12mDJwIKWn-_y8L.png" /><figcaption>The Diffusion process (image by author)</figcaption></figure><p>Diffusion models consist of two steps:</p><ul><li>Forward Diffusion — Maps data to noise by gradually perturbing the input data. This is formally achieved by a simple stochastic process that starts from a data sample and iteratively generates noisier samples using a simple Gaussian diffusion kernel. This process is used only during training and not on inference.</li><li>Parametrized Reverse — Undoes the forward diffusion and performs iterative denoising. This process represents data synthesis and is trained to generate data by converting random noise into realistic data.</li></ul><p>The forward and reverse processes require sequential repetition of thousands of steps, injecting and reducing noise, which makes the whole process slow and heavy on computational resources.</p><p>To enable training on limited resources while retaining its quality and flexibility, the creators of Stable Diffusion adopted the method suggested in the paper. Instead of using the actual pixel space, they applied the diffusion process over a lower dimensional latent space.</p><blockquote>For example, the autoencoder used in Stable Diffusion has a reduction factor of 8. This means that an image of shape (3, 512, 512) becomes (3, 64, 64) in latent space, which requires 8 × 8 = 64 times less memory.<br><a href="https://huggingface.co/blog/stable_diffusion">official “Stable Diffusion” release notes</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rW_y1kjruoT9BSO0.png" /><figcaption>Stable Diffusion Architecture (image from <a href="https://arxiv.org/abs/2112.10752">paper</a>)</figcaption></figure><h3>Stable Diffusion Architecture</h3><p>The Stable Diffusion architecture has three main components, two for reducing the sample to a lower dimensional latent space and then denoising random gaussian noise, and one for text processing.</p><p>1) The Autoencoder: The input of the model is a random noise of the size of the desired output. It will first reduce the sample to a lower dimensional latent space. For that, the authors used the <a href="https://towardsdatascience.com/understanding-variational-autoencoders-vaes-f70510919f73">VAE Architecture</a>, which consists of two parts — encoder and decoder. The encoder is used during training to convert the sample into a lower latent representation and passes it as input to the next block. On inference, the denoised, generated samples undergo reverse diffusion and are transformed back to their original dimensional latent space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rDygDwLLkTtSr-iS.png" /><figcaption>VAE Architecture (image from <a href="https://arxiv.org/abs/2112.10752">paper</a>)</figcaption></figure><p>2) U-Net: The U-Net block, comprised of ResNet, receives the noisy sample in a lower latency space, compresses it, and then decodes it back with less noise. The estimated noise residual from the U-Net output is used to construct the expected denoised sample representation.</p><p>3) Text Encoder: The text encoder is responsible for the text processing, transforming the prompt into an embedding space. Similar to Google’s <a href="https://arxiv.org/abs/2205.11487">Imagen</a>, Stable Diffusion uses a frozen CLIP ViT-L/14 Text Encoder.</p><h3>Technical details</h3><p>Stable Diffusion v1 was pre-trained on 256x256 images and then fine-tuned on 512x512 images, all from a subset of the <a href="https://laion.ai/blog/laion-5b/">LAION-5B</a> database. It uses a downsampling-factor 8 autoencoder with an 860M UNet and CLIP ViT-L/14 text encoder for the diffusion model. Stable Diffusion is relatively lightweight and runs on a GPU with 10GB VRAM, and even less when using float16 precision instead of the default float32.</p><p>The team has currently published the following checkpoints:</p><ul><li>sd-v1-1.ckpt: 237k steps at resolution 256x256 on <a href="https://huggingface.co/datasets/laion/laion2B-en">laion2B-en</a>. 194k steps at resolution 512x512 on <a href="https://huggingface.co/datasets/laion/laion-high-resolution">laion-high-resolution</a> (170M examples from LAION-5B with resolution &gt;= 1024x1024).</li><li>sd-v1-2.ckpt: Resumed from sd-v1-1.ckpt. 515k steps at resolution 512x512 on <a href="https://laion.ai/blog/laion-aesthetics/">laion-aesthetics v2 5+</a> (a subset of laion2B-en with estimated aesthetics score &gt; 5.0, and additionally filtered to images with an original size &gt;= 512x512, and an estimated watermark probability &lt; 0.5. The watermark estimate is from the <a href="https://laion.ai/blog/laion-5b/">LAION-5B</a> metadata, the aesthetics score is estimated using the <a href="https://github.com/christophschuhmann/improved-aesthetic-predictor">LAION-Aesthetics Predictor V2</a>).</li><li>sd-v1-3.ckpt: Resumed from sd-v1-2.ckpt. 195k steps at resolution 512x512 on &quot;laion-aesthetics v2 5+&quot; and 10% dropping of the text-conditioning to improve <a href="https://arxiv.org/abs/2207.12598">classifier-free guidance sampling</a>.</li><li>sd-v1-4.ckpt: Resumed from sd-v1-2.ckpt. 225k steps at resolution 512x512 on &quot;laion-aesthetics v2 5+&quot; and 10% dropping of the text-conditioning to improve <a href="https://arxiv.org/abs/2207.12598">classifier-free guidance sampling</a>.</li></ul><p><strong>From the official GitHub repository of Stable Diffusion</strong></p><h3>Model Performance</h3><p>To assess the quality of images created by generative models, it is common to use the <a href="https://en.wikipedia.org/wiki/Fr%C3%A9chet_inception_distance">Fréchet inception distance (FID)</a> metric. In a nutshell, FID calculates the distance between the feature vectors of real images and generated images. On the COCO benchmark, Imagen currently achieved the best (lowest) zero-shot FID score of 7.27, outperforming DALL·E 2 with a 10.39 FID score.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jC597OmwO9y-2Tq4.png" /><figcaption>Best Results for Diffusion Models (Image from <a href="https://paperswithcode.com/sota/text-to-image-generation-on-coco?tag_filter=246">papers with code</a>)</figcaption></figure><p>The Stable Diffusion team hasn’t published any benchmark scores to enable comparison to other models. From the original <a href="https://arxiv.org/abs/2112.10752">Latent Diffusion</a> paper (see below), the Latent Diffusion Model (LDM) has reached a 12.63 FID score using the 56 × 256-sized MS-COCO dataset: with 250 DDIM steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/0*NNwM0cfPslldA1Yr.png" /><figcaption>Stable Diffusion Results (image from <a href="https://arxiv.org/abs/2112.10752">paper</a>)</figcaption></figure><p>The best part of text-to-image models is that we can easily qualitatively assess the model’s performances. Let’s see how Stable Diffusion performs compare to SOTA closed-source model, DALL·E 2.</p><h3>Stable Diffusion vs DALL·E 2</h3><blockquote>Boston Terrier with a mermaid tail, at the bottom of the ocean, dramatic, digital art.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*F3jVIlEAyLkMpJFhb4fxKQ.png" /><figcaption>Images generated with Stable Diffusion and DALL·E 2 (Image by author)</figcaption></figure><blockquote>A Boston Terrier jedi holding a dark green lightsaber, photorealistic</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*R_EN0k8q7rwZ_jZkscRhwA.png" /><figcaption>Images generated with Stable Diffusion and DALL·E 2 (Image by author)</figcaption></figure><p>I can’t help but marvel at the results these models produce, it is absolutely mind-blowing. The future is here!</p><p>From the results, it can be seen that DALL·E-2 manages to understand and produce images that are more suitable to the prompt, while Stable Diffusion struggles. For example, the dog is standing on a fish instead of having a tail. However, the quality of the image, color, lighting, and style, are nothing less than impressive.</p><h3>Stable Diffusion vs Craiyon (DALL·E Mini)</h3><p>But as good data scientists, we’d like to compare apples to apples. Let’s compare Stable Diffusion to an Open Source project, Craiyon.</p><blockquote>Nerdy boston terrier with glasses behind computer writing code anime style</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*1zeo660JJmgboQRvO9ho5w.png" /><figcaption>Images generated with Stable Diffusion and Craiyon (Image by author)</figcaption></figure><p>As we can immediately see, Stable Diffusion produces much more realistic images while Craiyon struggles to shape the dog’s face.</p><h3>The Controversial Side of Stable Diffusion</h3><p>Stable Diffusion has generated a lot of debate in its short time of existence. Unlike DALL·E 2, Stable Diffusion has very few constraints on the content it can generate. Upon its release, users tested its limitations, generating images of people by name, pornographic images, and ones that suspiciously resemble works by artists who did not consent to the use of their materials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eoDFeVj7BJWVXZs_.png" /><figcaption>In the words of DALL·E 2 with slight text modifications 😉 (Image by auteur)</figcaption></figure><p>All these have generated a lot of discussions on <a href="https://dagshub.com/blog/d30f0aa7049c4a9cb7b958644d658a08">Twitter</a> and <a href="https://www.reddit.com/r/StableDiffusion/comments/woej9g/stable_diffusion_draws_controversy_on_twitter/">Reddit</a>, where people called to stop the project due to safety issues. As of the writing of this blog post, Twitter decided to block the project account, and the model hosted on <a href="https://huggingface.co/spaces/stabilityai/stable-diffusion">HugginFace Space</a> was restricted on the content it can generate, named “Safety Classifier,” which is intended to remove NSFW images.</p><h3>Conclusion</h3><p>Stable Diffusion is one of the most exciting OSDS projects recently released. It provides state-of-the-art results and a significant improvement on all fronts compared to previous OS text-to-image models. Can’t wait to see what the future holds in this domain but can’t help to be concerned by its implications.</p><h3>Resources</h3><ul><li><a href="https://huggingface.co/blog/stable_diffusion">Stable Diffusion release notes</a></li><li><a href="https://github.com/CompVis/stable-diffusion">Stable Diffusion GitHub repo</a></li><li><a href="https://arxiv.org/abs/2112.10752">“High-Resolution Image Synthesis with Latent Diffusion Models” paper</a></li><li><a href="https://developer.nvidia.com/blog/improving-diffusion-models-as-an-alternative-to-gans-part-1/">Improving Diffusion Models as an Alternative To GANs</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebcdf1cb64bc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/stable-diffusion-best-open-source-version-of-dall-e-2-ebcdf1cb64bc">Stable Diffusion: Best Open Source Version of DALL·E 2</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[YOLOv6: next-generation object detection — review and comparison]]></title>
            <link>https://medium.com/data-science/yolov6-next-generation-object-detection-review-and-comparison-c02e515dc45f?source=rss-c2f8d5541f2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c02e515dc45f</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[object-detection]]></category>
            <dc:creator><![CDATA[Nir Barazida]]></dc:creator>
            <pubDate>Tue, 05 Jul 2022 13:27:45 GMT</pubDate>
            <atom:updated>2022-07-05T13:27:45.690Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ntuxZniu-76-7ODdQmaemA.jpeg" /><figcaption>Image from <a href="https://unsplash.com/photos/jXd2FSvcRr8">Unsplash</a></figcaption></figure><h3>YOLOv6: next-generation object detection — review and comparison</h3><p>The field of computer vision has rapidly evolved in recent years and achieved results that seemed like science fiction a few years back. From <a href="https://dagshub.com/nirbarazida/pneumonia-Classification">analyzing X-ray images</a> and diagnosing patients to (semi-)autonomous cars, we’re witnessing a revolution in the making. These breakthroughs have many causes — building better, more accessible compute resources, but also the fact that they are the closest thing we have to <a href="https://dagshub.com/blog/a-case-for-open-source-data-science/">Open Source Data Science</a> (OSDS). Revealing the source code to the community unlocks the “wisdom of the crowd” and enables innovation and problem-solving at scale.</p><p>One of the most popular OS projects in computer vision is YOLO (You Only Look Once). YOLO is an efficient real-time object detection algorithm, first described in the seminal 2015 <a href="https://arxiv.org/abs/1506.02640">paper</a> by Joseph Redmon et al. YOLO divides an image into a grid system, and each grid detects objects within itself. It can be used for real-time inference and require very few computational resources.</p><p>Today, 7 years after the first version of YOLO was released, the research group at Meituan published the new YOLOv6 model — and it’s here to kick a**!</p><h3>The History of YOLO</h3><h3>Object detection before YOLO</h3><p>Before YOLO, the two-stage object detection architecture dominated the field. It used region-based classifiers to locate areas and then pass them to a more robust classifier. While this method gives accurate results, with a high mean Average Precision (mAP), it is very resource-intensive, requiring many iterations in its operation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/0*spAlDl0Jv11zBLMQ.png" /><figcaption>Two-stage object detection, image from paper</figcaption></figure><h3>How does YOLO work?</h3><p>YOLO suggested a different methodology where both stages are conducted in the same neural network. First, the image is divided into cells, each having an equal dimensional region of SxS. Then, each cell detects and locates the objects it contains with bounding box coordinates (relative to its coordinates) with the object label and probability of the thing being present in the cell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Lg8T0ghKhK9XAeW4.png" /><figcaption>YOLOv1, image from original paper</figcaption></figure><p>Because each cell “works on its own” it can process the grid simultaneously and reduces the required computing powers and time needed to train and infer. In fact, YOLO achieves state-of-the-art results, beating other real-time object detection algorithms.</p><h3>What versions does YOLO have?</h3><ul><li>YOLOv1 (Jun, 2015): <a href="https://arxiv.org/abs/1506.02640">You Only Look Once: Unified, Real-Time Object Detection</a></li><li>YOLOv2 (Dec, 2016): <a href="https://arxiv.org/abs/1612.08242v1">YOLO9000:Better, Faster, Stronger</a></li><li>YOLOv3 (Apr, 2018): <a href="https://arxiv.org/abs/1804.02767v1">YOLOv3: An Incremental Improvement</a></li><li>YOLOv4 (Apr, 2020): <a href="https://arxiv.org/abs/2004.10934v1">YOLOv4: Optimal Speed and Accuracy of Object Detection</a></li><li>YOLOv5 (May, 2020): <a href="https://github.com/ultralytics/yolov5">Github repo</a> (No paper was released yet)</li></ul><h3>YOLOv6 is here to kick A** and Take Names</h3><p>MT-YOLOv6 was inspired by the original one-stage YOLO architecture and thus <a href="https://github.com/meituan/YOLOv6/blob/main/docs/About_naming_yolov6.md">was (bravely) named</a> YOLOv6 by its authors. Though it provides outstanding results, it’s important to note that MT-YOLOv6 is not part of the official YOLO series.</p><p>YOLOv6 is a single-stage object detection framework dedicated to industrial applications, with hardware-friendly efficient design and high performance. It outperforms YOLOv5 in detection accuracy and inference speed, making it the best OS version of YOLO architecture for production applications.</p><h3>YOLOv6 Achievements</h3><ul><li>YOLOv6-nano — achieves 35.0 mAP on COCO val2017 dataset with 1242 FPS on T4 using TensorRT FP16 for bs32 inference</li><li>YOLOv6-s — achieves 43.1 mAP on COCO val2017 dataset with 520 FPS on T4 using TensorRT FP16 for bs32 inference.</li></ul><h3>Single Image Inference</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EuLMAXmwMpE2bvIP.png" /><figcaption>Image from YOLOv6 Repository</figcaption></figure><p>YOLOv6s (red) provide a better mean Average Precision (mAP) than all the previous versions of YOLOv5, with approximately 2x faster inference time. We can also see a huge performance gap between YOLO-based architecture and EfficientDet, which is based on two-stage object detection.</p><h3>Video Inference</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gITL6C_55cQHNpgk.png" /><figcaption>Image from YOLOv6 Repository</figcaption></figure><p>Same as in the single image inference, YOLOv6 provides better results for video on all the FPS spectrum. It’s interesting to note the change in the curve for ~550–620 FPS. I wonder if it has anything to do with hardware performance and whether or not the maintainers reduce the bias of hardware when conducting their experiments.</p><h3>Benchmark</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f7MwkX8WmUOz-YPe.png" /><figcaption>Image by author</figcaption></figure><ul><li>Comparisons of the mAP and speed of different object detectors are tested on <a href="https://cocodataset.org/#download">COCO val2017</a> dataset.</li><li>Speed results of other methods were tested in the maintainers’ environment using the official codebase and model if not found from the corresponding official release.</li></ul><p>Disclaimer: The above review is based on the authors’ claims, and we have yet to verify them.</p><h3>YOLOv5 vs. YOLOv6</h3><h3>Benchmark comparison between YOLOv5 and YOLOv6</h3><p>While looking into the benchmarks of both models, I found it hard to compare apples to apples. YOLOv6 has fewer types of models (lacking m/l/x) and doesn’t have any information about images larger than 640 pixels. For the benchmarks both projects reported, we can clearly see the improvement in mAP for YOLOv6. However, v6 has 2x the number of parameters and Flops from v5, making me want to dive into the training process myself and double-check the results below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OddcR-Ad89dBkq0i.png" /><figcaption>Image by author</figcaption></figure><h3>Qualitative comparison between YOLOv5 and YOLOv6</h3><p>I used the s version of both models to detect objects in the following images:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/0*iOyM8lhQzj7Apohi.jpeg" /><figcaption>YOLOv6 Performances, Image from YOLOv5 Repository</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/0*fyxmnTPGhbGHN-Wg.png" /><figcaption>YOLOv5 Performances, Image from YOLOv5 Repository</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*a5lXCtv-j0Vny_PG.jpeg" /><figcaption>YOLOv6 Performances, Image from YOLOv5 Repository</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*-xQ9gB8n-ZEdqH_G.jpeg" /><figcaption>YOLOv5 Performances, Image from YOLOv5 Repository</figcaption></figure><p>We can clearly see that YOLOv6s detect more objects in the image and has higher confidence about their label.</p><h3>Flexibility</h3><p>Both projects have similar approaches to creating different model sizes. The biggest difference is that <a href="https://github.com/ultralytics/yolov5/tree/master/models">YOLOv5 uses YAML</a>, whereas <a href="https://dagshub.com/nirbarazida/YOLOv6/src/main/configs">YOLOv6 defines the model parameters directly in Python</a>. A precursory glance also indicates that YOLOv5 might be a bit more customizable to a certain extent.</p><p>However, the fact that YOLOv6 is so flexible means that we could see larger versions of YOLOv6 in the future with even higher accuracy predictions!</p><p>If you create a larger YOLOv6 model, <a href="https://discord.com/invite/9gU36Y6">let us know on Discord</a>! We’d love to see it!</p><h3>Usage</h3><p><a href="https://yolov6.dagshubusercontent.com/">You can interact with the latest version of YOLOv6 using DagsHub’s application</a>. If you want to use it on your local machine follow these steps:</p><p><strong>Installation</strong></p><pre>git clone https://dagshub.com/nirbarazida/YOLOv6 cd<br>YOLOv6 pip install -r requirements.txt <br>dvc pull</pre><p><strong>Inference</strong></p><p>Use YOLOv6s:python tools/infer.py --weights yolov6s.pt --source &lt;path to image/directory&gt;</p><p>Use YOLOv6n: python tools/infer.py --weights yolov6n.pt --source &lt;path to image/directory&gt;</p><h3>Conclusion</h3><p>YOLOv6 is one of the most exciting OSDS projects recently released. It provides state-of-the-art results and a significant improvement on all fronts compared to previous YOLO versions. The maintainers are currently focused on enriching the types of models, deployment options, and quantization tools. Still, as with any open source project, the community can greatly impact its roadmap and progress curve.</p><p>Although the project is still in its early days, it looks very promising, and I’m intrigued to see what other benchmarks it will break in the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c02e515dc45f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/yolov6-next-generation-object-detection-review-and-comparison-c02e515dc45f">YOLOv6: next-generation object detection — review and comparison</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[STRAGGLERS AND LATENCY IN SYNCHRONOUS DISTRIBUTED TRAINING OF DEEP LEARNING MODELS]]></title>
            <link>https://medium.com/data-science/stragglers-and-latency-in-synchronous-distributed-training-of-deep-learning-models-43783b0266d9?source=rss-c2f8d5541f2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/43783b0266d9</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[model-training]]></category>
            <dc:creator><![CDATA[Nir Barazida]]></dc:creator>
            <pubDate>Tue, 08 Mar 2022 16:37:23 GMT</pubDate>
            <atom:updated>2022-03-10T09:08:57.632Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0RYS39p8d9Nym-5mKavF_w.jpeg" /><figcaption>Image from Unsplash</figcaption></figure><h3>Distributed training of deep learning models: handling stragglers and latency in synchronous training</h3><h4>A review of the challenges in Synchronous distributed training and best solutions for stragglers and high latency</h4><h3>Abstract</h3><p>Synchronous distributed training is a common way of distributing the training process of machine learning models with data parallelism. In synchronous training, a root aggregator node fans-out requests to many leaf nodes that work in parallel over different input data slices and return their results to the root node to aggregate. The latency of the leaf nodes greatly affects the efficiency of this architecture, and when scaling the number of parameters and data points, it can dramatically increase the training time. In this blog, I’ll explore the Synchronous Stochastic Gradient Descent (Sync-SGD) method to distribute the training process of deep learning models. I’ll focus my work on the effect of <strong>stragglers</strong> and <strong>high</strong> <strong>latency</strong> on its efficiency and research for methods and techniques to overcome those challenges.</p><h3>Motivation and background</h3><p>In recent years, we’ve seen the power of large-scale deep learning projects. Projects like GPT-3, its open-source version — GPT-NeoX-20B, and MT-NLG- involve model and dataset sizes that would be unfathomable only a few years ago and currently dominate the state of the art. We can see exponential growth in the complexity of the models, the number of parameters, and the size of datasets. This trend raised the demand for large-scale processing to the point where it has outpaced the increase in computation power of a single machine. The need to distribute the machine learning workload across multiple machines has been raised and led to the Synchronous Distributed Training idea.</p><blockquote>Note: <em>There is a difference between distributed training and distributed inference. if a machine learning service receives a large number of requests, we need to distribute the model over several machines to accommodate the load. Scaling training, on the other hand, is when training the same model on more than one machine.</em></blockquote><p>Synchronous stochastic gradient descent is a common way of distributing the training process of machine learning models with data parallelism. In synchronous training, a root aggregator node fans-out requests to many leaf nodes that work in parallel over different input data slices and return their results to the root node to aggregate.</p><h3>Stochastic Gradient Descent</h3><p>Before we dive into the implementation details and challenges, let’s first understand what stochastic gradient descent (SGD) is. Given a dataset D and a model with θ parameters, we’d like to minimize the parameterized empirical loss function, L, for a given (x,y) pairs in D, where x denotes the input sample while y is the output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*O-DekPIpmc5AezP_lrA9vQ.png" /><figcaption>Image by author</figcaption></figure><p>Where l is the loss of a data point (x,y) for model θ.</p><p>A first-order stochastic optimization algorithm optimizes the loss function by iteratively updating θ using a stochastic gradient. Usually, a learning rate will be applied to avoid over or underfitting, and therefore, the SGD will be calculated as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/224/1*rD4SJhSLAAIdnck5HhKH3g.png" /><figcaption>Image by author</figcaption></figure><p>where ɣ is the learning rate or step size at iteration.</p><p>A mini-batch version of the stochastic optimization algorithm computes the gradient over a mini-batch of size B instead of a single data point:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/265/1*rbhBBADULh41mQijPP9vlQ.png" /><figcaption>image by author</figcaption></figure><h3>Synchronous stochastic gradient descent</h3><p>Using distributed Synchronous Stochastic Gradient Descent (Sync-SGD), a root aggregator node splits the data into batches and fans-out requests to leaf nodes (worker machines) to process each batch and compute its gradient independently. Once all machines return their result, the root aggregator node averages the gradient and sends it back to the workers to update the model’s parameters. The root aggregator iterates over this process for a given number of epochs or based on a conversion condition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*0AZLnbndbpE_K-ZImE-w9w.png" /><figcaption>FIGURE 1: DISTRIBUTED SYNCHRONOUS STOCHASTIC GRADIENT DESCENT FLOW, Image by author</figcaption></figure><h3>Issues</h3><p>In theory, distributing the computation onto T worker machines should give a performance improvement of xT. Yet, in reality, the performance improvement is rarely xT. The decline in efficiency is caused due to many reasons, where recent researches segment <strong>Stragglers</strong> and <strong>High-Latency</strong> as the main root cause.</p><h3>Stragglers and High Latency in Distributed Synchronous SGD</h3><p><strong>Stragglers</strong> are tasks that run much slower than other workers. Slow stragglers may result from failing hardware, contention on shared underlying hardware resources in data centers, or even preemption by other jobs. <a href="https://arxiv.org/abs/1604.00981">Rafal et al. (2017)</a> conducted an experiment that calculated the time it takes to run a Sync-SGD using 100 workers and 19 parameters on the Inception model. These times are presented in Figure 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*u2B6WWQQ0oZlKdUn1mOiDA.png" /><figcaption>FIGURE 2: THE EFFECT OF NUMBER OF WORKERS ON THE SYNC-SGD TRAINING TIME, <a href="https://arxiv.org/abs/1604.00981">by Rafal et al. (2017)</a></figcaption></figure><p><strong>Latency</strong> is the time it takes for data to get to its destination across the network. Due to the high demand for strong computational power and its low supply, in many cases, the training data will not be in the same geographic location as the root aggregator and the workers, which results in high latency. Therefore, we will have to rely on the communication channel’s maximum bandwidth, which has limitations. For example, a good internet connection may provide a bandwidth of 15 megabytes per second, and a gigabit ethernet connection can provide a bandwidth of 125 megabytes per second. Those limitations can significantly reduce the iteration time when addressing large-scale data sets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*WuhyrMNirxsVLJB0W3uV5A.png" /><figcaption>FIGURE 3: NETWORK CONDITIONS ACROSS DIFFERENT CONTINENTS (LEFT) AND THE COMPARISON BETWEEN CONNECTIONS INSIDE A CLUSTER (RIGHT), <a href="https://openreview.net/pdf?id=SJeuueSYDH">Image from paper</a></figcaption></figure><p>Since the Sync-SGD algorithm is designed to wait until all workers return the loss function, it is sensitive to stragglers and high latency. The Sync-SGD architecture holds two defining properties:</p><ul><li>The running time is greater than or equal to the max of all workers’ running time.</li><li>Workers’ running time has a lognormal distribution [3].</li></ul><p>Due to those properties, as fanning out more workers, the tail of the distribution gets longer, and thus the running time gets worst on average. To grasp the effect of the number of workers on the running time, I conducted an experiment where I generated 1,000 lognormal distributions (μ=3, σ=0.1) with 3 samples sizes (10, 100, 1000) where each one represents the number of workers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*T3RlyWnJSld2mgM_GvYJ6g.png" /><figcaption>FIGURE 4: LATENCY LOGNORMAL DENSITY DISTRIBUTION, Image by author</figcaption></figure><p>Figure 4 clearly shows that as the fanout increases, the mean of the parent latency distribution gets higher with a lower variance. However, one would expect it to become exponentially worse, but it only becomes logarithmically worse, which might indicate that in some cases it’s better to fan out to more workers.</p><h3>Solutions for Stragglers and High Latency when using Sync-SGD</h3><p>The “arming race” for state-of-the-art machine learning models has led the industry to develop complex systems that require heavy computing to train. When it comes to such a large scale, any delay in the training cycle sum to a significant delay in the entire training process. To meet those high requirements and reduce the iteration time, researchers from academia and industry invest considerable time and resources in refining and streamlining the training process. I’ve gathered SOTA solutions for stragglers and high latency that improves the training time when using the Sync-SGD approach.</p><h4>Solutions for Stragglers</h4><p><strong>Drop Stragglers — WRONG APPROACH</strong></p><p>My initial approach to solving this issue was to drop the results of the stragglers and calculate the gradient using the results from the other workers. I supported this approach using two main hypotheses:</p><ul><li>Low ratio of stragglers to completed tasks — As fanning out to more workers, the number of stragglers increases, however, they only accommodate the ~98th percentile, and therefore their impact will be relatively small on the gradient on average.</li><li>Reducing a small amount of data from a large-scale dataset has little effect — The Sync-SGD method is used for a large amount of data. Thus, removing the result of the small batches from the training process will have a negligible effect on the gradient on average.</li></ul><p>However, my intonation was proven wrong by Rafal et al. (2017). They examined the effect of dropping the results of stragglers without using backup workers. Having fewer machines implies a smaller effective mini-batch size and thus greater gradient variance, which requires more iterations for convergence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*snxu4K1qa_YYh2zCKgQTiQ.png" /><figcaption>FIGURE 5: NUMBER OF ITERATIONS TO CONVERGE, <a href="https://arxiv.org/abs/1604.00981">by Rafal et al. (2017)</a></figcaption></figure><p>As shown in figure 5, the iterations needed to converge increase when reducing the number of workers we aggregate the gradient from. Thus, my approach reduces the iteration time per batch but increases the number of epochs to conversion and, therefore, the total training time.</p><p><strong>Backup Workers</strong></p><p>Rafal et al. (2017) approached the straggler drawback using technics from other distributed systems (<a href="https://www.ibm.com/topics/mapreduce#:~:text=MapReduce%20is%20a%20programming%20paradigm,tasks%20that%20Hadoop%20programs%20perform.">MapReduce</a>, <a href="https://www.microsoft.com/en-us/research/project/dryad/">Dryad</a>, <a href="https://hadoop.apache.org/">Hadoop</a>, and <a href="https://spark.apache.org/">Spark</a>). They choose to add <em>b</em> backup workers to the <em>N </em>workers. Once the root aggregator receives <em>N</em> inputs, it aggregates their gradient and updates the parameters. ​​The slowest <em>b</em> workers’ gradients are dropped when they arrive. From figure 2, we can see that their experiment resulted in 80% of the 98th gradient arriving under 2s, whereas only 30% of the final gradient did. Furthermore, the time to collect the final few gradients grows exponentially, resulting in wasted idle resources and time expended to wait for the slowest gradients.</p><p>As part of the research, they ran empirical comparisons of synchronous and <a href="https://arxiv.org/abs/1609.08326">Asynchronous distributed stochastic gradient descent</a> algorithms on the <a href="https://cloud.google.com/tpu/docs/inception-v3-advanced">Inception model</a> (Szegedy et al., 2016) trained on <a href="https://www.image-net.org/">ImageNet Challenge dataset</a> (Russakovsky et al., 2015).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*ghf0YfZRSmJYLRijeGTXRQ.png" /><figcaption>FIGURE 6: CONVERGENCE OF SYNC-SGD AND ASYNC-SGD ON INCEPTION MODEL USING VARYING NUMBER OF MACHINES, <a href="https://arxiv.org/abs/1604.00981">by Rafal et al. (2017)</a></figcaption></figure><p>From figure 6, we can see how using different numbers of workers and backup workers (<em>N+b</em>) has a clear effect on conversion time and rate. Figure 6 (b), shows that fanning out more workers doesn’t necessarily provide better results. When passing ~105 workers, the model’s precision decreases by ~0.3%. Moreover, In figure 6 (c) and 6 (d), the improvement slope decrease as the number of workers increases, which is reflected in the “elbow” shape.</p><h4>Solutions for High Latency</h4><p><strong>Ring All-Reduce</strong></p><p>The Ring All-Reduce is a well-known and used method to reduce high latency. It was adopted and incorporated into the <a href="https://eng.uber.com/horovod/">“Horovod“ library by Uber</a>. It takes advantage of bandwidth-optimal communication algorithms without loosening synchronization constraints. This method tackles the bandwidth limitation between the root aggregator and the workers and tries to optimize it.</p><p>To better understand how the Ring All-Reduce works, we’ll start by exploring the All-Reduce method. The All-Reduce algorithm has every worker share its parameters with all other workers and applies a reduction operation (e.g., sum, multiplication, max, or min). The All-Reduce algorithm is implemented in a variety of ways. Some aim to cut down on bandwidth, while others try to cut down on latency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*ON3SqSvTkDDzH86-sZduow.png" /><figcaption>FIGURE 7: ALL-REDUCE, by <a href="https://www.researchgate.net/publication/259239833_Sparse_Allreduce_Efficient_Scalable_Communication_for_Power-Law_Data">Huasha et al. (2013)</a></figcaption></figure><p>As shown in figure 4, when increasing the number of workers, we see the long tail phenomena of latency. On top of that, when using the naive communication method between the root aggregator and the workers to transfer data, the communication cost increased linearly with the number of workers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*RjpHVAOmeVH8CJ2n5fvkIg.png" /><figcaption>FIGURE 8: SYNCHRONOUS DISTRIBUTED TRAINING, Image by author</figcaption></figure><p>The Ring All-Reduce algorithm opens the bottleneck created by sending data to a single parameter server in an all-to-one method. In this technique, each worker is assigned with two workers; one to send data to and another to receive from, and then runs the following steps:</p><ul><li><strong>Scatter-reduce</strong> — each worker sends and receives a chunk of data from its neighbors. After the first transfer iteration is done, the workers conduct the reduced operation and then send it again to the next process in the ring. This phase finishes when each process holds the complete reduction of the chunk.</li><li><strong>All-gather</strong> — each worker will replace its value with the newly received one and continue with the data transfer until each worker receives the contributions from all other workers.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Iv8pJhrwLlhkhHMo.png" /><figcaption>FIGURE 9: RING ALL-REDUCE ALGORITHM, Image by <a href="https://eng.uber.com/horovod/">“Horovod“</a></figcaption></figure><p>The Ring All-Reduce algorithm speed is independent of the number of workers, instead, it is limited by the slowest communication link between neighboring workers. The ring all-reduce algorithm is applied to Sync-SGD systems the same way as the parameter server framework, but instead of sending gradients to a single parameter server, it sends it to its neighbors.</p><h3>Conclusion</h3><p>As the size of datasets and models’ complexity increases, distributed training will become more and more common in the MLOps ecosystem. As we saw, a delay in one training cycle has a high impact on the entire training process. Thus, the need to perfect the training process and reduce the time per epoch is high. If you have more ideas, questions, or thoughts — I’d love to hear about them!</p><p>For more content like this, follow me on <a href="https://www.linkedin.com/in/nir-barazida/">LinkedIn</a> &amp; <a href="https://twitter.com/barazida">Twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43783b0266d9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/stragglers-and-latency-in-synchronous-distributed-training-of-deep-learning-models-43783b0266d9">STRAGGLERS AND LATENCY IN SYNCHRONOUS DISTRIBUTED TRAINING OF DEEP LEARNING MODELS</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Closing the Data Loop with DagsHub Annotations and Label Studio]]></title>
            <link>https://medium.com/data-science/closing-the-data-loop-with-dagshub-annotations-and-label-studio-8bd328d3785a?source=rss-c2f8d5541f2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bd328d3785a</guid>
            <category><![CDATA[labels]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Nir Barazida]]></dc:creator>
            <pubDate>Tue, 15 Feb 2022 20:11:48 GMT</pubDate>
            <atom:updated>2022-02-15T20:11:48.712Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bACN9ZOeU90JciocIEV3fg.png" /><figcaption>DagsHub x Label Studio, Image by author</figcaption></figure><h4>No need to move your data between platforms, suffer from synchronization issues, break the project structure, or perform tedious tasks.</h4><p>A lot has been said about the importance of clean data with accurate and consistent labels. The entire <a href="https://www.forbes.com/sites/gilpress/2021/06/16/andrew-ng-launches-a-campaign-for-data-centric-ai/?sh=2433317f74f5">data-centric paradigm</a> relies heavily on making data labels more consistent to improve model performance. So why isn’t the data science community quickly adopting this approach? There might be many reasons, but a recurring claim is that <a href="https://dagshub.com/blog/challenges-in-labeling-unstructured-data/">labeling is too tedious a task</a>, one that’s hard to iterate over, manage, and scale.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*MXSM7YWBbUUXF1x1o6L9hw.png" /><figcaption>By <a href="https://twitter.com/abhi1thakur">Abhi shek</a>, with permission</figcaption></figure><h3>DagsHub integrates Label Studio</h3><p>Labeling is such an important task, but it’s more complex than it should be. Knowing that, we decided that it’s a barrier to entry DagsHub should help remove. We had many strong candidates for this integration, but the one that stood out was Label Studio — a powerful open-source tool that supports the labeling of many unstructured and structured data types with a strong and active community.</p><h3>Supported data types:</h3><ul><li>Computer Vision — images and video</li><li>Audio &amp; Speech Applications</li><li>NLP, Documents, Chatbots, Transcripts</li><li>Time series</li><li>Structured data — tabular, HTML, freeform</li><li>Multi-Domain Applications</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*CB-_hAUN1lRcpEJPswLpRg.gif" /><figcaption>From the official Label Studio website</figcaption></figure><p>Every repository on DagsHub comes with a fully configured <a href="https://dagshub.com/docs/reference/label_studio/">Label Studio workspace</a>. This workspace lets you annotate your data, with access to all the project’s files. By directly fetching data from <a href="https://dagshub.com/docs/reference/dagshub_storage/">DagsHub Storage</a>, so you no longer need to move, copy, or pull it to a third-party platform. This reduces a significant burden associated with labeling, which is managing and synchronizing data and labels.</p><h3>Git Flow for Data Labeling</h3><p>Labeling workflow is equivalent to developing a new feature. It should be done in an isolated environment with the ability to compare, analyze, and merge changes or roll them back and restore previous versions. Knowing that labeling is usually outsourced, these capabilities become even more vital to ensure its success.</p><p>Based on those needs and the challenges labelers face, DagsHub added a few toppings to Label Studio and created its unique flavor of the open-source version. It provides a Git experience, following the industry’s best practices, to ensure full <a href="https://dagshub.com/blog/data-science-workflows-to-track-experiments/">reproducibility, scalability, and efficient version control</a> of the labels and data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*YlE-dxGGrEYF_EU0tHFXNQ.png" /><figcaption>Git flow for labeling unstructured data, Image by author</figcaption></figure><h3>The workflow for DagsHub and Label Studio</h3><p>When creating a new labeling project on DagsHub, you associate it with a tip of an active branch. It marks the project’s starting point and will make all the files hosted on DagsHub Storage, under the selected commit, available for labeling. Once you reach a valuable result, you’ll be able to version and commit the annotations using Git, directly to a remote branch. Once the task is complete, you can create a pull request on DagsHub, where a reviewer can see and comment on every annotation.</p><h3>How to version a Label Studio project with DagsHub?</h3><p>To version control any artifact, it needs to have a single source of truth. To provide this source of truth for annotations, we created the .labelstudio directory, which holds annotations for every task in open source formats. When creating a new labeling project, DagsHub parses the selected commit for this directory and loads the existing annotations to their associated tasks. This way, we can roll back to previous versions with a click of a button.</p><h3>Get started with Label Studio and DagsHub</h3><p>In this section, I’ll guide you, step-by-step, on how to use Label Studio and DagsHub Annotations while following the recommended Git Flow. The main goal is to help you gain hands-on experience while having the benefit of following my lead. For that, I’ll use my “<a href="https://dagshub.com/nirbarazida/where-is-elon">Where’s Elon</a>” project, where I annotate Elon Musk’s images. I’m assuming you already have a project on DagsHub, with versioned data ready to be annotated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*DxSBvcbnFMM4B1M7phrbrg.png" /><figcaption>Image by author</figcaption></figure><h3>Step 1: Create a Label Studio workspace.</h3><p>Navigate to the Annotations tab in your DagsHub repository and create a new workspace. This process can take 2–3 minutes as DagsHub spins up the Label Studio machine behind the scenes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*McjN4ITjEsEzX9ioAPgKUw.gif" /><figcaption>Create a Label Studio workspace on DagsHub, Image by author</figcaption></figure><h3>Step 2: Create a Label Studio project</h3><p>In the new Annotation Project menu, choose the tip of a remote branch to associate the project with. It marks the project’s starting point and will make all the files hosted on DagsHub Storage, under the selected commit, available for labeling. To work in an isolated environment, we will create a new branch for the labeling project. The default project name is based on the annotator who created it; however, you can change it as you wish.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*F6re-lfRNLYDoOMXdbETNA.gif" /><figcaption>Create a Label Studio project on DagsHub, Image by author</figcaption></figure><h3>Step 3: Choose the files to annotate</h3><p>When launching the project for the first time, you’ll need to choose the files to annotate (AKA tasks). You can choose a specific file or an entire directory by checking the box next to its name.</p><p><strong>Note:</strong> you can annotate files hosted on both Git and DVC remotes. As a role of thumb: <em>“if you can see the file — you can annotate it.”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*sMbbSbN6weF1enDhscusZA.gif" /><figcaption>Choose the files to annotate on DagsHub, Image by author</figcaption></figure><h3>Step 4: Configure Label Studio</h3><p>You can configure <a href="https://labelstud.io/guide/setup.html">Label Studio’s labeling interface</a> using one of its many great templates. If you need a <a href="https://labelstud.io/guide/setup.html#Customize-a-template">custom template</a>, you can create it using basic HTML.</p><p>Note: If you choose to work with a template, you’ll need to set the project’s labels manually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*7ljDm9HhEAI35yhbnzk39w.gif" /><figcaption>Configure Label Studio on DagsHub, Image by author</figcaption></figure><h3>Step 5: Annotate the data</h3><p>As simple as that, you can start <a href="https://labelstud.io/guide/labeling.html#main">annotating your data</a>. No need to move the data to a different platform, change its structure or synchronize anything. You can start working on the tasks and save the annotations to DagsHub’s database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*0jPhasGeKczyBAnnmmWJxw.gif" /><figcaption>Annotate the data on DagsHub, Image by author</figcaption></figure><h3>Step 6: Commit changes to Git</h3><p>At any point in time, you can version the state of the project using <a href="https://git-scm.com/docs/git-commit">Git, and commit</a> the changes back to the branch you chose in step 2 or create a new branch and commit to it. The commit will include the special `.labelstudio` directory. You can add an annotations file in one of the commonly used formats (JSON, COCO, CSV, TSV, etc.) to the commit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Jvl4hQwzQMxa_gRZIZU-sg.gif" /><figcaption>Commit annotations to Git on DagsHub, Image by author</figcaption></figure><p>Utilizing Git’s capabilities, you can now seamlessly iterate over steps 5 and 6, compare the different versions, merge the results, or roll back the changes.</p><h3>Step 7: Create a pull request</h3><p>When you’re satisfied with the labels, meaning they’re accurate and consistent, you can merge them to the main branch. With DagsHub, communicating over the labels is part of the pull request without moving to a 3rd party platform. The reviewer can leave his comments on each label and have the entire process logged and easy to manage. Once completing the task, merging it to the project’s main branch is one click of a button away.</p><h3>Summary</h3><p>Labeling unstructured data comes with various challenges, many of which are a by-product of the workflow and unrelated to the annotation task itself. DagsHub Annotations and the Label Studio integration are designed to help overcome those challenges and create a smooth labeling workflow. It does the DevOps heavy lifting and provides you with the tools you need to manage and scale the labeling process.</p><p>If you have any questions, ideas, or thoughts about the integration — we’d love to hear about it on our <a href="https://discord.gg/y3T7zxuS">Discord channel</a>! We can’t wait to see your amazing projects become even greater with accurate and consistent labels.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bd328d3785a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/closing-the-data-loop-with-dagshub-annotations-and-label-studio-8bd328d3785a">Closing the Data Loop with DagsHub Annotations and Label Studio</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why is labeling unstructured data still hard?]]></title>
            <link>https://medium.com/data-science/why-is-labeling-unstructured-data-still-hard-56b5eb4152a3?source=rss-c2f8d5541f2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/56b5eb4152a3</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[unstructured-data]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Nir Barazida]]></dc:creator>
            <pubDate>Tue, 21 Dec 2021 19:07:12 GMT</pubDate>
            <atom:updated>2021-12-21T19:07:12.741Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*P3Olu-yax13UrEjy.jpg" /><figcaption>Two labeled opossums, image from <a href="https://www.pexels.com/photo/curios-hairy-possums-in-zoological-park-5749010/">Pexels</a></figcaption></figure><h4>Data labeling, one of the most critical tasks in the lifecycle of a machine learning project, is currently also one of the hardest to manage, scale, and monitor — and not for the right reasons</h4><p>Andrew Ng, an AI pioneer, is on a mission to change the AI ecosystem to be more <a href="https://www.youtube.com/watch?v=06-AZXmwHjo">data-centric</a>. Ng is basing his research on data (well, you should’ve seen it coming) collected throughout the years on how ML practitioners improve their model’s performances. Data, as Ng claims, is the most significant factor in the improvement rate, where good labeling is the number one cause.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/0*eW1AiSmVGGFKZqF7" /><figcaption>Table of improvement rate based on the mental model - source: <a href="https://www.deeplearning.ai/wp-content/uploads/2021/06/MLOps-From-Model-centric-to-Data-centric-AI.pdf">deeplearning.ai</a>, Image by Author</figcaption></figure><p>Moreover, basing the success of the model on the number of data points it’s trained on and not on their quality, will lower the potential improvement rate. Accurate and consistent labeled data increases the likelihood of our model to learn patterns that will help it predict events successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/0*e8pHTh6m48pyIgOr" /><figcaption>Graph of improvement rate based on given data, source: <a href="https://www.deeplearning.ai/wp-content/uploads/2021/06/MLOps-From-Model-centric-to-Data-centric-AI.pdf">deeplearning.ai</a>, Image by Author</figcaption></figure><h3>What are the challenges in labeling unstructured data</h3><p>Knowing that labeling is an essential factor in the project lifecycle — why is it still such a hard task to manage, scale and monitor? At DagsHub, we’ve interviewed ML professionals from hundreds of companies, trying to get to the bottom of their workflow problems. When examining the labeling phase, we encountered 5 main challenges:</p><ul><li>Managing data labeling.</li><li>Annotation version control.</li><li>Communicating throughout the labeling process.</li><li>Workforce management.</li><li>Domain knowledge required.</li></ul><h4>Managing data labeling</h4><p>The vast majority of labeling tools require moving the data to their workspace. If we have a DevOps team at our disposal, they might help us stream or pull a version of the data, while in most cases, we will have to copy it. When we gradually add new raw data or modify it, we need to also update the data hosed on the labeling tool workspace. For that, we need to curate what is missing, create a copy and move it to the labeling workspace — a tedious task in itself. But what happens when we have multiple versions of the data that differ from each other? It will require even more work to the extent of writing automations that synchronizes the storage and the labeling tool.</p><p>On top of that, when moving the data to the workspace, we lose its structure in the context of the project. It will only keep the name of the file without its path in the original project. Some tools even require modifying the data structure, to the extent that would have us abandon the directory structure and use a flat directory. Losing or modifying the data structure makes it even more complex to manage the labeling task and control the versions of the data.</p><h4>Annotation Version Control</h4><p>Labeling is a difficult task to master. It depends on a variety of parameters that are hard to predefine and, in most cases, will require multiple iterations. Same as any experiment we have in a data science project, we’d like a way to easily modify the annotations, test, analyze, and in some cases, retrieve and reproduce previous results. However, most labeling tools don’t support data lineage, making the iteration process ambiguous, which will likely result in stone age versioning (data_annotation1, data_annotation-11–02–2020, data_annotation_backup, etc.).</p><h4>Communicating Throughout the Labeling Process</h4><p>Labeling is an abstract task that doesn’t have a golden metric that can be tested easily. For example, “Use bounding boxes to indicate the position of the opossum.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XJkWa_TbN6fD4tvE" /><figcaption>Two opossums outside, image from <a href="https://www.pexels.com/photo/curios-hairy-possums-in-zoological-park-5749010/">Pexels</a></figcaption></figure><p>Can result in any one of the following outcomes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/0*3g0CCROjDFNhJcju.png" /><figcaption>Two labeled opossums, image from <a href="https://www.pexels.com/photo/curios-hairy-possums-in-zoological-park-5749010/">Pexels</a></figcaption></figure><p>As Andrew Ng showed, one of the most significant factors on the model’s performances is the noisiness of the data, or in other words, the consistency of the labels. Combining the ambiguousness of the task with the importance of its accurate outcome leads to the conclusion that the review process should be meticulous. However, most tools don’t support a communication channel between the reviewer and the labeler with the context of the labels. Thus, many organizations complete the reviewing process on a third-party platform, or worse, on a call, making it hard to track and manage the changes over time.</p><h4>Workforce management</h4><p>Because labeling can be a tedious and time-consuming task, many companies try to scale it by using <a href="https://www.mturk.com/">outsourcing solutions</a> or hiring a designated in-house expert team. Both options are valid and can help us move faster, but they do have some blind spots.</p><p><strong>The challenges when outsourcing the labeling task</strong></p><ul><li>Conflict of interest — usually, data labelers are paid by the quantity of the labeled data they provide. Therefore, it’s in their best interest to label as much data in as little time as possible, regardless of its noisiness. However, as the data consumers, we’d like to receive the best quality of data labels knowing how it affects the model’s performance. Since it’s hard to monitor the quality of the labeler’s work, this conflict can become a genuine concern when thinking of outsourcing the task.</li><li>High upfront investment — Training data labelers can be an arduous journey, especially if unique domain knowledge is required. It demands a significant upfront time investment, where its outcomes are unknown and might fail to actually be worth it.</li></ul><p><strong>The challenges when hiring a designated in-house labeling team</strong></p><ul><li>Scale-down — in many cases, labeling is not an ongoing task. We’ll put a lot of effort into labeling the required data at the start of the project, and then scale down to only work on improving the noisy samples. When hiring an in-house team, the scaling margin narrows down dramatically, and we’ll have to provide them with consistent work.</li><li>Resources — hiring and training an in-house labeling team require a lot of resources — on the financial, time, and staffing fronts. Further, it will require more of our daily attention for managing the team and quality-control their product.</li></ul><h4>Domain knowledge required</h4><p>Many projects demand prior knowledge to label their data. For example, labeling X-rays chest images and classifying them for Pneumonia will require a medical background that very few labelers have. Therefore, many projects are halted or require very large fundings due to the low pool of labelers and their high cost or the long training process required.</p><h3>Summary</h3><p>In recent years the AI domain has rapidly grown and evolved due to the enormous amount of data within reach of ML practitioners. However, the data-centric paradigm has proven that having a large amount of data just doesn’t cut it; we need high-quality labeled data to achieve SOTA results. Mastering the labeling task is still a work in progress, and once we’ll be able to easily scale and manage it, achieving those results will no longer be a MI.</p><p>If you’re facing challenges I didn’t mention here or can think of what can help us overcome them — <a href="https://www.linkedin.com/in/nir-barazida/">I’d love to hear about it!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56b5eb4152a3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/why-is-labeling-unstructured-data-still-hard-56b5eb4152a3">Why is labeling unstructured data still hard?</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Wrapping up the Papers with Code ML Reproducibility Challenge — Spring 2021]]></title>
            <link>https://medium.com/data-science/wrapping-up-the-papers-with-code-ml-reproducibility-challenge-spring-2021-451777f89526?source=rss-c2f8d5541f2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/451777f89526</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[reproducibility]]></category>
            <dc:creator><![CDATA[Nir Barazida]]></dc:creator>
            <pubDate>Tue, 21 Dec 2021 15:56:15 GMT</pubDate>
            <atom:updated>2021-12-21T15:56:15.279Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BBhle1UNw49MNmhuebfRfQ.png" /><figcaption>DagsHub x Papers with Code, image by author</figcaption></figure><h3>Wrapping up the Papers with Code ML Reproducibility Challenge — Spring 2021</h3><h4>The Spring 2021 edition of the ML Reproducibility Challenge is officially over, and we have some inspiring projects contributed by the DagsHub community to share!</h4><p>Data Science Reproducibility is one of the core reasons DagsHub was established, and we’re constantly developing new tools and integration to support a <a href="https://dagshub.com/blog/introducing-the-machine-learning-reproducibility-scale/">fully reproducible workflow</a>. This is why we’re so excited about the <a href="https://paperswithcode.com/rc2020">Papers with Code — Reproducibility Challenge</a> and decided to support its participants for the second time (<strong>Spoiler Alert</strong>: <strong>we’re also supporting the Fall 2021 Challenge</strong>!).</p><blockquote><em>“Independent verification of data is a fundamental principle of scientific research across the disciplines. The self-correcting mechanisms of the scientific method depend on the ability of researchers to reproduce the findings of published studies in order to strengthen evidence and build upon existing work.” </em><a href="https://www.nature.com/articles/d42473-019-00004-y"><em>Nature</em></a></blockquote><p>In the Spring 2021 edition, we supported 3 teams that submitted fully open source and reproducible ML papers that you can now easily use! Before we dive into the projects, we want to give our kudos to <a href="https://paperswithcode.com/">Papers with Code</a> for organizing the event and our community members who invested time and effort in reproducing papers and making them accessible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*PGhzvlYmZZbG_fRA" /><figcaption>Image from <a href="https://tenor.com/search/tender-gifs">Tenor</a></figcaption></figure><p>So without further a due, I’d like to welcome the Reproduced Papers of Spring 2021 edition!</p><h3>Contextual Decomposition Explanation Penalization</h3><p><a href="https://arxiv.org/abs/1909.13584"><strong><em>The paper</em></strong></a><strong><em> </em></strong>, <a href="https://dagshub.com/ShaileshSridhar2403/Re-CDEP"><strong><em>The repository</em></strong></a></p><h4>Contributors:</h4><ul><li><a href="https://dagshub.com/ShaileshSridhar2403">Shailesh Sridhar</a></li><li><a href="https://dagshub.com/azhar199865">Azhar Shaikh</a></li><li><a href="https://dagshub.com/midsterx">Midhush</a></li></ul><blockquote><em>“For an explanation of a deep learning model to be effective, it must provide both insights into a model and suggest a corresponding action in order to achieve some objective. Too often, the litany of proposed explainable deep learning methods stop at the first step, providing practitioners with insight into a model, but no way to act on it.“ Authors of the paper</em></blockquote><p><strong>The paper proposes contextual decomposition explanation penalization, CDEP, which allows the usage of explanations to penalize the model during training, so that spurious correlations are not learned</strong>. CDEP decomposes the feature space into relevant and irrelevant features with the help of explanations and penalizes the model to look at the relevant features for classification. For example, In the <a href="https://challenge.isic-archive.com/">ISIC Skin cancer classification task</a>, the dataset contains bias images where the positive patients wear band-aids. By using CDEP, the model can be trained to ignore the band-aids feature, which is bias, and learn the correct features. In the repository, CDEP has been applied to different architectures across multiple modalities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/0*ee472ircns79H2I1" /><figcaption>figure S4. Heatmaps for benign samples from ISIC, Image from the <a href="https://arxiv.org/abs/1909.13584">official paper</a></figcaption></figure><p>In this project, Shailesh, Azhar, and Midhush re-implemented the original <a href="https://github.com/laura-rieger/deep-explanation-penalization">PyTorch project</a> in <a href="https://www.tensorflow.org/">Tensorflow</a>. It required them to write <a href="https://pytorch.org/docs/stable/generated/torch.nn.MaxPool2d.html">PyTorch’s `unpool`</a> function from scratch in order to use it with Tensorflow. This later became a <a href="https://github.com/tensorflow/addons/commits?author=midsterx">patch</a> pushed to the Tensorflow Addons repository making them contribute to two open-source projects at the price of one!</p><h3>Self-supervision for Few-shot Learning</h3><p><a href="https://arxiv.org/abs/1910.03560"><strong><em>The paper</em></strong></a><strong><em> , </em></strong><a href="https://dagshub.com/arjun2000ashok/FSL-SSL"><strong><em>The repository</em></strong></a></p><h4><strong>Contributors:</strong></h4><ul><li><a href="https://dagshub.com/hassiahk">Haswanth Aekula</a></li><li><a href="https://dagshub.com/arjun2000ashok">Arjun Ashok</a></li></ul><p><strong>In this paper, the researchers investigate the role of </strong><a href="https://en.wikipedia.org/wiki/Self-supervised_learning"><strong>self-supervised learning</strong></a><strong> (SSL) in the context of </strong><a href="https://research.aimultiple.com/few-shot-learning/"><strong>few-shot learning</strong></a><strong> (FSL).</strong> Although recent research has shown the benefits of SSL on large unlabeled datasets, its utility on small datasets is relatively unexplored. They found that SSL reduces the relative error rate of few-shot meta-learners by 4%-27%, even when the datasets are small and only utilize images within the datasets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gDNoHMH3kdHScieD" /><figcaption>Combining supervised and self-supervised losses for few-shot learning, Image from the <a href="https://arxiv.org/abs/1910.03560">official paper</a></figcaption></figure><blockquote><em>“We choose this paper because few-shot learning is an emerging and increasingly popular paradigm of machine learning, and self-supervised learning seems to be an easy way to get better performance in FSL with no bells and whistles.” Arjun and Haswanth</em></blockquote><p>Arjun and Haswanth reproduced and verified the paper’s main results on five benchmark datasets, built on top of the author’s codebase. In addition, they implemented the domain selection algorithm from scratch and verified its benefits.</p><p>The paper used an image size of 224x224, which intrigued Arjun and Haswanth so they decided to research how it affects the model performance. They modified the image size to be 84x84, a well-used setting in FSL papers, along with a reduced architecture. They found that this setting was a failure which deteriorated the model’s performance.</p><h3>Interpretable GAN Controls</h3><p><a href="https://arxiv.org/abs/2004.02546"><strong><em>The paper</em></strong></a><strong><em> , </em></strong><a href="https://dagshub.com/midsterx/Re-GANSpace"><strong><em>The repository</em></strong></a></p><h4>Contributors</h4><ul><li><a href="https://dagshub.com/vdasu">Vishnu Asutosh Dasu</a></li><li><a href="https://dagshub.com/midsterx">Midhush</a></li></ul><p><strong>This paper describes a simple technique to analyze </strong><a href="https://en.wikipedia.org/wiki/Generative_adversarial_network"><strong>GANs models</strong></a><strong> and create interpretable controls for image synthesis, such as change of viewpoint, aging, lighting, and time of day.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/0*iBXJ5dX0Ci3MZ9vv" /><figcaption>Figure 1: Sequences of image edits performed using control discovered with our method, applied to three different GANs, Image the <a href="https://arxiv.org/abs/2004.02546">official paper</a></figcaption></figure><p>Vishnu and Midhush used <a href="https://arxiv.org/abs/1812.04948">StyleGAN</a> and <a href="https://arxiv.org/abs/1912.04958">StyleGAN2</a> models to reproduce the paper’s results. Both models work by computing the PCA of the outputs of the mapping network for a few sampled latent vectors. This gives the basis of the mapping network space, from which we can edit a new vector by varying the PCA coordinates. The augmented vector is then fed to the synthesis network to obtain an image with the modified attributes.</p><p>Vishnu and Midhush converted the original <a href="https://github.com/harskish/ganspace">PyTorch implementation</a> to Tensorflow and verified the claims presented in the paper. They trained the model with benchmark data sets used in the paper, such as <a href="https://github.com/NVlabs/ffhq-dataset">FFHQ</a>, <a href="https://www.tensorflow.org/datasets/catalog/lsun">LSUN Car</a>, and <a href="https://www.tensorflow.org/datasets/catalog/celeb_a_hq">CelebAHQ</a>. To verify their results, they tested the model’s performances with datasets not used in the original paper, such as <a href="https://asombro.org/beetles/">Beetles</a> and <a href="https://www.gwern.net/Crops">Anime Portraits</a>.</p><blockquote><em>“Initially, we tried to recreate images with identical RGB values using the original PyTorch code and our modified code in Tensorflow. However, due to differences in the random number generators in PyTorch and Tensorflow, the random values were not the same even with the same seed. This resulted in minute differences in the background artifacts of some of the generated images. Once we identified this as the cause for the minor differences, we were able to plug in PyTorch’s random number generator in our Tensorflow implementation and successfully reproduce those images as well. </em><strong><em>Ultimately, we were able to verify all the claims pertaining to the StyleGAN and StyleGAN2 models</em></strong><em>.” Vishnu and Midhush</em></blockquote><h3>Summary</h3><p>We want to thank all the amazing Data Scientists who took part in this challenge. The DagsHub team enjoyed working with each and every one of you and learned a lot in the process. You made a great impact on the community and moved us one step closer to <a href="https://dagshub.com/blog/a-case-for-open-source-data-science/">Open Source Data Science</a>. As mentioned, we are supporting the <strong>Fall 2021 edition of Papers with Code Reproducibility Challenge. </strong>If you want to take part and move the field of machine learning forward, go to <a href="https://dagshub.com/DAGsHub-Official/reproducibility-challenge/wiki/ML+Reproducibility+Challenge+Fall+2021">the new guidelines page</a> and join our <a href="https://discord.gg/7Bhm3WTxHk">Discord community</a> to get started! The team is here to help!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=451777f89526" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/wrapping-up-the-papers-with-code-ml-reproducibility-challenge-spring-2021-451777f89526">Wrapping up the Papers with Code ML Reproducibility Challenge — Spring 2021</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Science Workflows — Notebook to Production]]></title>
            <link>https://medium.com/data-science/data-science-workflows-notebook-to-production-26afc13442bb?source=rss-c2f8d5541f2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/26afc13442bb</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[deep-dives]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science-workflow]]></category>
            <dc:creator><![CDATA[Nir Barazida]]></dc:creator>
            <pubDate>Wed, 24 Nov 2021 18:23:41 GMT</pubDate>
            <atom:updated>2021-11-24T18:23:41.089Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZcCHZmCz4aDx4i99l32z-A.jpeg" /><figcaption>Image from PixaBay</figcaption></figure><h3>Data Science Workflows — Notebook to Production</h3><h4>Reduce the time from research to production using various MLOps tools and techniques.</h4><p>Refactoring a project developed in a notebook to a production-ready state can be challenging and consume our time and resources. At DagsHub, we’ve interviewed data science practitioners and ML engineers from hundreds of companies, trying to get to the bottom of their workflow problems and solutions. In this blog, I will construct our two years of research into a structured workflow that will help YOU reduce the iteration time between research and production using MLOps tools and techniques.</p><h3>Considerations When Deploying a Model to Production</h3><p>Implementing DagsHub’s product playbook, I’d like to start our journey at the end zone by thinking about our considerations when deploying a model to production.</p><p>When I think about production, the first thing that comes to mind is delivering a product to a different team — in or outside the company. Therefore, we’d like our results to be reliable, and in many cases, explainable. We’d also like to reduce the risk of bugs in production; therefore, our project should be testable, not only code but also model, data, pipeline, etc. When a bug arises in production, and it will, we need a way to reproduce the production’s state. This means not only having access to all different components but also the relevant versions. Last, we’d like the deploying process to be as automatic as possible, reducing the friction between the research team and the MLOps team.</p><p>Based on those considerations, let’s go back to the starting point. We’ll usually start a project by testing and prototyping our hypothesis, and our go-to tool will be Notebooks.</p><h3>Project Jupyter</h3><p>Born out of <a href="https://ipython.org/">IPython</a> in 2014, <a href="https://jupyter.org/">Project Jupyter</a> has seen enthusiastic adoption among the data science community to become the de facto standard tool for prototyping. Its impact was officially acknowledged in 2017 when chosen to <a href="https://blog.jupyter.org/jupyter-receives-the-acm-software-system-award-d433b0dfe3a2">receive the ACM Software Systems Award</a>, an honor shared with <a href="https://en.wikipedia.org/wiki/Unix">Unix</a>, the <a href="https://en.wikipedia.org/wiki/World_Wide_Web">Web</a>, <a href="https://en.wikipedia.org/wiki/Java_(programming_language)">Java</a>, and such.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*U6eapooweus9QlZONDzT3g.gif" /><figcaption>Google Trends for “Project Jupyter” , image by author</figcaption></figure><p>However, if you explore some of the data science communities, you’d get the impression that notebooks are the root of all evil. I disagree. I think that Notebooks are awesome! They give us an interactive way to work with our code. Many companies, DagsHub included, choose the notebook interface to host their tutorials and interactive manuals. They have built-in visualizations, a benefit for communicating your work with technical colleagues or with not-so-technical stakeholders. All of this means they are great for quick prototyping.</p><h3>The Downside of Using Notebooks in Production</h3><p>However, when your project evolves and grows in complexity, not to mention moving to production, you most likely hit walls. Based on our research, we mapped five core difficulties data scientists face:</p><ul><li><strong>Reproducibility</strong> — With notebooks, we can run out-of-order code and edit the cells after they have already been run once. A huge disadvantage for reproducibility, which makes us put a lot of effort into tracking the kernel state when executing an experiment.</li><li><strong>Version Control </strong>— Jupyter notebooks are basically large <a href="https://en.wikipedia.org/wiki/JSON">JSON</a> files that can’t easily be diffed by Git, which makes it hard to review (not to mention merge) changes.</li><li><strong>Debug</strong> — Notebooks have a <a href="https://blog.jupyter.org/a-visual-debugger-for-jupyter-914e61716559">debugger tool</a>, but as the notebook gets longer, it becomes a real pain to use.</li><li><strong>Testing &amp; Reusing</strong> — The code hosted in notebook cells is not callable from external locations and can’t be tested easily.</li><li><a href="https://www.redhat.com/en/topics/devops/what-is-ci-cd"><strong>CI/CD </strong></a>— Lacking proper CI/CD tools to automate the deployment process.</li></ul><p>If you encountered other challenges while working with Notebooks — <a href="https://www.linkedin.com/in/nir-barazida/">I’d love to hear about them</a>!</p><p>Some even go as far as deploying the notebook to production, which in my opinion, is not recommended. It disregards the industry standards, workflows, and best practices. Also, we’re still missing proper CI/CD tools to support the deployment lifecycle, the notebook requires significant cleanup and packaging of libraries outside of the data scientist skillset, and it’s hard to run while using other tools in production.</p><p>“But hi, <a href="https://netflixtechblog.com/notebook-innovation-591ee3221233">Netflix</a> deploys their notebook to production”, an argument used a lot in the <a href="https://mlops.community/">MLOps.community</a>. Well, yes, some great companies use notebooks in production, but they invest a lot of resources to support such workflows, which in most cases you’ll not have or want to deflect for this task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*51gLBQEPDzfFeJbMlFp4XA.png" /><figcaption>Courtesy of <a href="https://twitter.com/HamelHusain">HamelHusain</a>, with permission</figcaption></figure><h3>Components of a Solution</h3><p>Having the above challenges and production considerations in mind, I gathered the best practices currently used in the industry into a structured workflow based on six components.</p><ul><li><strong>Convert to Scripts </strong>— convert the code into functions hosted in scripts.</li><li><strong>Monorepo Strategy</strong> — Use the “monorepo for data science” structure to reduce complexity and scale our work.</li><li><strong>Version EVERYTHING</strong> — version all of the project components — code, data, model, etc.</li><li><strong>Experiments Tracking </strong>— automate the logging process of experiments to aid our understanding of the project history and enable people to review the high-level results.</li><li><strong>Export Logic</strong> — move the logic steps to external scripts to avoid using notebooks in production and maintain one codebase.</li><li><strong>Unit Testing</strong> — Write tests for the project components, and invest more efforts in testing components that are low level and form the basis for other components.</li></ul><p>If you find other ways to overcome the challenges we face, once again — <a href="https://www.linkedin.com/in/nir-barazida/">I’d love to hear about them</a>!</p><h3>Example scenario</h3><p>In our example scenario, the team lead just got off the phone with the board, and there is a new project in the funnel — “Save The World”. They just sent the dataset, and obviously — they want a model in production ASAP! So we open a new notebook and get our feet wet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/0*gyJySLkzRGKz-Trf" /><figcaption>Project structure, image by author</figcaption></figure><h3>Convert to Scripts</h3><p>Our initial step will probably be exploring the data at hand. For example, check for feature distribution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/0*ObiZbf__BPSY3M34" /><figcaption>Jupyter Notebook pseudo-code, image by author</figcaption></figure><p><strong>Now comes the most important conceptual change we need to make</strong>. After getting an initial piece of code to do what It was designed to do, we refactor it into a python function that doesn’t rely on any global variables and takes everything as arguments. We will store the function in python script, outside the notebook, which will make it callable from anywhere within the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*5CTHhL-PqpzRMFou" /><figcaption>IDE pseudo-code, image by author</figcaption></figure><p>Next, we will import the function to our notebook and use it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/0*t_W1JXLBry-UwOp0" /><figcaption>Jupyter Notebook pseudo-code, image by author</figcaption></figure><h3>Capabilities Unlocked</h3><ul><li><strong>Code versioning</strong> — Version control our code using standard tools.</li><li><strong>No hidden state</strong> — The function’s inputs and outputs are clearly defined with no side effects. The code is cleaner, testable, and repeatable.</li><li><strong>Stay DRY (don’t repeat yourself)</strong> — Reuse the code in this project or anywhere else.</li><li><strong>Lint</strong> — Use static code analysis tools, an industry-standard, to flag programming errors, bugs, stylistic errors, and suspicious constructs.</li></ul><h3>Monorepo strategy</h3><p>Now that we made our project much more modular, we’d like to leverage it and become more scalable by implementing the good old monorepo strategy. <a href="https://en.wikipedia.org/wiki/Monorepo">Monorepo</a> (“mono” meaning ‘single’ and “repo” is short for ‘repository’) is a trunk-based development implementation where code for many projects is stored in the same repository. Well-known companies use this strategy, such as <a href="https://research.google/pubs/pub45424/">Google</a>, <a href="https://buck.build/">Facebook</a>, <a href="https://rushjs.io/">Microsoft</a>, and more.</p><h3>What has monorepo got to do with Data Science?</h3><p>Data science projects can be divided into stages that are completely independent of the other, e.g., EDA, data processing, modeling, etc. If we address each step as a separate component, we will be able to divide the project into sub-tasks that are actually sub-projects. Using this mindset, we’ll be able to scale our work by dividing the tasks between different team members that will be independent of one another and conquer the project simultaneously.</p><p>We will notice that each stage depends only on the output of the previous one. For example, the modeling step only needs the output of the processing stage. This is why we’d like to open the bottleneck by producing a minimum valuable pipeline, MVP, and have each sub-team start working on its task. Once a team reaches a useful product, they release an update of their output.</p><p>Now, we’ll have a python module for every sub-task that stands on its own and as an integral component in the project’s pipeline. Moreover, Instead of having one long notebook for the entire project, we’ll have a notebook per task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/0*KLzUAm6PJUyV2_NH" /><figcaption>Project structure, image by author</figcaption></figure><h3>Capabilities Unlocked</h3><ul><li><strong>Scale</strong> — We can scale the number of collaborators on the project, increase our [product/time], and move X times faster to production.</li><li><strong>Maintain, review &amp; debug</strong> — Having shorter notebooks, that are task-oriented, will make it easier to maintain, review &amp; debug them.</li><li><strong>Onboarding</strong> — The clear structure of the project makes the onboarding process easier.</li></ul><h3>Version Control</h3><p>Once reaching a point where we’re collaborating with other people, it rings only one bell — <a href="https://www.atlassian.com/git/tutorials/what-is-version-control#:~:text=Version%20control%2C%20also%20known%20as,to%20source%20code%20over%20time.">Version Control</a>. For this task we’ll use <a href="https://git-scm.com/">Git</a>, an open-source tool widely adopted in the industry, that is great for modeling parallel work and versioning code files. Git enables us to use standard CI/CD tools, recover previous work with a click of a button, insulate the working environment, and more. If you want to dive into <a href="https://dagshub.com/blog/how-to-use-git-for-data-science/">Git for Data Science</a>, Martin explains it perfectly in his post.</p><h3>But what about the non-code artifacts?</h3><p>Let’s say that the data processing team created a new data set; should they just overwrite the old version? Or maybe stone-age-version it by creating a new folder and giving it a meaningful name (e.g., new_data_v3_fixed_(1)_best.csv)? Well, both options are inadequate. This is why we’d want to also version our large files.</p><p>Git was designed for managing software development projects and for versioning text/code files. Therefore, Git doesn’t handle large files. Git released <a href="https://git-lfs.github.com/">Git LFS</a> (Large File System) to overcome large file versioning, which is better than Git, but fails when scaling. Also, both Git and Git LFS are not optimized for data science workflow. To overcome this challenge, many powerful tools emerged in recent years, such as <a href="https://dvc.org/">DVC</a>, <a href="https://delta.io/">Delta Lake</a>, <a href="https://lakefs.io/">LakeFS</a>, and more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c20dI72IaaDds00j" /><figcaption>Dagshub x DVC — courtesy of Dagshub, with permission</figcaption></figure><p>At DagsHub, we’re <a href="https://dagshub.com/docs/integration-guide/integration-guide/#dvc">integrated with DVC</a>, which I love using. First and foremost, it’s <a href="https://github.com/iterative/dvc">open-source</a>. It provides pipeline capabilities and supports many cloud providers for remote storage. Also, DVC acts as an extension to Git, which allows you to keep using the standard Git flow in your work. If you don’t want to use both tools, I recommend using <a href="https://dagshub.com/pages/fds/">FDS</a>, an <a href="https://github.com/DAGsHub/fds">open-source</a> tool that makes version control for machine learning fast &amp; easy. It combines Git and DVC under one roof and takes care of code, data, and model versioning. (Bias alert: DagsHub developed FDS)</p><h3>Capabilities Unlocked</h3><ul><li><strong>Reproducibility</strong> — Having the state of all the project components under one version enables us to reproduce results with a click of a button.</li><li><strong>Avoid ad-hoc versioning</strong> done by filenames. The code outputs to the same file and versions it.</li><li><strong>Avoid overwriting work </strong>because of small mistakes and have the ability to recover files easily.</li><li><strong>Sharing &amp; synchronizing</strong> versions make collaborating with others easier.</li></ul><h3>Experiment Tracking</h3><p>Moving our code to functions makes it easier to control the input they get. This helps us manage the configuration of every run and track the hyperparameters of each experiment easily. We’ll move the configurations to an external file, and each module will import its relevant variables.</p><p>But as you can imagine, tracking each experiment with Git can become a hassle. We’d like to automate the logging process of each run. The same as for large file versioning, many tools emerged in recent years for experiment logging, such as <a href="https://wandb.ai/site">W&amp;B</a>, <a href="https://mlflow.org/">MLflow</a>, <a href="https://www.tensorflow.org/tensorboard">TensorBoard</a>, and the list goes on. In this case, I believe that it doesn’t matter with which hammer you choose to hit the nail, as long as you punch it through.</p><p>Note that when using external tools, you only log the experiment information without the ability to reproduce it. Therefore, I recommend Mix n’ Match between the tool and the use case. Prototyping a new hypothesis will probably not provide meaningful results; therefore, we’ll use the external tool to log the experiment. However, after reaching a meaningful result, we’ll version all of the project components and encapsulate them under a Git commit, making it reproducible with a click of a button.</p><h3>Capabilities Unlocked</h3><ul><li><strong>Research history </strong>— Automating the experiment tracking process will assure logging of all the research history, enable us to understand the high-level results, and avoid repeating our work twice.</li><li><strong>Sharing</strong> — Share the experiment results with the team while having the ability to compare apples to apples.</li><li><strong>Reproducibility</strong> — reproduce the experiments (to some extent.)</li><li><strong>Avoid ad-hoc recording</strong> of experiments, which will vary between the team members.</li></ul><h3>Export Logic to Scripts</h3><p>Just before we deploy to production, we’d like to move all of the logic steps stored in the notebook, to python scripts. However, we wouldn’t want to lose the notebook capabilities; therefore, we’ll import them back to the notebook.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/0*qecZz-FV9NYikyig" /></figure><h3>Capabilities Unlocked</h3><ul><li><strong>Use only scripts in production</strong>, which is the industry standard, and much easier to handle.</li><li><strong>Maintain one code base</strong> and not in both notebook and scripts.</li><li><strong>Keep using notebooks</strong> and utilizing their advantages.</li></ul><h3>Unit Tests</h3><p>The same as in software development, we’d want to make sure that our code/model does whatever it was designed to do. It goes with data processing, modeling, and all pipeline stages. Writing tests during coding actually makes you work faster overall. Since you get a tight fast feedback loop that catches bugs early, it’s much easier to debug problems since you can debug each unit in isolation instead of debugging a whole running system.</p><h3>Capabilities Unlocked</h3><ul><li>Fewer bugs in production = <strong>More sleeping hours.</strong></li></ul><h3>Summary</h3><p>Jupyter notebook is an excellent tool for prototyping and exploratory analysis, that after all, gives us superhuman abilities. However, when working in a production-oriented environment, its limitations are revealed. When a new project comes in the funnel, I highly recommend thinking about the production considerations, what tools should be used in the project, and how you can make your work more efficient. You might measure your work by the model’s performance, but you are measured by the iteration time to, and quality in, production.</p><p>If you’re facing challenges that I didn’t mention in this post or thinking of better ways to overcome them — I’d love to hear about it! Feel free to reach out on <a href="https://www.linkedin.com/in/nir-barazida/">LinkedIn</a> and <a href="https://twitter.com/barazida">Twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26afc13442bb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/data-science-workflows-notebook-to-production-26afc13442bb">Data Science Workflows — Notebook to Production</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[40 Open-Source Audio Datasets for ML]]></title>
            <link>https://medium.com/data-science/40-open-source-audio-datasets-for-ml-59dc39d48f06?source=rss-c2f8d5541f2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/59dc39d48f06</guid>
            <category><![CDATA[audio]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[dataset]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Nir Barazida]]></dc:creator>
            <pubDate>Tue, 16 Nov 2021 18:20:31 GMT</pubDate>
            <atom:updated>2021-11-17T08:57:19.539Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8K8QOqA-KhffF_Rxtxf5lA.png" /></figure><h4>Over 2 TBs of labeled audio datasets publicly available and parseable on DagsHub</h4><p>October is over and so is the <a href="https://dagshub.com/blog/hacktoberfest-x-dagshub-2/">DagsHub’s Hacktoberfest challenge</a>. When announcing the challenge, we didn’t imagine we’d reach the finish line with almost <a href="https://github.com/DAGsHub/audio-datasets">40 new audio datasets</a>, publicly available and parseable on DagsHub! Big kudos to our community for doing wonders and pulling off such a fantastic effort in so little time. Also, to <a href="https://www.digitalocean.com/">Digital Ocean</a>, <a href="https://github.com/">GitHub</a>, and <a href="https://about.gitlab.com/">GitLab</a> for organizing the event.</p><p>This year we focused our contribution on the audio domain. For that, we improved DagsHub’s audio catalog capabilities. Now, you can listen to samples hosted on DagsHub without having to download anything locally. For each sample, you get additional information like waveforms, spectrograms, and file metadata. Last but not least, the dataset is versioned by DVC, making it easy to improve and ready to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*61uDe2Rk0SnaptSP.png" /><figcaption>Image by author</figcaption></figure><p>To make it easier for audio practitioners to find the dataset they’re looking for, we gathered all Hacktoberfest’s contributions to this post. We have datasets from seven(!) different languages, various domains, and sources. If you’re interested in a dataset that is missing here, please <a href="https://discord.gg/qyFqqnwg">let us know</a>, and we’ll make sure to add it.</p><p>Although the month-long virtual festival is over, we’re still welcoming contributions to open source data science. If you’d like to enrich the audio datasets hosted on DagsHub, we’d be happy to support you in the process! Please reach out on our <a href="https://discord.gg/qyFqqnwg">Discord</a> channel for more details.</p><p>See you on Hacktoberfest 2022 🍻</p><h3><a href="https://dagshub.com/kingabzpro/Acted-Emotional-Speech-Dynamic-Database">Acted Emotional Speech Dynamic Database</a></h3><p>The Acted Emotional Speech Dynamic Database (AESDD) is a publicly available speech emotion recognition dataset. It contains utterances of acted emotional speech in the Greek language. It is divided into two main categories, one containing utterances of acted emotional speech and the other controlling spontaneous emotional speech. You can contribute to this dataset by <a href="https://speechemotionrecognition.xyz/">submitting recordings of emotional speech</a> to the site. They will be validated and be provided publicly for non-commercial research purposes.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/1abidaliawan/">Abid Ali Awan</a></li><li><a href="http://m3c.web.auth.gr/research/aesdd-speech-emotion-recognition/">Original dataset</a></li></ul><h3><a href="https://dagshub.com/mert.bozkirr/Arabic-Speech-Corpus">Arabic Speech Corpus</a></h3><p>The Arabic Speech Corpus has been developed as part of Ph.D. work by <a href="https://uk.linkedin.com/pub/nawar-halabi/65/532/67b">Nawar Halabi</a> at the <a href="http://www.southampton.ac.uk/">University of Southampton</a>. The corpus was recorded in south Levantine Arabic (Damascian accent) using a professional studio. Synthesized speech as an output using this corpus has produced a high-quality, natural voice.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/mertbozkir/">Mert Bozkır</a></li><li><a href="http://en.arabicspeechcorpus.com/">Original dataset</a></li></ul><h3><a href="https://dagshub.com/L-theorist/Att-HACK">Att-hack: French Expressive Speech</a></h3><p>This data is acted expressive speech in French, 100 phrases with multiple versions/repetitions (3 to 5) in four social attitudes: friendly, distant, dominant, and seductive. This research has been supported by the French Ph2D/IDF MoVE project on modeling of speech attitudes and application to an expressive conversational agent and funded by the Ile-de-France region. This database has led to a <a href="https://hal.archives-ouvertes.fr/hal-02508362">publication</a> for the 2020 Speech Prosody conference in Tokyo. For a more detailed account, see the <a href="https://dagshub.com/L-theorist/Att-HACK/src/master/Att_HACK_A_Speech_Database_for_the_Study_of_Social_Attitudes_16_03_20.pdf">research article</a>.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/flevikov/">Filipp Levikov</a></li><li><a href="https://gitlab.com/nicolasobin/att-hack/-/blob/master/README.md">Original dataset</a></li></ul><h3><a href="https://dagshub.com/mert.bozkirr/AudioMNIST">Audio MNIST</a></h3><p>This repository contains code and data used in Interpreting and Explaining Deep Neural Networks for <a href="https://arxiv.org/abs/1807.03418">Classifying Audio Signals</a>. The dataset consists of 30,000 audio samples of spoken digits (0–9) from 60 different speakers. Additionally, it holds the audioMNIST_meta.txt, which provides meta information such as the gender or age of each speaker.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/mertbozkir/">Mert Bozkır</a></li><li><a href="https://github.com/soerenab/AudioMNIST">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kinkusuma/basic-arabic-vocal-emotions-dataset">BAVED: Basic Arabic Vocal Emotions</a></h3><p>The Basic Arabic Vocal Emotions Dataset (BAVED) contains 7 Arabic words spelled in different levels of emotions recorded in an audio/ wav format. Each word is recorded in three levels of emotions, as follows:</p><ul><li>Level 0 — The speaker is expressing a low level of emotion. This is similar to feeling tired or down.</li><li>Level 1 — The “standard” level where the speaker expresses neutral emotions.</li><li>Level 2 — The speaker is expressing a high level of positive or negative emotions.</li><li>Contributed by: <a href="https://dagshub.com/kinkusuma">Kinkusuma</a></li><li><a href="https://www.kaggle.com/a13x10/basic-arabic-vocal-emotions-dataset">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kingabzpro/Bird-Audio-Detection-challenge">Bird Audio Detection</a></h3><p>This data set is part of a challenge hosted by the <a href="http://machine-listening.eecs.qmul.ac.uk/#:~:text=In%20the%20Machine%20Listening%20Lab,extract%20useful%20information%20from%20sound.">Machine Listening Lab</a> from the Queen Mary University of London In collaboration with the <a href="https://signalprocessingsociety.org/">IEEE Signal Processing Society</a>. It contains datasets collected in real live bio-acoustics monitoring projects and an objective, standardized evaluation framework. The <a href="https://arxiv.org/abs/1309.5275">freefield1010</a> hosted on DagsHub has a collection of over 7,000 excerpts from field recordings worldwide, gathered by the <a href="http://freesound.org/">FreeSound</a> project and then standardized for research. This collection is very diverse in location and environment.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/1abidaliawan/">Abid Ali Awan</a></li><li><a href="http://machine-listening.eecs.qmul.ac.uk/bird-audio-detection-challenge/">Original dataset</a></li></ul><h3><a href="https://github.com/DAGsHub/audio-datasets/tree/main/CHiME-Home">CHiME-Home</a></h3><p>The CHiME-Home dataset is a collection of annotated domestic environment audio recordings. The audio recordings were originally made for the <a href="https://www.semanticscholar.org/paper/The-CHiME-corpus%3A-a-resource-and-a-challenge-for-in-Christensen-Barker/7e6acdbbe3b5512cb3bb220c7083a222c97ef136">CHiME project</a>. In the CHiME-Home dataset, 4-second audio chunks are each associated with multiple labels, based on a set of 7 labels associated with sound sources in the acoustic environment.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/1abidaliawan/">Abid Ali Awan</a></li><li><a href="https://archive.org/details/chime-home">Original dataset</a></li></ul><h3><a href="https://dagshub.com/michizhou/CMU-MOSI">CMU-Multimodal SDK</a></h3><p>CMU-MOSI is a standard benchmark for multimodal sentiment analysis. It is especially suited to train and test multimodal models since most of the newest works in multimodal temporal data use this dataset in their papers. It holds 65 hours of annotated video from more than 1000 speakers, 250 topics, and 6 Emotions (happiness, sadness, anger, fear, disgust, surprise).</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/michizhou">Michael Zhou</a></li><li><a href="https://www.amir-zadeh.com/datasets">Original dataset</a></li></ul><h3><a href="https://dagshub.com/mert.bozkirr/CREMA-D">CREMA-D: Crowd-sourced Emotional Multimodal Actors</a></h3><p><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4313618/">CREMA-D</a> is a dataset of 7,442 original clips from 91 actors. These clips were from 48 male and 43 female actors between the ages of 20 and 74 coming from various races and ethnicities (African America, Asian, Caucasian, Hispanic, and Unspecified). Actors spoke from a selection of 12 sentences. The sentences were presented using six different emotions (Anger, Disgust, Fear, Happy, Neutral, and Sad) and four different emotion levels (Low, Medium, High and Unspecified). Participants rated the emotion and emotion levels based on the combined audiovisual presentation, the video alone, and the audio alone. Due to the large number of ratings needed, this effort was crowd-sourced, and a total of 2443 participants each rated 90 unique clips, 30 audio, 30 visual, and 30 audio-visual.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/mertbozkir/">Mert Bozkır</a></li><li><a href="https://github.com/CheyneyComputerScience/CREMA-D">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kinkusuma/children-song-dataset">Children’s Song</a></h3><p>Children’s Song Dataset is an open-source dataset for singing voice research. This dataset contains 50 Korean and 50 English songs sung by one Korean female professional pop singer. Each song is recorded in two separate keys resulting in a total of 200 audio recordings. Each audio recording is paired with a MIDI transcription and lyrics annotations in both grapheme-level and phoneme-level.</p><ul><li>Contributed by: <a href="https://dagshub.com/kinkusuma">Kinkusuma</a></li><li><a href="https://zenodo.org/record/4785016#.YYkpOtZBxqv">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kinkusuma/daps-dataset">Device and Produced Speech</a></h3><p>The <a href="https://ieeexplore.ieee.org/document/6981922">DAPS</a> (Device and Produced Speech) dataset is a collection of aligned versions of professionally produced studio speech recordings and recordings of the same speech on common consumer devices (tablet and smartphone) in real-world environments. It has 15 versions of audio (3 professional versions and 12 consumer device/real-world environment combinations). Each version consists of about 4 1/2 hours of data (about 14 minutes from each of 20 speakers).</p><ul><li>Contributed by: <a href="https://dagshub.com/kinkusuma">Kinkusuma</a></li><li><a href="https://archive.org/details/daps_dataset">Original dataset</a></li></ul><h3><a href="https://dagshub.com/L-theorist/Deeply_Nonverbal_Vocalization_Dataset">Deeply Vocal Characterizer</a></h3><p>The latter is a human nonverbal vocal sound dataset consisting of 56.7 hours of short clips from 1419 speakers, crowdsourced by the general public in South Korea. Also, the dataset includes metadata such as age, sex, noise level, and quality of utterance. This repo holds only 723 utterances (ca. 1% of the whole corpus) and is free to use under <a href="http://creativecommons.org/licenses/by-nc-nd/4.0/">CC BY-NC-ND 4.0</a>. For accessing the complete dataset under a more restrictive license, please contact <a href="http://deeplyinc.com/us">deeplyinc</a>.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/flevikov/">Filipp Levikov</a></li><li><a href="https://dagshub.com/L-theorist/Deeply_Nonverbal_Vocalization_Dataset/src/master/Deeply%20Nonverbal%20Vocalization%20Dataset%20description_Eng.pdf">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kinkusuma/emo-db">EMODB</a></h3><p>The EMODB database is the freely available German emotional database. The database was created by the <a href="https://www.tu.berlin/en/forschen/technologietransfer/science-communication/">Institute of Communication Science</a>, Technical University, Berlin. Ten professional speakers (five males and five females) participated in data recording. The database contains a total of 535 utterances. The EMODB database comprises seven emotions: anger, boredom, anxiety, happiness, sadness, disgust, and neutral. The data was recorded at a 48-kHz sampling rate and then down-sampled to 16-kHz.</p><ul><li>Contributed by: <a href="https://dagshub.com/kinkusuma">Kinkusuma</a></li><li><a href="http://emodb.bilderbar.info/index-1280.html">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kingabzpro/EMOVO">EMOVO Corpus</a></h3><p>EMOVO Corpus database built from the voices of 6 actors who played 14 sentences simulating six emotional states (disgust, fear, anger, joy, surprise, sadness) plus the neutral state. These emotions are well-known found in most of the literature related to emotional speech. The recordings were made with professional equipment in the <a href="https://www.fub.it/en/">Fondazione Ugo Bordoni laboratories</a>.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/1abidaliawan/">Abid Ali Awan</a></li><li><a href="http://voice.fub.it/activities/corpora/emovo/index.html">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kinkusuma/esc50-dataset">ESC-50: Environmental Sound Classification</a></h3><p>The ESC-50 dataset is a labeled collection of 2000 environmental audio recordings suitable for benchmarking methods of environmental sound classification. The dataset consists of 5-second-long recordings organized into 50 semantical classes (with 40 examples per class) loosely arranged into 5 major categories:</p><ul><li>Animals.</li><li>Natural soundscapes &amp; water sounds.</li><li>Human, non-speech sounds.</li><li>Interior/domestic sounds.</li><li>Exterior/urban noises.</li></ul><p>Clips in this dataset have been manually extracted from public field recordings gathered by the <a href="http://freesound.org/">Freesound.org project</a>. The dataset has been prearranged into five folds for comparable cross-validation, ensuring that fragments from the same original source file are contained in a single fold.</p><ul><li>Contributed by: <a href="https://dagshub.com/kinkusuma">Kinkusuma</a></li><li><a href="https://github.com/karolpiczak/ESC-50">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kingabzpro/EmoSynth">EmoSynth: Emotional Synthetic Audio</a></h3><p>EmoSynth is a dataset of 144 audio files, approximately 5 seconds long and 430 KB in size, which 40 listeners have labeled for their perceived emotion regarding the dimensions of Valence and Arousal. It has metadata about the classification of the audio based on the dimensions of Valence and Arousal.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/1abidaliawan/">Abid Ali Awan</a></li><li><a href="https://zenodo.org/record/3727593#.YYkxINZBxqu">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kingabzpro/Estonian-Emotional-Speech-Corpus">Estonian Emotional Speech Corpus</a></h3><p>The Estonian Emotional Speech Corps (EEKK) is a corps created at the <a href="https://www.eki.ee/EN/">Estonian Language Institute</a> within the framework of the state program “Estonian Language Technological Support 2006–2010”. The corpus contains 1,234 Estonian sentences that express anger, joy, and sadness or are neutral.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/1abidaliawan/">Abid Ali Awan</a></li><li><a href="https://metashare.ut.ee/repository/download/4d42d7a8463411e2a6e4005056b40024a19021a316b54b7fb707757d43d1a889/">Original dataset</a></li></ul><h3><a href="https://dagshub.com/michizhou/Flickr-Audio-Caption-Corpus">Flickr 8k Audio Caption Corpus</a></h3><p>The Flickr 8k Audio Caption Corpus contains 40,000 spoken audio captions in .wav audio format, one for each caption included in the train, dev, and test splits in the original corpus. The audio is sampled at 16000 Hz with 16-bit depth and stored in Microsoft WAVE audio format.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/michizhou">Michael Zhou</a></li><li><a href="https://groups.csail.mit.edu/sls/downloads/flickraudio/downloads/flickr_audio.tar.gz">Original dataset</a></li></ul><h3><a href="https://dagshub.com/L-theorist/Golos">Golos: Russian ASR</a></h3><p><a href="https://dagshub.com/L-theorist/Golos/src/master/2106.10161.pdf">Golos</a> is a Russian corpus suitable for speech research. The dataset mainly consists of recorded audio files manually annotated on the crowd-sourcing platform. The total duration of the audio is about 1240 hours.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/flevikov/">Filipp Levikov</a></li><li><a href="https://github.com/sberdevices/golos">Original dataset</a></li></ul><h3><a href="https://dagshub.com/hazalkl/JL-Corpus">JL Corpus</a></h3><p>Emotional speech in New Zealand English. This corpus was constructed by maintaining an equal distribution of 4 long vowels. The corpus has five secondary emotions along with five primary emotions. Secondary emotions are important in Human-Robot Interaction (HRI), where the aim is to model natural conversations among humans and robots.</p><ul><li>Contributed by: <a href="https://dagshub.com/hazalkl">Hazalkl</a></li><li><a href="https://www.kaggle.com/tli725/jl-corpus?select=README.md">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kinkusuma/lj-speech-dataset">LJ Speech</a></h3><p>a public domain speech dataset consisting of 13,100 short audio clips of a single speaker reading passages from 7 non-fiction books. A transcription is provided for each clip. Clips vary in length from 1 to 10 seconds and have a total length of approximately 24 hours. The texts were published between 1884 and 1964 and are in the public domain. The audio was recorded in 2016–17 by the <a href="https://librivox.org/">LibriVox project</a> and is also in the public domain.</p><ul><li>Contributed by: <a href="https://dagshub.com/kinkusuma">Kinkusuma</a></li><li><a href="https://keithito.com/LJ-Speech-Dataset">Original dataset</a></li></ul><h3><a href="https://dagshub.com/hazalkl/MS-SNSD">MS SNSD</a></h3><p>This dataset contains a large collection of clean speech files and various environmental noise files in .wav format sampled at 16 kHz. It provides the recipe to mix clean speech and noise at various signal-to-noise ratio (SNR) conditions to generate a large, noisy speech dataset. The SNR conditions and the number of hours of data required can be configured depending on the application requirements.</p><ul><li>Contributed by: <a href="https://dagshub.com/hazalkl">Hazalkl</a></li><li><a href="https://github.com/microsoft/MS-SNSD">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kingabzpro/Public_Domain_Sounds">Public Domain Sounds</a></h3><p>A wide array of sounds can be used for object detection research. The dataset is small (543MB) and divided into subdirectories by its format. The audio files vary from 5 seconds to 5 minutes.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/1abidaliawan/">Abid Ali Awan</a></li><li><a href="http://pdsounds.tuxfamily.org/">Original dataset</a></li></ul><h3><a href="https://dagshub.com/hazalkl/RSC">RSC: sounds from RuneScape Classic</a></h3><p>Extract RuneScape classic sounds from cache to wav (and vice versa). Jagex used Sun&#39;s original .au sound format, which is headerless, 8-bit, u-law encoded, 8000 Hz pcm samples. This module can decompress original sounds from sound archives as headered WAVs, and recompress (+ resample) new WAVs into archives.</p><ul><li>Contributed by: <a href="https://dagshub.com/hazalkl">Hazalkl</a></li><li><a href="https://github.com/2003scape/rsc-sounds">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kinkusuma/speech-accent-archive/">Speech Accent Archive</a></h3><p>This dataset contains 2140 speech samples, each from a different talker reading the same reading passage. Talkers come from 177 countries and have 214 different native languages. Each talker is speaking in English.</p><ul><li>Contributed by: <a href="https://dagshub.com/kinkusuma">Kinkusuma</a></li><li><a href="https://www.kaggle.com/rtatman/speech-accent-archive/version/1">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kingabzpro/Speech_Commands_Dataset">Speech Commands Dataset</a></h3><p>The dataset (1.4 GB) has 65,000 one-second long utterances of 30 short words by thousands of different people, contributed by public members through the AIY website. This is a set of one-second .wav audio files, each containing a single spoken English word.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/1abidaliawan/">Abid Ali Awan</a></li><li><a href="https://ai.googleblog.com/2017/08/launching-speech-commands-dataset.html">Original dataset</a></li></ul><h3><a href="https://dagshub.com/hazalkl/Toronto-emotional-speech-set-TESS">TESS: Toronto Emotional Speech Set</a></h3><p><a href="https://pubmed.ncbi.nlm.nih.gov/11926322/">The Northwestern University Auditory Test №6</a> was used to create these stimuli. Two actresses (aged 26 and 64 years) recited a set of 200 target words in the carrier phrase “Say the word _____,” and recordings were produced of the set depicting each of seven emotions (anger, disgust, fear, happiness, pleasant surprise, sadness, and neutral). There are a total of 2800 stimuli.</p><ul><li>Contributed by: <a href="https://dagshub.com/hazalkl">Hazalkl</a></li><li><a href="https://tspace.library.utoronto.ca/handle/1807/24487">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kingabzpro/URDU-Dataset">URDU</a></h3><p>The URDU dataset contains emotional utterances of Urdu speech gathered from Urdu talk shows. There are 400 utterances of four basic emotions in the book: Angry, Happy, Neutral, and Emotion. There are 38 speakers (27 male and 11 female). This data is created from YouTube.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/1abidaliawan/">Abid Ali Awan</a></li><li><a href="https://github.com/siddiquelatif/urdu-dataset">Original dataset</a></li></ul><h3><a href="https://dagshub.com/mert.bozkirr/VIVAE">VIVAE: Variably Intense Vocalizations of Affect and Emotion</a></h3><p>The Variably Intense Vocalizations of Affect and Emotion Corpus (VIVAE) consists of a set of human non-speech emotion vocalizations. The full set, comprising 1085 audio files, features eleven speakers expressing three positive (achievement/ triumph, sexual pleasure, and surprise) and three negatives (anger, fear, physical pain) affective states. Each parametrically varied from low to peak emotion intensity.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/mertbozkir/">Mert Bozkır</a></li><li><a href="https://zenodo.org/record/4066235">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kinkusuma/free-spoken-digit-dataset">FSDD: Free Spoken Digit Dataset</a></h3><p>A simple audio/speech dataset consisting of recordings of spoken digits in wav files at 8kHz. The recordings are trimmed so that they have near minimal silence at the beginning and ends.</p><ul><li>Contributed by: <a href="https://dagshub.com/kinkusuma">Kinkusuma</a></li><li><a href="https://github.com/Jakobovski/free-spoken-digit-dataset">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kinkusuma/lego-spoken-dialogue-corpus">LEGOv2 Corpus</a></h3><p>This spoken dialogue corpus contains interactions captured from the CMU Let’s Go (LG) System by Carnegie Mellon University in 2006 and 2007. It is based on raw log files from the LG system. 347 dialogs with 9,083 system-user exchanges; emotions classified as garbage, non-angry, slightly angry, and very angry.</p><ul><li>Contributed by: <a href="https://dagshub.com/kinkusuma">Kinkusuma</a></li><li><a href="https://www.ultes.eu/ressources/lego-spoken-dialogue-corpus/">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kinkusuma/musdb18-dataset">MUSDB18</a></h3><p>Multi-track music dataset for music source separation. There are two versions of MUSDB18, the compressed and the uncompressed(HQ).</p><ul><li><a href="https://dagshub.com/kinkusuma/musdb18/src/master/compressed">MUSDB18</a> — consists of a total of 150 full-track songs of different styles and includes both the stereo mixtures and the original sources, divided between a training subset and a test subset.</li><li><a href="https://dagshub.com/kinkusuma/musdb18/src/master/dataset">MUSDB18-HQ</a> — the uncompressed version of the MUSDB18 dataset. It consists of a total of 150 full-track songs of different styles and includes both the stereo mixtures and the original sources, divided between a training subset and a test subset.</li><li>Contributed by: <a href="https://dagshub.com/kinkusuma">Kinkusuma</a></li><li><a href="https://sigsep.github.io/datasets/musdb.html">Original dataset</a></li></ul><h3><a href="https://dagshub.com/kingabzpro/voice_gender_detection">Voice Gender</a></h3><p>The <a href="https://www.robots.ox.ac.uk/~vgg/data/voxceleb/">VoxCeleb</a> dataset (7000+ unique speakers and utterances, 3683 males / 2312 females). The VoxCeleb is an audio-visual dataset consisting of short clips of human speech, extracted from interview videos uploaded to YouTube. VoxCeleb contains speech from speakers spanning a wide range of different ethnicities, accents, professions, and ages.</p><ul><li>Contributed by: <a href="https://www.linkedin.com/in/1abidaliawan/">Abid Ali Awan</a></li><li><a href="https://drive.google.com/file/d/1HRbWocxwClGy9Fj1MQeugpR4vOaL9ebO/view">Original dataset</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59dc39d48f06" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/40-open-source-audio-datasets-for-ml-59dc39d48f06">40 Open-Source Audio Datasets for ML</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Faster Machine Learning Versioning and Tracking: Example using FDS]]></title>
            <link>https://medium.com/data-science/faster-machine-learning-versioning-and-tracking-example-using-fds-33fa7183aac8?source=rss-c2f8d5541f2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/33fa7183aac8</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Nir Barazida]]></dc:creator>
            <pubDate>Sun, 27 Jun 2021 10:55:37 GMT</pubDate>
            <atom:updated>2021-09-01T19:38:01.461Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using FDS, an open-source tool, to version control your machine learning project fast &amp; easy</h4><p><a href="http://fastds.io/">FDS, Fast Data Science</a>, is an <a href="https://github.com/DAGsHub/fds">open-source tool</a> that makes version control for machine learning fast &amp; easy. It combines Git and DVC under one roof, and takes care of code, data, and model versioning.</p><p>FDS will help you:</p><ul><li>Avoid mistakes, by recommending where each file should be tracked, using a smart version control wizard 🧙‍♂️.</li><li>Automate repetitive tasks, by unifying commands (e.g. git status + dvc status = fds status)</li><li>Make version control faster, easier to use, and more friendly, by providing a human-centric UX — want to save a new version and push it to your shared remote, just fds save and you&#39;re good to go.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fUzx2Lmw61tCDq7aHM1DpQ.jpeg" /><figcaption>Fast Data Science, image by author</figcaption></figure><p>This blog is a step-by-step guide on how to version your machine learning project using FDS. We’ll Track the “Pneumonia-Detection” project, in which we train a TensorFlow model to classify between sick and healthy chest X-ray images. The data set used in this project was taken from the “<a href="https://www.kaggle.com/paultimothymooney/chest-xray-pneumonia">Chest X-Ray Images (Pneumonia)</a>” Kaggle competition. By following the steps detailed below, you will gain hands-on experience using FDS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*Vy6Bq7NfONoyK52uaC3sGg.png" /><figcaption>Pneumonia detection data example, image by author</figcaption></figure><p>In this blog, we will cover how to perform the following actions using FDS:</p><ul><li>Initialize and configure Git and DVC in our local machine.</li><li>Track the project files using both Git and DVC with a single command.</li><li>Push the files to Git and DVC remotes.</li><li>Automatically version, track, commit, and push all project files to the remote with a single command</li></ul><h3>Project setup</h3><p>We will start by creating a new directory from the terminal named “Pneumonia-Detection” and move into it. Then, we will create a <a href="https://docs.python.org/3/tutorial/venv.html">virtual environment</a>, add it to the .gitignore file, activate it, and install FDS by running pip install fastds.</p><p><strong><em>Note:</em></strong> <em>Because DVC can also be installed with brew, we didn’t add it as a dependency package to FDS. However, if FDS recognizes that DVC is not installed in the virtual environment, it will suggest installing DVC for you.</em></p><h3>Mac &amp; Linux</h3><pre>$ mkdir Pneumonia-Detection &amp;&amp; cd Pneumonia-Detection<br>$ python -m .venv venv<br>$ echo .venv/ &gt;&gt; .gitignore<br>$ source .venv/bin/activate<br><br>$ pip install fastds</pre><h3>Windows</h3><pre>$ mkdir Pneumonia-Detection &amp;&amp; cd Pneumonia-Detection <br>$ py -m venv .venv <br>$ echo .venv/ &gt;&gt; .gitignore <br>$ .venv/Scripts/activate.bat  </pre><pre>$ pip install fastds</pre><p>Next, we will initialize Git and DVC. Instead of using the two tools for this task, we can use the fds init command that initializes them both.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j-VZZlMfjnK_YJm7U63Ozw.gif" /><figcaption>FDS init, Gif by author</figcaption></figure><p>Let’s <a href="https://dagshub.com/docs/getting-started/create-a-dagshub-project/#create-a-dagshub-repository">open a repository on DAGsHub</a> and name it “Pneumonia-Detection”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SI_2o4kPFylSgiKjcw7ZXQ.png" /><figcaption>New repository settings, image by author</figcaption></figure><p>Next, we will <a href="https://dagshub.com/docs/getting-started/create-a-dagshub-project/#configure-dagshub-as-dvc-remote-storage">configure the repository’s Git and DVC remotes</a> with our local directory by running the following command:</p><pre>$ git remote add origin https://dagshub.com/&lt;DAGsHub user-    name&gt;/Pneumonia-Detection.git<br>$ dvc remote add origin https://dagshub.com/&lt;DAGsHub user-name&gt;/Pneumonia-Detection.dvc<br>$ dvc remote modify origin --local auth basic<br>$ dvc remote modify origin --local user &lt;DAGsHub user-name&gt;<br>$ dvc remote modify origin --local password &lt;your token&gt;</pre><h3>Adding the project files</h3><p>We are ready to add files to our local directory. For this task, we will use the dvc get command to download the files from DAGsHub. Please note that this command is required only for the sake of the tutorial. I choose to use it, so you will have access to the files to follow the tutorial.</p><p><strong><em>Note:</em></strong><em> The original data set is very big. We will use a smaller version of the data set to reduce the downloading, versioning, and uploading time. If you want to use the full data set, skip the first command and download it directly from the </em><a href="https://www.kaggle.com/paultimothymooney/chest-xray-pneumonia"><em>Kaggle competition</em></a><em> and unzip it under </em><em>Pneumonia-Detection/data/raw-data.</em></p><pre>$ dvc get https://dagshub.com/nirbarazida/Pneumonia-Detection-FDS-Demo data/raw-data -o data/raw-data<br>$ dvc get https://dagshub.com/nirbarazida/Pneumonia-Detection-FDS-Demo eval <br>$ dvc get https://dagshub.com/nirbarazida/Pneumonia-Detection-FDS-Demo model/ -o model/ <br>$ dvc get https://dagshub.com/nirbarazida/Pneumonia-Detection-FDS-Demo src</pre><p>Now, the project holds the following directories:</p><ul><li>data/ - Holds the raw data images split into three subdirectories: train, val (validation), and test.</li><li>eval/ - Holds information about the model and its performance.</li><li>model/ - Holds a pretreated model with the best performances.</li><li>src/ - holds the project&#39;s code files, including Python modules and Jupiter notebooks.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*VJ4Lpyjx0oQd3nSdIuz84g.png" /><figcaption>The project’s tree, image by author</figcaption></figure><h3>Tracking files with Git + DVC = FDS</h3><p>At this point, we want to track the files in the project with Git and DVC. This task requires the following steps:</p><ul><li>Choose and track the large files/directories with DVC.</li><li>Use Git to track the pointer/pipeline files using Git.</li><li>Track the rest of the project’s files with Git.</li></ul><p>When using Git and DVC to version the project, we perform these actions frequently. This repetitive work can be a hassle and, for some users, not intuitive. This is exactly why we created the fds add WIZARD!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*2RQPFGfpHqbeBG5ifW-gUA.jpeg" /><figcaption>Image created with imgflip.com</figcaption></figure><p>Because we want to version all the project files, we will run fds add ..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*ZBpB0aBjDyLSpiCB2nBWgQ.gif" /><figcaption>FDS add, Gif by author</figcaption></figure><p>All of the project’s files are versioned and ready to be pushed! But wait, before we run the push command, we need to commit the files first. The fds commit command encapsulates dvc commit and git commit into one. It commits changes to DVC first, adds the pointer files with the updated hashes to Git, then immediately commits these changes (plus any other staged changes) to a new git commit. In our case, FDS will recognize that nothing was changed in the DVC tracked files; therefore, it will effectively only commit Git-tracked files, which is what we&#39;d expect.</p><pre>$ fds commit “Track all the project files with FDS”</pre><p>At this point, we want to make sure that all the files are committed. To do that, we will run the fds status command that checks the status of both Git and DVC tracked files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3cwRTOF1GhcZ-nf-md4Icg.gif" /><figcaption>FDS status, Gif by author</figcaption></figure><p><strong>Ladies and gentlemen, please fasten your seatbelts… It’s officially PUSH time!</strong></p><p>To push our files, we will use the fds push command that...you guessed it - pushes the files tracked by both Git and DVC! Let&#39;s check the new <a href="https://dagshub.com/nirbarazida/Pneumonia-Detection/src/a0de78d2b99cd958f5c96e3160c5e40898c20e6f">status of the repository on DAGsHub</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g_vg40Qjqr3r5P1AkYmSZQ.png" /><figcaption>The new status of the repository, image by author</figcaption></figure><p>As we can see, all the files tracked by Git and DVC were pushed to the remotes. Not only that, we can see all of the project’s components in one place, including code, data, models, and pipeline.</p><h3>Shortening the process to 1 command</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ZRF6QNid3mnSmsT5jqP7Q.jpeg" /><figcaption>A shortcut. Photo by <a href="https://unsplash.com/@usinglight?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Stefan Steinbauer</a> / <a href="https://unsplash.com/?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Unsplash</a></figcaption></figure><p>If you’re not familiar with Git, DVC, or FDS and don’t feel comfortable using those commands or just want to make your life easier, the fds save command is for you! By running this command, FDS will version, track, commit, and push all project files using Git and DVC to your remote. To showcase the usage of this command, we will download a processed data directory and run the fds save command.</p><pre>$ dvc get <a href="https://dagshub.com/nirbarazida/Pneumonia-Classification">https://dagshub.com/nirbarazida/</a><a href="https://dagshub.com/nirbarazida/Pneumonia-Detection-FDS-Demo">Pneumonia-Detection-FDS-Demo</a> data/processed -o data/processed<br>$ fds save “Add processed data directory”</pre><p>Let’s check the <a href="https://dagshub.com/nirbarazida/Pneumonia-Detection/src/88e4e94a2d3677b2bec18e179150ad6dca3ad6c5">new status of the repository on DAGsHub</a>. As we can see, the processed data directory was tracked by DVC, the updated data.dvc pointer file was tracked by Git, and both were successfully pushed to DAGsHub.</p><h3>Summary</h3><p>We reached the end of this tutorial, but our journey together has only begun.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*1fKYgtEWn11Z5ArUVNSeHQ.jpeg" /><figcaption>Image created with makememe.org</figcaption></figure><p>FDS is completely Open-Source!</p><p>Although our developers constantly improve FDS’s capabilities, we welcome you to contribute to FDS and receive everlasting glory. You can participate by:</p><ul><li>Creating a <a href="https://github.com/DAGsHub/fds/pulls">pull request</a> with a bug fix or a new enhancement,</li><li>Using FDS and letting us know of any issue or improvements we can make — by creating an <a href="https://github.com/DAGsHub/fds/issues">issue</a> or sharing it on our <a href="https://discord.gg/pk22NradY4">Discord channel</a></li><li><a href="https://github.com/DAGsHub/fds/stargazers">Starring</a> the repo and sharing it with your colleagues and friends.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33fa7183aac8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/faster-machine-learning-versioning-and-tracking-example-using-fds-33fa7183aac8">Faster Machine Learning Versioning and Tracking: Example using FDS</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Science Workflows — Experiment Tracking]]></title>
            <link>https://medium.com/data-science/data-science-workflow-experiment-tracking-609e649973a3?source=rss-c2f8d5541f2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/609e649973a3</guid>
            <category><![CDATA[experiment-tracking]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[teamwork]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Nir Barazida]]></dc:creator>
            <pubDate>Sun, 13 Jun 2021 14:36:50 GMT</pubDate>
            <atom:updated>2021-06-14T13:03:20.360Z</atom:updated>
            <content:encoded><![CDATA[<h3>Data Science Workflow — Experiment Tracking</h3><h4>Exploring data science <strong>hypotheses</strong> using Git Flow</h4><p>Data Science is a research-driven field, and exploring many solutions to a problem is a core principle. When a project evolves and grows in complexity, we need to compare results and see what approaches are more promising than others. In this process, we need to ensure we don’t lose track of the project’s components or miss out on critical information. Moreover, we need to have the ability to reproduce results and manage past experiments so as not to waste time exploring the same hypothesis twice. For this reason, it&#39;s necessary to use a structured workflow to explore new experiments.</p><p>In this blog post we’ll cover the following topics:</p><ul><li>Key challenges in data science projects and the desired capabilities to overcome them.</li><li>Insights from the software development workflow.</li><li>The recommended workflow to run a new experiment.</li></ul><h3>Key challenges in the Data Science Workflow</h3><p>To better understand the challenges in the experiment tracking workflow, let’s first define the steps involved in a typical project:</p><ol><li>Understand the business problem at hand.</li><li>Gather the raw data.</li><li>Explore, transform, clean, and prepare the data.</li><li>Create and select models based on the data.</li><li>Train, test, tune and deploy the model.</li><li>Monitor the model’s performance.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*QRaPtarHTkWsJ5UJTuM6tg.jpeg" /><figcaption>Data Science Project Lifecycle, <em>Image by author</em></figcaption></figure><p>The workflow outlined above provides a road map to deploying a machine learning model to production and monitoring it. As we can see, much of the process in a data science project is based on trial-and-error. The data scientist runs tests, compares the results, reruns them, compares the results, and so on. As a result, we have to deal with three main challenges.</p><p><strong>The Challenge:</strong> <em>Manage the different experiments/approaches to solving the problem.</em></p><p>When working on a data science project, we often need to explore different approaches to solve a problem — hyperparameter tuning, model architecture, data processing methods, etc. Every approach might be different and even orthogonal to the other. Moreover, every approach will have sub-experiments, challenging the researcher to choose the best result.</p><p><strong>The Desired Capability:</strong> <em>Comparison tools that present the different results and compare them by various parameters.</em></p><p><strong>The Challenge:</strong> <em>Reproduce results of previous experiments with all of the project’s components.</em></p><p>When exploring sub-experiments, we can’t tell when we reached the desired result. It might be in the first experiment, the Xth, or the last one. Thus, we need to have the ability to reproduce the code, data, and model of the experiment with the best result.</p><p><strong>The Desired Capability</strong>: <em>Encapsulate all of the project’s components with the result of the experiment.</em></p><p><strong>The Challenge: </strong><em>Work in parallel and synchronize the project’s components.</em></p><p>When working in a production environment, one of the greatest challenges is collaborating with other data scientists. While working simultaneously on various experiments, managing the code, data, and model becomes an excruciating task rather than a working state.</p><p><strong>The Desired Capability:</strong> <em>Version all of the project’s components.</em></p><h3>Learning from Software Development</h3><p>Because of the similarities between software development and data science, and since software development in teams has had significantly more time to mature, let’s see how we can adapt and apply methods from that domain and use them to define an efficient workflow in the data science field.</p><p>The software development workflow is an extensive discipline. I want to address our attention to the “Git Feature Branch Workflow” that defines a strict branching model. It provides a robust framework for managing large-scale projects with a considerable number of developers. For simplicity, I will not cover in this blog post the usage of Develop and Release branches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*vyLpiRtu0QW9Qn4nMpUsyA.png" /><figcaption>Git Flow — Feature Branch Workflow, <em>Image by author</em></figcaption></figure><p>In the Feature Branch Workflow, we will store the production version of the project on the <strong>Master</strong> branch and the developed features on different ones. Git will isolate the working environment for every branch, so developers can edit, stage, and commit changes to a feature branch without affecting the production version.</p><p>If using Git hosting platforms (e.g., GitHub, BitBucket, GitLab), when the feature is ready, the developer will not simply merge it to the Master branch but will create a pull request (PR). At this time, he will assign it to his colleague to review the entire work and changes.</p><p>Finally, when the feature is ready for deployment, the developer will merge the feature’s branch to the Master branch. Then, CI/CD tools will pull the new version, build it, and deploy it to production.</p><p>This workflow enables many teams to work in parallel and manage their project efficiently. With some modifications, we can adapt it to data science to overcome the challenges described earlier. Let’s explore how we can do that.</p><h3>Experiment Tracking Workflow</h3><p>Based on the challenges mentioned throughout this blog post, the desired capabilities, and the traditional software development workflow, we suggest a new approach.</p><p><strong>Core Elements</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*vvkicZ3ptLCYCl7Ov7xW7w.png" /><figcaption>Experiment Tracking Workflow — Core Elements, <em>Image by author</em></figcaption></figure><p>Each of the elements above is based on the previous one, and by combining them, they create a holistic solution.</p><p>The foundation of this workflow is <strong>Data and Model Versioning</strong>. Tracking all the project’s components makes reproducing prior work easier. Furthermore, when working in a team, it enables us to manage the project more efficiently and work in parallel on the different components. Several MLOps tools support <a href="https://dagshub.com/blog/data-version-control-tools/">data versioning</a>, and they include <a href="https://dagshub.com/shcheklein/example-get-started">DVC</a>, MLflow, and Pachyderm.</p><p>The second element is <strong>Encapsulating the E</strong><a href="https://dagshub.com/blog/how-to-compare-ml-experiment-tracking-tools-to-fit-your-data-science-workflow/"><strong>xperiment</strong></a><strong>’s Components</strong> with the result. To reproduce the results of an experiment, we need to have the ability to retrieve the version of code, data, and model the produced them. We will use one of the above tools to version the data and model files and Git to version the code files. We recommend logging the experiment’s parameters and metrics into an <a href="https://dagshub.com/docs/reference/open_data_science_formats/">open-source readable file</a> and tracking them using Git.</p><p>The third element refers to the <strong>Isolation of Experiments</strong>. This element was inspired by the software development workflow where the production code is held on the Master branch, and the evolving features are stored on different branches. In our case, the project’s best components will be held on the Master branch, and every experiment will be hosted on another branch. This way, it will be easy to manage and track the various experiments, review every experiment’s result, and not reap the same one twice.</p><p>The fourth and last element is the <strong>Data Science Poll Request (DSPR)</strong>. When creating a PR for a software development project, the only element that needs to be reviewed and merged is the code. However, a data science project has more components. Therefore, to enable an efficient reviewing process with a complete picture of the experiment, the DSPR will include the code, data, model, and experiment results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*FqbbIMuWQf3fZuvIY4lGRQ.png" /><figcaption>Experiment Tracking Workflow, <em>Image by author</em></figcaption></figure><p><strong>Experiment Tracking<em> </em>Workflow</strong></p><ol><li>Create a branch for the experiment and checkout to it.</li></ol><p>2. Run sub-experiments on the branch and track the qualitative results with the project’s components.</p><ul><li><strong>Parallel Approach </strong>— For every sub-experiment, create a new branch and run the experiment on it. When having multiple experiments, this approach can become hard to manage.</li><li><strong>Sequential Approach </strong>— For every sub-experiment, create a new commit of the project version. This approach allows you to choose which experiment you want to track and filter noise.</li></ul><p>3. Compare the results of different experiments and choose the best one.</p><p>4. If the best experiment result is better than the result of the model on the Master branch.</p><ul><li><strong>Parallel Approach</strong> — checkout to the branch that stores the experiment with the best results.</li><li><strong>Sequential Approach</strong> — checkout to the commit with the best result and fork it to a new branch.</li></ul><p>5. Create a Data Science Poll Request with all of the project components — code, data, models, and experiments.</p><p>6. After reviewing the DSPR and its approval, merge the files to the Master branch.</p><p><strong>Git Flow</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*NX1KOhRW_IFaqBIfmR0t3g.png" /><figcaption>Git Flow — Sequential Approach, <em>Image by author</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*ajL7lwysqqMKKv9MGGwjAA.png" /><figcaption>Git Flow — Parallel Approach, <em>Image by author</em></figcaption></figure><h3><strong>Summary</strong></h3><p>Using the above workflow and elements, exploring a new hypothesis becomes a more manageable task. We can easily compare the results of the experiments and determine what approach was more effective. If you have tried this workflow and it helped you — I would love to hear about it via <a href="https://twitter.com/barazida">Twitter</a> or <a href="https://www.linkedin.com/in/nir-barazida/">LinkedIn</a>. If you have suggestions for optimization, we can talk about them on our <a href="https://discord.com/channels/698874030052212737/705302775784800278">Discord channel</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=609e649973a3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/data-science-workflow-experiment-tracking-609e649973a3">Data Science Workflows — Experiment Tracking</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>